[go: up one dir, main page]

CN118193078B - Vehicle-mounted application implementation method, vehicle and storage medium - Google Patents

Vehicle-mounted application implementation method, vehicle and storage medium

Info

Publication number
CN118193078B
CN118193078B CN202410274170.2A CN202410274170A CN118193078B CN 118193078 B CN118193078 B CN 118193078B CN 202410274170 A CN202410274170 A CN 202410274170A CN 118193078 B CN118193078 B CN 118193078B
Authority
CN
China
Prior art keywords
interface
aidl
event
service
layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410274170.2A
Other languages
Chinese (zh)
Other versions
CN118193078A (en
Inventor
许海诺
谈力
陈健聪
郭同刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chery Automobile Co Ltd
Original Assignee
Chery Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chery Automobile Co Ltd filed Critical Chery Automobile Co Ltd
Priority to CN202410274170.2A priority Critical patent/CN118193078B/en
Publication of CN118193078A publication Critical patent/CN118193078A/en
Application granted granted Critical
Publication of CN118193078B publication Critical patent/CN118193078B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请提供了一种车载应用实现方法、车辆及存储介质,属于计算机技术领域。该方法应用于车载系统,车载系统包括应用层、适配层和服务层,应用层运行有多个应用,每个应用包括用于提供Java接口和AIDL接口的第一代码文件,适配层包括用于提供继承自服务层中服务的抽象服务和AIDL接口的第二代码文件;通过任一应用的第一代码文件提供的Java接口和AIDL接口,调用适配层的AIDL接口;通过适配层的AIDL接口调用适配层的抽象服务;通过适配层的抽象服务,调用服务层中的服务。这样,应用层只需与适配层对接即可,使得应用调用的接口得以固定,无需开发与不同接口对接的多个应用版本,降低了应用开发成本和开发周期。

This application provides a method for implementing in-vehicle applications, a vehicle, and a storage medium, belonging to the field of computer technology. The method is applied to an in-vehicle system, which includes an application layer, an adaptation layer, and a service layer. The application layer runs multiple applications, each including a first code file providing Java and AIDL interfaces. The adaptation layer includes a second code file providing abstract services inherited from services in the service layer and AIDL interfaces. The method involves calling the AIDL interface of the adaptation layer through the Java and AIDL interfaces provided by the first code file of any application; calling the abstract service of the adaptation layer through the AIDL interface of the adaptation layer; and calling services in the service layer through the abstract service of the adaptation layer. In this way, the application layer only needs to interface with the adaptation layer, fixing the interfaces called by the application and eliminating the need to develop multiple application versions that interface with different interfaces, thus reducing application development costs and time.

Description

Vehicle-mounted application implementation method, vehicle and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a vehicle-mounted application implementation method, a vehicle, and a storage medium.
Background
In an in-vehicle system, each application needs to interface with a service layer in the in-vehicle system. Because the vehicle-mounted systems of different vehicles are different, the service layers of different vehicle-mounted systems are also different, therefore, the docking specifications applied to different service layers are also different, and application developers need to develop a plurality of different versions to dock different service layers, so that the application development cost is higher, and the development period is longer.
Disclosure of Invention
The embodiment of the application provides a vehicle-mounted application implementation method, a vehicle and a storage medium, so that an application developer only needs to develop one version, the development cost is reduced, and the development period is shortened. The technical scheme is as follows:
In one aspect, there is provided a vehicle-mounted application implementation method, applied to a vehicle-mounted system, the vehicle-mounted system including an application layer, an adaptation layer, and a service layer, the application layer running a plurality of applications, each application including a first code file for providing a Java interface and an AIDL interface, the adaptation layer including a second code file for providing an abstract service inherited from a service in the service layer and for providing an AIDL interface, the method comprising:
when any application receives a service call request, calling an AIDL interface of the adaptation layer through a Java interface and an AIDL interface provided by a first code file of any application;
invoking abstract services of the adaptation layer through an AIDL interface of the adaptation layer;
and calling the service in the service layer through the abstract service of the adaptation layer.
In one possible implementation, the method further includes:
After the vehicle-mounted system operates, a target service integrating a plurality of abstract services in the second code file is created through the adaptation layer, and the target service is registered in a manifest file.
In one possible implementation, the method further includes:
registering a plurality of event schedulers in the target service, wherein each event scheduler is used for processing one type of event;
The method for calling the service in the service layer through the abstract service of the adaptation layer comprises the following steps:
Calling a corresponding event dispatcher through the abstract service of the adaptation layer;
and calling the service in the service layer through the event dispatcher.
In one possible implementation manner, the first code file is further used for providing a plurality of listeners, and after the Java interface and the AIDL interface provided by the first code file of any application call the AIDL interface of the adaptation layer, the method further comprises:
after capturing a first event by any monitor, establishing a mapping relation between the first event and the monitor monitoring the first event;
After any monitor monitors callback of the first event, determining a plurality of callback interfaces of the first event based on the mapping relation, and sequentially triggering the callback interfaces, wherein one monitor corresponds to one callback interface.
In one possible implementation, the second code file is further configured to provide a plurality of listeners, and the method further includes:
After capturing a second event by any monitor, establishing a mapping relation between the second event and the monitor monitoring the second event;
And when the adaptation layer needs to send a callback message corresponding to the second event to the application layer, determining a plurality of callback interfaces of the second event based on the monitor corresponding to the second event and the mapping relation, and triggering the callback interfaces in sequence, wherein one monitor corresponds to one callback interface.
In one possible implementation, the first code file includes at least one of:
An AIDL interface specification for defining at least one of a method, parameters, and return values of an AIDL interface;
An AIDL subfile, the AIDL subfile describing a structure of an AIDL interface;
The first code data are used for realizing an application end service connection function and/or a connection retry function;
a plurality of AIDL interfaces including at least one of a set-up service initialization interface, a registration event listening interface, an acquisition event value interface, and a modification event value interface;
And the second code data is used for managing interface call and callback monitoring.
In one possible implementation, the second code file includes at least one of the following:
An AIDL interface specification for defining at least one of a method, parameters, and return values of an AIDL interface;
An AIDL subfile, the AIDL subfile describing a structure of an AIDL interface;
a plurality of AIDL interfaces including at least one of a set-up service initialization interface, a registration event listening interface, an acquisition event value interface, and a modification event value interface;
The abstract class is inherited from the service class in the service layer and is used for realizing abstract service;
and third code data for processing event callbacks.
In another aspect, a vehicle is provided, the vehicle including a processor and a memory, the memory having stored therein at least one program code, the at least one program code loaded and executed by the processor to implement an in-vehicle application implementation method as described in any of the above implementations.
In another aspect, a computer readable storage medium is provided, in which at least one program code is stored, the at least one program code being loaded and executed by a processor to implement the vehicle-mounted application implementation method according to any of the above-mentioned implementations.
In another aspect, a computer program product is provided, the computer program product comprising at least one piece of program code, the at least one piece of program code being loaded and executed by a processor to implement an in-vehicle application implementation method as described in any of the implementations above.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
The embodiment of the application provides a vehicle-mounted application implementation method, which is characterized in that an adaptation layer is added in a vehicle-mounted system, the adaptation layer is abutted against a service layer, and the application layer realizes the call of services in the service layer by calling the adaptation layer, so that the interface called by the application layer is fixed, the interface called by the application layer is not changed along with the change of the service layer in the vehicle-mounted system, and only different adaptation layers are configured for the service layers in different vehicle-mounted systems, so that an application developer only needs to develop one version, the development cost is reduced, and the development period is shortened.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a vehicle-mounted system according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for implementing a vehicle-mounted application according to an embodiment of the present application;
Fig. 3 is a schematic structural diagram of a vehicle according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present disclosure are all authorized by the user or are fully authorized by the parties. The collection, use and processing of relevant data requires compliance with relevant national and regional laws and regulations. For example, service invocation requests, events, etc. referred to in the present application are all acquired with sufficient authorization.
The implementation method of the vehicle-mounted application provided by the embodiment of the application is executed by the vehicle-mounted system. In some embodiments, as shown in FIG. 1, the in-vehicle system includes an application layer, an adaptation layer, and a service layer. The application layer runs a plurality of applications, each application comprises a first code file, the first code file is used for providing Java interfaces and AIDL (Android Interface Definition Language ) interfaces, the adaptation layer comprises a second code file, the second code file is used for providing abstract services inherited from services in the service layer and is used for providing AIDL interfaces, and therefore when the application layer needs to call services in the service layer, the application layer can call the AIDL interfaces in the application layer through Java interfaces in the application layer, call the AIDL interfaces in the adaptation layer through AIDL interfaces in the application layer, and call the abstract services in the adaptation layer through AIDL interfaces in the adaptation layer. Since the abstract services in the adaptation layer are inherited from the services in the service layer, by invoking the abstract services in the adaptation layer, the corresponding services in the service layer can be invoked.
In the development architecture of applications, each application needs to interface with a Framework (FW) interface of the service layer to invoke a service in the service layer through the FW interface. However, different interface specifications are adopted by service layers of different vehicle-mounted systems, so that application developers need to develop a plurality of different application versions aiming at the different interface specifications. The vehicle-mounted system provided by the embodiment of the application introduces the adaptation layer between the application layer and the service layer, the adaptation layer is based on the AIDL interface specification, the interface communication between the application layer and the adaptation layer is encapsulated, and the encapsulation not only can realize the standardization of the communication mode, but also can dynamically add the interface. Therefore, the adaptation work of the service layer is concentrated on the adaptation layer, so that the adaptation process of each vehicle-mounted system is unified. Accordingly, the problem caused by the difference of interface specifications of service layers of different in-vehicle systems is solved.
AIDL is an interface definition language on the Android platform that describes the interfaces used for communication between different processes. It allows a developer to define an interface method for interaction between a client and a server, including input parameters, output parameters, and return values. The AIDL generates Java classes for data transfer and method invocation between different processes based on the interface definition. AIDL is mainly used to solve the communication problem between different processes in Android applications, especially in cases involving inter-process communication (IPC).
The AIDL interface defines that each application definitely defines the function and the data transmission mode, and the aim is achieved through the AIDL interface. These interfaces generate corresponding Java classes at the compilation stage to support cross-process communication. In order to ensure standardization of the interface and improve the use convenience of the interface, in the embodiment of the application, a set of encapsulation interface specifications between an application layer and an adaptation layer are created on the basis of the AIDL interface. This will help to provide a unified interface for the application layer, while the adaptation layer provides corresponding service capabilities. In the embodiment of the application, the packaging specification is integrated into a jar file so as to be convenient for application developers to use.
Cross-process communication, namely, cross-process communication can be carried out among different modules through Java classes generated by AIDL. In this way, different applications can run in separate processes, achieving a high degree of isolation and modularity.
Dynamic extension-new applications can be seamlessly integrated with existing modules by defining interfaces that conform to the AIDL specification. In this way, the expandability of the in-vehicle system is improved, and new functions can be more easily introduced into the in-vehicle system.
Fig. 2 is a flowchart of a method for implementing a vehicle-mounted application according to an embodiment of the present application, where a vehicle is used as an execution body and a vehicle-mounted system is operated in the vehicle, and the vehicle-mounted system includes an application layer, an adaptation layer and a service layer. The application layer runs a plurality of applications, each application comprising a first code file for providing a Java interface and an AIDL interface, the adaptation layer comprising a second code file for providing abstract services inherited from services in the service layer and for providing an AIDL interface. As shown in fig. 2, the method includes:
201. when any application receives a service call request, the vehicle calls an AIDL interface of the adaptation layer through a Java interface and an AIDL interface provided by a first code file of the any application.
In the embodiment of the application, a set of encapsulation interface specifications between an application layer and an adaptation layer are created on the basis of an AIDL interface. This will help to provide a unified interface for the application layer, while the adaptation layer provides corresponding service capabilities. In the embodiment of the application, the package specification is integrated into a jar file, and the first code file and the second code file are the jar file.
In one possible implementation, the first code file includes at least one of:
(1) An AIDL interface specification for defining at least one of a method, parameters, and return values of an AIDL interface. (2) An AIDL subfile, which is used to describe the structure of the AIDL interface. (3) And the first code data is used for realizing an application end service connection function and/or a connection retry function. (4) The system comprises a plurality of AIDL interfaces, wherein the AIDL interfaces comprise at least one of a service initialization interface, a registration event monitoring interface, an acquisition event value interface and a modification event value interface; (5) second code data for managing interface calls and callback snoops.
It should be noted that, in the embodiment of the present application, the AIDL interface generates a corresponding Java interface in the compiling stage, so, although the first code file only includes the AIDL interface specification and the AIDL subfiles, after the vehicle system operates, the AIDL interface generates a corresponding Java interface in the compiling stage, and thus, the first code file may provide the AIDL interface and the Java interface.
In some embodiments, the first code file includes second code data for providing a plurality of listeners through which callback listening is implemented. Optionally, the first code file is further used for providing a plurality of listeners, after the Java interface and the AIDL interface provided by the first code file of any application call the AIDL interface of the adaptation layer, the method further comprises the steps of establishing a mapping relation between the first event and the listeners listening to the first event after the first event is captured by any one of the listeners, and determining a plurality of callback interfaces of the first event based on the mapping relation after the callback of the first event is listened to by any one of the listeners, and triggering the callback interfaces in sequence, wherein one of the listeners corresponds to one callback interface. By the method, a plurality of listeners can be effectively managed and called, and all relevant callbacks are ensured to be executed after the event is triggered.
In one possible implementation, the abstract service is registered in the manifest file before it can be invoked. The method further includes creating, by the adaptation layer, a target service integrating the plurality of abstract services in the second code file after the in-vehicle system is running, and registering the target service in the manifest file. Subsequently, a corresponding abstract service may be invoked based on the manifest file.
In one possible implementation, the second code file includes at least one of (1) an AIDL interface specification for defining at least one of a method, a parameter, and a return value of the AIDL interface. (2) An AIDL subfile, which is used to describe the structure of the AIDL interface. (3) The system comprises a plurality of AIDL interfaces including at least one of a set-up service initialization interface, a registration event listening interface, an acquisition event value interface, and a modification event value interface. (4) The abstract class inherits from the service class in the service layer and is used for realizing abstract service. (5) And the third code data is used for processing event callback.
The first code file and the second code file each comprise an AIDL interface specification, an AIDL sub-file and a plurality of AIDL interfaces, the AIDL interface specification in the first code file is the same as the AIDL sub-file, and the plurality of AIDL interfaces in the first code file and the plurality of AIDL interfaces in the second code file are in one-to-one correspondence, so that the application layer and the adaptation layer can communicate based on the first code file and the second code file.
In the embodiment of the application, the first code file provides a Java interface and an AIDL interface, wherein the Java interface is generated in the compiling process of the AIDL interface. The vehicle calls the AIDL interface of the adaptation layer through the Java interface and the AIDL interface provided by the first code file of any application, comprising that the vehicle calls the AIDL interface provided by the first code file through the Java interface provided by the first code file of any application; the AIDL interface of the adaptation layer is called through the AIDL interface provided by the first code file. The Java interfaces in the first code file and the AIDL interfaces in the second code file are in one-to-one correspondence, and the AIDL interfaces in the first code file and the AIDL interfaces in the second code file are correspondingly set by a developer in the development process.
202. The vehicle invokes the abstract services of the adaptation layer through the AIDL interface of the adaptation layer.
The Java interface and the AIDL interface provided by the first code file of the application carry corresponding parameters when the AIDL interface of the adaptation layer is called, and the abstract service in the adaptation layer can be determined to be called based on the corresponding parameters.
In one possible implementation, the second code file includes third code data for providing a plurality of listeners through which event callbacks are processed. In some embodiments, the second code file is further used for providing a plurality of listeners, the method further comprises the steps of after the second event is captured through any listener, establishing a mapping relation between the second event and the listeners which monitor the second event, and determining a plurality of callback interfaces of the second event based on the listeners corresponding to the second event and the mapping relation when the adaptation layer needs to send callback information corresponding to the second event to the application layer, and sequentially triggering the callback interfaces, wherein one listener corresponds to one callback interface. By the method, a plurality of listeners can be effectively managed and called, and all relevant callbacks are ensured to be executed after the event is triggered.
203. The vehicle invokes a service in the service layer through the abstract service of the adaptation layer.
In one possible implementation, a plurality of event schedulers are registered in the service layer, and it should be noted that the event schedulers need to be registered in the service layer after definition is completed, so that the event schedulers can be normally used. A corresponding event processing range is set for each event scheduler, and each event scheduler only processes events in a specific range, so that modular management is realized. The method further includes registering a plurality of event schedulers in the target service, each event scheduler for processing a class of events. The vehicle calls the service in the service layer through the abstract service of the adaptation layer, and the vehicle calls the corresponding event dispatcher through the abstract service of the adaptation layer, and calls the service in the service layer through the event dispatcher.
The embodiment of the application provides a vehicle-mounted application implementation method, which is characterized in that an adaptation layer is added in a vehicle-mounted system, the adaptation layer is abutted against a service layer, and the application layer realizes the call of services in the service layer by calling the adaptation layer, so that the interface called by the application layer is fixed, the interface called by the application layer is not changed along with the change of the service layer in the vehicle-mounted system, and only different adaptation layers are configured for the service layers in different vehicle-mounted systems, so that an application developer only needs to develop one version, the development cost is reduced, and the development period is shortened.
The generation process of the first code file and the second code file comprises the following steps:
1. interface specification-interface specification to be explicitly defined, the interface specification including method, parameters, return values, etc. of the interface.
2. Creating AIDL subfiles, namely creating corresponding AIDL subfiles according to defined interface specifications, wherein the AIDL subfiles are used for describing the structure of an AIDL interface and generating corresponding JAVA interfaces when compiling.
3. First code data is written, and the first code data is used for realizing an application end service connection function and/or a connection retry function. And the connection operation of the application layer and the adaptation layer service is uniformly processed in the communication layer, and the connection of the service is not required to be concerned for the application layer.
4. And (3) encapsulating the application calling interface, namely establishing a service initialization interface, registering an event monitoring interface, acquiring an event value interface, modifying the event value interface and the like.
5. In actual development, one event often needs to be captured by a plurality of listeners at the same time, and in order to adopt a Map data structure in the embodiment of the application, the event is used as a Key, the corresponding callback is realized as a Value, and the listeners are stored in a mapping form. After receiving the callback from the server, finding all callback implementations corresponding to the callback implementations in the Map according to the event, and then triggering the callback interfaces one by one in sequence. By the method, a plurality of listeners can be effectively managed and called, and all relevant callbacks are ensured to be executed after the event is triggered.
6. An abstract class is established, which is intended to facilitate the adaptation layer to implement the service. In communication jar, the created abstract class inherits from services in the service layer to handle connection maintenance and event callbacks for clients. Similarly, a Map data structure is employed in which events are treated as keys and callbacks are treated as values. When callback information needs to be carried out to the client, all related callback implementations can be positioned in the Map according to the event as a Key, and callback interfaces are triggered orderly one by one. By the method, a plurality of listeners can be effectively managed, and all related callbacks can be smoothly executed after the event is triggered.
7. And generating an encapsulation specification jar file, wherein the encapsulation specification jar file is packaged into a jar file based on steps 1,2, 3,4 and 5, namely a first code file, and is packaged into a jar file based on steps 1,2, 4 and 6, namely a second code file.
Subsequently, the generated jar file may be provided to an application developer, who may integrate the jar file into an application to easily communicate with the adaptation layer without concern for differences in service layers of different vehicle-mounted systems.
Fig. 3 is a schematic structural diagram of a vehicle according to an embodiment of the present application. In general, the vehicle 300 includes a processor 301.
The processor 301 may include one or more computer-readable storage media, which may be non-transitory. In some embodiments, a non-transitory computer readable storage medium in processor 301 is used to store at least one program code for execution by processor 901 to perform the operations performed by a vehicle in the in-vehicle application implementation method provided by the method embodiments of the present application.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not limiting of the vehicle 300 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
The embodiment of the application also provides a computer readable storage medium, wherein at least one program code is stored in the computer readable storage medium, and the at least one program code is loaded and executed by a processor to realize the vehicle-mounted application implementation method according to any implementation mode.
Embodiments of the present application also provide a computer program product comprising at least one program code loaded and executed by a processor to implement a vehicle-mounted application implementation method as described in any of the above implementations.
The foregoing is illustrative of the present application and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., which fall within the spirit and principles of the present application.

Claims (10)

1.一种车载应用实现方法,其特征在于,应用于车载系统,所述车载系统包括应用层、适配层和服务层,所述应用层运行有多个应用,每个应用包括第一代码文件,所述第一代码文件用于提供Java接口和AIDL接口,所述适配层包括第二代码文件,所述第二代码文件用于提供继承自所述服务层中服务的抽象服务,且用于提供AIDL接口;所述方法包括:1. A method for implementing an in-vehicle application, characterized in that it is applied to an in-vehicle system, the in-vehicle system comprising an application layer, an adaptation layer, and a service layer, wherein the application layer runs multiple applications, each application comprising a first code file, the first code file being used to provide a Java interface and an AIDL interface, the adaptation layer comprising a second code file, the second code file being used to provide an abstract service inherited from the service layer, and also being used to provide an AIDL interface; the method comprising: 当任一应用接收到服务调用请求时,通过所述任一应用的第一代码文件提供的Java接口和AIDL接口,调用所述适配层的AIDL接口;When any application receives a service call request, it calls the AIDL interface of the adaptation layer through the Java interface and AIDL interface provided by the first code file of the application. 通过所述适配层的AIDL接口调用所述适配层的抽象服务;The AIDL interface of the adaptation layer is used to call the abstract service of the adaptation layer; 通过所述适配层的抽象服务,调用所述服务层中的服务。The services in the service layer are invoked through the abstract services of the adaptation layer. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 在所述车载系统运行之后,通过所述适配层创建一个集成所述第二代码文件中多个抽象服务的目标服务,在清单文件中注册所述目标服务。After the vehicle system is running, a target service integrating multiple abstract services in the second code file is created through the adaptation layer, and the target service is registered in the manifest file. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, characterized in that the method further comprises: 在所述目标服务中注册多个事件调度器,每个事件调度器用于处理一类事件;Multiple event schedulers are registered in the target service, and each event scheduler is used to handle a type of event. 所述通过所述适配层的抽象服务,调用所述服务层中的服务,包括:The process of calling services in the service layer through the abstract service of the adaptation layer includes: 通过所述适配层的抽象服务,调用对应的事件调度器;The corresponding event scheduler is invoked through the abstract service of the adaptation layer; 通过所述事件调度器调用所述服务层中的服务。The event scheduler invokes the services in the service layer. 4.根据权利要求1所述的方法,其特征在于,所述第一代码文件还用于提供多个监听器;所述通过所述任一应用的第一代码文件提供的Java接口和AIDL接口,调用所述适配层的AIDL接口之后,所述方法还包括:4. The method according to claim 1, wherein the first code file is further configured to provide multiple listeners; after calling the AIDL interface of the adaptation layer through the Java interface and AIDL interface provided by the first code file of any application, the method further includes: 在通过任一监听器捕获到第一事件之后,建立所述第一事件与监听到所述第一事件的监听器之间的映射关系;After the first event is captured by any listener, a mapping relationship is established between the first event and the listener that captured the first event; 在通过任一监听器监听到所述第一事件的回调之后,基于所述映射关系,确定所述第一事件的多个回调接口,依次触发所述多个回调接口,其中,一个监听器对应一个回调接口。After the callback of the first event is detected by any listener, multiple callback interfaces of the first event are determined based on the mapping relationship, and the multiple callback interfaces are triggered in sequence, wherein one listener corresponds to one callback interface. 5.根据权利要求1所述的方法,其特征在于,所述第二代码文件还用于提供多个监听器;所述方法还包括:5. The method according to claim 1, wherein the second code file is further configured to provide multiple listeners; the method further includes: 在通过任一监听器捕获到第二事件之后,建立所述第二事件与监听到所述第二事件的监听器之间的映射关系;After the second event is captured by any listener, a mapping relationship is established between the second event and the listener that captured the second event; 在所述适配层需要向所述应用层发送所述第二事件对应的回调消息时,基于所述第二事件对应的监听器,基于所述映射关系,确定所述第二事件的多个回调接口,依次触发所述多个回调接口,其中,一个监听器对应一个回调接口。When the adaptation layer needs to send a callback message corresponding to the second event to the application layer, based on the listener corresponding to the second event and based on the mapping relationship, multiple callback interfaces of the second event are determined and triggered sequentially, wherein one listener corresponds to one callback interface. 6.根据权利要求1所述的方法,其特征在于,所述第一代码文件包括以下至少一项:6. The method according to claim 1, wherein the first code file comprises at least one of the following: AIDL接口规范,所述AIDL接口规范用于定义AIDL接口的方法、参数和返回值中的至少一项;AIDL Interface Specification, which defines at least one of the methods, parameters and return values of an AIDL interface; AIDL子文件,所述AIDL子文件用于描述AIDL接口的结构;AIDL sub-files, which are used to describe the structure of AIDL interfaces; 第一代码数据,所述第一代码数据用于实现应用端服务连接功能和/或连接重试功能;First code data, the first code data is used to implement the application-side service connection function and/or connection retry function; 多个AIDL接口,所述多个AIDL接口包括建立服务初始化接口、注册事件监听接口、获取事件值接口和修改事件值接口中的至少一项;Multiple AIDL interfaces, wherein the multiple AIDL interfaces include at least one of a service initialization interface, an event listener registration interface, an event value retrieval interface, and an event value modification interface; 第二代码数据,所述第二代码数据用于管理接口调用和回调监听。The second code data is used to manage interface calls and callback listeners. 7.根据权利要求1所述的方法,其特征在于,所述第二代码文件包括以下至少一项:7. The method according to claim 1, wherein the second code file comprises at least one of the following: AIDL接口规范,所述AIDL接口规范用于定义AIDL接口的方法、参数和返回值中的至少一项;AIDL Interface Specification, which defines at least one of the methods, parameters and return values of an AIDL interface; AIDL子文件,所述AIDL子文件用于描述AIDL接口的结构;AIDL sub-files, which are used to describe the structure of AIDL interfaces; 多个AIDL接口,所述多个AIDL接口包括建立服务初始化接口、注册事件监听接口、获取事件值接口和修改事件值接口中的至少一项;Multiple AIDL interfaces, wherein the multiple AIDL interfaces include at least one of a service initialization interface, an event listener registration interface, an event value retrieval interface, and an event value modification interface; 抽象类,所述抽象类继承自所述服务层中的服务类,用于实现抽象服务;An abstract class, which inherits from the service class in the service layer, is used to implement abstract services; 第三代码数据,所述第三代码数据用于处理事件回调。The third code data is used to handle event callbacks. 8.一种车辆,其特征在于,所述车辆包括处理器和存储器,所述存储器中存储有至少一条程序代码,所述至少一条程序代码由所述处理器加载并执行,以实现如上述权利要求1-7任一项所述的车载应用实现方法。8. A vehicle, characterized in that the vehicle includes a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the in-vehicle application implementation method as described in any one of claims 1-7. 9.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储至少一条程序代码,所述至少一条程序代码由处理器加载并执行,以实现如上述权利要求1-7任一项所述的车载应用实现方法。9. A computer-readable storage medium, characterized in that at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to implement the vehicle application implementation method as described in any one of claims 1-7. 10.一种计算机程序产品,其特征在于,所述计算机程序产品包括至少一条程序代码,所述至少一条程序代码由处理器加载并执行,以实现如上述权利要求1-7任一项所述的车载应用实现方法。10. A computer program product, characterized in that the computer program product includes at least one piece of program code, the at least one piece of program code being loaded and executed by a processor to implement the vehicle application implementation method as described in any one of claims 1-7.
CN202410274170.2A 2024-03-11 2024-03-11 Vehicle-mounted application implementation method, vehicle and storage medium Active CN118193078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410274170.2A CN118193078B (en) 2024-03-11 2024-03-11 Vehicle-mounted application implementation method, vehicle and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410274170.2A CN118193078B (en) 2024-03-11 2024-03-11 Vehicle-mounted application implementation method, vehicle and storage medium

Publications (2)

Publication Number Publication Date
CN118193078A CN118193078A (en) 2024-06-14
CN118193078B true CN118193078B (en) 2025-10-31

Family

ID=91399561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410274170.2A Active CN118193078B (en) 2024-03-11 2024-03-11 Vehicle-mounted application implementation method, vehicle and storage medium

Country Status (1)

Country Link
CN (1) CN118193078B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119728774A (en) * 2024-12-02 2025-03-28 康键信息技术(深圳)有限公司 Network request method, device, storage medium and equipment based on abstract thinking

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110808952A (en) * 2019-09-26 2020-02-18 广州南方卫星导航仪器有限公司 Method for acquiring data across applications based on AIDL language
CN114579334A (en) * 2022-03-08 2022-06-03 中国农业银行股份有限公司 Communication method, communication device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6954799B2 (en) * 2000-02-01 2005-10-11 Charles Schwab & Co., Inc. Method and apparatus for integrating distributed shared services system
CN116418616A (en) * 2021-12-30 2023-07-11 大众问问(北京)信息科技有限公司 Vehicle-mounted service providing method and vehicle-mounted system based on active CAN protocol adaptation layer
CN115454539A (en) * 2022-08-12 2022-12-09 中电长城(长沙)信息技术有限公司 UWP application extension peripheral calling method, system and medium
CN116501516B (en) * 2023-04-18 2024-03-22 南京领行科技股份有限公司 Multi-map calling method, device, equipment and storage medium
CN116909766A (en) * 2023-07-10 2023-10-20 长城汽车股份有限公司 Media service calling method and device in vehicle-mounted system and vehicle-mounted system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110808952A (en) * 2019-09-26 2020-02-18 广州南方卫星导航仪器有限公司 Method for acquiring data across applications based on AIDL language
CN114579334A (en) * 2022-03-08 2022-06-03 中国农业银行股份有限公司 Communication method, communication device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN118193078A (en) 2024-06-14

Similar Documents

Publication Publication Date Title
US20120173614A1 (en) Event broker for an improved application server platform for telecom-based applications
CN109815025B (en) A business model calling method, device and storage medium
US20080049022A1 (en) Distributing Services in Graph-Based Computations
CN111163129A (en) Resource processing method and device based on cross-link network
CN111857892A (en) Method and device for business processing through blockchain
CN109002362A (en) A kind of method of servicing, device, system and electronic equipment
EP1066564A2 (en) Modular application collaboration including filtering at the source and proxy execution of compensating transactions to conserve server resources
US8156479B2 (en) System and method of monitoring dynamic scopes in synchronous and asynchronous calls
CN103546571A (en) Platform-as-a-service (PaaS) realizing method and device
CN107908488B (en) Message request interface interaction method and device, computer equipment and storage medium
CN118193078B (en) Vehicle-mounted application implementation method, vehicle and storage medium
CN107977260B (en) Task submitting method and device
CN113946614A (en) iOS (Internet operating System) static library-based network data transmission method, device and system
US20200310828A1 (en) Method, function manager and arrangement for handling function calls
CN112596931B (en) Cross-process communication method and device, electronic equipment and storage medium
CN113051086B (en) Data processing method and device, electronic equipment and storage medium
KR100683812B1 (en) Inbound connector
CN113448655B (en) Calling method and device of C standard dynamic library
US7318229B1 (en) Method, system, and program for dispatching a method call
CN119105887B (en) Message processing method, device, electronic device and storage medium
CN111831402A (en) Method, apparatus and computer program product for managing software functions
CN109669793B (en) Middleware in-process object call method
CN101179414A (en) A method for integrating lower-level network management functions in upper-level network management
CN113360302B (en) Method and system for time-consuming operation cancellation and blocking asynchronous conversion
CN112333270B (en) Method and system for dynamic routing of micro-services

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant