Connection method, connection system, electronic equipment and computer readable storage medium

By creating multiple thread listening channels in the device and feedback request instructions to the detected second device, the problem of long device connection time is solved, and the efficiency of WifiDirect connection is improved.

CN119629771APending Publication Date: 2025-03-14SHENZHEN SMARTSAFE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411588993.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, WifiDirect connections between various devices are long, resulting in low connection efficiency.

Method used

By creating a plurality of threads in the first device, monitoring the channel, if the broadcast data sent by the second device is detected, a request command is feedback to the second device to establish a wireless connection.

Benefits of technology

Fast discovery and connection to the second device is achieved, reducing wireless connection time and improving connection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629771A_ABST
    Figure CN119629771A_ABST
Patent Text Reader

Abstract

The invention provides a connection method, a connection system, electronic equipment and a computer readable storage medium, and relates to the technical field of vehicle detection.The method comprises the steps that a created channel is monitored through a plurality of created threads; if the channel receives broadcast data sent by the second device, a request instruction is fed back to the second device, and the request instruction is used for requesting to establish a connection with the second device; and establishing a wireless connection between the first device and the second device according to a confirmation instruction sent by the second device, the confirmation instruction being generated after the second device receives the request instruction. According to the technical scheme provided by the invention, the created channel is monitored through the first equipment, the second equipment can be found in time, and the first equipment is quickly connected with the second equipment, so that the time spent on establishing the wireless connection between the first equipment and the second equipment can be reduced, and the efficiency of establishing the wireless connection between the first equipment and the second equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of vehicle detection technology, and in particular, relates to a connection method, a connection system, an electronic device, and a computer-readable storage medium. Background Art

[0002] WifiDirect (Wi-Fi Direct) is a wireless communication technology that allows devices to communicate directly with each other without traditional wireless access points. Multiple components can be set up inside and outside the vehicle, and multiple components can be interconnected through WifiDirect technology, so that the environment around the vehicle can be determined through multiple components.

[0003] In the related art, the channel scanning process of each device can be optimized. For example, the frequency and order of channel scanning can be dynamically adjusted to reduce the number of times the device scans on a channel that is severely interfered.

[0004] However, in actual applications, there is still a problem that a device may need to scan for a long time before finding other devices that can be connected to Wifi Direct, resulting in a long time for connecting various devices. Summary of the invention

[0005] The present application provides a connection method, a connection system, an electronic device and a computer-readable storage medium, which solve the problem in the prior art that it takes a long time to connect various devices.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a connection method, which is applied to a first device of a connection system, the connection system includes: a first device and a second device, the connection system is applied to an advanced driver assistance system, and the method includes:

[0008] Monitor the created channels through multiple created threads;

[0009] If the channel receives the broadcast data sent by the second device, a request instruction is fed back to the second device, where the request instruction is used to request to establish a connection with the second device;

[0010] A wireless connection is established between the first device and the second device according to a confirmation instruction sent by the second device, where the confirmation instruction is generated by the second device after receiving the request instruction.

[0011] Optionally, before monitoring the created channels through the created multiple threads, the method further includes:

[0012] Obtaining a direct connection permission, where the direct connection permission is used to allow the first device and the second device to be wirelessly directly connected;

[0013] Create channels and a thread for each channel.

[0014] Optionally, after establishing a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device, the method further includes:

[0015] creating a plurality of transmission paths between the first device and the second device;

[0016] Selecting a main path from multiple transmission paths;

[0017] Data is transmitted to the second device via the primary path.

[0018] Optionally, after transmitting data to the second device through the primary path, the method further includes:

[0019] Monitor the connection status of the main path;

[0020] If it is detected that the connection state of the main path is disconnected, data transmission is performed through a backup path among the multiple transmission paths.

[0021] Optionally, after transmitting data to the second device through the primary path, the method further includes:

[0022] If it is detected that the first device has completed data transmission to the second device, the device switches to a low power consumption mode, in which the first device stops broadcasting and stops monitoring the channel.

[0023] Optionally, after switching to the low power consumption mode, the method further includes:

[0024] Periodically waking up the first device;

[0025] Broadcast within the preset time and monitor the channel;

[0026] After the preset time, it switches to low power mode again.

[0027] Optionally, after switching to the low power consumption mode, the method further includes:

[0028] If a triggered data transmission action is detected, waking up the first device;

[0029] Data is transmitted to the second device.

