A multi-communication module based on Android and its compatibility method
The innovative solution of the patent addresses the compatibility of multiple communication modules by implementing an Android-based multi-communication module with multiple communication interfaces, utilizing USB serial port connections and VID/PID identification to achieve seamless switching and compatibility among different communication modules on a single Android device.
Patent Information
- Application Number
- CN202210165850.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-02-23
AI Technical Summary
Existing devices struggle to support compatibility of communication modules from multiple different manufacturers on a single system device.
An Android-based multi-communication module with multiple communication interfaces, using USB serial port connections, VID and PID identification, and private shared libraries to automatically detect, match, and control operations of multiple communication modules, enabling rapid switching and compatibility among different modules.
Enables simultaneous connection and compatibility of multiple communication modules on a single Android device, facilitating effective communication compatibility and seamless switching between different modules.
Smart Images

Figure CN114595177B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an Android-based multi-communication module and a compatibility method thereof. Background Art
[0002] With the advancement of science and technology, people's demand for communication modules is increasing. Many devices require two or more communication modules. At present, some devices need to support two or more peripheral communication modules from different manufacturers. However, most devices now only support peripheral modules from one manufacturer, which makes it difficult to support communication modules from more than two different manufacturers on one system device. Therefore, it is difficult for communication modules from multiple different manufacturers to be compatible on one device. Summary of the invention
[0003] The purpose of the present invention is to overcome the problem that the prior art is difficult to meet the demand for more than two communication modules, and multiple communication modules from different manufacturers are difficult to achieve compatibility on one device, and to provide an Android-based multi-communication module and a compatibility method thereof.
[0004] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0005] An Android-based multi-communication module, comprising: an Android terminal and a plurality of different communication modules;
[0006] The Android terminal includes multiple communication interfaces;
[0007] The communication module is connected to the Android terminal using a USB serial port communication;
[0008] The Android terminal includes multiple pairs of VIDs and PIDs corresponding to the communication modules, and multiple private shared libraries corresponding to the communication modules;
[0009] The identification method of the VID and PID adopts idProduct and idVendor in the usb sys subsystem, which is used to automatically verify the connected communication module and bind the communication interface connected to the communication module. The private shared library is used to realize the communication between the communication module and the Android end.
[0010] By adopting the above technical solution, the Android end can connect to multiple different communication modules at the same time, and automatically detect and match the interfaces of the communication modules, and control the operation of the communication modules through the corresponding private shared library, thereby realizing communication compatibility between an Android end and two or more different communication modules, as well as rapid switching of communication modules.
[0011] As a preferred solution of the present invention, one communication interface can connect to different communication modules.
[0012] On the other hand, a compatibility method of multiple communication modules based on Android includes the following steps:
[0013] S1: Preset multiple pairs of VIDs and PIDs corresponding to the communication modules and multiple private shared libraries corresponding to the communication modules on the Android side;
[0014] S2: The Android terminal automatically verifies the connected communication module through the preset VID and PID;
[0015] S3: if it is determined that the VID and PID of the connected communication module are the same as the preset VID and PID, the communication module is bound to the corresponding connected communication interface;
[0016] S4: defining a system property on the Android terminal, and defining a corresponding property value of the communication module on the Android terminal, and dynamically loading the private shared libraries of different communication modules by using the system property;
[0017] S5: After the private shared library is loaded, control the communication between the communication module and the Android terminal;
[0018] S6: The user selects the communication module to be used through the Android terminal, and then repeats steps S4-S5.
[0019] By adopting the above technical scheme, based on the USB interface plug and play, different communication modules are automatically discovered and identified, and the communication interface corresponding to the communication module is bound, and the function of the private shared library corresponding to different communication modules is implemented in the RIL interface. The function of manually switching and selecting the interface of the communication module is set in the Android side, which is convenient for users to switch and select the corresponding communication module for communication through the human-machine interface. It can realize the connection of one communication interface to different communication modules, and can also realize the compatibility of multiple different communication modules on one Android side.
[0020] As a preferred solution of the present invention, the step S2 includes: the Android terminal reads the VID and PID of the connected communication module, and compares and verifies them with the preset VID and PID.
[0021] As a preferred solution of the present invention, step S3 includes: after the comparison is successful, traversing the communication interface corresponding to the communication module, finding the AT communication interface and the data communication interface corresponding to the communication module, and then binding the corresponding AT communication interface and the data communication interface to the communication module and recording them for use by the RIL interface.
[0022] As a preferred solution of the present invention, step S4 includes: the attribute value can be read and written by the upper-level API interface for selection and use of the communication module, and after the RIL interface receives the attribute value of the communication module, it loads the corresponding private shared library of the communication module through the system property.
[0023] As a preferred solution of the present invention, the step S5 includes: setting the bound communication interface and then running it through the private shared library.
[0024] As a preferred solution of the present invention, the step S6 includes: the user selects the corresponding communication module through a selection list.
[0025] As a preferred solution of the present invention, step S6 also includes: after the user selects the communication module, it is necessary to set the attribute value corresponding to the communication module again; after the RIL interface detects the attribute value, it deactivates the communication module currently in use, loads the private shared library of the selected communication module, and then restarts the RIL interface to switch and start different communication modules.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] 1. The multi-communication module based on Android described in the present invention connects multiple different communication modules through the Android terminal, automatically detects and matches the interfaces of the communication modules, controls the operation of the communication modules through the corresponding private shared libraries, and realizes the communication compatibility between one Android terminal and two or more different communication modules, as well as the rapid switching of the communication modules.
[0028] 2. The present invention discloses a method for compatibility of multiple communication modules based on Android. Based on the plug-and-play of the USB interface, it automatically discovers and identifies different communication modules, binds the communication interface corresponding to the communication module, and implements the function of the private shared library corresponding to different communication modules in the RIL interface. A function of manually switching and selecting the interface of the communication module is provided in the Android terminal, so that the user can switch and select the corresponding communication module for communication through the human-machine interface. It can realize the access of one communication interface to different communication modules, and can also realize the compatibility of multiple different communication modules on one Android terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a structural diagram of an Android-based multi-communication module described in Example 1 of the present invention;
[0030] Figure 2 A flowchart of switching and selecting a communication module in the settings of a compatible method for multiple communication modules based on Android as described in Embodiment 2 of the present invention;
[0031] Figure 3 A flowchart of processing system properties in a hardware abstraction layer of a compatible method for multiple communication modules based on Android as described in Embodiment 2 of the present invention, and specifying a module shared library to be loaded;
[0032] Figure 4 The present invention is a flowchart of searching for corresponding interfaces of communication modules in a compatible method of multiple communication modules based on Android as described in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0033] The present invention is further described in detail below in conjunction with test examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following embodiments, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0034] Example 1
[0035] A multi-communication module based on Android, such as Figure 1 As shown, it includes: an Android terminal and multiple different communication modules;
[0036] The Android terminal includes multiple communication interfaces;
[0037] The communication module is connected to the Android terminal using a USB serial port communication;
[0038] The Android terminal includes multiple pairs of VIDs and PIDs corresponding to the communication modules, and multiple private shared libraries corresponding to the communication modules;
[0039] The identification method of the VID and PID adopts idProduct and idVendor in the usb sys subsystem, which is used to automatically verify the connected communication module and bind the communication interface connected to the communication module. The private shared library is used to realize the communication between the communication module and the Android end.
[0040] By adopting the above technical solution, the Android end can connect to multiple different communication modules at the same time, and automatically detect and match the interfaces of the communication modules, and control the operation of the communication modules through the corresponding private shared library, thereby realizing communication compatibility between an Android end and two or more different communication modules, as well as rapid switching of communication modules.
[0041] Example 2
[0042] A compatibility method for multiple communication modules based on Android according to embodiment 1, such as Figure 2 , Figure 3 and Figure 4 As shown, the following steps are included:
[0043] S1: Preset multiple pairs of VIDs and PIDs corresponding to the communication modules and multiple private shared libraries corresponding to the communication modules on the Android side;
[0044] S2: The Android terminal automatically verifies the connected communication module through the preset VID and PID;
[0045] S3: if it is determined that the VID and PID of the connected communication module are the same as the preset VID and PID, the communication module is bound to the corresponding connected communication interface;
[0046] S4: defining a system property on the Android side, the system property being persist.rild.libpath, defining a corresponding property value of the communication module on the Android side, and using the system property to dynamically load the private shared libraries of different communication modules;
[0047] S5: After the private shared library is loaded, control the communication between the communication module and the Android terminal;
[0048] S6: The user selects the communication module to be used through the Android terminal, and then repeats steps S4-S5.
[0049] During the communication process after binding, other modules cannot be connected. After binding, an index will be established for the communication interface corresponding to each communication module. Through step S6, after the user switches to select the communication module to be used, the index will be found and the connection will be reestablished.
[0050] Specifically, after the communication module is connected via USB, the underlying layer will not be executed immediately after automatic identification and binding, but will only record the interface of the corresponding communication module in the system. When the user specifies the communication module, it will cooperate with the loading module private shared library to communicate with the specified module. Therefore, the hardware can realize the simultaneous connection of multiple communication modules without causing communication confusion.
[0051] The step S2 includes: the Android terminal reads the VID and PID of the connected communication module, and compares and verifies them with the preset VID and PID.
[0052] The step S3 includes: after the comparison is successful, traversing the communication interfaces corresponding to the communication module, finding the AT communication interface and the data communication interface corresponding to the communication module, and then binding the corresponding AT communication interface and the data communication interface to the communication module and recording them for use by the RIL interface.
[0053] The step S4 includes: the attribute value can be read and written by the upper layer API interface for selection and use of the communication module, and after the RIL interface receives the attribute value of the communication module, the corresponding private shared library of the communication module is loaded through the system attribute.
[0054] The step S5 includes: setting the bound communication interface, and then running it through the private shared library.
[0055] The step S6 includes: the user selects the corresponding communication module through a selection list.
[0056] The step S6 also includes: after the user selects the communication module, it is necessary to set the attribute value corresponding to the communication module again. After the RIL interface detects the attribute value, it deactivates the communication module currently in use, loads the private shared library of the selected communication module, and then restarts the RIL interface to switch and start different communication modules.
[0057] Specifically, the user can decide which communication module to use by himself, and introduce user interaction. The user can freely switch and select the communication module to be used. Once selected, the communication module selected by the user will be the default after shutting down and restarting the computer.
[0058] By adopting the above technical scheme, based on the USB interface plug and play, different communication modules are automatically discovered and identified, and the communication interface corresponding to the communication module is bound, and the function of the private shared library corresponding to different communication modules is implemented in the RIL interface. The function of manually switching and selecting the interface of the communication module is set in the Android side, which is convenient for users to switch and select the corresponding communication module for communication through the human-machine interface. It can realize the connection of one communication interface to different communication modules, and can also realize the compatibility of multiple different communication modules on one Android side.
[0059] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A compatible method for multiple communication modules based on Android, characterized in that: The multi-communication module includes an Android terminal and a plurality of different communication modules, and the method includes the following steps: S1: Preset multiple pairs of VIDs and PIDs corresponding to the communication modules and multiple private shared libraries corresponding to the communication modules on the Android side; S2: The Android terminal automatically verifies the connected communication module through a preset VID and PID; wherein the Android terminal reads the VID and PID of the connected communication module and compares and verifies them with the preset VID and PID; S3: if it is determined that the VID and PID of the connected communication module are the same as the preset VID and PID, the communication module is bound to the corresponding communication interface connected; wherein, after the comparison is successful, the communication interfaces corresponding to the communication module are traversed to find the AT communication interface and the data communication interface corresponding to the communication module, and then the corresponding AT communication interface and the data communication interface are bound to the communication module and recorded for use by the RIL interface; S4: defining a system property on the Android side, and defining a corresponding property value of the communication module on the Android side, using the system property to dynamically load the private shared libraries of different communication modules, the property value can be read and written by the upper layer API interface, and is used for the selection and use of the communication module, and after the RIL interface receives the property value of the communication module, the corresponding private shared library of the communication module is loaded through the system property; S5: After the private shared library is loaded, the communication between the communication module and the Android terminal is controlled, and the private shared library is used to realize the communication between the communication module and the Android terminal; S6: The user selects the communication module to be used through the Android terminal, and then repeats the steps S4-S5, wherein after the user selects the communication module, the attribute value corresponding to the communication module needs to be set again, and after the RIL interface detects the attribute value, the communication module currently in use is disabled, and the private shared library of the selected communication module is loaded, and then the RIL interface is restarted to switch and start different communication modules; The Android terminal includes a plurality of communication interfaces, the communication module is connected to the Android terminal using a USB serial port communication, and the Android terminal is provided with a function of manually switching and selecting an interface of the communication module; The identification method of the VID and PID adopts the idProduct and idVendor of the usb sys subsystem to automatically verify the connected communication module and bind the communication interface connected to the corresponding communication module.
2. According to claim 1, a compatible method for multiple communication modules based on Android, characterized in that: The step S5 includes: setting the bound communication interface, and then running it through the private shared library.
3. According to claim 1, a compatible method for multiple communication modules based on Android, characterized in that: The step S6 includes: the user selects the corresponding communication module through a selection list.
Citation Information
Patent Citations
Method and device for compatibility of multiple models of mobile communication modules in Android systems
CN107291637A
Method for dynamically being compatible with WIFI and Bluetooth modules of different manufacturers based on Android system
CN113099433A
Module compatibility method, platform and server based on android system
CN113238807A
