Connection establishment method, device, equipment and program product
The solution is that the method facilitates automatic generation and storage of configuration files for Bluetooth connections across multiple operating systems, addressing user challenges and ensuring secure and easy usability.
Patent Information
- Application Number
- CN202411204401.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
Users face challenges in establishing Bluetooth connections between different operating systems due to randomly generated addresses, manual configuration difficulties, and format differences, leading to errors and user confusion.
A method and device that automatically generate and store configuration files for Bluetooth connections across multiple operating systems by utilizing pre-built templates and mapping relationships between verification information, allowing seamless switching between devices.
The efficacy of the solution is that the method effectively facilitates automatic generation and storage of configuration files for Bluetooth connections across multiple operating systems, ensuring secure and easy usability.
Smart Images

Figure CN119095199A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of electronic equipment, and relate to but are not limited to a connection establishment method, apparatus, device, and program product. Background Art
[0002] To meet the application requirements of different scenarios, many users need to install multiple operating systems on one computer. Due to the Bluetooth adaptation mechanism, a new address will be randomly generated for each pairing. These users will encounter a problem: each time they start from one system to another, the Bluetooth device needs to re-establish the connection.
[0003] Switching the operating system to manually configure the configuration information of the Bluetooth mouse involves the system registry, device management files, etc., which is difficult for users. In addition, the data formats of different operating systems are different, such as base differences, whether there are spaces, etc., which are difficult to process manually and prone to errors. The configuration item information of the Bluetooth mouse in different operating systems is different, which is easy to be confused. Summary of the invention
[0004] In view of this, embodiments of the present application provide a connection establishment method, apparatus, device, and program product.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a connection establishment method, which is applied to a first electronic device, where the first electronic device includes at least two different operating systems, and the method includes:
[0007] In response to the first electronic device running a second operating system;
[0008] If the first electronic device last ran the first operating system, a first configuration file is obtained; the first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection;
[0009] Obtain a configuration template corresponding to the second operating system, and modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
[0010] In a second aspect, an embodiment of the present application provides a connection establishment device, including:
[0011] A response module, used for responding to the first electronic device running the second operating system;
[0012] A first obtaining module is used to obtain a first configuration file if the first electronic device last ran the first operating system; the first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection;
[0013] The second acquisition module is used to obtain a configuration template corresponding to the second operating system, and to modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the above method is implemented when the processor executes the program.
[0015] In a fourth aspect, an embodiment of the present application provides a storage medium storing executable instructions for implementing the above method when executed by a processor.
[0016] In a fifth aspect, a computer program product includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps in the above method are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1A A schematic diagram of an implementation flow of a connection establishment method provided in an embodiment of the present application;
[0018] Figure 1B An operation diagram of selecting an operating system provided in an embodiment of the present application;
[0019] Figure 1C A schematic diagram of an interface for selecting an operating system provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of an implementation flow of obtaining and storing a configuration file provided in an embodiment of the present application;
[0021] Figure 3A A schematic diagram of the implementation process of building and storing a configuration item template provided in an embodiment of the present application;
[0022] Figure 3B A schematic diagram of an implementation flow of obtaining a second configuration file provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a process for establishing a Bluetooth connection provided in an embodiment of the present application;
[0024] Figure 5A schematic diagram of the structure of a connection establishment device provided in an embodiment of the present application;
[0025] Figure 6 A hardware entity schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the embodiments of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0027] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0028] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0030] The embodiment of the present application provides a connection establishment method, which is applied to a first electronic device, wherein the first electronic device includes at least two different operating systems, such as Figure 1A As shown, the method includes:
[0031] Step S110, in response to the first electronic device running a second operating system;
[0032] Figure 1B An operation diagram of selecting an operating system provided in an embodiment of the present application is as follows: Figure 1B As shown in the figure, the operation diagram includes three options: Windows Boot Manager, Ubuntu and EFIPXE Network.
[0033] If multiple operating systems are installed on an electronic device, Windows Boot Manager can provide a boot menu that allows the user to select the operating system to boot.
[0034] Ubuntu is an open source operating system distribution based on the Linux kernel, which includes the Linux kernel and a series of pre-installed software, tools and services.
[0035] EFIPXE Network is a network boot method based on Extensible Firmware Interface (EFI) and Pre-boot eXecution Environment (PXE) technology. This boot method allows electronic devices to download boot files from a remote server over the network to start the operating system or other software.
[0036] Electronic devices can display the following information during the startup phase: Figure 1B The interface shown is used to provide the user with a selection of the operating system of the electronic device.
[0037] Figure 1C A schematic diagram of an interface for selecting an operating system provided in an embodiment of the present application, such as Figure 1C As shown, the interface diagram includes Windows 11 On volume 5, Windows 11 On volume 4 and Windows 10, among which,
[0038] Users can Figure 1C Select the operating system used on the electronic device on the interface shown.
[0039] above Figure 1B and Figure 1C Both show that multiple operating systems are included on one electronic device.
[0040] During implementation, users can Figure 1B or Figure 1C Select to run the second operating system on the first electronic device.
[0041] Step S120: if the first electronic device last ran the first operating system, obtain a first configuration file; the first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection;
[0042] Here, the first operating system and the second operating system are different operating systems, or they may be different versions of the same operating system. For example, the first operating system is a Windows system, and the second operating system is a Linux system; the first operating system is Windows 11 on volume 5, and the second operating system is Windows 11 on volume 4.
[0043] The second electronic device may be a Bluetooth device to be paired with the first electronic device through Bluetooth. For example, the second electronic device may be a Bluetooth headset, a Bluetooth speaker, a Bluetooth mouse, a Bluetooth keyboard, or other electronic device that can be connected based on the Bluetooth protocol.
[0044] To enhance privacy, smartphones, laptops, and other Bluetooth devices use a randomly generated physical (Media Access Control, MAC) address when connecting, rather than the device's real MAC address. This randomized MAC address changes each time it connects. Bluetooth pairing is the process of confirming the identities of two Bluetooth devices when they communicate for the first time. Through pairing, devices can recognize and verify each other's identities, thereby ensuring the security and integrity of data transmission. After pairing is successful, a shared key, i.e., verification information, is generated between the devices to encrypt subsequent data transmission. For example, in order to obtain other information about a Bluetooth mouse in the operating system, it is necessary to pair at least once to allow the system to automatically generate these verification information, and then obtain key information such as the Connection Signature Resolving Key (CSRK), Identity Resolving Key (IRK), Long Term Key (LTK), Encrypted Diversifier (EDIV), and Random Number (ERand) due to the change in the MAC address when the Bluetooth mouse is paired.
[0045] In the implementation process, the verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection is obtained. The connection between Bluetooth devices requires multiple key verifications before normal operation.
[0046] In some embodiments, the configuration template includes at least the following verification information: an identity resolution key, a local signature resolution key, and a long-term key.
[0047] Identity resolution key, used to resolve the variable address of Bluetooth devices, identify the device, and ensure the integrity and confidentiality of communications.
[0048] Local Signature Key: The key used by the local system or device to generate a signature to prove that the message or data was sent by the system or device.
[0049] Long-term key, a key used to maintain the security of communications over a longer period of time.
[0050] Here, different operating systems may have different configuration items. During implementation, key information of Bluetooth pairing that can be generated by multiple operating systems can be screened out as common verification information.
[0051] For example, the Bluetooth configuration information (BTConfig) Bluetooth mouse's personalized information and pairing information may include at least the following information:
[0052] [General]
[0053] Name=BT Mouse Product Name
[0054] BTChipSetID=XXXXXXXXXXXXXXXXXXXXXXXX
[0055] [IdentityResolvingKey]
[0056] Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[0057] [RemoteSignatureKey]
[0058] Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[0059] [LocalSignatureKey]
[0060] Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[0061] [LongTermKey]
[0062] Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[0063] EDiv=xxxxxx
[0064] Rand=xxxxxxxxxxxxxxxxxxxxxxxxxxx
[0065] [DeviceID]
[0066] Vendor = xxxxxx
[0067] Product=xxxxxx
[0068] Version=xxxx
[0069] In the above, IdentityResolvingKey is the identity resolution key, RemoteSignatureKey is the remote signature key, LocalSignatureKey is the local signature resolution key, and LongTermKey is the long-term key.
[0070] Step S130, obtain a configuration template corresponding to the second operating system, and modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
[0071] Here, the configuration template is a configuration item template pre-built and stored in the first electronic device, including different operating systems for Bluetooth connection. When it is determined that the first electronic device uses the second operating system to connect to the second electronic device, the configuration template corresponding to the second operating system can be modified based on the first configuration file to obtain a second configuration file corresponding to the second operating system.
[0072] For example, when the first operating system is Windows and the second operating system is Linux, a first configuration file of Windows can be obtained, and the first configuration file is used to modify the configuration template corresponding to the Linux system to obtain a second configuration file of Linux.
[0073] Table 1 is a mapping relationship table of Windows and Linux configuration information (including at least key verification information) provided in an embodiment of the present application.
[0074] Table 1
[0075] Windows Linux Remark IRK Identity Resolving Key Convert to uppercase, remove commas and spaces CSRK LocalSignatureKey Convert to uppercase, remove commas and spaces LTK Long Term Key Convert hexadecimal to decimal ERand Rand Convert hexadecimal to decimal EDIV Div Convert hexadecimal to decimal
[0076] As shown in the first row of Table 1 above, the keyword IRK in the Windows system corresponds to the keyword Identity Resolving Key in the Linux system, and the note is how to convert the keyword IRK in the Windows system and the keyword Identity Resolving Key in the Linux system.
[0077] During implementation, the mapping relationship in Table 1 above may be used to construct and store a configuration template.
[0078] In the embodiment of the present application, first, the first electronic device includes at least two different operating systems, and in response to the first electronic device running the second operating system; if the first electronic device last ran the first operating system, a first configuration file is obtained; a configuration template corresponding to the second operating system is obtained, and the configuration template is modified based on the first configuration file to obtain a second configuration file. In this way, one Bluetooth pairing can support multiple systems to switch to use the same second electronic device; the software automatically reads and sets the configuration item template containing different operating systems for Bluetooth connection, without the need for users to learn relevant knowledge, avoiding various problems that arise during the manual setting process, and having good ease of use. The software implementation scheme is suitable for establishing a Bluetooth connection between any first electronic device and a second electronic device, with low cost and a wide range of applications.
[0079] In some embodiments, the present application also provides a method for obtaining and storing a configuration file, such as Figure 2 As shown, this can be achieved by following the steps below:
[0080] Step S210: if no configuration file corresponding to the verification information exists in the first electronic device, establish a Bluetooth connection between the second operating system and the second electronic device, and obtain a second configuration file; the second configuration file is the verification information generated when the first electronic device runs the second operating system and the second electronic device performs Bluetooth pairing with the first electronic device to establish a Bluetooth connection;
[0081] Here, if the first electronic device establishes a Bluetooth connection with the second electronic device for the first time, the first electronic device does not have the verification information of the second electronic device and any configuration file corresponding to the verification information. In this case, in response to the first electronic device running the second operating system, a Bluetooth connection is established between the second operating system and the second electronic device, and the second configuration file is obtained.
[0082] For example, in response to a Bluetooth mouse establishing a Bluetooth connection with a Linux system, the Bluetooth mouse configuration information in Linux can be obtained as follows:
[0083] There are two configuration files in the / var / lib / bluetooth / Bluetooth adapter address / Bluetooth device address / directory: attributes and info.
[0084] The contents of the file info are as follows:
[0085] [General]
[0086] Name=TP Precision Evo BT 5.0
[0087] Appearance = 0x03c2
[0088] AddressType=static
[0089] SupportedTechnologies=LE;
[0090] Trusted=true
[0091] Blocked=false
[0092] WakeAllowed=true
[0093] Services=00001800-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;0000fff0-0000-1000-8000-00805f9b34fb;
[0094] [IdentityResolvingKey]
[0095] Key=BB48E9A21D7DA0CBC0B70BF47642B873
[0096] [RemoteSignatureKey]
[0097] Key=884307710F96DC495BE4B02443D4CB6D
[0098] Counter=0
[0099] Authenticated=false
[0100] [LocalSignatureKey]
[0101] Key=18CD3A5C3C0339C1D90834F571CF7D80
[0102] Counter=0
[0103] Authenticated=false
[0104] [LongTermKey]
[0105] Key=FC770CFF2492CA8ECBFAF7F44E96E7B4Authenticated=0
[0106] EncSize=16
[0107] EDiv=29302
[0108] Rand=286239034237948181
[0109] [PeripheralLongTermKey]
[0110] Key=FD45BAC74C9951E5541731CC219FB959
[0111] Authenticated=0
[0112] EncSize=16
[0113] EDiv=40756
[0114] Rand=8125185711043430142
[0115] [SlaveLongTermKey]
[0116] Key=FD45BAC74C9951E5541731CC219FB959
[0117] Authenticated=0
[0118] EncSize=16
[0119] EDiv=40756
[0120] Rand=8125185711043430142
[0121] [DeviceID]
[0122] Source=2
[0123] Vendor=6127
[0124] Product=24819
[0125] Version=774
[0126] [ConnectionParameters]
[0127] MinInterval=6
[0128] MaxInterval=6
[0129] Latency = 96
[0130] Timeout=300
[0131] As shown above, you can obtain the verification information corresponding to IdentityResolvingKey, RemoteSignatureKey, LocalSignatureKey, LongTermKey, Rand, and EDiv in the configuration file info.
[0132] For example, in response to a Bluetooth mouse establishing a Bluetooth connection with a Windows system, the path for obtaining Bluetooth mouse configuration information in Windows is as follows:
[0133] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPOR T\Parameters\Keys\e00af67fcba0\c03911fac17f]
[0134] The configuration information under this path is as follows:
[0135] "LTK"=hex:cb,a1,6b,18,16,80,1c,99,2c,c7,d5,02,89,43,5a,72
[0136] "KeyLength" = dword:00000010
[0137] "ERand"=hex(b):ba,aa,cc,5f,d3,1a,0f,be
[0138] "EDIV" = dword:00003291
[0139] "IRK"=hex:4e,3d,7f,40,2f,a2,89,40,22,1e,a1,21,bc,fe,30,f6
[0140] "Address"=hex(b):7f,c1,fa,11,39,c0,00,00
[0141] "AddressType"=dword:00000001
[0142] "CSRKInbound"=hex:96,a7,f6,48,5a,1f,89,11,fe,da,f0,3b,44,61,f5,ad
[0143] "InboundSignCounter"=hex(b):ff,ff,ff,ff,ff,ff,ff,ff
[0144] "CSRK"=hex:cf,65,19,44,ea,01,dd,42,ca,ab,00,4d,cc,7b,b9,1a
[0145] As shown above, you can obtain the verification information corresponding to LTK, KeyLength, Erand, EDIV, and CSRK in the configuration file.
[0146] Step S220: store the second configuration file, so that when the first electronic device switches to another operating system except the second operating system, the second configuration file is used to establish a Bluetooth connection between the second electronic device and the other operating system.
[0147] During implementation, a second configuration file may be stored to store configuration information when the second electronic device is connected to the first electronic device, so as to establish a Bluetooth connection between the second electronic device and other operating systems using the configuration information in the second configuration file.
[0148] In the embodiment of the present application, if there is no configuration file corresponding to the verification information in the first electronic device, a Bluetooth connection is established between the second operating system and the second electronic device, and a second configuration file is obtained; and the second configuration file is stored. In this way, when the first electronic device switches to an operating system other than the second operating system, a Bluetooth connection between the second electronic device and the other operating system can be established using the second configuration file.
[0149] In some embodiments, the above step S210 is implemented to determine that no configuration file corresponding to the verification information exists in the first electronic device, which can be implemented by the following steps:
[0150] Step 211: Determine that the first electronic device has never been paired with the second electronic device before;
[0151] Here, when it is determined that the first electronic device and the second electronic device are paired for the first time, it can be determined that the first electronic device does not have the verification information of the second electronic device. For example, it can be the first pairing of a Bluetooth mouse and a laptop computer.
[0152] or,
[0153] Step 212: Determine whether the first electronic device is running for the first time.
[0154] Here, when it is determined that the first electronic device is powered on for the first time, that is, when the first electronic device is not connected to any other electronic device through Bluetooth, no configuration file exists in the first electronic device.
[0155] In the embodiment of the present application, it is determined that the first electronic device has never been paired with the second electronic device before; or it is determined that the first electronic device is running for the first time. Based on any of the above scenarios, it can be determined that the first electronic device does not store any configuration file corresponding to the verification information.
[0156] In some embodiments, "storing the second configuration file" in step S220 may be implemented by the following process:
[0157] The second configuration file is stored in a cloud server, and the at least two different operating systems can access the cloud server, so that when the first electronic device is switched to an operating system other than the second operating system, the second configuration file can be obtained from the cloud server, and a Bluetooth connection between the second electronic device and the other operating system can be established using the second configuration file.
[0158] Of course, in addition to the cloud server, the second configuration file may also be stored in a storage space accessible to both operating systems, which is not limited in this embodiment.
[0159] Here, a cloud server is a virtual server provided based on cloud computing technology. At least two different operating systems of the first electronic device can access the cloud server.
[0160] During implementation, the second configuration file can be stored in a cloud server, so that when the first electronic device switches to an operating system other than the second operating system, the second configuration file can be obtained from the cloud server and a Bluetooth connection between the second electronic device and the other operating system can be established using the second configuration file.
[0161] For example, the second configuration file of the Bluetooth mouse corresponding to the Linux system can be stored in the cloud server. When the laptop computer switches to the Windows system, the second configuration file is obtained from the cloud server, and the verification information of the Bluetooth mouse in the second configuration file is parsed, and the Bluetooth connection between the Bluetooth mouse and the laptop computer in the Windows system is established using the verification information.
[0162] In the embodiment of the present application, the second configuration file is stored in the cloud server, so that when the first electronic device switches to another operating system, the second configuration file can be obtained from the cloud server, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the other operating system. In this way, the second configuration file is stored in the cloud server to ensure its security, availability, and ease of use.
[0163] In some embodiments, the present application provides a method for constructing and storing a configuration item template, such as Figure 3A As shown, this can be achieved by following the steps below:
[0164] Step S310: obtaining Bluetooth version information of the first electronic device;
[0165] Here, the first electronic device may be installed with different Bluetooth versions, for example, Bluetooth 4.0, Bluetooth 5.0, Bluetooth 5.3, etc.
[0166] During the implementation process, since different Bluetooth versions may need to obtain different verification information when a Bluetooth connection exists, the configuration template may contain configuration information corresponding to different Bluetooth versions.
[0167] Step S320: Obtain type information of the different operating systems;
[0168] like Figure 1B As shown, the operation diagram includes: Windows Boot Manager, Ubuntu and EFI PXENetwork, etc., which provide users with different operating systems to choose to start
[0169] like Figure 1C As shown, the interface diagram includes different version information of Windows systems such as Windows 11 On volume 5, Windows 11 On volume 4 and Windows 10.
[0170] During the implementation process, since different operating systems correspond to different configuration files, it is necessary to obtain type information of different operating systems.
[0171] Step S330: construct and store configuration item templates containing different operating systems for Bluetooth connection based on the Bluetooth version information of the first electronic device and the type information of the different operating systems.
[0172] During implementation, a configuration item template containing different operating systems for Bluetooth connection may be constructed and stored based on the Bluetooth version information of the first electronic device and the type information of different operating systems.
[0173] In the embodiment of the present application, the Bluetooth version information of the first electronic device is first obtained; the type information of different operating systems is obtained; then, based on the Bluetooth version information of the first electronic device and the type information of different operating systems, configuration item templates containing different operating systems for Bluetooth connection are constructed and stored. In this way, configuration item templates corresponding to different operating systems can be constructed based on the Bluetooth version of the first electronic device.
[0174] In some embodiments, the present application provides a method for obtaining a second configuration file, such as Figure 3B As shown, this can be achieved by following the steps below:
[0175] Step S340: obtaining verification information in the first configuration file;
[0176] Here, the verification information may be a shared key generated between devices after successful Bluetooth pairing, including: an identity resolution key, a local signature resolution key, and a long-term key.
[0177] During implementation, the verification information stored in the first configuration file after the first electronic device establishes a Bluetooth connection with the first operating system may be obtained.
[0178] Step S350: Based on the name mapping relationship of the same verification information between the first configuration file and the second configuration file, fill the verification information into the configuration template corresponding to the second configuration file to obtain the second configuration file.
[0179] During implementation, a configuration item template containing different operating systems for Bluetooth connection can be used to determine the name mapping relationship of the same verification information between the first configuration file and the second configuration file; using the name mapping relationship, the verification information is filled into the configuration template corresponding to the second configuration file to obtain the second configuration file.
[0180] For example, the following Table 2 is a mapping relationship table of Bluetooth mouse configuration information in Windows and Bluetooth mouse configuration information in Linux provided in an embodiment of the present application.
[0181] Table 2
[0182]
[0183] During implementation, the mapping relationship between the Bluetooth mouse configuration information in Windows and the Bluetooth mouse configuration information in Linux in Table 2 above can be used to fill the verification information generated in Windows under the keyword under the corresponding path in Linux.
[0184] For example, the Identity Resolving Key is located in the following path on Windows systems:
[0185] HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPOR T\Parameters\Keys\e00af67fcba0\BT-Mouse-MAC
[0186] Corresponding keyword IRK.
[0187] Identity Resolving Key, in Linux system, the following path:
[0188] / var / lib / bluetooth / Bluetooth adapter address / Bluetooth device address / info
[0189] Corresponding keyword: Identity Resolving Key.
[0190] During the implementation process, the identity resolution key can be obtained from the corresponding keyword IRK under the path of the Windows system, and based on the mapping relationship in Table 2 above, the identity resolution key is filled into the corresponding keyword Identity Resolving Key under the path of the Linux system.
[0191] In this way, the mapping relationship can be used to map the verification information required by the second operating system for Bluetooth configuration, and the verification information is filled into the specified path to obtain the second configuration file for the first electronic device to establish a Bluetooth connection with the second operating system.
[0192] In the embodiment of the present application, the verification information in the first configuration file is first obtained, and then based on the name mapping relationship of the same verification information between the first configuration file and the second configuration file, the verification information is filled into the configuration template corresponding to the second configuration file. In this way, the second configuration file can be obtained using the mapping relationship.
[0193] Figure 4 A schematic diagram of a method for establishing a Bluetooth connection according to an embodiment of the present application is shown in FIG. Figure 4 As shown, the method for establishing a Bluetooth connection can be implemented by the following steps:
[0194] Step S410, pairing a Bluetooth mouse in operating system A;
[0195] Step S420: The application reads the Bluetooth mouse information to generate a Bluetooth configuration file and uploads it to the cloud server;
[0196] In the implementation process, after the Bluetooth mouse is adapted in the operating system A, the client application (ClientApp) reads the Bluetooth mouse related information (such as the information in the Windows registry, / var / lib / bluetooth / Bluetooth adapter address / Bluetooth device address / * in the Linux system, etc.), extracts the Bluetooth mouse information in this state and generates a Bluetooth configuration file (BTConfig). On this basis, the Client App uploads this Bluetooth configuration file to the cloud server (Cloud), and the communication method between the Client App and the cloud server is not restricted.
[0197] Step S430: The application of operating system B that is not paired with the Bluetooth mouse downloads the Bluetooth configuration file from the cloud server;
[0198] During implementation, after other operating systems B (such as Windows, Linux, MacOS) are installed, the application downloads the Bluetooth configuration file from the cloud server according to the user information.
[0199] Step S440: The application extracts corresponding information in the Bluetooth configuration file and selects a Bluetooth configuration file module suitable for operating system B to generate a configuration file for operating system B.
[0200] During the implementation process, multiple Bluetooth configuration information templates are built into the application. According to the local Bluetooth chip information and the characteristics of different operating systems, relevant information is searched from the Bluetooth configuration file, the configuration information in the corresponding Bluetooth configuration template is changed, and applied to the Bluetooth configuration file of system B.
[0201] In this way, after switching between multiple systems, the user can directly use the Bluetooth mouse without pairing or switching again.
[0202] The advantages of adopting this solution include: one Bluetooth pairing can support multiple systems to switch to use the same Bluetooth mouse, improving work efficiency; the client software automatically reads and sets the configuration file of the Bluetooth mouse, without the user having to learn relevant knowledge, avoiding various problems that occur during manual setting, and good usability; the Bluetooth configuration file is stored on the cloud server to ensure its security, availability, and ease of use. The software implementation solution is applicable to any Bluetooth mouse, with low cost and wide application range.
[0203] Based on the foregoing embodiments, the embodiments of the present application provide a connection establishment device, which includes the modules included, each module includes sub-modules, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0204] Figure 5 A schematic diagram of the structure of the connection establishment device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, the device 500 includes:
[0205] A response module 510, configured to respond to the first electronic device running a second operating system;
[0206] A first obtaining module 520 is configured to obtain a first configuration file if the first electronic device last ran a first operating system; the first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection;
[0207] The second acquisition module 530 is used to obtain a configuration template corresponding to the second operating system, and to modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
[0208] In some embodiments, the connection establishment device further includes an establishment and acquisition module and a storage module, wherein the establishment and acquisition module is used to establish a Bluetooth connection between the second operating system and the second electronic device and obtain a second configuration file if no configuration file corresponding to the verification information exists in the first electronic device; the second configuration file is the verification information generated when the first electronic device runs the second operating system and the second electronic device performs Bluetooth pairing with the first electronic device to establish a Bluetooth connection; the storage module is used to store the second configuration file so that when the first electronic device switches to an operating system other than the second operating system, the second configuration file is used to establish a Bluetooth connection between the second electronic device and the other operating system.
[0209] In some embodiments, the establishment and acquisition module includes a first determination submodule, or a second determination submodule, wherein the first determination submodule is used to determine that the first electronic device has never been paired with the second electronic device before; and the second determination submodule is used to determine that the first electronic device is running for the first time.
[0210] In some embodiments, the storage module is further used to store the second configuration file in a cloud server, and the at least two different operating systems can access the cloud server, so that when the first electronic device switches to an operating system other than the second operating system, the second configuration file can be obtained from the cloud server, and a Bluetooth connection between the second electronic device and the other operating systems can be established using the second configuration file.
[0211] In some embodiments, the connection establishment device also includes a first acquisition module, a second acquisition module and a construction and storage module, wherein the first acquisition module is used to obtain the Bluetooth version information of the first electronic device; the second acquisition module is used to obtain the type information of the different operating systems; the construction and storage module is used to construct and store a configuration item template containing different operating systems for Bluetooth connection based on the Bluetooth version information of the first electronic device and the type information of the different operating systems.
[0212] In some embodiments, the connection establishment device also includes a third acquisition module and a filling module, wherein the third acquisition module is used to obtain the verification information in the first configuration file; and the filling module is used to fill the verification information into the configuration template corresponding to the second configuration file based on the name mapping relationship of the same verification information between the first configuration file and the second configuration file to obtain the second configuration file.
[0213] In some embodiments, the configuration template includes at least the following verification information: an identity resolution key, a local signature resolution key, and a long-term key.
[0214] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0215] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable an electronic device (which can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0216] Correspondingly, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the connection establishment method provided in the above embodiment are implemented.
[0217] Correspondingly, an embodiment of the present application provides an electronic device, Figure 6 A hardware entity diagram of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the hardware entity of the device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores a computer program that can be run on the processor 602, and the processor 602 implements the steps in the connection establishment method provided in the above embodiment when executing the program.
[0218] The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data to be processed or processed by the processor 602 and various modules in the electronic device 600 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0219] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0220] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0221] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0222] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0223] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0224] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0225] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0226] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0227] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0228] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0229] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0230] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A connection establishment method, applied to a first electronic device, wherein the first electronic device includes at least two different operating systems, the method comprising: In response to the first electronic device running a second operating system; If the first electronic device last ran a first operating system, obtaining a first configuration file; The first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection; Obtain a configuration template corresponding to the second operating system, and modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
2. The method of claim 1, further comprising: If no configuration file corresponding to the verification information exists in the first electronic device, a Bluetooth connection is established between the second operating system and the second electronic device, and a second configuration file is obtained; the second configuration file is the verification information generated when the first electronic device runs the second operating system and the second electronic device performs Bluetooth pairing with the first electronic device to establish a Bluetooth connection; The second configuration file is stored so that when the first electronic device is switched to another operating system except the second operating system, a Bluetooth connection between the second electronic device and the other operating system is established by using the second configuration file.
3. The method according to claim 2, wherein determining that no configuration file corresponding to the verification information exists in the first electronic device comprises: determining that the first electronic device has never been paired with the second electronic device before; or, It is determined that the first electronic device is operating for the first time.
4. The method according to claim 2, wherein storing the second configuration file comprises: The second configuration file is stored in a cloud server, and the at least two different operating systems can access the cloud server, so that when the first electronic device is switched to an operating system other than the second operating system, the second configuration file can be obtained from the cloud server, and a Bluetooth connection between the second electronic device and the other operating system can be established using the second configuration file.
5. The method of claim 1, further comprising: Acquire Bluetooth version information of the first electronic device; Obtaining type information of the different operating systems; Based on the Bluetooth version information of the first electronic device and the type information of the different operating systems, a configuration item template containing different operating systems for Bluetooth connection is constructed and stored.
6. The method of claim 1, further comprising: Obtaining verification information in the first configuration file; Based on the name mapping relationship of the same verification information between the first configuration file and the second configuration file, the verification information is filled into the configuration template corresponding to the second configuration file to obtain the second configuration file.
7. The method of claim 1, wherein the configuration template includes at least the following verification information: an identity resolution key, a local signature resolution key, and a long-term key.
8. A connection establishment device, the device comprising: A response module, used for responding to the first electronic device running the second operating system; A first obtaining module is used to obtain a first configuration file if the first electronic device last ran a first operating system; the first configuration file is verification information generated when the second electronic device and the first electronic device perform the latest Bluetooth pairing to establish a Bluetooth connection; The second acquisition module is used to obtain a configuration template corresponding to the second operating system, and to modify the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored configuration item template containing different operating systems for Bluetooth connection, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, a first electronic device comprises at least two different operating systems, and when the processor executes the program, in response to the first electronic device running a second operating system; if the first electronic device last ran the first operating system, a first configuration file is obtained; the first configuration file is verification information generated by the second electronic device and the first electronic device when the second electronic device and the first electronic device perform the most recent Bluetooth pairing to establish a Bluetooth connection; a configuration template corresponding to the second operating system is obtained, and the configuration template is modified based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored template containing configuration items for Bluetooth connections of different operating systems, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
10. A computer program product, comprising a computer program or instructions, which, when executed by a processor, implements a response to a first electronic device running a second operating system; if the first electronic device last ran the first operating system, obtains a first configuration file; the first configuration file is verification information generated by the second electronic device and the first electronic device when the second electronic device and the first electronic device perform the most recent Bluetooth pairing to establish a Bluetooth connection; obtains a configuration template corresponding to the second operating system, and modifies the configuration template based on the first configuration file to obtain a second configuration file; the configuration template is a pre-built and stored template containing configuration items for Bluetooth connections of different operating systems, and the second configuration file is used to establish a Bluetooth connection between the second electronic device and the second operating system.