[0030] In a second aspect, an embodiment of the present application provides a connection device, which is applied to a first device of a connection system, the connection system includes: a first device and a second device, the connection system is applied to an advanced driver assistance system, and the device includes:

[0031] The monitoring module is used to monitor the created channels through multiple created threads;

[0032] A feedback module, configured to feedback a request instruction to the second device if the channel receives broadcast data sent by the second device, wherein the request instruction is used to request to establish a connection with the second device;

[0033] The establishing module is used to establish a wireless connection between the first device and the second device according to a confirmation instruction sent by the second device, where the confirmation instruction is generated by the second device after receiving the request instruction.

[0034] Optionally, before monitoring the created channels through the created multiple threads, the device further includes:

[0035] An acquisition module, used to acquire a direct connection permission, where the direct connection permission is used to allow the first device and the second device to be wirelessly directly connected;

[0036] The first creation module is used to create channels and threads corresponding to each channel.

[0037] Optionally, after establishing a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device, the apparatus further includes:

[0038] A second creation module, used to create multiple transmission paths between the first device and the second device;

[0039] A selection module, used for selecting a main path from multiple transmission paths;

[0040] The transmission module is used to transmit data to the second device through the main path.

[0041] Optionally, after transmitting data to the second device through the main path, the apparatus further includes:

[0042] A monitoring module, used to monitor the connection status of the main path;

[0043] The transmission module is further configured to transmit data through a backup path among the multiple transmission paths if it is detected that the connection state of the main path is disconnected.

[0044] Optionally, after transmitting data to the second device through the main path, the apparatus further includes:

[0045] The switching module is used to switch to a low power consumption mode if it is detected that the first device has completed data transmission to the second device. In the low power consumption mode, the first device stops broadcasting and stops monitoring the channel.

[0046] Optionally, after switching to the low power consumption mode, the device further includes:

[0047] A wake-up module, used for periodically waking up the first device;

[0048] The monitoring module is also used to broadcast within a preset time and monitor the channel;

[0049] The switching module is also used to switch to the low power consumption mode again after a preset time.

[0050] Optionally, after switching to the low power consumption mode, the device further includes:

[0051] A wake-up module, configured to wake up the first device if a triggered data transmission action is detected;

[0052] The transmission module is also used to transmit data to the second device.

[0053] In a third aspect, an embodiment of the present application provides a connection system, the connection system comprising: a first device and a second device;

[0054] The first device monitors the created channel through the created multiple threads;

[0055] If any channel receives the broadcast data sent by the second device, the first device feeds back a request instruction to the second device, where the request instruction is used to request to establish a connection with the second device;

[0056] The second device generates and sends a confirmation instruction to the first device according to the received request instruction;

[0057] The first device establishes a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device.

[0058] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to execute the method of the above-mentioned first aspect or any one of the implementations of the first aspect when calling the computer program.

[0059] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of the above-mentioned first aspect or any implementation manner of the first aspect.

[0060] The embodiment of the present application provides a connection method, a connection system, an electronic device, and a computer-readable storage medium. The first device monitors the created channel through multiple created threads. If it is detected that the channel receives broadcast data sent by the second device, a request instruction can be fed back to the second device, thereby establishing a wireless connection between the first device and the second device through the request instruction. By the first device monitoring the created channel, the second device can be discovered in time and quickly connected to the second device, thereby reducing the time spent by the first device to establish a wireless connection with the second device and improving the efficiency of establishing a wireless connection between the first device and the second device. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A system schematic diagram of a connection system involved in a connection method provided in an embodiment of the present application;

[0062] Figure 2 A schematic flow chart of a connection method provided in an embodiment of the present application;

[0063] Figure 3 A structural block diagram of a connection device provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known technologies, algorithms, and electronic devices are omitted to prevent unnecessary details from hindering the description of the present application.

[0066] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "said", "above", and "the" are intended to also include expressions such as "one or more", unless the context clearly indicates otherwise.

[0067] Wifi Direct (Wi-Fi Direct) is a wireless communication technology that allows devices to communicate directly with each other without a traditional wireless access point. Multiple components can be set up inside and outside the vehicle, and multiple components can be interconnected through WifiDirect technology, thereby determining the environment around the vehicle through multiple components.

[0068] In the related art, the channel scanning process of each device can be optimized. For example, the frequency and order of channel scanning can be dynamically adjusted to reduce the number of times the device scans on a channel that is severely interfered.

