CN117156597A - Ad hoc network-based device processing method, device and storage medium - Google Patents

Ad hoc network-based device processing method, device and storage medium Download PDF

Info

Publication number
CN117156597A
CN117156597A CN202310091011.4A CN202310091011A CN117156597A CN 117156597 A CN117156597 A CN 117156597A CN 202310091011 A CN202310091011 A CN 202310091011A CN 117156597 A CN117156597 A CN 117156597A
Authority
CN
China
Prior art keywords
terminal device
broadcast
terminal
equipment
terminal equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310091011.4A
Other languages
Chinese (zh)
Other versions
CN117156597B (en
Inventor
张录
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310091011.4A priority Critical patent/CN117156597B/en
Publication of CN117156597A publication Critical patent/CN117156597A/en
Application granted granted Critical
Publication of CN117156597B publication Critical patent/CN117156597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/25Maintenance of established connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides an equipment processing method, equipment and a storage medium based on an ad hoc network. The method comprises the following steps: if it is determined that the second broadcast of the second terminal device is not received within the first time period after the first broadcast is sent out, establishing a connection based on a classical Bluetooth protocol with the second terminal device; the second terminal equipment is equipment belonging to the same ad hoc network with the first terminal equipment; if the connection based on the classical Bluetooth protocol is successful, determining the time difference between the first moment and the second moment; the first moment is the moment after the initial moment when the connection based on the classical Bluetooth protocol is established, and the second moment is the moment when the connection based on the classical Bluetooth protocol is successful; if the time difference meets the preset condition, determining to continuously maintain a pre-stored equipment list; the equipment is prevented from being misplaced, the connection reliability between the equipment in the ad hoc network under the super terminal scene is improved, and the reliability of the ad hoc network is improved.

Description

Ad hoc network-based device processing method, device and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to an apparatus processing method, an apparatus, and a storage medium based on an ad hoc network.
Background
The plurality of terminal devices may form an ad hoc network, and devices in the ad hoc network may communicate with each other. If the equipment in the ad hoc network determines that the other equipment in the ad hoc network is not in the near field, the equipment in the ad hoc network can kick off the equipment which is not in the near field; however, if the equipment in the ad hoc network is misplaced, the data interaction between the equipment in the ad hoc network is affected, and the service processing of the ad hoc network is affected.
Thus, a method for accurately determining whether the equipment in the ad hoc network can be disconnected is needed; preventing wrong equipment in the ad hoc network from being taken off line.
Disclosure of Invention
The embodiment of the application provides an equipment processing method, equipment and a storage medium based on an ad hoc network, which are applied to the technical field of terminals and used for preventing equipment in the ad hoc network from being taken off line by mistake.
In a first aspect, an embodiment of the present application provides an apparatus processing method based on an ad hoc network, where the method is applied to a first terminal apparatus, and the method includes:
if it is determined that the second broadcast of the second terminal device is not received within the first time period after the first broadcast is sent out, establishing a connection based on a classical Bluetooth protocol with the second terminal device; the second terminal equipment is equipment belonging to the same ad hoc network with the first terminal equipment, and the ad hoc network comprises at least one terminal equipment; the first broadcast is a broadcast based on a low-power Bluetooth protocol, and the second broadcast is a broadcast based on a low-power Bluetooth protocol; the second broadcast is sent by responding to a broadcast based on a low-power Bluetooth protocol sent by a central node in the ad hoc network; the first time length comprises a time period before a sending time and a time period after the sending time, and the sending time is the time when the first broadcast is sent out;
If the connection based on the classical Bluetooth protocol is determined to be successful, determining a time difference between the first moment and the second moment; wherein the first time is a time after an initial time when the connection based on the classical Bluetooth protocol is established, and the second time is a time when the connection based on the classical Bluetooth protocol is successful;
if the time difference is determined to be in accordance with the preset condition, determining to continuously maintain a pre-stored equipment list; the pre-stored equipment list comprises equipment belonging to the same ad hoc network with the first terminal equipment.
In this way, the BR connection is successful, the opposite terminal equipment is determined to be in the near field, and the opposite terminal equipment is not taken off line. Then after the BR connection is successful, calculating the establishment and the success time of the BR connection to obtain a time difference; based on the time difference, it is finally determined whether the opposite device is kicked off. Therefore, the equipment is prevented from being misplaced, the connection reliability between the equipment in the ad hoc network in the super terminal scene is improved, and the reliability of the ad hoc network is improved; the normal operation of the service between the devices in the ad hoc network is ensured.
In one possible implementation manner, if it is determined that after the first broadcast is sent, the second broadcast of the second terminal device is not received within the first time period, a connection based on a classical bluetooth protocol is established with the second terminal device, including:
Waiting a second period of time after the first broadcast is sent out;
after the second duration, if it is determined that the second broadcast of the second terminal device is not received within the first duration, establishing a connection based on a classical Bluetooth protocol with the second terminal device; wherein the first duration is a preset period of time before a last moment in the second duration.
Thus, detecting whether a second broadcast of a second terminal device is received for a longer second duration; and if the first terminal equipment does not receive the second broadcast of the second terminal equipment, the BR connection is established between the first terminal equipment and the second terminal equipment.
In one possible implementation, the second duration is 10 seconds; the first duration is 21 seconds.
In one possible implementation manner, the connection based on the classical bluetooth protocol is established with the second terminal device, including:
acquiring an address of the second terminal equipment based on a classical Bluetooth protocol; establishing a physical link between the address based on the classical Bluetooth protocol and the second terminal equipment;
if the physical link is established successfully, a success instruction is fetched from the first terminal equipment; wherein the success instruction characterizes success of connection with the second terminal device based on classical Bluetooth protocol.
In this way, a BR connection is successfully established with the second terminal device.
In one possible implementation manner, if it is determined that the time difference meets a preset condition, determining to continue to maintain the pre-stored device list includes:
if the time difference is smaller than or equal to a first preset threshold value, the pre-stored equipment list is determined to be maintained continuously.
In this way, if the time difference is smaller than or equal to the first preset threshold, the second terminal device is determined to be in the near field, and the second terminal device is not kicked off.
In one possible implementation, the method further includes:
if the time difference is determined to be larger than the first preset threshold value, deleting the second terminal equipment from the pre-stored equipment list; and determining to delete the second terminal device in a first interface, wherein the first interface is used for displaying devices in the pre-stored device list.
And if the time difference is smaller than or equal to the first preset threshold, determining that the second terminal equipment is not in the near field, and kicking off the second terminal equipment.
In one possible implementation, the difference between the first time instant and the initial time instant is 8 seconds; the first preset threshold is 29 seconds.
In one possible implementation, if the first terminal device is a central node in the ad hoc network, the second broadcast is sent in response to the first broadcast;
if the first terminal device is an edge node in the ad hoc network, the second broadcast is sent in response to a bluetooth low energy broadcast of a central node in the ad hoc network.
Thus, when the first terminal device is a central node in the ad hoc network and the second terminal device is an edge node in the ad hoc network, the BR unicast confirmation process of the scheme can be completed. When the first terminal equipment is an edge node in the ad hoc network and the second terminal equipment is a central node in the ad hoc network, the BR unicast confirmation process of the scheme can be completed.
In one possible implementation manner, if the first terminal device is a central node in the ad hoc network, the transmission period of the first broadcast is 30 seconds, and the transmission period of the second broadcast is 20 seconds;
if the first terminal device is an edge node in the ad hoc network, the transmission period of the first broadcast is 20 seconds, and the transmission period of the second broadcast is 30 seconds.
Thus, when the first terminal device is a central node in the ad hoc network and the second terminal device is an edge node in the ad hoc network, the BR unicast confirmation process of the scheme can be completed. When the first terminal equipment is an edge node in the ad hoc network and the second terminal equipment is a central node in the ad hoc network, the BR unicast confirmation process of the scheme can be completed.
In one possible implementation, the method further includes:
in response to the turn-on instruction, issuing a third broadcast; wherein, the opening instruction characterizes the function of opening the super terminal of the first terminal equipment; the third broadcast is a broadcast based on a bluetooth low energy protocol; and receiving a fourth broadcast sent by the second terminal device; wherein the fourth broadcast is a broadcast based on a bluetooth low energy protocol;
performing equipment authentication processing with the second terminal equipment;
determining the equipment score of the first terminal equipment, and receiving the equipment score of the second terminal equipment sent by the second terminal equipment; wherein the device score of the first terminal device is related to the operational status of the first terminal device; the equipment score of the second terminal equipment is related to the running state of the second terminal equipment;
And determining a center node and an edge node in the ad hoc network according to the equipment score of the first terminal equipment and the equipment score of the second terminal equipment.
In this way, the establishment of the ad hoc network is automatically completed. An ad hoc network includes a plurality of terminal devices including a central node and at least one edge node.
In one possible implementation manner, the device authentication process with the second terminal device includes:
establishing a bare channel based on the fourth broadcast;
sending first encryption information to the second terminal equipment through the bare channel; receiving second encryption information sent by second terminal equipment through the bare channel; the first encryption information is encrypted equipment information of the first terminal equipment, and the second encryption information is encrypted equipment information of the second terminal equipment;
establishing an encryption channel according to the first encryption information and the second encryption information;
sending a first handshake packet to the second terminal equipment through the encryption channel; and receiving a second handshake packet sent by the second terminal equipment through the encryption channel to finish equipment authentication.
Thus, the first terminal device and the second terminal device can complete the device authentication processing, and preparation is made for establishing the ad hoc network.
In one possible implementation manner, after performing a device authentication process with the second terminal device, the method further includes:
displaying the equipment information of the second terminal equipment in a first interface; the first interface is used for displaying the devices in the pre-stored device list.
In one possible implementation, determining the device score of the first terminal device includes:
acquiring state information of the first terminal equipment; the state information of the first terminal equipment comprises at least one state parameter, and the state parameter of the first terminal equipment represents the current state of the first terminal equipment;
and determining the equipment score of the first terminal equipment according to the state parameters in the state information of the first terminal equipment and the preset weights corresponding to the state parameters.
In this way, the terminal device determines the device score of the terminal device according to the operation state of the terminal device.
In a possible implementation manner, the state information of the first terminal device includes one or more of the following state parameters: charging parameters, screen locking parameters, first network discovery parameters, second network discovery parameters and battery power parameters;
The charging parameter characterizes whether the terminal equipment is charged or not, the screen locking parameter characterizes whether the terminal equipment is screen locked or not, the first network discovery parameter characterizes whether the terminal equipment supports CoAp discovery or not, the second network discovery parameter characterizes whether the terminal equipment supports low-power Bluetooth discovery or not, and the battery power parameter characterizes whether the current battery residual capacity of the terminal equipment is larger than or equal to a second preset threshold value or not;
the preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter, the preset weight corresponding to the screen locking parameter is greater than the preset weight corresponding to the first network discovery parameter, the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter, and the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
In this way, the value of the preset weight of the state parameter is strongly related to the service; the terminal device is being charged or the terminal device has completed charging, the terminal device has strong capability, and the terminal device can do more tasks, so that a higher weight value needs to be set for the charging parameter. Therefore, the preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter. And if the terminal equipment is not locked, the terminal equipment has strong capability and can do more tasks, so that the preset weight corresponding to the screen locking parameter is greater than the preset weight corresponding to the first network discovery parameter. Because the scheme is based on the scene of the ad hoc network, the ad hoc network comprises a plurality of terminal devices, and signaling and information need to be transmitted among the plurality of terminal devices, so that the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter. The scheme is that a protocol based on low-power consumption Bluetooth is required to send out broadcasting, so that the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
In a possible implementation manner, the device Score of the first terminal device is score=ischaring 16+isunlock 8+iscoappsup 4+iscblesup 2+highbattery 1;
wherein isCharing is a charging parameter of the first terminal device, isUnlock is a screen locking parameter of the first terminal device, iscoappsup is a first network discovery parameter of the first terminal device, isceappsup is a second network discovery parameter of the first terminal device, and highBattery is a battery power parameter of the first terminal device.
In one possible implementation, after responding to the start instruction, the method further includes:
if the Bluetooth function of the first terminal equipment is not started, generating and displaying first prompt information; the first prompt information characterizes whether a user starts a Bluetooth function or not; responding to a first confirmation instruction of a user, and starting the Bluetooth function of the first terminal equipment; the first confirmation instruction is used for indicating to start the Bluetooth function of the first terminal equipment;
if the wireless local area network function of the first terminal equipment is not started, generating and displaying second prompt information; the second prompt information characterizes whether the user starts the wireless local area network function or not; responding to a second confirmation instruction of the user, and starting the Bluetooth function of the first terminal equipment; the second confirmation instruction is used for indicating to start the wireless local area network function of the first terminal equipment.
Thus, the function of the super terminal is required to be started under the scheme, and the Bluetooth function and the wireless local area network function of the terminal equipment are required to be used. It is required to automatically turn on the bluetooth function and the wireless lan function of the terminal device based on the user interaction procedure.
In one possible implementation manner, determining a center node and an edge node in the ad hoc network according to the device score of the first terminal device and the device score of the second terminal device includes:
determining terminal equipment with equipment score belonging to a preset score range as a central node of the ad hoc network; the rest terminal equipment is the edge node of the ad hoc network.
In a second aspect, an embodiment of the present application provides a terminal device, which may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a smart television, a wearable device, a tablet (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or the like.
The terminal device includes: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored in the memory to cause the terminal device to perform a method as in the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements a method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run, causes a computer to perform the method as in the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip comprising a processor for invoking a computer program in a memory to perform a method according to the first aspect.
It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the advantages obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
Fig. 1 shows a schematic configuration diagram of a terminal device 100;
Fig. 2 is a software configuration block diagram of the terminal device 100 of the embodiment of the present application;
FIG. 3 is a schematic view of a scenario provided by an embodiment of the present application;
fig. 4 is a signaling diagram one of a device processing method based on an ad hoc network according to an embodiment of the present application;
fig. 5 is a signaling diagram two of a device processing method based on ad hoc network according to an embodiment of the present application;
fig. 6 is a software structure diagram of a first terminal device according to an embodiment of the present application;
fig. 7 is a software structure diagram of a second terminal device according to an embodiment of the present application;
FIG. 8 is a schematic diagram I of a first interface according to an embodiment of the present application;
FIG. 9 is a second schematic diagram of a first interface according to an embodiment of the present application;
FIG. 10 is a third schematic diagram of a first interface according to an embodiment of the present application;
fig. 11 is a signaling diagram of a construction process of an ad hoc network according to an embodiment of the present application;
fig. 12 is a signaling diagram III of a device processing method based on ad hoc network according to an embodiment of the present application;
fig. 13 is a signaling diagram four of a device processing method based on ad hoc network according to an embodiment of the present application;
fig. 14 is a first time axis based on each broadcast according to an embodiment of the present application;
fig. 15 is a second time axis based on each broadcast according to an embodiment of the present application;
Fig. 16 is a signaling diagram four of a device processing method based on ad hoc network according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of a chip according to an embodiment of the present application;
fig. 18 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
For purposes of clarity in describing the embodiments of the present application, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The plurality of terminal devices may form an ad hoc network, and devices in the ad hoc network may communicate with each other. If the equipment in the ad hoc network determines that the other equipment in the ad hoc network is not in the near field, the equipment in the ad hoc network can kick off the equipment which is not in the near field; however, if the equipment in the ad hoc network is misplaced, the data interaction between the equipment in the ad hoc network is affected, and the service processing of the ad hoc network is affected.
Thus, a method for accurately determining whether the equipment in the ad hoc network can be disconnected is needed; preventing wrong equipment in the ad hoc network from being taken off line.
The "at … …" in the embodiment of the present application may be an instant when a certain situation occurs, or may be a period of time after a certain situation occurs, which is not particularly limited. In addition, the display interface provided by the embodiment of the application is only used as an example, and the display interface can also comprise more or less contents.
The electronic device includes a terminal device, which may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a smart television, a wearable device, a tablet (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or the like. The embodiment of the application does not limit the specific technology and the specific equipment form adopted by the terminal equipment.
In order to better understand the embodiments of the present application, the following describes the structure of the terminal device according to the embodiments of the present application:
fig. 1 shows a schematic structure of a terminal device 100. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriberidentification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processingunit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The antennas in the terminal device 100 may be used to cover single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wirelesslocal area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the terminal device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of terminal device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that terminal device 100 may communicate with a network and other devices via wireless communication techniques. Wireless communication techniques may include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (codedivision multiple access, CDMA), wideband code division multiple access (wideband code division multipleaccess, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidounavigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellitesystem, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrixorganic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot lightemitting diodes, QLED), or the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The software system of the terminal device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the terminal device 100 is illustrated.
Fig. 2 is a software configuration block diagram of the terminal device 100 of the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include camera, calendar, phone, map, phone, music, settings, mailbox, video, social, etc. applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a notification manager, and the like.
The window manager is used for managing window programs. The window manager may obtain the display screen size, determine if there is a status bar, lock the screen, touch the screen, drag the screen, intercept the screen, etc.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The workflow of the terminal device 100 software and hardware is illustrated below in connection with the scenario of application launch or interface switching occurring in an application.
The following describes in detail the scheme provided by the embodiment of the present application with reference to the accompanying drawings.
Fig. 3 is a schematic view of a scenario provided by an embodiment of the present application, as shown in fig. 3, a plurality of terminal devices 100 may form an ad hoc network; the devices in the ad hoc network can communicate with each other through a wireless connection mode. For example, the ad hoc network includes three terminal devices, which are a personal computer, one mobile terminal device, and another mobile terminal device.
Fig. 4 is a signaling diagram one of a device processing method based on ad hoc network according to an embodiment of the present application. As shown in fig. 4, the method may include:
s401, if the first terminal equipment determines that the second broadcast of the second terminal equipment is not received within a first time period after the first broadcast is sent out, establishing connection based on a classical Bluetooth protocol with the second terminal equipment; the second terminal equipment is equipment belonging to the same self-organizing network with the first terminal equipment, and the self-organizing network comprises at least one terminal equipment; the first broadcast is a broadcast based on a low-power Bluetooth protocol, and the second broadcast is a broadcast based on a low-power Bluetooth protocol; the second broadcast is sent in response to a broadcast based on the bluetooth low energy protocol sent by a central node in the ad hoc network; the first time period includes a period before and a period after a transmission time, the transmission time being a time at which the first broadcast is transmitted.
The embodiments relate to, for example, terminal devices in an ad hoc network, where a plurality of terminal devices are required to form an ad hoc network. In addition, each terminal device in the ad hoc network has a super terminal function; thus, the user can use the service of the super terminal, such as super connection, super notification, super call, super mouse and the like, between the terminal devices in the ad hoc network.
The terminal devices in the ad hoc network may be personal computers, mobile terminal devices (e.g., cell phones), tablet computers, and the like.
After the ad hoc network is constructed, each terminal device in the ad hoc network needs to send out BLE broadcast, so as to perform online state maintenance (i.e., keep alive) between the terminal devices. After the ad hoc network is constructed, the first terminal device transmits a first broadcast. Wherein the first broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the first broadcast is a BLE broadcast. Then, after the first terminal device issues the first broadcast (the first broadcast that is not the first time), the first terminal device waits for the second period of time; the second period of time is, for example, 10 seconds.
The first terminal device waits for the second time period, and the first terminal device determines a preset time period before the last moment in the second time period as a first time period. The first terminal device detects whether a second broadcast of the second terminal device is received within a first time period. Wherein the second broadcast is a broadcast based on the bluetooth low energy protocol, i.e., the second broadcast is a BLE broadcast; and, the second broadcast is transmitted in response to a broadcast based on the bluetooth low energy protocol transmitted by a central node in the ad hoc network.
If the first terminal device determines that the second broadcast of the second terminal device is received within the first time period, the first terminal device determines not to kick off the line.
If the first terminal device determines that the second broadcast of the second terminal device is not received within the first duration, the first terminal device needs to establish a connection based on a classical Bluetooth (BR) protocol with the second terminal device (the second terminal device is a device that does not receive the second broadcast sent by the second terminal device), that is, establish a BR connection.
S402, if the first terminal equipment determines that the connection based on the classical Bluetooth protocol is successful, determining a time difference between a first moment and a second moment; the first time is a time after an initial time when the connection based on the classical Bluetooth protocol is established, and the second time is a time when the connection based on the classical Bluetooth protocol is successful.
The first terminal device, after determining that the connection with the second terminal device based on the classical bluetooth protocol was successful, determines the time instant at which the connection based on the classical bluetooth protocol was successful as the second time instant t3. The second terminal equipment records the initial time when the connection based on the classical Bluetooth protocol is established in advance, and the second terminal equipment determines one time after the initial time as the first time; for example, the second terminal device determines a time 8 seconds after the initial time as the first time t4.
The first terminal device calculates a time difference between the first time and the second time, and obtains a time difference w=t4-t 3.
S403, if the first terminal equipment determines that the time difference meets the preset condition, determining to continuously maintain a pre-stored equipment list; the pre-stored device list comprises devices belonging to the same ad hoc network with the first terminal device.
The first terminal device determines whether the time difference W meets a preset condition. For example, the first terminal device determines whether the time difference W is less than or equal to a first preset threshold.
If the first terminal device determines that the time difference W meets the preset condition, the second terminal device is determined to be in the near field, the second terminal device is not off line, and the first terminal device continues to maintain the device list of the first terminal device. The device list of the first terminal device includes devices belonging to the same ad hoc network as the first terminal device.
If the first terminal device determines that the time difference W does not meet the preset condition, the second terminal device is determined not to be in the near field, and the second terminal device is determined to be off-line. At this time, the first terminal device deletes the second terminal device from the device list of the first terminal device; and determining to delete the second terminal device in the first interface. And thus the second terminal device which is offline is not displayed in the first interface.
In this embodiment, if it is determined that after the first broadcast is sent, the second broadcast of the second terminal device is not received within the first time period, a connection based on a classical bluetooth protocol is established between the second terminal device and the second terminal device; if the connection based on the classical Bluetooth protocol is successful, determining the time difference between the first moment and the second moment; the first time is the time after the initial time when the connection based on the classical Bluetooth protocol is established, and the second time is the time when the connection based on the classical Bluetooth protocol is successful; if the time difference meets the preset condition, determining that the second terminal equipment is in the near field, and determining to continuously maintain the pre-stored equipment list without taking the second terminal equipment off line. Therefore, the BR connection is successful, the opposite terminal equipment is determined to be in the near field, and the opposite terminal equipment is not taken off line. Then after the BR connection is successful, calculating the establishment and the success time of the BR connection to obtain a time difference; based on the time difference, it is finally determined whether the opposite device is kicked off. Therefore, the equipment is prevented from being misplaced, the connection reliability between the equipment in the ad hoc network in the super terminal scene is improved, and the reliability of the ad hoc network is improved; the normal operation of the service between the devices in the ad hoc network is ensured.
Fig. 5 is a signaling diagram two of a device processing method based on ad hoc network according to an embodiment of the present application. As shown in fig. 5, the method may include:
s501a, the first terminal equipment responds to an opening instruction and sends out a third broadcast; the starting instruction characterizes the function of starting the super terminal of the first terminal equipment; the third broadcast is a broadcast based on the bluetooth low energy protocol.
S501b, the first terminal equipment receives a fourth broadcast sent by the second terminal equipment; wherein the fourth broadcast is a broadcast based on the bluetooth low energy protocol.
The present embodiment relates to an exemplary terminal device in an ad hoc network, and it is necessary to form an ad hoc network from a plurality of terminal devices. In addition, each terminal device in the ad hoc network has a super terminal function; thus, the user can use the service of the super terminal, such as super connection, super notification, super call, super mouse and the like, between the terminal devices in the ad hoc network.
The terminal devices in the ad hoc network may be personal computers, mobile terminal devices (e.g., cell phones), tablet computers, and the like.
First, an ad hoc network needs to be composed of a plurality of terminal devices.
The method comprises the steps that a first terminal device obtains an opening instruction, wherein the opening instruction characterizes the function of a super terminal of the first terminal device.
In one example, the first terminal device is a personal computer, and a manager application is installed in the first terminal device, and is used for managing the application in the first terminal device; after the first terminal equipment is started, a manager application in the first terminal equipment is automatically started, and the first terminal equipment can log in an account number of the manager application; the first terminal equipment automatically turns on a switch of the super terminal; then, the first terminal device automatically generates an opening instruction.
In another example, the first terminal device is a personal computer, and a manager application is installed in the first terminal device, where the manager application is used for managing the application in the first terminal device; when a manager application in the first terminal equipment is started, the first terminal equipment can log in an account of the manager application, and the first terminal equipment automatically opens a switch of a super terminal; then, the first terminal device automatically generates an opening instruction.
In another example, the first terminal device is a mobile phone or a tablet computer, and after the first terminal device is started, the first terminal device automatically generates a starting instruction.
Then, the first terminal device issues a third broadcast based on the turn-on instruction. The third broadcast is a broadcast based on a bluetooth low energy (Bluetooth Low Energy, BLE) protocol; that is, the third broadcast is a BLE broadcast. So that the other terminal device can receive the third broadcast of the first terminal device.
And, the period in which the first terminal device transmits the third broadcast is 30 seconds, that is, the third broadcast is transmitted once every 30 seconds; thereby facilitating the second terminal device to receive the third broadcast sent by the first terminal device. To complete the subsequent device authentication process.
For the second terminal device, the second terminal device may also generate its own turn-on command. The process of generating the opening command by the second terminal device may refer to the process of generating the opening command by the first terminal device.
Then, each of the at least one second terminal device issues a fourth broadcast based on the turn-on instruction of the second terminal device. The fourth broadcast is a broadcast based on a low-power consumption Bluetooth protocol; that is, the fourth broadcast is a BLE broadcast. So that the first terminal device can receive the fourth broadcast of each second terminal device.
And, for each second terminal device, the period in which the second terminal device transmits the fourth broadcast is 30 seconds, that is, the fourth broadcast is transmitted once every 30 seconds; thereby facilitating the first terminal device to receive the fourth broadcast sent by the second terminal device. To complete the subsequent device authentication process.
In the scheme, each terminal device in the ad hoc network needs to use the function of the super terminal; the function of the super terminal requires that the terminal equipment starts the Bluetooth function and the wireless local area network (wifi) function. Thus, after the first terminal device generates the start instruction, the first terminal device needs to determine whether to start the bluetooth function and the wireless local area network function; after the second terminal device generates the turn-on instruction, the second terminal device needs to determine whether to turn on the bluetooth function and the wireless local area network function.
In one example, after "responding to the on instruction" in step S501a, the following procedure is further included:
if the Bluetooth function of the first terminal equipment is not started, generating and displaying first prompt information; the first prompt information characterizes whether a user starts a Bluetooth function or not; responding to a first confirmation instruction of a user, and starting a Bluetooth function of the first terminal equipment; the first confirmation instruction is used for indicating to start the Bluetooth function of the first terminal device.
If the wireless local area network function of the first terminal equipment is not started, generating and displaying second prompt information; the second prompt information characterizes whether the user starts the wireless local area network function or not; responding to a second confirmation instruction of the user, and starting the Bluetooth function of the first terminal equipment; the second confirmation instruction is used for indicating to start the wireless local area network function of the first terminal equipment.
Illustratively, after the first terminal device generates the turn-on instruction, the first terminal device determines whether the first terminal device has turned on the bluetooth function.
If the first terminal equipment determines that the first terminal equipment does not start the Bluetooth function, the first terminal equipment generates and displays first prompt information so as to prompt a user whether to start the Bluetooth function. The user interacts with the first terminal equipment, and the user determines to start the Bluetooth function of the first terminal equipment; the first terminal equipment receives the first confirmation instruction of the user, and then the first terminal equipment starts the Bluetooth function of the first terminal equipment based on the first confirmation instruction.
Or, the first terminal equipment pre-stores first authorization information, wherein the first authorization information comprises scene information capable of automatically starting the Bluetooth function of the first terminal equipment; the scene information characterizes the currently running function of the first terminal device. If the first terminal equipment determines that the Bluetooth function of the first terminal equipment is not started, the first terminal equipment determines that the Bluetooth function of the first terminal equipment can be started automatically according to the first authorization information, and the first terminal equipment starts the Bluetooth function of the first terminal equipment.
And after the first terminal equipment generates the starting instruction, the first terminal equipment judges whether the first terminal equipment starts the wireless local area network function or not.
If the first terminal equipment determines that the first terminal equipment does not start the wireless local area network function, the first terminal equipment generates and displays second prompt information so as to prompt a user whether to start the wireless local area network function. The user interacts with the first terminal equipment, and the user determines to start the wireless local area network function of the first terminal equipment; the first terminal equipment receives the second confirmation instruction of the user, and then the first terminal equipment starts the wireless local area network function of the first terminal equipment based on the second confirmation instruction.
Or, the first terminal equipment pre-stores second authorization information, wherein the second authorization information comprises scene information capable of automatically starting the wireless local area network function of the first terminal equipment; the scene information characterizes the currently running function of the first terminal device. If the first terminal equipment determines that the wireless local area network function of the first terminal equipment is not started, the first terminal equipment determines that the wireless local area network function of the first terminal equipment can be started automatically according to the second authorization information, and the first terminal equipment starts the wireless local area network function of the first terminal equipment.
Then, after determining that the bluetooth function and the wireless local area network function of the first terminal device are turned on, the first terminal device transmits a third broadcast, which is a BLE broadcast.
For each second terminal device, after the second terminal device generates the start instruction, the second terminal device judges whether the second terminal device starts the Bluetooth function.
If the second terminal equipment determines that the second terminal equipment does not start the Bluetooth function, the second terminal equipment generates and displays third prompt information so as to prompt a user whether to start the Bluetooth function. The user interacts with the second terminal equipment, and the user determines to start the Bluetooth function of the second terminal equipment; and the second terminal equipment receives the third confirmation instruction of the user, and then starts the Bluetooth function of the second terminal equipment based on the third confirmation instruction.
Or, the second terminal equipment is pre-stored with third authorization information, wherein the third authorization information comprises scene information capable of automatically starting the Bluetooth function of the second terminal equipment; the scene information characterizes the currently running function of the second terminal device. If the second terminal equipment determines that the Bluetooth function of the second terminal equipment is not started, the second terminal equipment determines that the Bluetooth function of the second terminal equipment can be started automatically according to the third authorization information, and the second terminal equipment starts the Bluetooth function of the second terminal equipment.
And after the second terminal equipment generates the starting instruction, the second terminal equipment judges whether the second terminal equipment starts the wireless local area network function or not.
If the second terminal equipment determines that the second terminal equipment does not start the wireless local area network function, the second terminal equipment generates and displays fourth prompt information so as to prompt a user whether to start the wireless local area network function. The user interacts with the second terminal equipment, and the user determines to start the wireless local area network function of the second terminal equipment; and the second terminal equipment receives the fourth confirmation instruction of the user, and then starts the wireless local area network function of the second terminal equipment based on the fourth confirmation instruction.
Or, the second terminal equipment pre-stores fourth authorization information, wherein the fourth authorization information comprises scene information capable of automatically starting the wireless local area network function of the second terminal equipment; the scene information characterizes the currently running function of the second terminal device. If the second terminal equipment determines that the wireless local area network function of the second terminal equipment is not started, the second terminal equipment determines that the wireless local area network function of the second terminal equipment can be started automatically according to the fourth authorization information, and the second terminal equipment starts the wireless local area network function of the second terminal equipment.
Then, after determining that the bluetooth function and the wireless local area network function of the second terminal device are turned on, the second terminal device transmits a fourth broadcast, which is a BLE broadcast.
S502, performing equipment authentication processing between the first terminal equipment and the second terminal equipment.
In one example, step S502 includes:
the first step of step S502, the first terminal device establishes a bare channel based on the fourth broadcast.
The second step of step S502, the first terminal device sends the first encryption information to the second terminal device through the bare channel; receiving second encryption information sent by a second terminal device through the bare channel; the first encryption information is encrypted device information of the first terminal device, and the second encryption information is encrypted device information of the second terminal device.
And step S502, the first terminal equipment establishes an encryption channel according to the first encryption information and the second encryption information.
A fourth step of step S502, in which the first terminal device sends a first handshake packet to the second terminal device through an encryption channel; and receiving a second handshake packet sent by the second terminal equipment through the encryption channel to finish equipment authentication.
For example, after the first terminal device transmits the third broadcast, the second terminal device may receive the third broadcast of the first terminal device; after the second terminal device transmits the fourth broadcast, the first terminal device may receive the fourth broadcast of the second terminal device. After the first terminal device can receive the fourth broadcast of the second terminal device and the second terminal device can receive the third broadcast of the first terminal device, device authentication processing is performed between the first terminal device and the second terminal device, and then the self-organizing network is built for preparation.
In one example, after the first terminal device may receive the fourth broadcast of the second terminal device and the second terminal device may receive the third broadcast of the first terminal device, a bare channel is established between the first terminal device and the second terminal device, i.e., the first terminal device establishes a bare channel and the second terminal device establishes a bare channel.
Then, the first terminal device encrypts the device information of the first terminal device to obtain encrypted device information of the first terminal device, that is, obtain first encrypted information. Wherein the device information of the first terminal device includes a device name, a device unique identification, a device type, a device address, and the like. The first terminal device sends the first encrypted information to the second terminal device through the bare channel.
And the second terminal device encrypts the device information of the second terminal device to obtain encrypted device information of the second terminal device, that is, obtain second encrypted information. Wherein the device information of the second terminal device includes a device name, a device unique identification, a device type, a device address, and the like. And the second terminal equipment sends the second encrypted information to the first terminal equipment through the bare channel.
Thus, the first terminal device and the second terminal device interact with each other's device information. The first terminal equipment establishes an encryption channel based on the first encryption information and the second encryption information; the first terminal equipment establishes an encryption channel based on the first encryption information and the second encryption information; the two encryption channels are the same channel. That is, an encryption channel is established between the first terminal device and the second terminal device based on the first encryption information and the second encryption information.
Then, the first terminal equipment sends a first handshake packet to the second terminal equipment through an encryption channel; and the second terminal device sends a second handshake packet to the first terminal device through the encrypted channel. Thus, the process of the device authentication processing is completed between the first terminal device and the second terminal device.
S503, the first terminal device displays the device information of the second terminal device in the first interface; the first interface is used for displaying the devices in the pre-stored device list.
After the device authentication process is completed between the first terminal device and the second terminal device, the first terminal device reports the device information of the second device to the first interface of the manager application of the first terminal device for display through a Profile module of the code layer. Thus, the first terminal device displays information of other terminal devices passing through the device authentication on the first interface. At this time, the device information of the second device is reported to the manager, including the device name, the unique identifier of the device, the device type, and the like; but does not include a device address.
And if the ad hoc network is established in the subsequent process, each terminal device needs to store a device list, and the device list of each terminal device comprises devices belonging to the same ad hoc network with the terminal device. The device list includes device information of devices belonging to the same ad hoc network as the terminal device. Device information in the device list, including but not limited to: device name, device unique identification, device type, device address.
In this step, after the device authentication process is completed between the first terminal device and the second terminal device, since the process of the device authentication process is to prepare for the subsequent construction of the ad hoc network, the first terminal device can generate the device list of the first terminal device at this time. The first terminal equipment provides a first interface which is used for displaying equipment information of equipment in a pre-stored equipment list; wherein, for security and privacy reasons, the device address is not included in the device information displayed by the first interface.
S504, the first terminal equipment determines the equipment score of the first terminal equipment. Wherein the device score of the first terminal device is related to the operational status of the first terminal device.
In one example, step S504 includes: acquiring state information of a first terminal device; the state information of the first terminal equipment comprises at least one state parameter, and the state parameter of the first terminal equipment represents the current state of the first terminal equipment. And determining the equipment score of the first terminal equipment according to the state parameter in the state information of the first terminal equipment and the preset weight corresponding to the state parameter.
In one example, the status information of the first terminal device includes one or more of the following status parameters: charging parameters, screen locking parameters, first network discovery parameters, second network discovery parameters and battery power parameters.
The charging parameters represent whether the terminal equipment is charged, the screen locking parameters represent whether the terminal equipment is screen locked, the first network discovery parameters represent whether the terminal equipment supports CoAp discovery, the second network discovery parameters represent whether the terminal equipment supports low-power Bluetooth discovery, and the battery power parameters represent whether the current battery residual power of the terminal equipment is larger than or equal to a second preset threshold value.
The preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter, the preset weight corresponding to the screen locking parameter is greater than the preset weight corresponding to the first network discovery parameter, the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter, and the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
In one example, the device Score of the first terminal device is score=ischaring 16+isUnlock 8+iscoappsup 4+isceappsup 2+highpacket 1.
The isCharing is a charging parameter of the first terminal device, the isUnlock is a screen locking parameter of the first terminal device, the iscoappsup is a first network discovery parameter of the first terminal device, the isceappsup is a second network discovery parameter of the first terminal device, and the highBattery is a battery power parameter of the first terminal device.
For example, after the device authentication process is completed between the first terminal device and each second terminal device, the center node and the edge node need to be selected from the first terminal device and each second terminal device, and thus the ad hoc network needs to be built.
For the first terminal equipment, the first terminal equipment determines the equipment score of the first terminal equipment according to the running state of the first terminal equipment. The operating state of the first terminal device includes, but is not limited to: whether the terminal device is charged, whether the terminal device is screen locked, whether the terminal device supports CoAp (The Constrained Application Protocol) discovery, whether the terminal device supports bluetooth low energy discovery, the current battery level remaining of the terminal device, and so on.
In one example, a first terminal device obtains state information of the first terminal device; the state information of the first terminal device includes at least one state parameter. Preset weights corresponding to the state parameters are preset for each state parameter in advance. The first terminal equipment calculates the equipment score of the first terminal equipment according to each state parameter of the first terminal equipment and the preset weight corresponding to each state parameter.
The first terminal device obtains a charging parameter of the first terminal device, wherein the charging parameter characterizes whether the terminal device is charged (i.e. whether charging is being performed or whether charging is completed). And the charging parameters have preset weights.
The method comprises the steps that a first terminal device obtains a screen locking parameter of the first terminal device, wherein the screen locking parameter represents whether the terminal device locks a screen or not. And the screen locking parameters have preset weights. Wherein, the value of the preset weight of the state parameter is strongly related to the service; the terminal device is being charged or the terminal device has completed charging, the terminal device has strong capability, and the terminal device can do more tasks, so that a higher weight value needs to be set for the charging parameter. Therefore, the preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter.
The first terminal device obtains a first network discovery parameter of the first terminal device, wherein the first network discovery parameter characterizes whether the terminal device supports CoAp discovery. And if the terminal equipment is not locked, the terminal equipment has strong capability and can do more tasks, so that the preset weight corresponding to the screen locking parameter is greater than the preset weight corresponding to the first network discovery parameter.
The first terminal device obtains a second network discovery parameter of the first terminal device, wherein the second network discovery parameter characterizes whether the terminal device supports bluetooth low energy discovery. Because the scheme is based on the scene of the ad hoc network, the ad hoc network comprises a plurality of terminal devices, and signaling and information need to be transmitted among the plurality of terminal devices, so that the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter.
The first terminal equipment acquires a battery power parameter of the first terminal equipment, wherein the battery power parameter characterizes whether the current battery residual power of the terminal equipment is larger than or equal to a second preset threshold value. The scheme is that a protocol based on low-power consumption Bluetooth is required to send out broadcasting, so that the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
For example, if the first terminal device is charged (is charging or has completed charging), the charging parameter of the first terminal device has a value of 1; if the first terminal device is not charged (is not charged, or is not charged), the value of the charging parameter of the first terminal device is 0. The preset weight corresponding to the charging parameter of the first terminal equipment is 16.
If the screen of the first terminal equipment is unlocked, the value of the screen locking parameter of the first terminal equipment is 1; and if the screen of the first terminal equipment is locked, the value of the screen locking parameter of the first terminal equipment is 0. The preset weight corresponding to the screen locking parameter of the first terminal equipment is 8.
If the first terminal equipment supports the Coap discovery, the value of the first network discovery parameter of the first terminal equipment is 1; if the first terminal device supports the Coap discovery, the value of the first network discovery parameter of the first terminal device is 0. The preset weight corresponding to the first network discovery parameter of the first terminal equipment is set to be 4.
If the first terminal equipment supports BLE discovery, the value of the second network discovery parameter of the first terminal equipment is 1; if the first terminal device does not support BLE discovery, the value of the second network discovery parameter of the first terminal device is 0. The preset weight corresponding to the second network discovery parameter of the first terminal equipment is 2.
If the current battery remaining capacity of the first terminal device is greater than or equal to a second preset threshold, for example, the second preset threshold is 50%, the value of the battery capacity parameter of the first terminal device is 1; if the current battery remaining capacity of the first terminal device is smaller than a second preset threshold, for example, the second preset threshold is 50%, the value of the battery capacity parameter of the first terminal device is 0. The preset weight corresponding to the battery power parameter of the first terminal equipment is 1.
Then, the first terminal device obtains a charging parameter isCharing of the first terminal device, a screen locking parameter isUnlock of the first terminal device, an iscoapplort of a first network discovery parameter of the first terminal device, an iscble support of a second network discovery parameter of the first terminal device, and a highBattery of a battery power parameter of the first terminal device according to the above process. And, the first terminal device has previously acquired a preset weight corresponding to each state parameter. Then, the first terminal device calculates a device Score of the first terminal device.
For example, the first terminal device calculates a device Score score=ischaring 16+isconnock 8+iscoappsup 4+iscblesup 2+highbattery 1 of the first terminal device.
The first terminal device sends the device score of the first terminal device to each second terminal device through BLE broadcasting.
S505, the first terminal equipment receives the equipment score of the second terminal equipment sent by the second terminal equipment; the device score of the second terminal device is related to the operational status of the second terminal device.
The first terminal device also needs to know the device score of the second terminal device, for example. The device score of the second terminal device is calculated by the second terminal device.
And for each second terminal device, the second terminal device determines the device score of the second terminal device according to the running state of the second terminal device. The operating state of the second terminal device includes, but is not limited to: whether the terminal device is charged, whether the terminal device is screen locked, whether the terminal device supports CoAp (The Constrained Application Protocol) discovery, whether the terminal device supports bluetooth low energy discovery, the current battery level remaining of the terminal device, and so on.
In one example, the second terminal device obtains state information of the second terminal device; the state information of the second terminal device includes at least one state parameter. Preset weights corresponding to the state parameters are preset for each state parameter in advance. And the second terminal equipment calculates the equipment score of the second terminal equipment according to each state parameter of the second terminal equipment and the preset weight corresponding to each state parameter.
The second terminal device obtains a charging parameter of the second terminal device, wherein the charging parameter characterizes whether the terminal device is charged (i.e. whether charging is being performed or whether charging is completed). And the charging parameters have preset weights.
The second terminal equipment acquires a screen locking parameter of the second terminal equipment, wherein the screen locking parameter characterizes whether the terminal equipment locks a screen or not. And the screen locking parameters have preset weights. Wherein, the value of the preset weight of the state parameter is strongly related to the service; the terminal device is being charged or the terminal device has completed charging, the terminal device has strong capability, and the terminal device can do more tasks, so that a higher weight value needs to be set for the charging parameter. Therefore, the preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter.
The second terminal device obtains a first network discovery parameter of the second terminal device, wherein the first network discovery parameter characterizes whether the terminal device supports CoAp discovery. The terminal equipment is unlocked, the terminal equipment has strong capability and can do more tasks, so that the preset weight corresponding to the screen locking parameter is larger than the preset weight corresponding to the first network discovery parameter,
the second terminal device obtains a second network discovery parameter of the second terminal device, wherein the second network discovery parameter characterizes whether the terminal device supports bluetooth low energy discovery. Because the scheme is based on the scene of the ad hoc network, the ad hoc network comprises a plurality of terminal devices, and signaling and information need to be transmitted among the plurality of terminal devices, so that the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter.
The second terminal equipment acquires battery power parameters of the second terminal equipment, wherein the battery power parameters represent whether the current battery residual power of the terminal equipment is larger than or equal to a second preset threshold value. The scheme is that a protocol based on low-power consumption Bluetooth is required to send out broadcasting, so that the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
For example, if the second terminal device is charged (is charging or has completed charging), the charging parameter of the second terminal device has a value of 1; if the second terminal device is not charged (is not charged, or is not charged), the value of the charging parameter of the second terminal device is 0. The preset weight corresponding to the charging parameter of the second terminal device is 16.
If the screen of the second terminal equipment is unlocked, the value of the screen locking parameter of the second terminal equipment is 1; and if the screen of the second terminal equipment is locked, the value of the screen locking parameter of the second terminal equipment is 0. The preset weight corresponding to the screen locking parameter of the second terminal equipment is 8.
If the second terminal equipment supports the Coap discovery, the value of the first network discovery parameter of the second terminal equipment is 1; if the second terminal device supports the Coap discovery, the value of the first network discovery parameter of the second terminal device is 0. The preset weight corresponding to the first network discovery parameter of the second terminal equipment is set to be 4.
If the second terminal equipment supports BLE discovery, the value of the second network discovery parameter of the second terminal equipment is 1; and if the second terminal equipment does not support BLE discovery, the value of the second network discovery parameter of the second terminal equipment is 0. The preset weight corresponding to the second network discovery parameter of the second terminal equipment is 2.
If the current battery remaining capacity of the second terminal equipment is greater than or equal to a second preset threshold, for example, the second preset threshold is 50%, the value of the battery capacity parameter of the second terminal equipment is 1; if the current battery remaining capacity of the second terminal device is smaller than the second preset threshold, for example, the second preset threshold is 50%, the value of the battery capacity parameter of the second terminal device is 0. The preset weight corresponding to the battery power parameter of the second terminal equipment is 1.
And then, the second terminal equipment obtains a charging parameter isCharing1 of the second terminal equipment, a screen locking parameter isUnlock1 of the second terminal equipment, an iscoappsupport 1 of a first network discovery parameter of the second terminal equipment, an iscblesupport 1 of a second network discovery parameter of the second terminal equipment and a highBattery1 of a battery power parameter of the second terminal equipment according to the above process. And, the second terminal device has previously acquired a preset weight corresponding to each state parameter. Then, the second terminal device calculates a device Score1 of the second terminal device.
For example, the second terminal device calculates a device Score of the second terminal device of Score 1=ischaring 1 x 16+isconnock1 x 8+iscoappsuppalt1 x 4+iscblesupport1 x 2+highbattery1 x 1.
For each second terminal device, the second terminal device transmits the device score of the second terminal device to the first terminal device through BLE broadcast.
Thus, the first terminal device obtains the device score of the first terminal device, and the device score of each of the second terminal devices.
And for each second terminal device, the first terminal device sends the score of the first terminal device to each second terminal device through BLE broadcasting; each second terminal device has calculated its own device score. Thus, for each second terminal device, the second terminal device also has a device score for the first terminal device, a device score for each of the second terminal devices.
S506, the first terminal equipment determines a center node and an edge node in the ad hoc network according to the equipment score of the first terminal equipment and the equipment score of the second terminal equipment.
In one example, step S506 includes: the first terminal equipment determines that the equipment score belongs to the terminal equipment with a preset score range and is a central node of the ad hoc network; the rest of the terminal equipment is an edge node of the ad hoc network.
The first terminal device is illustratively pre-selected to store a list of devices that includes devices belonging to the same ad hoc network as the first terminal device. The device list includes device information of devices belonging to the same ad hoc network as the terminal device. But at this time, since the ad hoc network has not been built; therefore, included in the device list at this time is a device adjacent to the first terminal device.
The first terminal equipment writes the equipment score of the first terminal equipment and the equipment score of each second terminal equipment in the terminal equipment into an equipment list.
The first terminal equipment obtains the equipment score of the first terminal equipment and the equipment score of each second terminal equipment in each terminal equipment; then, the first terminal device obtains the device score of the first terminal device and the device score of each second terminal device in each terminal device, and selects a center node and an edge node in the ad hoc network.
In one example, the first terminal device has acquired a device score for the first terminal device, a device score for each second terminal device in the respective terminal devices; the first terminal equipment compares the scores of the equipment, determines that the score of the equipment belongs to the terminal equipment with a preset score range and is a central node of the ad hoc network; the first terminal equipment determines that the rest of the terminal equipment is an edge node of the ad hoc network.
For example, the first terminal device has acquired a device score for the first terminal device, a device score for each second terminal device; comparing the scores of the devices by the first terminal device, and determining the terminal device with the largest score as a central node of the ad hoc network; the first terminal equipment determines that the rest of the terminal equipment is an edge node of the ad hoc network.
For another example, the first terminal device has acquired a device score for the first terminal device, a device score for each second terminal device; the first terminal equipment compares the equipment scores, determines that the equipment scores belong to the terminal equipment within a preset value range and is a central node of the ad hoc network; the first terminal equipment determines that the rest of the terminal equipment is an edge node of the ad hoc network.
The second terminal equipment obtains the equipment score of the first terminal equipment and the equipment score of each second terminal equipment in the terminal equipment; the second terminal equipment compares the scores of the equipment, determines that the score of the equipment belongs to the terminal equipment with a preset score range and is a central node of the ad hoc network; the second terminal equipment determines the rest terminal equipment as the edge node of the ad hoc network.
For example, the second terminal device has acquired the device score of the first terminal device, the device score of each second terminal device; comparing the scores of the devices by the second terminal equipment, and determining the terminal equipment with the largest score as a central node of the ad hoc network; the second terminal equipment determines the rest terminal equipment as the edge node of the ad hoc network.
For another example, the second terminal device has acquired the device score of the first terminal device, the device score of each second terminal device; the second terminal equipment compares the equipment scores, determines that the equipment scores belong to the terminal equipment within a preset value range and is a central node of the ad hoc network; the second terminal equipment determines the rest terminal equipment as the edge node of the ad hoc network.
The device score of each terminal device is acquired by the first terminal device, and the device score of each terminal device is also acquired by the second terminal device. The first terminal equipment selects a mode of a center node and an edge node according to the equipment scores of the terminal equipment; the second terminal equipment selects a mode of a center node and an edge node according to the equipment scores of the terminal equipment; the selection modes of the two are the same. So the center nodes determined by the first terminal equipment are the same as the center nodes determined by each second terminal equipment; the edge nodes determined by the first terminal device and the edge nodes determined by each second terminal device are identical.
Further, each terminal device maintains a list of devices of all surrounding terminal devices (the list of devices at this time includes a device score); each terminal device performs election. So that all terminal devices know which is the center node and which is the edge node.
Based on the above process, the center node and each edge node are obtained, so that the center node and each edge node of the ad hoc network are determined from the first terminal device and each second terminal device. The obtained ad hoc network comprises a plurality of terminal devices; one of a plurality of terminal devices in the ad hoc network is a central node of the ad hoc network; the rest of the plurality of terminal devices in the ad hoc network are all edge nodes of the ad hoc network.
In addition, in the application, the function of the super terminal of each terminal device in the ad hoc network is required to be started, the Bluetooth function of each terminal device is required to be started, and the wireless local area network function of each terminal device is required to be started; and, each terminal device in the ad hoc network logs into the same account under the housekeeping application, i.e., each terminal device in the ad hoc network is a device under the same account.
Fig. 6 is a software architecture diagram of a first terminal device according to an embodiment of the present application, where, as shown in fig. 6, the first terminal device includes an application layer (app), an application framework layer (FW), a system runtime layer (Native), a hardware abstraction layer (Hardware Abstraction Layer HAL), and a Linux kernel layer (Kenrel).
If the first terminal device is a personal computer, the application layer of the first terminal device deploys a housekeeping application.
An application framework layer of the first terminal device is provided with a first self-discovery module. The first discovery module includes a first discovery policy management module, a first device information management module, a first group management module, a first device information update module, a first broadcast module, and a first unicast module (brmonitor st).
A first discovery policy management module for actively issuing BLE broadcasts and determining whether to follow the broadcasts.
And the first equipment information management module is used for storing the equipment information of the first terminal equipment.
The first group management module is used for storing a device list of the first terminal device; thereby, the device information for managing other terminal devices belonging to the same ad hoc network as the first terminal device is managed.
The first equipment information updating module is used for updating the equipment information of each second terminal equipment; and is further configured to calculate a device score for the first terminal device and a device score for each of the second terminal devices.
The first broadcasting module includes a first cop monitoring (copa monitor) module and a first BLE monitoring (BLE monitor) module.
Fig. 7 is a software structure diagram of a second terminal device according to an embodiment of the present application. As shown in fig. 7, the second terminal device includes an application layer (app), an application framework layer (FW), a system runtime layer (Native), a hardware abstraction layer (Hardware Abstraction Layer HAL), and a Linux kernel layer (Kenrel).
If the second terminal device is a personal computer, the application layer of the second terminal device deploys a housekeeping application.
And an application framework layer of the second terminal equipment is provided with a second self-discovery module. The second discovery module includes a second discovery policy management module, a second device information management module, a second group management module, a second device information update module, a second broadcast module, and a second unicast module (brmonitor st).
A second discovery policy management module for actively issuing BLE broadcasts and determining whether to follow the broadcasts.
And the second equipment information management module is used for storing the equipment information of the second terminal equipment.
A second group management module, configured to store a device list of a second terminal device; thereby, the device information for managing other terminal devices belonging to the same ad hoc network as the second terminal device is managed.
The second equipment information updating module is used for updating the equipment information of each second terminal equipment; and is further configured to calculate a device score for the second terminal device and a device score for the first terminal device.
The second broadcasting module includes a second cop monitor (copa monitor) module and a second BLE monitor (BLE monitor) module.
According to the architecture of fig. 6 and 7, the first terminal device turns on the switch of the super terminal and turns on the bluetooth function and the wireless lan function. The first self-discovery module of the first terminal equipment sends out a third broadcast through the first broadcast module, and the third broadcast is BLE broadcast; wherein the first terminal device transmits the third broadcast once every 30 seconds.
The second terminal device turns on the switch of the super terminal and turns on the Bluetooth function and the wireless local area network function. A second self-discovery module of the second terminal equipment sends out a fourth broadcast through a second broadcast module, wherein the fourth broadcast is BLE broadcast; wherein the second terminal device transmits a fourth broadcast every 30 seconds.
And after the first terminal equipment receives the fourth broadcast and the second terminal equipment receives the third broadcast, a naked channel is established between the first terminal equipment and the second terminal equipment. The first terminal device and the second terminal device exchange encryption information and then establish an encryption channel. And the first terminal equipment and the second terminal equipment are mutually wrapped by handshake to finish the process of equipment authentication processing.
Then, the first terminal device reports the device information of the second terminal device (at this time, the authentication between the second terminal device and the first terminal device is passed) to the first interface through the Profile module of the first terminal device; the first terminal device displays device information of the second terminal device on the first interface. At this time, the device information displayed in the first interface may include a device name, a device unique identifier, a device type, and the like; but does not include a device address.
The first terminal equipment sends the equipment information of the second terminal equipment to a first equipment information updating module in a first discovery module; the first device information updating module of the first terminal device updates a device list in the first terminal device.
And a first equipment information updating module in a first discovery module of the first terminal equipment determines the equipment score of the first terminal equipment according to the running state of the first terminal equipment. And then, the first discovery module of the first terminal equipment sends the equipment score of the first terminal equipment to each second terminal equipment through BLE broadcasting. It can be known that the BLE broadcast sent by the first terminal device carries the device score of the first terminal device.
Meanwhile, the second terminal equipment reports the equipment information of the first terminal equipment (at the moment, the authentication between the second terminal equipment and the first terminal equipment is passed) to the second interface through a Profile module of the second terminal equipment; the second terminal device displays the device information of the first terminal device on the second interface. At this time, the device information displayed in the second interface may include a device name, a device unique identifier, a device type, and the like; but does not include a device address.
The second terminal equipment sends the equipment information of the first terminal equipment to a second equipment information updating module in a second discovery module; and the second equipment information updating module of the second terminal equipment updates the equipment list in the second terminal equipment.
And a second equipment information updating module in a second discovery module of the second terminal equipment determines the equipment score of the second terminal equipment according to the running state of the second terminal equipment. And then, a second discovery module of the second terminal equipment sends the equipment score of the second terminal equipment to the first terminal equipment through BLE broadcasting. It can be known that the BLE broadcast sent by the second terminal device carries the device score of the second terminal device.
Thus, the first terminal device obtains the device score of the first terminal device, and obtains the device score of each second terminal device. The first terminal device first discovery module stores a device list including device information and device scores of other surrounding terminal devices.
Meanwhile, the second terminal device obtains the device score of the second terminal device, and obtains the device score of the first terminal device and the device scores of other second terminal devices. The second terminal device second discovery module stores a device list including device information and device scores of other surrounding terminal devices.
Since respective device scores are sent out between the terminal devices through BLE broadcasting, each terminal device obtains its own device score and the device scores of other terminal devices.
And then, the first terminal equipment selects a center node and each edge node of the self-networking according to the equipment score of the first terminal equipment and the equipment score of each second terminal equipment. The second terminal equipment selects the center node and each edge node of the self-networking according to the equipment scores of the second terminal equipment, the equipment scores of the first terminal equipment and the equipment scores of other second terminal equipment. The central node obtained by each terminal device is consistent; the edge nodes obtained by each terminal device are consistent.
Fig. 8 is a schematic diagram of a first interface according to an embodiment of the present application. As shown in fig. 8, if the first terminal device is a mobile phone, a first interface of the first terminal device is shown in fig. 8; and other terminal devices belonging to the same ad hoc network with the first terminal device are displayed in the first interface. As shown in fig. 8 (a), the display of fig. 8 (b) is triggered by the "smart interconnection" key in the "setup" interface of the first terminal device. As shown in fig. 8 (a), other terminal devices belonging to the same ad hoc network as the first terminal device are shown, for example, terminal device a, terminal device b, and terminal device c.
If the second terminal device is a mobile phone, the second interface of the second terminal device may also be referred to fig. 8.
Fig. 9 is a schematic diagram of a first interface according to an embodiment of the present application. As shown in fig. 9, if the first terminal device is a tablet computer, a first interface of the first terminal device is shown in fig. 9; and other terminal devices belonging to the same ad hoc network with the first terminal device are displayed in the first interface. As shown in fig. 9, other terminal devices, such as terminal device a, terminal device b, terminal device c, and terminal device d, which are displayed to belong to the same ad hoc network with the first terminal device, are triggered by the "smart interconnection" key in the "setup" interface of the first terminal device.
If the second terminal device is a tablet computer, the second interface of the second terminal device may also be referred to as fig. 9.
Fig. 10 is a schematic diagram III of a first interface according to an embodiment of the present application. As shown in fig. 10, if the first terminal device is a personal computer, a first interface of the first terminal device is shown in fig. 10; and other terminal devices belonging to the same ad hoc network with the first terminal device are displayed in the first interface. As shown in fig. 10, other terminal devices, such as terminal device b, terminal device c, terminal device d, and terminal device e, which are displayed to belong to the same ad hoc network with the first terminal device, are triggered by the "smart interconnection" key in the "setup" interface of the first terminal device.
If the second terminal device is a personal computer, the second interface of the second terminal device may also be referred to as fig. 10.
S507, the first terminal equipment waits for a second duration after sending out the first broadcast.
The second terminal equipment is equipment belonging to the same self-organizing network with the first terminal equipment, and the self-organizing network comprises at least one terminal equipment; the first broadcast is a broadcast based on the bluetooth low energy protocol.
Fig. 11 is a signaling diagram illustrating a construction process of an ad hoc network according to an embodiment of the present application, as shown in fig. 11, in step S1101, the first terminal device sends out the third broadcast. Step S1102, the second terminal device sends out the fourth broadcast. Step S1103, the first terminal device performs the above-mentioned device authentication processing procedure. Step S1104, the second terminal device performs the device authentication process.
And then if the first terminal equipment is on line, the first terminal equipment sends out BLE broadcasting, and the second self-discovery module of the second terminal equipment can receive the BLE broadcasting of the first terminal equipment. If the second terminal device is on line, the second terminal device sends out a BLE broadcast, and the first discovery module of the first terminal device can receive the BLE broadcast of the second terminal device.
Then, in step S1105, the first terminal device determines a center node and an edge node in the ad hoc network. And S1106, the second terminal equipment determines a center node and an edge node in the ad hoc network. Thereby constructing an ad hoc network.
After the ad hoc network is constructed, each terminal device in the ad hoc network needs to send out BLE broadcast, so as to perform online state maintenance (i.e., keep alive) between the terminal devices. However, each terminal device in the ad hoc network sends out a BLE broadcast, and due to short-distance power consumption control, there is a case that the BLE function of the terminal device is dormant, or there is a case that the terminal device scans the BLE broadcast of other terminal devices; at this time, if the terminal device does not receive the BLE broadcast of some other terminal device after sending the BLE broadcast, the terminal device will kick off the other terminal device; however, the other terminal devices are not separated from the near field, so that the device is misplaced, and the service processing cannot be normally performed, thereby affecting the user experience.
In one example, after an ad hoc network is built, a first terminal device transmits a first broadcast. Wherein the first broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the first broadcast is a BLE broadcast. Then, the first terminal equipment waits for a second duration; the second period of time is, for example, 10 seconds. Then, after waiting for the second duration, the first terminal device drops the second terminal device if it is determined that the second broadcast of the second terminal device is not received within the first duration; wherein the first duration is for example 21 seconds. The second broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the second broadcast is a BLE broadcast. Thus, the first terminal device deletes the second terminal device in the device list. The first terminal device no longer maintains information of the second terminal device, and the first terminal device no longer performs service communication with the second terminal device.
However, in the above process, there may be a case where the BLE function of the second terminal device is dormant, or there may be a case where the first terminal device scans BLE broadcast not requiring the second terminal device; it is known that the second terminal device is not away from the near field. The first terminal equipment misplaces the second terminal equipment, so that the service processing can not be normally performed.
For example, fig. 12 is a signaling diagram three of an apparatus processing method based on an ad hoc network according to an embodiment of the present application, as shown in fig. 12, a first terminal apparatus is a central node, and each second terminal apparatus is an edge node. Taking the first terminal equipment as a central node, the second terminal equipment A as an edge node and the second terminal equipment B as an edge node as an example for illustration and description.
S1201, after an ad hoc network is constructed, a first terminal device serving as a central node sends out a first broadcast; the first broadcast is a BLE broadcast.
The first terminal equipment serving as a central node in the ad hoc network performs active broadcasting, namely, the first terminal equipment serving as the central node sends out first broadcasting. Wherein the period of the first broadcast is 30 seconds; it is known that the first terminal device as the center node actively transmits the first broadcast once every 30 seconds. The first broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the first broadcast is a BLE broadcast.
S1202, after receiving the first broadcast, the second terminal equipment A serving as an edge node sends out a second broadcast of the second terminal equipment A; the second broadcast is a BLE broadcast.
Wherein the second terminal device a as an edge node in the ad hoc network performs a follow-up broadcast after receiving the first broadcast, i.e. the second terminal device a as an edge node issues a second broadcast after receiving the first broadcast. Wherein the period of the second broadcast is 20 seconds; it is known that the second terminal device a, which is an edge node, actively transmits a second broadcast every 20 seconds after receiving the first broadcast. The second broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the second broadcast is a BLE broadcast.
Thereby performing the keep-alive.
S1203, after receiving the first broadcast, the second terminal device B serving as the edge node sends out a second broadcast of the second terminal device B; the second broadcast is a BLE broadcast.
S1204, the first terminal equipment sends out a first broadcast again; the first broadcast is a BLE broadcast.
Wherein, after receiving the first broadcast again, the second terminal device a sends out the second broadcast of the second terminal device a again; the second broadcast is a BLE broadcast.
After the second terminal device B receives the first broadcast again, the second terminal device B sends out the second broadcast again; the second broadcast is a BLE broadcast.
S1205, the first terminal equipment waits for a second duration.
Wherein the second time period is for example 10 seconds. After the first terminal device does not first issue the first broadcast, steps S1205-S1206 are performed each time the first broadcast is issued.
S1206, after waiting for the second duration, if it is determined that the second broadcast of the second terminal device B is not received within the first duration, the first terminal device drops the second terminal device B.
Wherein the first duration is for example 21 seconds. After waiting for the second time period, the first terminal device determines whether a second broadcast of each second terminal device is received within a first time period preceding a last time of the second time period. And if the first terminal equipment determines that the second broadcast of the second terminal equipment B is not received within the first time period, the second terminal equipment B is disconnected.
For example, the first terminal device detects whether or not a second broadcast of each second terminal device is received within the past 21 seconds after waiting for 10 seconds; if the first terminal device determines that the second broadcast of the second terminal device B is not received within the past 21 seconds after waiting for 10 seconds, the first terminal device kicks off the second terminal device B.
In the process shown in fig. 12, there may be a case where the BLE function of the second terminal device is dormant, or there may be a case where the first terminal device scans BLE broadcast without the second terminal device; it is known that the second terminal device is not away from the near field. The first terminal equipment misplaces the second terminal equipment, so that the service processing can not be normally performed.
For example, fig. 13 is a signaling diagram of a device processing method based on ad hoc network according to an embodiment of the present application, as shown in fig. 13, a first terminal device is an edge node, a certain second terminal device is a center node, and the rest of second terminal devices are all edge nodes. Taking the first terminal equipment as an edge node and the second terminal equipment as an edge node as an example, the description is given by way of example.
S1301, after an ad hoc network is built, the equipment serving as a central node sends out active broadcast; the active broadcast is a BLE broadcast.
The device serving as the central node in the ad hoc network performs active broadcasting, that is, the device serving as the central node sends out active broadcasting. Wherein the period of active broadcasting is 30 seconds; it is known that a device as a central node actively transmits an active broadcast once every 30 seconds. Active broadcast is a broadcast based on the bluetooth low energy protocol, i.e. active broadcast is BLE broadcast.
S1302, after receiving the active broadcast, the first terminal device serving as the edge node sends out a first broadcast of the first terminal device; the first broadcast is a BLE broadcast.
Wherein the first terminal device as an edge node in the ad hoc network performs following broadcast after receiving the active broadcast, i.e. the first terminal device as an edge node sends out the first broadcast after receiving the active broadcast. Wherein the period of the first broadcast is 20 seconds; it is known that the first terminal device as the edge node actively transmits a first broadcast every 20 seconds after receiving the first active broadcast. The first broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the first broadcast is a BLE broadcast.
Thereby performing the keep-alive.
S1303, after receiving the active broadcast, the second terminal device serving as the edge node sends out a second broadcast of the second terminal device; the second broadcast is a BLE broadcast.
Wherein the second terminal device as an edge node in the ad hoc network performs the follow-up broadcast after receiving the active broadcast, i.e. the second terminal device as an edge node sends out the second broadcast after receiving the active broadcast. Wherein the period of the second broadcast is 20 seconds; it is known that the second terminal device, which is an edge node, actively transmits a second broadcast every 20 seconds after receiving the first active broadcast. The second broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the second broadcast is a BLE broadcast.
S1304, the equipment of the central node sends out active broadcast again; the active broadcast is a BLE broadcast.
The method comprises the steps that after the first terminal equipment receives active broadcasting again, the first terminal equipment sends out first broadcasting of the first terminal equipment again; the first broadcast is a BLE broadcast.
The second terminal equipment sends out the second broadcast of the second terminal equipment again after receiving the active broadcast again; the second broadcast is a BLE broadcast.
S1305, the first terminal device waits for a second duration.
Wherein the second time period is for example 10 seconds. After the first terminal device does not first issue the first broadcast, steps S1305 to S1306 are executed each time the first broadcast is issued.
S1306, after waiting for the second duration, the first terminal device drops the second terminal device if it is determined that the second broadcast of the second terminal device is not received within the first duration.
Wherein the first duration is for example 21 seconds. After waiting for the second time period, the first terminal device determines whether a second broadcast of each second terminal device is received within a first time period preceding a last time of the second time period. And if the first terminal equipment determines that the second broadcast of the second terminal equipment is not received within the first duration, the second terminal equipment is disconnected.
For example, the first terminal device detects whether or not a second broadcast of the second terminal device is received within the past 21 seconds after waiting for 10 seconds; if the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21 seconds after waiting for 10 seconds, the first terminal device drops the second terminal device.
In the process shown in fig. 13, there may be a case where the BLE function of the second terminal device is dormant, or there may be a case where the first terminal device scans BLE broadcast without the second terminal device; it is known that the second terminal device is not away from the near field. The first terminal equipment misplaces the second terminal equipment, so that the service processing can not be normally performed.
In the present application, at the time of execution to step S507, after the ad hoc network is constructed, it is required that each terminal device in the ad hoc network transmits BLE broadcast, so as to perform online state maintenance (i.e., keep-alive) between the terminal devices. After the ad hoc network is constructed, the first terminal device transmits a first broadcast. Wherein the first broadcast is a broadcast based on the bluetooth low energy protocol, i.e. the first broadcast is a BLE broadcast. Then, after the first terminal device issues the first broadcast (the first broadcast that is not the first time), the first terminal device waits for the second period of time; the second period of time is, for example, 10 seconds.
And S508, after the second time period, if the first terminal equipment does not receive the second broadcast of the second terminal equipment in the first time period, establishing connection based on a classical Bluetooth protocol with the second terminal equipment.
Wherein the second broadcast is a broadcast based on a bluetooth low energy protocol; the second broadcast is sent in response to a bluetooth low energy protocol based broadcast sent by a central node in the ad hoc network.
The first time includes a period before the transmission time and a period after the transmission time, the transmission time being a time at which the first broadcast is transmitted; the first time period is a preset period before the last time in the second time period.
In one example, the second duration is 10 seconds; the first duration was 21 seconds.
In one example, if the first terminal device is a central node in the ad hoc network, the second broadcast is sent in response to the first broadcast; if the first terminal device is an edge node in the ad hoc network, the second broadcast is sent in response to a bluetooth low energy broadcast by a central node in the ad hoc network.
If the first terminal device is a central node in the ad hoc network, the transmission period of the first broadcast is 30 seconds, and the transmission period of the second broadcast is 20 seconds. If the first terminal device is an edge node in the ad hoc network, the transmission period of the first broadcast is 20 seconds, and the transmission period of the second broadcast is 30 seconds.
In one example, the "establishing a connection with the second terminal device based on the classical bluetooth protocol" in step S508 includes:
acquiring an address of a second terminal device based on a classical Bluetooth protocol; and establishes a physical link with the second terminal device based on the classical bluetooth protocol based address.
If the physical link is established successfully, a success instruction is fetched from the first terminal equipment; wherein the success instruction characterizes a success of the connection with the second terminal device based on the classical bluetooth protocol.
Illustratively, after step S507, the first terminal device waits for a second duration, and the first terminal device determines a preset period of time before a last time in the second duration as a first duration. The first terminal device detects whether a second broadcast of the second terminal device is received within a first time period. Wherein the second broadcast is a broadcast based on the bluetooth low energy protocol, i.e., the second broadcast is a BLE broadcast; and, the second broadcast is transmitted in response to a broadcast based on the bluetooth low energy protocol transmitted by a central node in the ad hoc network.
The time when the first terminal equipment sends out the first broadcast is the sending time; after the transmission time, a second period of time is waited. The first terminal device detects whether a second broadcast of the second terminal device is received within a preset period (i.e., a first period) preceding a last time of the second period. And, the first time period includes a period before the transmission time and a period after the transmission time. For example, the second duration is 10 seconds and the first duration is 21 seconds; after the first terminal device sends out the sending moment of the first broadcast, waiting for 10 seconds, and then detecting whether the first terminal device receives the second broadcast of the second terminal device within the past 21 seconds; as can be seen, the 21 seconds includes a period before the transmission timing and a period after the transmission timing.
If the first terminal device determines that the second broadcast of the second terminal device is received within the first time period, the first terminal device determines not to kick off the line.
If the first terminal device determines that the second broadcast of the second terminal device is not received within the first duration, the first terminal device needs to establish a connection based on a classical Bluetooth (BR) protocol with the second terminal device (the second terminal device is a device that does not receive the second broadcast sent by the second terminal device), that is, establish a BR connection.
Wherein a connection based on the classical bluetooth protocol, i.e. a BR connection, needs to be established between a "first terminal device and a second terminal device, which is a device that does not receive the second broadcast it sent. "procedure is described below.
After the authentication is passed due to the procedure of the previous device authentication process, the first terminal device may acquire the address of the second terminal device based on the classical bluetooth protocol from the interface, i.e. acquire the BR address of the second terminal device. Then, the first terminal device establishes a physical link with the second terminal device according to the BR address of the second terminal device.
And after the physical link is successfully established, performing a callback process. Because the establishment of the physical link is completed between the bottom layer of the first terminal device and the bottom layer of the second terminal device, the first terminal device can call a success instruction from the inside of the first terminal device; wherein the success instruction characterizes the success of the connection between the first terminal device and the second terminal device based on the classical Bluetooth protocol. The second terminal equipment can call a success instruction from the inside of the second terminal equipment; wherein the success instruction characterizes the success of the connection between the first terminal device and the second terminal device based on the classical Bluetooth protocol.
S509, if the first terminal equipment determines that the connection based on the classical Bluetooth protocol is successful, determining a time difference between a first time and a second time; the first time is a time after an initial time when the connection based on the classical Bluetooth protocol is established, and the second time is a time when the connection based on the classical Bluetooth protocol is successful.
The first terminal device, after determining that the connection with the second terminal device based on the classical bluetooth protocol was successful, determines the time instant at which the connection based on the classical bluetooth protocol was successful as the second time instant t3. The second terminal equipment records the initial time when the connection based on the classical Bluetooth protocol is established in advance, and the second terminal equipment determines one time after the initial time as the first time; for example, the second terminal device determines a time 8 seconds after the initial time as the first time t4.
The first terminal device calculates a time difference between the first time and the second time, and obtains a time difference w=t4-t 3.
S510, if the first terminal equipment determines that the time difference is smaller than or equal to a first preset threshold value, the first terminal equipment determines to continuously maintain a pre-stored equipment list. The pre-stored device list comprises devices belonging to the same ad hoc network with the first terminal device.
The first terminal device determines, for example, whether the time difference W is equal to or less than a first preset threshold. If the first terminal equipment determines that the time difference W is smaller than or equal to the first preset threshold value, the second terminal equipment is determined to be in the near field, the second terminal equipment is not off line, and the first terminal equipment continues to maintain the equipment list of the first terminal equipment.
The device list of the first terminal device includes devices belonging to the same ad hoc network as the first terminal device. The list of devices is presented in the description of the steps above.
S511, if the first terminal equipment determines that the time difference is greater than a first preset threshold, deleting the second terminal equipment from a pre-stored equipment list; and determining to delete the second terminal device in a first interface, wherein the first interface is used for displaying devices in a pre-stored device list.
In one example, the difference between the first time and the initial time is 8 seconds; the first preset threshold is 29 seconds.
For example, if the first terminal device determines that the time difference W is greater than the first preset threshold, it determines that the second terminal device is not in the near field, and determines to kick the second terminal device off line. At this time, the first terminal device deletes the second terminal device from the device list of the first terminal device; and determining to delete the second terminal device in the first interface. And thus the second terminal device which is offline is not displayed in the first interface.
In one example, after step S506, an ad hoc network is obtained, where the ad hoc network includes a plurality of terminal devices. The first terminal equipment is a central node in the ad hoc network, and the second terminal equipment is an edge node in the ad hoc network.
The first terminal device actively transmits a first broadcast, which is a BLE broadcast, every 30 seconds. The second terminal device transmits a following broadcast every 20 seconds after receiving the first broadcast; that is, the second terminal device transmits a second broadcast, which is a BLE broadcast, every 20 seconds after receiving the first broadcast. And the second terminal device may also receive the following broadcast of other edge nodes in the ad hoc network.
Then, the first terminal device waits for 10 seconds after each first broadcast (first broadcast other than the first time), at which time point t2 is reached. The first terminal device then detects whether a following broadcast of each edge node is received within the past 21 seconds, so that the first terminal device detects whether a second broadcast of the second terminal device is received within the past 21 seconds.
In case 1, if the first terminal device determines that the second broadcast of each second terminal device is received, the first terminal device continues to execute the process of sending the first broadcast once every 30 seconds.
And 2, if the first terminal equipment determines that the second broadcast of the second terminal equipment is not received, the second terminal equipment is not started to be off line.
It is possible that the second terminal device does not deliver the second broadcast or that the first terminal device does not receive the second broadcast of the second terminal device due to network reasons. However, if the second terminal device is in the near field and the first terminal device drops off the line, the second terminal device is misplaced, so that the service and the opposite terminal device cannot be used as the service.
First, a first terminal device initiates BR connection to a second terminal device.
The specific procedure of "BR connection" is as follows. Since the first terminal device can take the BR address of the second terminal device of the counterpart from the interface after the previous procedure of the device authentication process. If the first terminal equipment determines that the second broadcast of the second terminal equipment is not received, a physical link is established between the first terminal equipment and the second terminal equipment according to the BR address of the second terminal equipment. The establishment of a physical link is completed between the bottom layer of the first terminal equipment and the bottom layer of the second terminal equipment; if the physical link can be established, confirming that the second terminal equipment of the opposite terminal is in the near field.
After the physical link is successfully established, a callback process is performed, and the establishment of the physical link is completed between the bottom layer of the first terminal device and the bottom layer of the second terminal device, so that a success instruction can be interacted inside the first terminal device, and a success instruction can be interacted inside the second terminal device; and further the BR connection is successful. Wherein the success instruction characterizes the BR connection success between the first terminal device and the second terminal device.
Then, after the BR connection is successful, the first terminal device records the time when the BR connection is successful as a second time t3. The first terminal device determines a first time t4, the first time t4 being 8 seconds after the time at which the first terminal device initiates the BR connection. The first terminal device calculates a time difference w=t4-t 3 between the first time instant t4 and the second time instant t3.
If the first terminal equipment determines that the time difference W is smaller than or equal to the first preset threshold value, the second terminal equipment is determined to be in the near field, and the second terminal equipment cannot be misplaced. The first preset threshold may take 29 seconds.
If the first terminal equipment determines that the time difference W is larger than the first preset threshold value, unicast timeout is determined, unicast confirmation fails, and the second terminal equipment is not in the near field under the high probability. Thereby, the first terminal device kicks off the second terminal device; because the equipment list maintained by the first terminal equipment comprises equipment belonging to the same self-organizing network with the first terminal equipment, the first terminal equipment deletes the second terminal equipment which is off line from the equipment list of the first terminal equipment. The first terminal device no longer displays the second terminal device that is offline in the first interface.
The process of BR unicast acknowledgement provided by the application refers to the following complete process: the first terminal device determines that the second broadcast of the second terminal device is not received within a first time period (21 seconds); establishing BR connection; based on the time difference, it is determined whether to kick the second terminal device off line.
For example, fig. 14 shows a first time axis based on each broadcast according to an embodiment of the present application, and as shown in fig. 14, the coordinates of the axis of fig. 14 are time (in seconds s). The first terminal device is a central node, and the second terminal device is an edge node. The first terminal device transmits a first broadcast, which is a BLE broadcast, every 30 s. The first terminal equipment sends out a first broadcast for the first time at the 0 s; the first terminal equipment sends out a first broadcast for the second time at 30 s; the first terminal equipment sends out a first broadcast for the third time at 60 s; the first terminal device transmits the first broadcast at 90s, the fourth time. The first broadcast is an active broadcast.
After the first terminal device sends out the first broadcast for the first time at the 0 th s, the second terminal device responds to the first broadcast for the first time and sends out a second broadcast which is a BLE broadcast every 20 s. The second terminal device responds to the first broadcast for the first time at the 1 st s and sends out a second broadcast; the second terminal device transmitting a second broadcast in response to the first broadcast for the first time at 21 s; the second terminal device transmits a second broadcast in response to the first broadcast for the first time at 41 s. The second broadcast is a follow-up broadcast.
After the first terminal device sends out the first broadcast for the second time, the second terminal device responds to the first broadcast for the second time, and sends out the second broadcast once every 20s interval, wherein the second broadcast is BLE broadcast. The second terminal device responds to the second first broadcast at 31s and sends out a second broadcast; the second terminal device transmitting a second broadcast in response to the second first broadcast at 51 s; the second terminal device transmits a second broadcast in response to the second first broadcast at 71 s.
And, the first terminal device waits 10 seconds after the 30 th s, the second time of transmitting the first broadcast, at which time it reaches 40 th s. Then, the first terminal device detects whether or not the second broadcast of the second terminal device is received within the past 21 s. If the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21S, the first terminal device performs the above steps S508 to S511.
After the first terminal device sends out the first broadcast for the third time at 60s, the second terminal device responds to the first broadcast for the third time, and sends out a second broadcast which is a BLE broadcast every 20 s. The second terminal device responds to the third first broadcast at 61s to send out a second broadcast; the second terminal device responds to the third first broadcast at 81s to send out a second broadcast; the second terminal device transmits a second broadcast in response to the third first broadcast at 101 s.
And, the first terminal device waits for 10 seconds after the 60 th s, the third time of transmitting the first broadcast, at which time it reaches the 70 th s. Then, the first terminal device detects whether or not the second broadcast of the second terminal device is received within the past 21 s. If the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21S, the first terminal device performs the above steps S508 to S511.
In one example, after step S506, an ad hoc network is obtained, where the ad hoc network includes a plurality of terminal devices. The first terminal equipment is an edge node in the ad hoc network, and the second terminal equipment is an edge node in the ad hoc network; an ad hoc network has a device as a central node.
The central node actively transmits active broadcast once every 30 seconds, and the active broadcast is BLE broadcast.
After the first terminal device receives the active broadcast, the first terminal device transmits the following broadcast every 20 seconds; that is, the first terminal device transmits a first broadcast, which is a BLE broadcast, every 20 seconds after receiving the active broadcast. And the first terminal device may also receive the following broadcast of other edge nodes in the ad hoc network.
The second terminal device transmits a following broadcast every 20 seconds after receiving the active broadcast; that is, the second terminal device transmits a second broadcast, which is a BLE broadcast, every 20 seconds after receiving the active broadcast. And the first terminal device may also receive the following broadcast of other edge nodes in the ad hoc network.
Then, the first terminal device waits for 10 seconds after each first broadcast (first broadcast other than the first time), at which time point t2 is reached. The first terminal device then detects whether a following broadcast of each other edge node is received within the past 21 seconds, so that the first terminal device detects whether a second broadcast of the second terminal device is received within the past 21 seconds.
In case 1, if the first terminal device determines that the second broadcast of the second terminal device is received, the first terminal device continues to execute the process of sending the first broadcast every 20 seconds.
And 2, if the first terminal equipment determines that the second broadcast of the second terminal equipment is not received, the second terminal equipment is not started to be off line.
It is possible that the second terminal device does not deliver the second broadcast or that the first terminal device does not receive the second broadcast of the second terminal device due to network reasons. However, if the second terminal device is in the near field and the first terminal device drops off the line, the second terminal device is misplaced, so that the service and the opposite terminal device cannot be used as the service.
First, a first terminal device initiates BR connection to a second terminal device.
The specific procedure of "BR connection" is as follows. Since the first terminal device can take the BR address of the second terminal device of the counterpart from the interface after the previous procedure of the device authentication process. If the first terminal equipment determines that the second broadcast of the second terminal equipment is not received, a physical link is established between the first terminal equipment and the second terminal equipment according to the BR address of the second terminal equipment. The establishment of a physical link is completed between the bottom layer of the first terminal equipment and the bottom layer of the second terminal equipment; if the physical link can be established, confirming that the second terminal equipment of the opposite terminal is in the near field.
After the physical link is successfully established, a callback process is performed, and the establishment of the physical link is completed between the bottom layer of the first terminal device and the bottom layer of the second terminal device, so that a success instruction can be interacted inside the first terminal device, and a success instruction can be interacted inside the second terminal device; and further the BR connection is successful. Wherein the success instruction characterizes the BR connection success between the first terminal device and the second terminal device.
Then, after the BR connection is successful, the first terminal device records the time when the BR connection is successful as a second time t3. The first terminal device determines a first time t4, the first time t4 being 8 seconds after the time at which the first terminal device initiates the BR connection. The first terminal device calculates a time difference w=t4-t 3 between the first time instant t4 and the second time instant t3.
If the first terminal equipment determines that the time difference W is smaller than or equal to the first preset threshold value, the second terminal equipment is determined to be in the near field, and the second terminal equipment cannot be misplaced. The first preset threshold may take 29 seconds.
If the first terminal equipment determines that the time difference W is larger than the first preset threshold value, unicast timeout is determined, unicast confirmation fails, and the second terminal equipment is not in the near field under the high probability. Thereby, the first terminal device kicks off the second terminal device; because the equipment list maintained by the first terminal equipment comprises equipment belonging to the same self-organizing network with the first terminal equipment, the first terminal equipment deletes the second terminal equipment which is off line from the equipment list of the first terminal equipment. The first terminal device no longer displays the second terminal device that is offline in the first interface.
The process of BR unicast acknowledgement provided by the application refers to the following complete process: the first terminal device determines that the second broadcast of the second terminal device is not received within a first time period (21 seconds); establishing BR connection; based on the time difference, it is determined whether to kick the second terminal device off line.
For example, fig. 15 shows a second time axis based on each broadcast according to an embodiment of the present application, as shown in fig. 15, the coordinates of the axes of fig. 15 are time (in seconds s). The first terminal equipment is an edge node, and the second terminal equipment is an edge node; an ad hoc network has a device as a central node.
The central node transmits an active broadcast, which is a BLE broadcast, every 30 s. The central node sends out active broadcast for the first time at the 0 s; the central node sends out active broadcast for the second time at 30 s; the central node sends out active broadcast for the third time at 60 s; the center node sends out an active broadcast the fourth time at 90 s. The active broadcast is an active broadcast.
After the central node sends the active broadcast for the first time, the first terminal device responds to the active broadcast for the first time and sends the first broadcast once every 20 seconds, and the first broadcast is the BLE broadcast. The first terminal equipment responds to the first active broadcast at the 1 st s and sends out a first broadcast; the first terminal device responds to the first active broadcast at 21s to send out a first broadcast; the first terminal device transmits a first broadcast in response to the first active broadcast at 41 s. The first broadcast is a follow-up broadcast.
And, after the central node transmits the active broadcast for the first time at the 0s, the second terminal device responds to the active broadcast for the first time, and transmits a second broadcast, which is a BLE broadcast, every 20 s. The second terminal equipment responds to the first active broadcast at the 1 st s and sends out a second broadcast; the second terminal device responds to the first active broadcast at 21s and sends out a second broadcast; the second terminal device transmits a second broadcast in response to the first active broadcast at 41 s. The second broadcast is a follow-up broadcast.
After the central node sends out the active broadcast for the second time, the first terminal device responds to the active broadcast for the second time and sends out a first broadcast, which is a BLE broadcast, every 20 s. The first terminal equipment responds to the second active broadcast at 31s and sends out a first broadcast; the first terminal device responds to the second active broadcast at 51s to send out a first broadcast; the first terminal device transmits a first broadcast in response to the second active broadcast at 71 s. The first broadcast is a follow-up broadcast.
And, after the central node transmits the active broadcast for the second time, the second terminal device transmits the second broadcast once every 20s interval in response to the active broadcast for the second time, and the first broadcast is a BLE broadcast. The second terminal device responds to the second active broadcast at 31s to send out a second broadcast; the second terminal device responds to the second active broadcast at 51s to send out a second broadcast; the second terminal device transmits a second broadcast in response to the second active broadcast at 71 s. The first broadcast is a follow-up broadcast.
After the central node sends out the active broadcast for the third time at 60s, the first terminal device responds to the active broadcast for the third time and sends out a first broadcast, which is a BLE broadcast, every 20 s. The first terminal device responds to the third active broadcast at 61s to send out a first broadcast; the first terminal device responds to the third active broadcast at 81s to send out a first broadcast; the first terminal device transmits a first broadcast in response to the third active broadcast at 101 s. The first broadcast is a follow-up broadcast.
And, after the center node transmits the active broadcast for the third time at 60s, the second terminal device transmits a second broadcast once every 20s interval in response to the active broadcast for the third time, and the first broadcast is a BLE broadcast. The second terminal device responds to the third active broadcast at 61s to send out a second broadcast; the second terminal device responds to the third active broadcast at 81s to send out a second broadcast; the second terminal device transmits a second broadcast in response to the third active broadcast at 101 s. The first broadcast is a follow-up broadcast.
And, the first terminal device waits for 10 seconds after the 21 st s, the second transmission of the first broadcast, at which time it reaches 31 st s. Then, the first terminal device detects whether or not the second broadcast of the second terminal device is received within the past 21 s. If the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21S, the first terminal device performs the above steps S508 to S511.
Then, the first terminal device waits for 10 seconds after the first broadcast is transmitted at 31s, at which point 41s is reached. Then, the first terminal device detects whether or not the second broadcast of the second terminal device is received within the past 21 s. If the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21S, the first terminal device performs the above steps S508 to S511.
Then, the first terminal device waits 10 seconds after issuing the first broadcast at 51s, at which point it reaches 61s. Then, the first terminal device detects whether or not the second broadcast of the second terminal device is received within the past 21 s. If the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21S, the first terminal device performs the above steps S508 to S511.
And so on. The first terminal device detects each time after the first broadcast is sent out (the first broadcast is not sent out for the first time).
Fig. 16 is a signaling diagram four of an ad hoc network-based device processing method according to an embodiment of the present application, where, as shown in fig. 16, a first discovery module, a first device information update module, and a first authentication module are arranged in a first terminal device; and, the first terminal device may display the first interface. A second discovery module, a second equipment information updating module and a second authentication module are arranged in the second terminal equipment; and, the second terminal device may display the second interface.
S1601a, the first interface of the first terminal device may trigger a first discovery module of the first terminal device to start.
S1601b, the second interface of the second terminal device may trigger a second discovery module of the second terminal device to start.
S1602a, a first discovery module of the first terminal device sends a third broadcast to a second authentication module of the second terminal device. The third broadcast is a BLE broadcast.
S1602b, the second discovery module of the second terminal device sends a fourth broadcast to the first authentication module of the first terminal device. The fourth broadcast is a BLE broadcast.
S1603a, a first authentication module of the first terminal device performs a device authentication process.
S1603b, a second authentication module of the second terminal device performs a device authentication process.
S1604a, a first authentication module of the first terminal device informs the first interface that the second terminal device is online.
S1604b, a second authentication module of the second terminal device informs the second interface that the first terminal device is online.
S1605a, triggering a first equipment information updating module of the first terminal equipment by a first authentication module of the first terminal equipment, and updating equipment information.
S1605b, triggering a second equipment information updating module of the second terminal equipment by a second authentication module of the second terminal equipment, and updating equipment information.
S1606a, a first device information update module of the first terminal device calculates a device score of the first terminal device.
S1606b, a second device information updating module of the second terminal device calculates a device score of the second terminal device.
S1607a, a first device information updating module of the first terminal device sends the device score of the first terminal device to a first discovery module of the first terminal device.
And the first discovery module of the first terminal equipment transmits the equipment score of the first terminal equipment to the second terminal equipment through BLE broadcast.
S1607b, a second device information updating module of the second terminal device sends the device score of the second terminal device to a second self-discovery module of the second terminal device.
And the second discovery module of the second terminal device transmits the device score of the second terminal device to the first terminal device through BLE broadcast.
S1608a, a first self-discovery module of the first terminal equipment selects a central node according to the scores of the equipment.
S1608b, a second self-discovery module of the second terminal equipment selects a central node according to the scores of the equipment.
S1609, the first terminal equipment is a central node; the second terminal device is an edge node. The first terminal device transmits a first broadcast. The first broadcast is a BLE broadcast.
S1610, the second terminal device responds to the first broadcast and issues a second broadcast. The second broadcast is a BLE broadcast.
S1611, the first terminal device waits for 10 seconds after the first broadcast again.
S1612, the first terminal device determines whether the second broadcast of the second terminal device is received within the past 21 seconds after waiting for 10 seconds.
S1613, the first terminal device determines that the second broadcast of the second terminal device is not received within the past 21 seconds, and establishes a BR connection with the second terminal device.
S1614, if the first terminal device determines that the connection based on the classical bluetooth protocol is successful, determining a time difference w=t4-t 3 between the first time and the second time.
S1615, if the first terminal device determines that the time difference W is less than or equal to 29 seconds, the second terminal device is determined not to be off line, and the first terminal device continues to maintain the device list of the first terminal device.
S1616a, if the first terminal device determines that the time difference W is greater than 29 seconds, it determines to delete the second terminal device in the first interface.
S1616b, if the first terminal device determines that the time difference W is greater than 29 seconds, the first terminal device notifies the second terminal device, and the second terminal device determines to delete the first terminal device in the second interface.
Then, the first terminal device waits for 10 seconds after the first broadcast again. Steps S1611-S1616b are performed again.
In this embodiment, the first terminal device responds to the start instruction and sends out a third broadcast; the third broadcast is a BLE broadcast. The second terminal device sends out a fourth broadcast; the fourth broadcast is a BLE broadcast. And then performing device authentication processing between the first terminal device and the second terminal device. And finishing the process of equipment authentication processing between the first terminal equipment and the second terminal equipment. The first terminal equipment acquires the equipment score of the first terminal equipment and the equipment score of each second terminal equipment; wherein the device score is related to the operational status of the second terminal device. The first terminal equipment selects a central node based on the equipment score of the first terminal equipment and the equipment score of each second terminal equipment; thereby, an ad hoc network is built, the ad hoc network comprises a plurality of terminal devices, and the ad hoc network comprises a central node and at least one edge node. After the first terminal device transmits the first broadcast (the first broadcast not for the first time), the first terminal device detects whether the second broadcast of the second terminal device is received within the past first time period after waiting for the second time period; if the heartbeat time-out is not received, the heartbeat time-out between the devices is determined, but the scheme does not kick off the second terminal device, and the BR connection is established between the first terminal device and the second terminal device.
Then, if it is determined that the BR connection is successful, it is determined that the second terminal device is likely to be in the near field. At this time, a procedure of unicast acknowledgement is added once. The first terminal equipment determines the moment when the BR connection is successful as a second moment; the first terminal device determines an initial time when the BR connection is established, and then takes a time after the initial time as a first time. Then, the first terminal device determines a time difference between the first time and the second time, and obtains the time difference. If the first terminal equipment determines that the time difference is smaller than or equal to a first preset threshold value, determining that the second terminal equipment is in the near field, and not taking off the second terminal equipment; the first terminal device determines to continue maintaining a list of devices in the first terminal device.
Therefore, the BR connection is successful, the opposite terminal equipment is determined to be in the near field, and the opposite terminal equipment is not taken off line. Then after the BR connection is successful, calculating the establishment and the success time of the BR connection to obtain a time difference; based on the time difference, it is finally determined whether the opposite device is kicked off. Therefore, the equipment is prevented from being misplaced, the connection reliability between the equipment in the ad hoc network in the super terminal scene is improved, and the reliability of the ad hoc network is improved; the normal operation of the service between the devices in the ad hoc network is ensured.
The method for sorting the list of the devices in the embodiment of the present application has been described above, and the device for executing the method for sorting the list provided in the embodiment of the present application is described below. It will be appreciated by those skilled in the art that the methods and apparatus may be combined and referred to, and that the related apparatus provided by the embodiments of the present application may perform the steps in the methods for ordering lists described above.
The embodiment of the application can divide the functional modules of the device of the method according to the method example, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Fig. 17 is a schematic structural diagram of a chip according to an embodiment of the present application. Chip 1700 includes one or more (including two) processors 1701, communication lines 1702, communication interfaces 1703, and memory 1704.
In some implementations, the memory 1704 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
The methods described above for embodiments of the present application may be applied to the processor 1701 or implemented by the processor 1701. The processor 1701 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the method performed by the terminal device may be implemented by an integrated logic circuit of hardware in the processor 1701 or instructions in the form of software. The processor 1701 may be a general-purpose processor (e.g., a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gates, transistor logic, or discrete hardware components, and the processor 1701 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the application.
The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the field, such as a random access memory, a read-only memory, a programmable read-only memory, or a charged erasable programmable memory (electrically erasa bluetooth low energy program low energy bluetooth read only memory, EEPROM). Which is located in a memory 1704 and a processor 1701 reads information from the memory 1704 and, in combination with its hardware, performs the steps of the method described above.
Communication between the processor 1701, the memory 1704 and the communication interface 1703 may be performed through a communication line 1702.
Fig. 18 is a schematic structural diagram of a terminal device according to an embodiment of the present application, and as shown in fig. 18, a terminal device 1800 includes the above-mentioned chip and a display unit. The display unit is provided with an integrated circuit panel which is used for sending out periodic interrupt events. Wherein the integrated circuit panel removes the integrated circuit unit for calculating the coordinate information corresponding to the touch operation. The terminal equipment is the first terminal equipment or the second terminal equipment.
The device processing method based on the ad hoc network provided by the embodiment of the application can be applied to the electronic device with the communication function. The electronic device includes a terminal device, and specific device forms and the like of the terminal device may refer to the above related descriptions, which are not repeated herein.
The embodiment of the application provides a terminal device, which comprises: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to cause the terminal device to perform the method described above. The terminal equipment is the first terminal equipment or the second terminal equipment.
The embodiment of the application provides a chip. The chip comprises a processor for invoking a computer program in a memory to perform the technical solutions in the above embodiments. The principle and technical effects of the present application are similar to those of the above-described related embodiments, and will not be described in detail herein.
The embodiment of the application also provides a computer readable storage medium. The computer-readable storage medium stores a computer program. The computer program realizes the above method when being executed by a processor. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
In one possible implementation, the computer readable medium may include RAM, ROM, compact disk-read only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium targeted for carrying or storing the desired program code in the form of instructions or data structures and accessible by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (Digital Subscriber Line, DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes optical disc, laser disc, optical disc, digital versatile disc (Digital Versatile Disc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Embodiments of the present application provide a computer program product comprising a computer program which, when executed, causes a computer to perform the above-described method.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing detailed description of the application has been presented for purposes of illustration and description, and it should be understood that the foregoing is by way of illustration and description only, and is not intended to limit the scope of the application.

Claims (20)

1. An apparatus processing method based on ad hoc network, wherein the method is applied to a first terminal apparatus, and the method comprises:
if it is determined that the second broadcast of the second terminal device is not received within the first time period after the first broadcast is sent out, establishing a connection based on a classical Bluetooth protocol with the second terminal device; the second terminal equipment is equipment belonging to the same ad hoc network with the first terminal equipment, and the ad hoc network comprises at least one terminal equipment; the first broadcast is a broadcast based on a low-power Bluetooth protocol, and the second broadcast is a broadcast based on a low-power Bluetooth protocol; the second broadcast is sent by responding to a broadcast based on a low-power Bluetooth protocol sent by a central node in the ad hoc network; the first time length comprises a time period before a sending time and a time period after the sending time, and the sending time is the time when the first broadcast is sent out;
if the connection based on the classical Bluetooth protocol is determined to be successful, determining a time difference between the first moment and the second moment; wherein the first time is a time after an initial time when the connection based on the classical Bluetooth protocol is established, and the second time is a time when the connection based on the classical Bluetooth protocol is successful;
If the time difference is determined to be in accordance with the preset condition, determining to continuously maintain a pre-stored equipment list; the pre-stored equipment list comprises equipment belonging to the same ad hoc network with the first terminal equipment.
2. The method of claim 1, wherein establishing a classical bluetooth protocol-based connection with the second terminal device if it is determined that a second broadcast of the second terminal device is not received within a first time period after the first broadcast is transmitted, comprises:
waiting a second period of time after the first broadcast is sent out;
after the second duration, if it is determined that the second broadcast of the second terminal device is not received within the first duration, establishing a connection based on a classical Bluetooth protocol with the second terminal device; wherein the first duration is a preset period of time before a last moment in the second duration.
3. The method of claim 2, wherein the second duration is 10 seconds; the first duration is 21 seconds.
4. A method according to any of claims 1-3, characterized in that establishing a classical bluetooth protocol based connection with the second terminal device comprises:
Acquiring an address of the second terminal equipment based on a classical Bluetooth protocol; establishing a physical link between the address based on the classical Bluetooth protocol and the second terminal equipment;
if the physical link is established successfully, a success instruction is fetched from the first terminal equipment; wherein the success instruction characterizes success of connection with the second terminal device based on classical Bluetooth protocol.
5. The method according to any one of claims 1-4, wherein determining to continue maintaining the pre-stored list of devices if it is determined that the time difference meets a preset condition comprises:
if the time difference is smaller than or equal to a first preset threshold value, the pre-stored equipment list is determined to be maintained continuously.
6. The method according to claim 5, further comprising:
if the time difference is determined to be larger than the first preset threshold value, deleting the second terminal equipment from the pre-stored equipment list; and determining to delete the second terminal device in a first interface, wherein the first interface is used for displaying devices in the pre-stored device list.
7. The method according to claim 5 or 6, characterized in that the difference between the first moment and the initial moment is 8 seconds; the first preset threshold is 29 seconds.
8. The method according to any of claims 1-7, wherein the second broadcast is sent in response to the first broadcast if the first terminal device is a central node in the ad hoc network;
if the first terminal device is an edge node in the ad hoc network, the second broadcast is sent in response to a bluetooth low energy broadcast of a central node in the ad hoc network.
9. The method according to any of claims 1-7, wherein if the first terminal device is a central node in the ad hoc network, the transmission period of the first broadcast is 30 seconds and the transmission period of the second broadcast is 20 seconds;
if the first terminal device is an edge node in the ad hoc network, the transmission period of the first broadcast is 20 seconds, and the transmission period of the second broadcast is 30 seconds.
10. The method according to any one of claims 1-9, further comprising:
in response to the turn-on instruction, issuing a third broadcast; wherein, the opening instruction characterizes the function of opening the super terminal of the first terminal equipment; the third broadcast is a broadcast based on a bluetooth low energy protocol; and receiving a fourth broadcast sent by the second terminal device; wherein the fourth broadcast is a broadcast based on a bluetooth low energy protocol;
Performing equipment authentication processing with the second terminal equipment;
determining the equipment score of the first terminal equipment, and receiving the equipment score of the second terminal equipment sent by the second terminal equipment; wherein the device score of the first terminal device is related to the operational status of the first terminal device; the equipment score of the second terminal equipment is related to the running state of the second terminal equipment;
and determining a center node and an edge node in the ad hoc network according to the equipment score of the first terminal equipment and the equipment score of the second terminal equipment.
11. The method of claim 10, wherein performing a device authentication process with the second terminal device comprises:
establishing a bare channel based on the fourth broadcast;
sending first encryption information to the second terminal equipment through the bare channel; receiving second encryption information sent by second terminal equipment through the bare channel; the first encryption information is encrypted equipment information of the first terminal equipment, and the second encryption information is encrypted equipment information of the second terminal equipment;
Establishing an encryption channel according to the first encryption information and the second encryption information;
sending a first handshake packet to the second terminal equipment through the encryption channel; and receiving a second handshake packet sent by the second terminal equipment through the encryption channel to finish equipment authentication.
12. The method according to claim 11, further comprising, after performing a device authentication process with the second terminal device:
displaying the equipment information of the second terminal equipment in a first interface; the first interface is used for displaying the devices in the pre-stored device list.
13. The method according to any of claims 10-12, wherein determining the device score of the first terminal device comprises:
acquiring state information of the first terminal equipment; the state information of the first terminal equipment comprises at least one state parameter, and the state parameter of the first terminal equipment represents the current state of the first terminal equipment;
and determining the equipment score of the first terminal equipment according to the state parameters in the state information of the first terminal equipment and the preset weights corresponding to the state parameters.
14. The method according to claim 13, wherein the status information of the first terminal device includes one or more of the following status parameters: charging parameters, screen locking parameters, first network discovery parameters, second network discovery parameters and battery power parameters;
the charging parameter characterizes whether the terminal equipment is charged or not, the screen locking parameter characterizes whether the terminal equipment is screen locked or not, the first network discovery parameter characterizes whether the terminal equipment supports CoAp discovery or not, the second network discovery parameter characterizes whether the terminal equipment supports low-power Bluetooth discovery or not, and the battery power parameter characterizes whether the current battery residual capacity of the terminal equipment is larger than or equal to a second preset threshold value or not;
the preset weight corresponding to the charging parameter is greater than the preset weight corresponding to the screen locking parameter, the preset weight corresponding to the screen locking parameter is greater than the preset weight corresponding to the first network discovery parameter, the preset weight corresponding to the first network discovery parameter is greater than the preset weight corresponding to the second network discovery parameter, and the preset weight corresponding to the second network discovery parameter is greater than the preset weight corresponding to the battery power parameter.
15. The method according to claim 14, wherein the device Score of the first terminal device is Score = isCharing 16+isunlock 8+iscoappsupport 4+iscblesupport 2+highbattery 1;
wherein isCharing is a charging parameter of the first terminal device, isUnlock is a screen locking parameter of the first terminal device, iscoappsup is a first network discovery parameter of the first terminal device, isceappsup is a second network discovery parameter of the first terminal device, and highBattery is a battery power parameter of the first terminal device.
16. The method of any of claims 10-15, further comprising, after responding to the on command:
if the Bluetooth function of the first terminal equipment is not started, generating and displaying first prompt information; the first prompt information characterizes whether a user starts a Bluetooth function or not; responding to a first confirmation instruction of a user, and starting the Bluetooth function of the first terminal equipment; the first confirmation instruction is used for indicating to start the Bluetooth function of the first terminal equipment;
if the wireless local area network function of the first terminal equipment is not started, generating and displaying second prompt information; the second prompt information characterizes whether the user starts the wireless local area network function or not; responding to a second confirmation instruction of the user, and starting the Bluetooth function of the first terminal equipment; the second confirmation instruction is used for indicating to start the wireless local area network function of the first terminal equipment.
17. The method according to any of claims 10-16, wherein determining a center node and an edge node in the ad hoc network based on the device score of the first terminal device and the device score of the second terminal device comprises:
determining terminal equipment with equipment score belonging to a preset score range as a central node of the ad hoc network; the rest terminal equipment is the edge node of the ad hoc network.
18. A terminal device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory to cause the terminal device to perform the method of any one of claims 1-17.
19. A computer readable storage medium storing a computer program, which when executed by a processor performs the method of any one of claims 1-17.
20. A computer program product comprising a computer program which, when run, causes a computer to perform the method of any of claims 1-17.
CN202310091011.4A 2023-01-20 2023-01-20 Ad hoc network-based device processing method, device and storage medium Active CN117156597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310091011.4A CN117156597B (en) 2023-01-20 2023-01-20 Ad hoc network-based device processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310091011.4A CN117156597B (en) 2023-01-20 2023-01-20 Ad hoc network-based device processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN117156597A true CN117156597A (en) 2023-12-01
CN117156597B CN117156597B (en) 2024-05-07

Family

ID=88908777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310091011.4A Active CN117156597B (en) 2023-01-20 2023-01-20 Ad hoc network-based device processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117156597B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106131826A (en) * 2016-07-11 2016-11-16 华东师范大学 A kind of Intelligent household network control system by self-organizing network wireless telecommunications
CN108476060A (en) * 2016-06-27 2018-08-31 华为技术有限公司 Method and bimodulus bluetooth equipment for establishing classical bluetooth connection between bimodulus bluetooth equipment
WO2019237263A1 (en) * 2018-06-13 2019-12-19 卧槽科技(深圳)有限公司 Low-energy bluetooth network maintenance method, electronic device, bluetooth network, and medium
CN111885562A (en) * 2020-07-01 2020-11-03 精伦电子股份有限公司 Bluetooth networking method and system
CN115150801A (en) * 2022-09-05 2022-10-04 北京联盛德微电子有限责任公司 Inter-node communication method and system based on Bluetooth Mesh network
CN115250544A (en) * 2021-04-28 2022-10-28 华为技术有限公司 Equipment networking method, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108476060A (en) * 2016-06-27 2018-08-31 华为技术有限公司 Method and bimodulus bluetooth equipment for establishing classical bluetooth connection between bimodulus bluetooth equipment
CN106131826A (en) * 2016-07-11 2016-11-16 华东师范大学 A kind of Intelligent household network control system by self-organizing network wireless telecommunications
WO2019237263A1 (en) * 2018-06-13 2019-12-19 卧槽科技(深圳)有限公司 Low-energy bluetooth network maintenance method, electronic device, bluetooth network, and medium
CN111885562A (en) * 2020-07-01 2020-11-03 精伦电子股份有限公司 Bluetooth networking method and system
CN115250544A (en) * 2021-04-28 2022-10-28 华为技术有限公司 Equipment networking method, electronic equipment and storage medium
CN115150801A (en) * 2022-09-05 2022-10-04 北京联盛德微电子有限责任公司 Inter-node communication method and system based on Bluetooth Mesh network

Also Published As

Publication number Publication date
CN117156597B (en) 2024-05-07

Similar Documents

Publication Publication Date Title
US10880824B2 (en) Method of transmitting proximity service data and electronic device for the same
KR102577358B1 (en) Method and apparatus for communicating using multi frequency bands
KR102490415B1 (en) Electronic device and method for power saving in the electronic device
WO2020233538A1 (en) Method for accessing wireless local area network and terminal
CN110505572B (en) Indoor positioning method and electronic equipment
KR102444897B1 (en) Device and method for establishing communication connection
CN114257960B (en) Bluetooth connection method and device
US20240073978A1 (en) Method for monitoring link and terminal device
EP4199562A1 (en) Method for transmitting data and electronic device
WO2021197071A1 (en) Wireless communication system and method
CN114615660A (en) Access method, system and electronic equipment
CN116033342B (en) Geofence processing method, equipment and storage medium
CN117156597B (en) Ad hoc network-based device processing method, device and storage medium
CN115348630B (en) Multi-device cooperation method and related device
CN116055505B (en) Message synchronization method and terminal equipment
WO2023142993A1 (en) Detection method, related electronic device and system
WO2023274026A1 (en) Interaction method and apparatus for electronic device
CN116567054A (en) Detection method, related electronic equipment and system
CN118101637A (en) Equipment cooperation method and electronic equipment
CN117769023A (en) Carrier selection method, device and readable storage medium
CN116708533A (en) Connection switching method, server stopping method, terminal equipment and server
CN117666854A (en) Method for sharing input device and electronic device
CN116939551A (en) Near field communication method, device and terminal
CN118075393A (en) Display method and electronic equipment
CN117768572A (en) Notification message processing system, method and device

Legal Events

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