Bluetooth chip adaptation method and apparatus, device, medium, and product
By introducing an adaptation layer into the Bluetooth chip adaptation method and utilizing standardized interfaces and target library files, flexible switching of the protocol stack during Bluetooth chip applications is achieved, solving the problem of R&D and maintenance costs caused by protocol stack changes.
Patent Information
- Application Number
- PCT/CN2025/085315
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-27
- Filing Date
- 2025-03-27
- Publication Date
- 2026-01-02
AI Technical Summary
In existing technologies, changes in the protocol stack software of Bluetooth chips require frequent code modifications to upper-layer applications, making flexible switching impossible and increasing research and development and maintenance costs.
The concept of an adaptation layer is introduced. Chip adaptation requests are obtained through standardized interfaces, target library files are loaded or updated, and the target Bluetooth protocol stack is called to connect with the vehicle Bluetooth chip, enabling flexible switching of the protocol stack.
It reduces R&D and maintenance costs, decouples upper-layer applications from protocol stack software, and supports flexible protocol stack switching when using Bluetooth chips.
Smart Images

Figure CN2025085315_02012026_PF_FP_ABST
Abstract
Description
Bluetooth chip adaptation method, device, equipment, medium and product
[0001] The present application claims priority to the Chinese patent application No. 202410848877.X filed on June 27, 2024 with the China Patent Office, the whole content of the above application is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the computer technology field, for example, relates to a Bluetooth chip adaptation method, device, equipment, medium and product. BACKGROUND
[0003] For the same Bluetooth chip, different protocol stacks can be used for adaptation, and different protocol stack software also defines different calling interfaces to the upper layer application. The upper layer application needs to adapt different protocol stack software and maintain multiple sets of codes.
[0004] The upper layer application and the protocol stack software are highly coupled. When the protocol stack provider changes, the corresponding protocol stack software also changes. Accordingly, the upper layer application also needs to modify its code to adapt to the new protocol stack software. The flexible switching of the protocol stack cannot be realized, and the research and development and maintenance costs are greatly increased. SUMMARY
[0005] The present application provides a Bluetooth chip adaptation method, device, equipment, medium and product, which realizes the flexible switching of the protocol stack when the Bluetooth chip is applied, and reduces the research and development and maintenance costs.
[0006] In a first aspect, the present application provides a Bluetooth chip adaptation method, comprising:
[0007] Obtaining a chip adaptation request for a target vehicle-mounted Bluetooth chip, and determining a standardized interface corresponding to the chip adaptation request;
[0008] Accessing a corresponding adaptation layer based on the standardized interface and determining a target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request;
[0009] Calling a target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file;
[0010] Connecting the target vehicle-mounted Bluetooth chip through the target Bluetooth protocol stack.
[0011] In a second aspect, the present application provides a Bluetooth chip adaptation device, comprising:
[0012] The adaptation interface determination module is configured to acquire a chip adaptation request for a target vehicle-mounted Bluetooth chip, and determine a standardized interface corresponding to the chip adaptation request;
[0013] The library file adaptation module is configured to access a corresponding adaptation layer based on the standardized interface, and determine a target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request;
[0014] The protocol stack adaptation module is configured to call a target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file;
[0015] The Bluetooth chip connection module is configured to connect with the target vehicle-mounted Bluetooth chip through the target Bluetooth protocol stack.
[0016] In a third aspect, an electronic device is provided, and the electronic device comprises:
[0017] at least one processor; and
[0018] a memory connected with the at least one processor in communication; wherein
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the Bluetooth chip adaptation method provided in the first aspect.
[0020] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the Bluetooth chip adaptation method provided in the first aspect when executed.
[0021] In a fifth aspect, a computer program product is provided, and the computer program product comprises a computer program, and the computer program implements the Bluetooth chip adaptation method provided in the first aspect when executed by a processor. BRIEF DESCRIPTION OF DRAWINGS
[0022] FIG. 1 is a flowchart of a Bluetooth chip adaptation method provided in an embodiment of the present application;
[0023] FIG. 2 is a schematic diagram of the overall interaction involved in the Bluetooth chip adaptation method provided in the embodiment of the present application;
[0024] FIG. 3 is a flowchart of a Bluetooth chip adaptation method provided in an embodiment of the present application;
[0025] FIG. 4 is a schematic diagram of the selection of a standardized interface involved in the Bluetooth chip adaptation method provided in the embodiment of the present application;
[0026] Fig. 5 is a schematic diagram of selection of an adaptation layer library file involved in a Bluetooth chip adaptation method according to Embodiment Two of the present application;
[0027] Fig. 6 is a schematic diagram of adaptation layer application involved in a Bluetooth chip adaptation method according to Embodiment Two of the present application;
[0028] Fig. 7 is a schematic diagram of the structure of a Bluetooth chip adaptation apparatus according to Embodiment Three of the present application;
[0029] Fig. 8 is a schematic diagram of the structure of an electronic device according to Embodiment Four of the present application. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. The described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of the present application.
[0031] It should be noted that the terms "first", "second", and "target" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product, or device.
[0032] Embodiment One
[0033] Fig. 1 is a flowchart of a Bluetooth chip adaptation method according to Embodiment One of the present application. The present embodiment can be applied to the case of Bluetooth protocol stack adaptation for a target vehicle-mounted Bluetooth chip. The method can be executed by a Bluetooth chip adaptation apparatus, which can be implemented in the form of hardware and / or software.
[0034] As shown in Fig. 1, the method includes:
[0035] S101, obtaining a chip adaptation request for a target vehicle-mounted Bluetooth chip, and determining a standardized interface corresponding to the chip adaptation request.
[0036] In the embodiment, the target vehicle-mounted Bluetooth chip can be understood as a Bluetooth chip to be adapted and connected, and the target vehicle-mounted Bluetooth chip is applied to a vehicle. The chip adaptation request can be understood as a request for adapting the protocol stack for the target vehicle-mounted Bluetooth chip, and the chip adaptation request includes at least one of the Bluetooth function, the Bluetooth specification, the Bluetooth version and the required Bluetooth protocol stack type required by the client, or directly includes a specified Bluetooth protocol stack. The chip adaptation request is obtained through an upper application, which can be understood as an application interacting with a user. The standardized interface can be understood as an application programming interface (API) for connecting with a library file calling the protocol stack software, and in the embodiment, the standardized interface is connected with an adaptation layer, and defines an interaction mode between the upper application and the adaptation layer.
[0037] For example, the chip adaptation request for the target vehicle-mounted Bluetooth chip is obtained, and based on the Bluetooth function, the Bluetooth version, the protocol stack type and other information contained in the chip adaptation request, the target Bluetooth protocol stack satisfying the above content is determined, or when the chip adaptation request directly includes a specified Bluetooth protocol stack, the specified Bluetooth protocol stack is taken as the target Bluetooth protocol stack, and the target Bluetooth protocol stack is the Bluetooth protocol stack to be connected and driven with the target vehicle-mounted Bluetooth chip in the embodiment. Each Bluetooth protocol stack has its predefined standardized interface, and after the target Bluetooth protocol stack is determined, the standardized interface corresponding to the target Bluetooth protocol stack is determined based on the correspondence between each Bluetooth protocol stack and each standardized interface.
[0038] In the embodiment, the adaptation layer can be understood as a layer for connecting the upper application and the protocol stack software, and the adaptation layer usually contains necessary library files and configurations to support specific Bluetooth protocol stacks and functions. The target library file can be understood as a library file corresponding to the chip adaptation request and the standardized interface contained in the adaptation layer, and the target library file at least includes the Bluetooth protocol stack code capable of realizing the function required by the chip adaptation request or the Bluetooth protocol stack code specified by the chip adaptation request. The library file at least includes a shared library (so library) and a Java archive file (Jar library).
[0039] In the embodiment, the adaptation layer can be understood as a layer for connecting the upper application and the protocol stack software, and the adaptation layer usually contains necessary library files and configurations to support specific Bluetooth protocol stacks and functions. The target library file can be understood as a library file corresponding to the chip adaptation request and the standardized interface contained in the adaptation layer, and the target library file at least includes the Bluetooth protocol stack code capable of realizing the function required by the chip adaptation request or the Bluetooth protocol stack code specified by the chip adaptation request. The library file at least includes a shared library (so library) and a Java archive file (Jar library).
[0040] The standardized interface accesses an adaptation layer matching the type of the standardized interface, for example, when the standardized interface is a native interface, the adaptation layer corresponding to the native interface is accessed, and a target library file corresponding to the chip adaptation request and the standardized interface is loaded or updated in the adaptation layer. The target library file is determined based on the language type and content of the chip adaptation request, and the target library file matching the language type and content of the chip adaptation request is determined from a library file set. The target library file can be an so library, a jar library, or other types of library files, which are not limited in the embodiment.
[0041] When the target vehicle-mounted Bluetooth chip is not connected to any Bluetooth protocol stack, the target library file is directly loaded in the adaptation layer; when the target vehicle-mounted Bluetooth chip is currently connected to a Bluetooth protocol stack, the library file corresponding to the chip adaptation request is used as the target library file to update the adaptation layer library file.
[0042] The above technical solution loads the target library file into the memory by dynamic loading or static linking, so that the adaptation layer can respond to the request of the upper application according to the function provided by the standardized interface.
[0043] S103, calling a target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file.
[0044] In the embodiment, the target Bluetooth protocol stack can be understood as a Bluetooth protocol stack meeting the requirements of the chip adaptation request, for example, a Bluetooth protocol stack meeting at least one of the Bluetooth functions, Bluetooth specifications, Bluetooth versions, and Bluetooth protocol stack types included in the chip adaptation request, or a Bluetooth protocol stack directly specified by the chip adaptation request.
[0045] For example, the target library file contains the codes of multiple Bluetooth protocol stacks, and the target Bluetooth protocol stack is known when the chip adaptation request is obtained, so the code of the target Bluetooth protocol stack is directly called from the target library file.
[0046] S104, connecting the target vehicle-mounted Bluetooth chip through the target Bluetooth protocol stack.
[0047] In the embodiment, the corresponding protocol stack software is connected through the interface corresponding to the target Bluetooth protocol stack, the protocol stack software is used as a driver, and the target vehicle-mounted Bluetooth chip is connected to realize the calling of the target vehicle-mounted Bluetooth chip.
[0048] FIG. 2 is a schematic diagram of the overall interaction involved in a Bluetooth chip adaptation method provided by the embodiment, as shown in FIG. 2, the upper application applies the target library file through the adaptation layer, calls the target Bluetooth protocol stack through the target library file, and connects the Bluetooth chip through the protocol stack software of the target Bluetooth protocol stack to realize the adaptation and calling of the Bluetooth chip.
[0049] The Bluetooth chip adaptation method provided in the embodiments of the present application comprises: obtaining a chip adaptation request for a target vehicle-mounted Bluetooth chip, and determining a standardized interface corresponding to the chip adaptation request; accessing a corresponding adaptation layer based on the standardized interface and determining a target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request; calling a target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file; and connecting with the target vehicle-mounted Bluetooth chip through the target Bluetooth protocol stack. The above technical solution introduces the concept of an adaptation layer, loads a library file in the adaptation layer, and when adding, modifying or replacing a library file caused by changes in a protocol stack occurs, only corresponding adjustment of the library file in the adaptation layer is needed, without the need to recompile the entire program, and the upper-layer application does not need to be modified, thereby realizing decoupling of the upper-layer application and the protocol stack software, realizing flexible switching of the protocol stack when the Bluetooth chip is applied, and reducing the research and development and maintenance costs.
[0050] Embodiment Two
[0051] FIG. 3 is a flowchart of a Bluetooth chip adaptation method provided in Embodiment Two of the present application. This embodiment is a further optimization of any of the above embodiments, and can be applied to the case of adapting a Bluetooth protocol stack for a target vehicle-mounted Bluetooth chip. The method can be executed by a Bluetooth chip adaptation device, which can be implemented in the form of hardware and / or software.
[0052] As shown in FIG. 3, the method comprises:
[0053] S201: Obtain a chip adaptation request for a target vehicle-mounted Bluetooth chip.
[0054] S202: Determine a target Bluetooth protocol stack corresponding to the chip adaptation request.
[0055] In this embodiment, the chip adaptation request comprises at least one of a required Bluetooth function, a Bluetooth specification, a Bluetooth version and a required Bluetooth protocol stack type, or directly comprises a specified Bluetooth protocol stack. Therefore, the matching Bluetooth protocol stack can be directly determined based on the requirements corresponding to the chip adaptation request.
[0056] For example, when the chip adaptation request comprises a required Bluetooth function, a Bluetooth specification, a Bluetooth version and a Bluetooth protocol stack type, a Bluetooth protocol stack matching all of the required Bluetooth function, the Bluetooth specification, the Bluetooth version and the Bluetooth protocol stack type is determined as the target Bluetooth protocol stack; or when the chip adaptation request comprises a specified Bluetooth protocol stack, the specified Bluetooth protocol stack is determined as the target Bluetooth protocol stack.
[0057] S203: Determine a standardized interface corresponding to the chip adaptation request based on a predefined correspondence between the target Bluetooth protocol stack and the standardized interface.
[0058] In the embodiment, the standardized interface includes at least a native interface, an extended interface and a custom interface. The native interface is a native interface provided by Google. The extended interface is a native interface with specific functions added on the basis of the native interface. The custom interface is a brand-new native interface, and is related to functions corresponding to actual needs of a user. Different Bluetooth protocol stack providers, some of which adapt the native interface, some of which have mature custom interfaces, and some of which have extended interfaces based on the native interface. Different Bluetooth protocol stacks are from different protocol stack providers. The Bluetooth protocol stack, the provider and the standardized interface have a predefined two-to-two corresponding relationship.
[0059] Based on the protocol stack provider attribute of the target Bluetooth protocol stack, the protocol stack provider of the target Bluetooth protocol stack is determined, and then the standardized interface corresponding to the protocol stack provider is determined.
[0060] FIG. 4 is a schematic diagram of selection of a standardized interface involved in a Bluetooth chip adaptation method according to Embodiment Two of the present application. As shown in FIG. 4, an upper-layer application accesses an adaptation layer through a standardized interface. The standardized interface is one of a native interface (Google Native), an extended interface (Google+Custom Native) and a custom interface (Custom Native).
[0061] S204, based on the standardized interface, the corresponding adaptation layer is accessed, and a target library file corresponding to the chip adaptation request is determined.
[0062] FIG. 5 is a schematic diagram of selection of an adaptation layer library file involved in a Bluetooth chip adaptation method according to Embodiment Two of the present application. As shown in FIG. 5, taking a so library as an example, an upper-layer application determines a corresponding adaptation layer based on a standardized interface. The three adaptation layers shown in FIG. 5 are a native adaptation layer (libbluetooth_jni.so) corresponding to a native interface, an extended adaptation layer corresponding to an extended interface and a custom adaptation layer corresponding to a custom interface. The adaptation layer corresponding to the type of the standardized interface is determined.
[0063] For example, when the standardized interface is a native interface, the native interface is used to access a native adaptation layer, where the native adaptation layer is used to store a protocol stack library file of a protocol stack provider corresponding to the native interface; when the standardized interface is an extended interface, the extended interface is used to access an extended adaptation layer, where the extended adaptation layer is used to store a protocol stack library file of a protocol stack provider corresponding to the extended interface; when the standardized interface is a custom interface, the custom interface is used to access a custom adaptation layer, where the custom adaptation layer is used to store a protocol stack library file of a protocol stack provider corresponding to the custom interface. After accessing the corresponding adaptation layer, the target library file to be loaded or updated is determined based on the target Bluetooth protocol stack corresponding to the chip adaptation request.
[0064] Optionally, the target library file corresponding to the chip adaptation request is determined, and the method comprises the following steps.
[0065] S2041, determining a target Bluetooth protocol stack corresponding to the chip adaptation request.
[0066] In this embodiment, the content of the target Bluetooth protocol stack corresponding to the chip adaptation request is determined, which is consistent with the above step S202, and will not be described here.
[0067] S2042, determining a target library file containing a code of the target Bluetooth protocol stack corresponding to a language of the chip adaptation request from the library file set.
[0068] In this embodiment, the chip adaptation request can correspond to a C language, such as C language or C++ language, or can correspond to a Java virtual machine language (JVM), such as Java, Kotlin, Scala, Groovy, etc. When the chip adaptation request is a C language, a shared library (so library) containing a code of the target Bluetooth protocol stack is determined from the library file set as the target library file; when the chip adaptation request is a Java virtual machine language, a Java archive file (Jar library) containing a code of the target Bluetooth protocol stack is determined from the library file set as the target library file.
[0069] FIG. 6 is a schematic diagram of an adaptation layer application involved in a Bluetooth chip adaptation method according to Embodiment Two of the present application; as shown in FIG. 6, if the library file is directly determined to be a so library, but the language corresponding to the chip adaptation request is a Java virtual machine language, a Java native interface (Java Native Interface, JNI) is used to call Java code to form a target library file in a language corresponding to the chip adaptation request.
[0070] S205, determining whether the target vehicle-mounted Bluetooth chip is currently applying a Bluetooth protocol stack.
[0071] In the embodiment, it is determined whether the target vehicle-mounted Bluetooth chip is currently driven by the Bluetooth protocol stack, or it is determined whether the library file is contained in the adaptation layer accessed based on the standardized interface, if yes, it is determined that the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack, otherwise, the target vehicle-mounted Bluetooth chip is not applying the Bluetooth protocol stack.
[0072] In S206, if the target vehicle-mounted Bluetooth chip is not applying the Bluetooth protocol stack, the target library file is loaded in the adaptation layer.
[0073] In the embodiment, if the target vehicle-mounted Bluetooth chip is not applying the Bluetooth protocol stack, the target library file corresponding to the chip adaptation request (or the target Bluetooth protocol stack) can be directly loaded in the adaptation layer at this time.
[0074] In S207, if the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack, the target library file is updated in the adaptation layer according to the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request.
[0075] In the embodiment, if the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack, the chip adaptation request at this time can be understood as a protocol stack replacement request, and it is needed to judge whether the target library file needs to be updated in the adaptation layer based on the target Bluetooth protocol stack to be applied according to the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip.
[0076] Optionally, if the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack, the target library file is updated in the adaptation layer according to the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request, including:
[0077] In S2071, if the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have the same protocol stack supply attribute, the current library file currently applied by the adaptation layer is taken as the target library file.
[0078] In the embodiment, the current Bluetooth protocol stack can be understood as the Bluetooth protocol stack being adopted by the Bluetooth chip at the current time. The protocol stack supply attribute can be understood as attribute information used for representing the source supply of the Bluetooth protocol stack. When the protocol stack supply attributes of two Bluetooth protocol stacks are consistent, it represents that the two Bluetooth protocol stacks are from the same protocol stack supply. The current library file can be understood as the library file corresponding to the current Bluetooth protocol stack applied by the adaptation layer when the target vehicle-mounted Bluetooth chip adopts the current Bluetooth protocol stack at the current time.
[0079] For example, if the same protocol stack provider provides the same library file, if the current Bluetooth protocol stack applied by the target vehicle Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have the same protocol stack supply attribute, it indicates that the current Bluetooth protocol stack and the target Bluetooth protocol stack come from the same protocol stack provider, at this time, the current library file applied by the adaptation layer also includes the code of the target Bluetooth protocol stack, and the calling of the target Bluetooth protocol stack can be realized. Therefore, when the current Bluetooth protocol stack and the target Bluetooth protocol stack have the same protocol stack supply attribute, the current library file applied by the adaptation layer is directly used as the target library file, and it is assumed that the updating of the library file has been completed, and the updating of the library file does not need to be actually performed.
[0080] S2072, if the current Bluetooth protocol stack applied by the target vehicle Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have different protocol stack supply attributes, updating the current library file applied by the adaptation layer to the target library file corresponding to the target Bluetooth protocol stack.
[0081] In the embodiment, if the current Bluetooth protocol stack applied by the target vehicle Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have different protocol stack supply attributes, it indicates that the current Bluetooth protocol stack and the target Bluetooth protocol stack come from different protocol stack providers, and different protocol stack providers correspond to different library files, and the current library file applied by the adaptation layer cannot realize the calling of the target Bluetooth protocol stack code. Therefore, when the current Bluetooth protocol stack and the target Bluetooth protocol stack have different protocol stack supply attributes, the current library file applied by the adaptation layer is deleted, and the target library file corresponding to the chip adaptation request (or the target Bluetooth protocol stack) determined in step S204 is loaded, so as to realize the updating of the library file in the adaptation layer.
[0082] S208, calling the target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file.
[0083] S209, calling the target protocol stack software of the target Bluetooth protocol stack through the protocol stack interface provided by the target Bluetooth protocol stack, and connecting the target vehicle Bluetooth chip through the target protocol stack software.
[0084] In the embodiment, the target protocol stack software can be understood as the protocol stack software corresponding to the target Bluetooth protocol stack, and is used to realize the connection and driving of the target vehicle Bluetooth chip.
[0085] Exemplarily, the target protocol stack software of the target Bluetooth protocol stack is connected through the protocol stack interface provided by the target Bluetooth protocol stack, the target protocol stack software is called to be connected with the target vehicle-mounted Bluetooth chip, and the calling and driving of the target Bluetooth chip are realized through the target protocol stack software. The protocol stack interface provided by the target Bluetooth protocol stack is related to the language corresponding to the chip adaptation request. When the language corresponding to the chip adaptation request is a C language, the target Bluetooth protocol stack provides a C / C++ interface. When the language corresponding to the chip adaptation request is a Java virtual machine language, the target Bluetooth protocol stack provides a Java / kotlin interface.
[0086] As shown in FIG. 6, the corresponding interface is called based on the language type of the target library file. When the target library file is an so library, the target Bluetooth protocol stack is called through a C++ interface, and the target protocol stack software is called through the C / C++ interface of the target Bluetooth protocol stack. When the target library file is a jar library determined after the JNI is called back to the Java layer, the target Bluetooth protocol stack is called through Java, and the target protocol stack software is called through the Java / Kotlin interface of the target Bluetooth protocol stack.
[0087] The Bluetooth chip adaptation method provided by the embodiment includes obtaining a chip adaptation request for a target vehicle-mounted Bluetooth chip; determining a target Bluetooth protocol stack corresponding to the chip adaptation request; determining a standardized interface corresponding to the chip adaptation request based on a predefined correspondence relationship between the target Bluetooth protocol stack and the standardized interface; accessing a corresponding adaptation layer based on the standardized interface, and determining a target library file corresponding to the chip adaptation request; determining whether the target vehicle-mounted Bluetooth chip is applying a Bluetooth protocol stack; if the target vehicle-mounted Bluetooth chip is not applying the Bluetooth protocol stack, loading the target library file in the adaptation layer; if the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack, updating the target library file in the adaptation layer according to a current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request; calling the target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file; calling target protocol stack software of the target Bluetooth protocol stack through a protocol stack interface provided by the target Bluetooth protocol stack, and connecting the target protocol stack software with the target vehicle-mounted Bluetooth chip. The above technical solution introduces the concept of the adaptation layer, loads the library file in the adaptation layer, and only needs to make corresponding adjustments of the library file in the adaptation layer when adding, modifying or replacing the library file due to changes in the protocol stack, without the need to recompile the entire program. The upper-layer application does not need to be modified, the upper-layer application and the protocol stack software are decoupled, the flexible switching of the protocol stack is realized when the Bluetooth chip is applied, and the research and development and maintenance costs are reduced.
[0088] Embodiment three
[0089] Fig. 7 is a structural schematic diagram of a Bluetooth chip adaptation device according to Embodiment Three of the present application. As shown in Fig. 7, the device comprises:
[0090] An adaptation interface determination module 31 is configured to acquire a chip adaptation request for a target vehicle-mounted Bluetooth chip, and determine a standardized interface corresponding to the chip adaptation request;
[0091] A library file adaptation module 32 is configured to access a corresponding adaptation layer based on the standardized interface, and determine a target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request;
[0092] A protocol stack adaptation module 33 is configured to call a target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file;
[0093] A Bluetooth chip connection module 34 is configured to connect with the target vehicle-mounted Bluetooth chip through the target Bluetooth protocol stack.
[0094] The Bluetooth chip adaptation device according to the technical solution has the advantages that the concept of adaptation layer is introduced, and a library file is loaded in the adaptation layer. When adding, modifying or replacing a library file due to changes in a protocol stack, only the corresponding adjustment of the library file in the adaptation layer is needed, and the entire program does not need to be recompiled. The upper-layer application does not need to be modified, the upper-layer application and the protocol stack software are decoupled, the flexible switching of the protocol stack during the application of the Bluetooth chip is realized, and the research and development and maintenance costs are reduced.
[0095] Optionally, the adaptation interface determination module 31 is specifically configured to:
[0096] determine a target Bluetooth protocol stack corresponding to the chip adaptation request;
[0097] determine a standardized interface corresponding to the chip adaptation request based on a predefined corresponding relationship between the target Bluetooth protocol stack and the standardized interface.
[0098] Optionally, the library file adaptation module 32 comprises:
[0099] A library file determination unit is configured to access a corresponding adaptation layer based on the standardized interface, and determine a target library file corresponding to the chip adaptation request;
[0100] A protocol stack occupation confirmation unit is configured to determine whether the target vehicle-mounted Bluetooth chip is applying a Bluetooth protocol stack;
[0101] A library file loading unit is configured to load the target library file in the adaptation layer if the target vehicle-mounted Bluetooth chip is not applying a Bluetooth protocol stack;
[0102] The library file updating unit is configured to update the target library file in the adaptation layer according to a current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request, if the target vehicle-mounted Bluetooth chip is applying the Bluetooth protocol stack.
[0103] Optionally, the library file determining unit is specifically configured to:
[0104] determine the target Bluetooth protocol stack corresponding to the chip adaptation request;
[0105] determine, from the library file set, a target library file corresponding to a language of the chip adaptation request and containing the target Bluetooth protocol stack code.
[0106] Optionally, the library file updating unit is specifically configured to:
[0107] if the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have the same protocol stack supply attribute, use a current library file currently applied by the adaptation layer as the target library file;
[0108] if the current Bluetooth protocol stack being applied by the target vehicle-mounted Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request have different protocol stack supply attributes, update the current library file currently applied by the adaptation layer to a target library file corresponding to the target Bluetooth protocol stack.
[0109] Optionally, the Bluetooth chip connection module 34 is specifically configured to: call target protocol stack software of the target Bluetooth protocol stack through a protocol stack interface provided by the target Bluetooth protocol stack, and connect with the target vehicle-mounted Bluetooth chip through the target protocol stack software.
[0110] The Bluetooth chip adaptation apparatus provided in the embodiments of the present application can execute the Bluetooth chip adaptation method provided in any of the embodiments of the present application, and has the corresponding function modules and effects of the execution method.
[0111] Embodiment Four
[0112] FIG. 8 is a structural schematic diagram of an electronic device according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown in the figures, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application as described and / or claimed in this document.
[0113] As shown in FIG. 8, the electronic device 40 includes at least one processor 41, and a memory, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., connected to the at least one processor 41 in communication, where the memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 42 or loaded into the random access memory (RAM) 43 from the storage unit 48. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0114] Various components in the electronic device 40 are connected to the I / O interface 45, including an input unit 46, such as a keyboard, a mouse, etc., an output unit 47, such as various types of displays, speakers, etc., a storage unit 48, such as a magnetic disk, an optical disk, etc., and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0115] The processor 41 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs various methods and processes described above, such as the Bluetooth chip adaptation method.
[0116] In some embodiments, the Bluetooth chip adaptation method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 48. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 40 via, e.g., ROM 42 and / or communication unit 49. When the computer program is loaded onto RAM 43 and executed by processor 41, one or more steps of the Bluetooth chip adaptation method described above can be performed. Alternatively, in other embodiments, processor 41 can be configured to perform the Bluetooth chip adaptation method by other means, e.g., with the aid of firmware.
[0117] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0118] Computer programs implementing methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0119] In the context of this application, a computer readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium can be a machine readable signal medium. A machine readable signal medium can include an electrical, optical, acoustical, or other form of propagated signals, e.g., carrier waves, infrared signals, digital signals, etc.
[0120] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0121] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.
[0122] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business expansion in traditional physical host and VPS service.
[0123] It should be understood that the various forms of flow shown above can be reordered, additional steps added, or steps deleted. For example, the steps described in this application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of this application can be achieved, which are not limited herein.
Claims
1. A Bluetooth chip adaptation method, comprising: Obtain the chip adaptation request for the target vehicle Bluetooth chip, and determine the standardized interface corresponding to the chip adaptation request; Access the corresponding adaptation layer based on the standardized interface and determine the target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request; The target Bluetooth protocol stack corresponding to the chip adaptation request is invoked through the target library file. The target Bluetooth protocol stack is connected to the target vehicle Bluetooth chip.
2. The method according to claim 1, wherein, The determination of the standardized interface corresponding to the chip adaptation request includes: Determine the target Bluetooth protocol stack corresponding to the chip adaptation request; Based on the predefined correspondence between the target Bluetooth protocol stack and the standardized interface, the standardized interface corresponding to the chip adaptation request is determined.
3. The method according to claim 1, wherein, The step of accessing the corresponding adaptation layer based on the standardized interface and determining the target library file of the adaptation layer includes: Access the corresponding adaptation layer based on the standardized interface, and determine the target library file corresponding to the chip adaptation request; Determine whether the target vehicle Bluetooth chip is currently using the Bluetooth protocol stack; In response to the target vehicle Bluetooth chip not being used in the Bluetooth protocol stack, the target library file is loaded in the adaptation layer; In response to the target vehicle Bluetooth chip being used with a Bluetooth protocol stack, the target library file is updated at the adaptation layer according to the current Bluetooth protocol stack being used by the target vehicle Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request.
4. The method according to claim 3, wherein, The determination of the target library file corresponding to the chip adaptation request includes: Determine the target Bluetooth protocol stack corresponding to the chip adaptation request; Identify from the library file set the target library file that corresponds to the language of the chip adaptation request and contains the target Bluetooth protocol stack code.
5. The method according to claim 3, wherein, In response to the target vehicle Bluetooth chip being used with a Bluetooth protocol stack, the target library file is updated at the adaptation layer according to the current Bluetooth protocol stack being used by the target vehicle Bluetooth chip and the target Bluetooth protocol stack corresponding to the chip adaptation request, including: In response to the fact that the current Bluetooth protocol stack being used by the target vehicle Bluetooth chip has the same protocol stack supply attribute as the target Bluetooth protocol stack corresponding to the chip adaptation request, the current library file currently used by the adaptation layer is taken as the target library file. In response to the fact that the current Bluetooth protocol stack being used by the target vehicle Bluetooth chip has different protocol stack supply attributes from the target Bluetooth protocol stack corresponding to the chip adaptation request, the current library file currently used by the adaptation layer is updated to the target library file corresponding to the target Bluetooth protocol stack.
6. The method according to claim 1, wherein, The connection with the target vehicle Bluetooth chip via the target Bluetooth protocol stack includes: The target protocol stack software of the target Bluetooth protocol stack is called through the protocol stack interface provided by the target Bluetooth protocol stack, and then connected to the target vehicle Bluetooth chip through the target protocol stack software.
7. A Bluetooth chip adapter device, comprising: The adapter interface determination module is configured to obtain a chip adaptation request for a target automotive Bluetooth chip and determine the standardized interface corresponding to the chip adaptation request. The library file adaptation module is configured to access the corresponding adaptation layer based on the standardized interface and determine the target library file of the adaptation layer, wherein the target library file is obtained by loading or updating based on the chip adaptation request; The protocol stack adaptation module is configured to call the target Bluetooth protocol stack corresponding to the chip adaptation request through the target library file. The Bluetooth chip connection module is configured to connect to the target vehicle Bluetooth chip via the target Bluetooth protocol stack.
8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a Bluetooth chip adaptation method according to any one of claims 1-6.
9. A computer-readable storage medium storing computer instructions for causing a processor to execute and implement a Bluetooth chip adaptation method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements a Bluetooth chip adaptation method according to any one of claims 1-6.
Citation Information
Patent Citations
Apparatus for implementing data transmission based on Bluetooth
CN101415251A
Multi-Bluetooth driving method, device and equipment, medium and vehicle
CN115442781A
Bluetooth communication method and device supporting multiple protocol stacks, electronic equipment and medium
CN117597953A
Bluetooth chip adaptation method, device, equipment, medium and product
CN118748848A
A multistandard protocol stack with an access channel
WO2010109260A1