[0069] However, in actual applications, there is still a problem that a device may need to scan for a long time before finding other devices that can be connected to Wifi Direct, which results in a long time for the devices to connect.

[0070] Therefore, the embodiment of the present application proposes a connection method, in which the first device monitors the created channel through multiple created threads, and if it is detected that the channel receives the broadcast data sent by the second device, a request instruction can be fed back to the second device, thereby establishing a wireless connection between the first device and the second device through the request instruction. By the first device monitoring the created channel, the second device can be discovered in time and quickly connected to the second device, thereby reducing the time spent by the first device to establish a wireless connection with the second device and improving the efficiency of establishing a wireless connection between the first device and the second device.

[0071] See also Figure 1 , Figure 1 A system schematic diagram of a connection system involved in a connection method provided in an embodiment of the present application, wherein the connection system may include: at least one first device 10 and at least one second device 20.

[0072] The connection system can be applied to the field of Advanced Driving Assistant System (ADAS) calibration, especially the field of ADAS calibration with electronic screens. Moreover, the electronic screen can be connected to other devices through wireless connection to form ADAS.

[0073] It should be noted that in actual applications, ADAS uses a variety of sensors installed on the vehicle to collect environmental data inside and outside the vehicle in real time, so that it can perform technical processing such as identification of static and dynamic objects, as well as detection and tracking. This allows the driver to be aware of possible dangers in the fastest time, thereby attracting attention and improving safety. It is an active safety technology.

[0074] Accordingly, ADAS needs to detect the environment in which the vehicle is located through multiple sensors, and the multiple sensors can establish wireless connections through the connection system involved in the embodiment of the present application. The connection system is introduced as follows.

[0075] The first device 10 and the second device 20 may both be sensors disposed inside or outside the vehicle, and the embodiment of the present application does not specifically limit the first device 10 and the second device 20 .

[0076] Specifically, the first device 10 may pre-create a channel and multiple threads, and monitor the channel through the multiple threads. When it is detected that the channel receives the broadcast data sent by the second device 20, the first device 10 may feed back a request instruction to the second device 20.

[0077] Correspondingly, the second device 20 can receive the request instruction, and after verifying the identity of the first device 10 according to the request instruction, can generate a confirmation instruction, and then feed back the confirmation instruction to the first device 10. The first device 10 can establish a wireless connection between the first device 10 and the second device 20 according to the received confirmation instruction. Furthermore, after the first device 10 establishes a wireless connection with the second device 20, it can transmit data with the second device 20, so as to realize various functions of ADAS.

[0078] It should be noted that the embodiments of the present application are described by taking the application of the first device 10 and the second device 20 in the field of ADAS calibration as an example. In actual applications, the first device 10 and the second device 20 can also be applied in other fields. The embodiments of the present application do not specifically limit the fields in which the first device 10 and the second device 20 are applied.

[0079] The following takes the connection system as an example to describe in detail the process of connecting the first device and the second device.

[0080] Figure 2 A schematic flow chart of a connection method provided in an embodiment of the present application is applied to the first device of the above connection system, as an example but not a limitation, see Figure 2 , the method comprising:

[0081] Step 201: Obtain direct connection permission.

[0082] The direct connection permission is used to allow the first device and the second device to be directly connected wirelessly.

[0083] After being started, the first device may first obtain a direct connection authority for wirelessly directly connecting to other devices, so that in subsequent steps, a wireless connection with the second device may be established based on the obtained direct connection authority.

[0084] It should be noted that in actual applications, the code of the first device can be adjusted in advance to obtain direct connection permission when the first device is running, or the configuration file of the first device can be adjusted. When it is detected that the first device is started, the direct connection permission can be obtained through the configuration file.

[0085] For example, the Android source code of the first device (such as WifiP2pManager.java and WifiP2pServiceImpl.java) can be modified to support multi-channel broadcasting of the first device; the code corresponding to the Wireless Fidelity (WiFi) driver can also be modified so that the first device can operate on multiple channels simultaneously according to the modified code, and the underlying code can be called through JAVA native call (Java Native Interface, JNI) to control the WiFi hardware.

[0086] Step 202: Create channels and threads corresponding to each channel.

[0087] After obtaining the direct connection permission, the first device can initialize WifiP2pManager based on the obtained direct connection permission and obtain a channel instance, thereby completing the creation of the channel.

[0088] Similarly, the first device may also create multiple threads, so that in subsequent steps, the first device may monitor the corresponding channel through each thread, and may also broadcast on different channels through each thread.

[0089] It should be noted that, in actual applications, one channel may correspond to multiple threads, and each thread may monitor the corresponding channel to determine whether the channel receives broadcasts sent by other devices, thereby establishing a wireless connection with other devices.

[0090] Moreover, during the broadcasting process, each thread may broadcast on one or more designated channels according to a customized broadcasting mechanism, so that other devices may discover the first device through the sent broadcast, thereby quickly establishing a wireless connection with other devices.

[0091] Step 203: Monitor the created channels through the created multiple threads.

[0092] After creating the channel and multiple threads, the first device may establish a correspondence between the multiple threads and the channel, so that the multiple threads can monitor the channel to determine whether broadcast data sent by other devices is received.

[0093] Specifically, the first device can configure a preset number of threads for the channel according to a preset configuration file, and establish a correspondence between each thread and the channel, so that the channel corresponding to each thread can be monitored through each thread to timely discover broadcasts sent by other devices.

[0094] It should be noted that, in actual applications, the first device can create multiple channels. For the sake of simplicity, the embodiment of the present application takes the first device creating a channel as an example, and the embodiment of the present application does not specifically limit the number of channels.

[0095] Step 204: If the channel receives the broadcast data sent by the second device, a request instruction is fed back to the second device.

[0096] The request instruction is used to request to establish a connection with the second device.

[0097] In the process of monitoring the channel through multiple threads, the first device can determine whether a broadcast sent by other devices is received, and thus can determine whether to establish a wireless connection with the other devices.

[0098] Specifically, the first device can monitor the channel through multiple threads to determine whether the channel receives broadcasts sent by other devices. If a thread detects that the channel receives broadcast data sent by the second device, the first device can obtain the device identification of the second device according to the broadcast data, and then generate a request instruction according to the obtained device identification to request the second device to establish a wireless connection with the first device, and finally send the request instruction to the second device.

[0099] It should be noted that in actual applications, the first device may detect broadcasts sent by multiple devices through multiple threads. The first device can then feedback request instructions to each device in turn according to the device corresponding to each broadcast and the priority corresponding to each device, thereby establishing a wireless connection with each device.

[0100] The priority of each device is calculated based on the information of each device. For example, feature extraction can be performed based on at least one of the basic information, account configuration, configuration information, and historical connection records of each device, and then calculated using a pre-set data model to obtain the priority corresponding to each device.

[0101] Step 205: Establish a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device.

[0102] The confirmation instruction is generated by the second device after receiving the request instruction.

[0103] Corresponding to step 204, after the first device sends the request instruction, the second device can receive the request instruction and verify the information corresponding to the first device carried in the request instruction. If the verification is successful, a confirmation instruction can be generated to establish a wireless connection with the first device through the confirmation instruction.

[0104] Correspondingly, after the second device sends a confirmation instruction to the first device, the first device can establish a wireless connection with the second device according to the confirmation instruction. The connection between the first device and the second device can be a WiFi connection, a Bluetooth connection, or other wireless connection, which is not specifically limited in the embodiments of the present application.

[0105] Step 206: Create multiple transmission paths between the first device and the second device.

[0106] After the first device establishes a wireless connection with the second device, the first device can transmit data to the second device, and the second device can also transmit data to the first device. The following takes the transmission of data from the first device to the second device as an example.

[0107] Before transmitting data to the second device, the first device may establish multiple transmission paths, so that when a transmission path is disconnected, the transmission path to the second device can continue through other transmission paths, thereby improving the reliability of data transmission from the first device to the second device.

[0108] The transmission speed and transmission stability of each transmission path are different due to environmental influences.

[0109] Step 207: Select a main path from multiple transmission paths.

[0110] After establishing multiple transmission paths between the first device and the second device, the first device may select a transmission path from the multiple transmission paths as a main path, so that in subsequent steps, data transmission may be performed through the main path.

[0111] Specifically, the first device can evaluate each transmission path, determine the transmission speed, transmission stability and other transmission parameters corresponding to each transmission path, and calculate according to the pre-set weights corresponding to each transmission parameter to determine the transmission quality corresponding to each transmission path, so that the main path can be selected from multiple transmission paths according to the transmission quality corresponding to each transmission path.

[0112] It should be noted that, in actual applications, the transmission quality of each transmission path may change, and the first device may dynamically determine the main path to improve the efficiency of data transmission of the first device. For example, the first device may periodically test the transmission quality of each transmission path and re-determine the main path based on the transmission quality of each test. The embodiment of the present application does not specifically limit the way in which the first device adjusts the main path.

[0113] Step 208: Transmit data to the second device through the primary path.

[0114] After determining the main path, the first device may first confirm the main path corresponding to the current moment among multiple transmission paths, and then transmit data to the second device through the interface corresponding to the main path until the data transmission is completed.

[0115] It should be noted that, during the data transmission process, the first device may monitor the connection status of the main path, and determine whether it is necessary to change to another transmission path for transmission according to the connection status of the main path.

[0116] Correspondingly, if the connection status of the main path continues to remain connected, the first device can continue to transmit data through the main path until the transmission is completed, and execute step 209; however, if the connection status of the main path switches to a disconnected state, the first device can continue to transmit data through other transmission paths, that is, execute step 210.

[0117] Step 209: If it is detected that the first device has completed data transmission to the second device, the first device switches to a low power consumption mode, in which the first device stops broadcasting and stops monitoring the channel.

[0118] After the first device completes transmitting data to the second device, the first device can be switched to a low power consumption mode, so that the first device can stop broadcasting and monitoring the channel in the low power consumption mode, thereby reducing the energy consumption of the first device.

[0119] However, the first device can be awakened periodically so that it can broadcast within the preset time of awakening and establish a wireless connection with other devices, or it can monitor the channel within the preset time to determine whether it has received broadcast data sent by other devices so as to establish a wireless connection with other devices.

[0120] If the first device does not need to establish a wireless connection with other devices within a preset time, the first device can enter the low power consumption mode again after the preset time.

[0121] It should be noted that when the first device is in low power consumption mode, if a triggered data transmission action is detected, the first device can be awakened and data can be transmitted to the second device. The process of the first device transmitting data to the second device is similar to step 208 and will not be repeated here.

[0122] Step 210: If it is detected that the connection state of the main path is disconnected, data transmission is performed through a backup path among the multiple transmission paths.

[0123] Corresponding to step 208, if it is detected that the connection state of the main path is disconnected, it means that the first device cannot continue to transmit data to the second device through the main path, and the first device can transmit data through other transmission paths.

[0124] Specifically, the first device may select a transmission path with the best transmission quality based on the transmission qualities corresponding to the various transmission paths, transmit data to the second device through the transmission path, and continue to detect the transmission path until the data transmission is completed.

[0125] Furthermore, in order to improve the efficiency and reliability of data transmission, when the first device determines that the connection state of the main path is disconnected, it can test multiple transmission paths again to determine the transmission quality corresponding to each transmission path, and then select the transmission path for data transmission based on the transmission quality corresponding to each transmission path.

[0126] In summary, in a connection method proposed in an embodiment of the present application, the first device monitors the created channel through multiple created threads. If it is detected that the channel receives broadcast data sent by the second device, a request instruction can be fed back to the second device, thereby establishing a wireless connection between the first device and the second device through the request instruction. By the first device monitoring the created channel, the second device can be discovered in time and quickly connected to the second device, thereby reducing the time spent by the first device to establish a wireless connection with the second device and improving the efficiency of establishing a wireless connection between the first device and the second device.

[0127] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. 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.

[0128] Corresponding to the connection method described in the above embodiment, Figure 3 This is a structural block diagram of a connection device provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0129] See also Figure 3 , the device comprises:

[0130] The monitoring module 301 is used to monitor the created channels through the created multiple threads;

[0131] A feedback module 302 is configured to feedback a request instruction to the second device if the channel receives the broadcast data sent by the second device, where the request instruction is used to request to establish a connection with the second device;

[0132] The establishing module 303 is used to establish a wireless connection between the first device and the second device according to a confirmation instruction sent by the second device, where the confirmation instruction is generated by the second device after receiving the request instruction.

[0133] Optionally, the device further comprises:

[0134] An acquisition module 304 is used to acquire a direct connection permission, where the direct connection permission is used to allow the first device and the second device to be wirelessly directly connected;

[0135] The first creation module 305 is used to create the channel and each thread corresponding to the channel.

[0136] Optionally, the device further comprises:

[0137] A second creation module 306, configured to create a plurality of transmission paths between the first device and the second device;

[0138] A selection module 307, configured to select a main path from the plurality of transmission paths;

[0139] The transmission module 308 is configured to transmit data to the second device through the primary path.

[0140] Optionally, the device further comprises:

[0141] A monitoring module 309, used to monitor the connection status of the primary path;

[0142] The transmission module 308 is further configured to transmit data through a backup path among the plurality of transmission paths if it is detected that the connection status of the primary path is disconnected.

[0143] Optionally, the device further comprises:

[0144] The switching module 310 is configured to switch to a low power consumption mode if it is detected that the first device has completed data transmission to the second device. In the low power consumption mode, the first device stops broadcasting and stops monitoring the channel.

[0145] Optionally, the device further comprises:

[0146] A wake-up module 311, configured to periodically wake up the first device;

[0147] The monitoring module 301 is also used to broadcast within a preset time and monitor the channel;

[0148] The switching module 310 is further configured to switch to the low power consumption mode again after the preset time has passed.

[0149] Optionally, the device further comprises:

[0150] A wake-up module 311 is configured to wake up the first device if a triggered data transmission action is detected;

[0151] The transmission module 308 is further configured to transmit data to the second device.

[0152] In summary, in a connection device proposed in an embodiment of the present application, a first device monitors a created channel through multiple created threads. If it is detected that the channel receives broadcast data sent by a second device, a request instruction can be fed back to the second device, thereby establishing a wireless connection between the first device and the second device through the request instruction. By the first device monitoring the created channel, the second device can be discovered in time and quickly connected to the second device, thereby reducing the time spent by the first device to establish a wireless connection with the second device and improving the efficiency of establishing a wireless connection between the first device and the second device.

[0153] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device provided in this embodiment includes: a memory 41 and a processor 42, the memory 41 is used to store a computer program 43; the processor 42 is used to execute the method described in the above method embodiment when calling the computer program 43.

[0154] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0155] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.

[0156] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiment when executing the computer program product.

[0157] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0159] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0160] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0161] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0162] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0163] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0164] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0165] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A connection method, characterized in that: A first device applied to a connection system, the connection system comprising: the first device and a second device, the connection system being applied to an advanced driver assistance system, the method comprising: Monitor the created channels through multiple created threads; If the channel receives the broadcast data sent by the second device, feeding back a request instruction to the second device, where the request instruction is used to request to establish a connection with the second device; A wireless connection is established between the first device and the second device according to a confirmation instruction sent by the second device, wherein the confirmation instruction is generated by the second device after receiving the request instruction.

2. The method according to claim 1, characterized in that Before monitoring the created channels through the created multiple threads, the method further includes: Acquire a direct connection permission, where the direct connection permission is used to allow the first device and the second device to be wirelessly directly connected; The channels and the threads corresponding to each of the channels are created.

3. The method according to claim 1, characterized in that: After establishing a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device, the method further includes: creating a plurality of transmission paths between the first device and the second device; Selecting a main path from the plurality of transmission paths; Data is transmitted to the second device via the primary path.

4. The method according to claim 3, characterized in that After performing data transmission to the second device through the primary path, the method further includes: Monitoring the connection status of the primary path; If it is detected that the connection state of the main path is disconnected, data transmission is performed through a backup path among the plurality of transmission paths.

5. The method according to claim 3, characterized in that: After performing data transmission to the second device through the primary path, the method further includes: If it is detected that the first device has completed data transmission to the second device, the mode is switched to a low power consumption mode, in which the first device stops broadcasting and stops monitoring the channel.

6. The method according to claim 5, characterized in that After switching to the low power consumption mode, the method further includes: Periodically waking up the first device; Broadcasting within a preset time and monitoring the channel; After the preset time has passed, the low power consumption mode is switched again.

7. The method according to claim 5, characterized in that After switching to the low power consumption mode, the method further includes: If a triggered data transmission action is detected, waking up the first device; The device transmits data to the second device.

8. A connection system, characterized in that: The connection system comprises: a first device and a second device; The first device monitors the created channel through the created multiple threads; If any of the channels receives the broadcast data sent by the second device, the first device feeds back a request instruction to the second device, where the request instruction is used to request to establish a connection with the second device; The second device generates, according to the received request instruction, and sends a confirmation instruction to the first device; The first device establishes a wireless connection between the first device and the second device according to the confirmation instruction sent by the second device.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the method according to any one of claims 1 to 7 when calling the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.