Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the description of "first", "second", etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," and the like in various places are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
An ad hoc network is a network combining mobile communication and a computer network, wherein the information exchange of the network adopts a packet switching mechanism in the computer network, and each device in the ad hoc network has two functions of a router and a host. The device needs to run various application programs facing users, such as editors, browsers and the like, as a host, and the device needs to run corresponding routing protocols as a router, and completes the forwarding and routing maintenance work of the data packets according to the routing strategy and the routing table. At present, two-by-two authentication is needed between devices of an ad hoc network, for example, as shown in fig. 1, when a device a, a device B and a device C perform ad hoc network, the authentication is needed between the device a and the device B, between the device a and the device C, and between the device B and the device C, the authentication process is repeated and complicated, which inevitably occupies more resources such as a network and is time-consuming, and the efficiency of the ad hoc network is low.
In order to solve the problems, the embodiment of the application provides a multi-device ad hoc network method, a device, equipment and a storage medium, wherein the method comprises the steps that a first device respectively authenticates with a plurality of second devices, a data path is established between the first device and each second device after authentication is successful, equipment information of each second device is obtained based on the data path, each second device obtains equipment information of other second devices from the first device, mutual communication among the second devices is completed, and the first device and each second device conduct ad hoc network, so that the multi-device ad hoc network efficiency is improved.
Referring to fig. 2, fig. 2 is a flow chart of a multi-device ad hoc network method provided in an embodiment of the present application, where the method may be applied to a device, and the device may be any one of a mobile phone, a camera, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (augmentedreality, AR)/a virtual reality (virtualreality, VR) device, a notebook computer, a Personal Computer (PC), a netbook, a Personal Digital Assistant (PDA), and the embodiment of the present application is not limited in any way.
As shown in fig. 2, the multi-device ad hoc network method provided in the embodiment of the present application includes steps S101 to S103.
S101, the first equipment respectively authenticates with a plurality of second equipment, and after authentication is successful, the first equipment establishes a data path with each second equipment.
The first device and the second device are communication devices to be networked, such as a mobile phone, a camera, a tablet computer, a helmet, and the like.
In some embodiments, the first device performs authentication with a plurality of second devices, and before the first device establishes a data path with each of the second devices after the authentication is successful, the method includes:
One communication device is selected from a plurality of communication devices to be determined as the first device, and the other communication devices are determined as the second device.
By way of example, a certain communication device may be selected from the individual communication devices by arbitration, and determined as a first device, and the remaining other communication devices determined as second devices.
In another embodiment, the first device may be determined according to the first device setting information input by the user through the interactive operation of the user, and the other communication devices are determined as the second devices. For example, a first device setting interface is displayed, the user inputs first device setting information through the first device setting interface, and the first device is determined according to the first device setting information input by the user. For another example, a first device setup voice request is output, the user inputs first device setup voice reply information according to the first device setup voice request, and the first device is determined according to the first device setup voice reply information.
The first device authenticates with each second device separately. The first device sends a negotiation command to each second device, and the second device returns a negotiation response command to the first device after receiving the negotiation command. After receiving the negotiation response command, the first device sends a request authentication command to the second device, after receiving the request authentication command, the second device returns the request authentication response command to the first device, after receiving the request authentication response command, the first device inputs pin (PersonalIdentificationNumber) codes and performs pin code authentication, after passing the authentication, the second device sends an end authentication command to the second device, and after receiving the end authentication command, the second device ends the authentication state. After the first device completes authentication with each second device, the first device establishes a data path with each second device.
S102, acquiring device information of each second device based on the first device of the data path.
After the first device establishes a data path with each second device, the first device obtains device information of the corresponding second device based on each data path. Wherein the device information includes, but is not limited to, a device type, a device version, a device ID, authentication information, and the like, and the authentication information includes, but is not limited to, key information.
S103, each second device obtains the device information of other second devices from the first device so as to complete mutual trust among the second devices, and the first device and the second devices conduct self-networking.
Since the first device obtains the device information of each second device, each second device can obtain the device information of the other respective second devices based on the data path with the first device. And each second device completes mutual trust among the second devices based on the device information according to the obtained device information of other second devices, and the first device and each second device perform ad hoc network.
For example, as shown in fig. 3, when the device a, the device B, and the device C perform ad hoc networking, the device a is used as a first device, the device B and the device C are used as a second device, the device a and the device B perform authentication, the device a and the device C perform authentication, the device a obtains device information of the device B and the device C, then the device B obtains device information of the device C from the device a, the device C obtains device information of the device B from the device a, that is, the device B and the device C obtain device information of each other, mutual trust between the device B and the device C is completed based on the device information, and the device a, the device B, and the device C perform ad hoc networking.
In some embodiments, each of the second devices obtains the device information of the other second devices from the first device to complete mutual trust between the respective second devices, including:
The method comprises the steps that first equipment to be networked obtains equipment information of second equipment to be networked from the first equipment, and the second equipment to be networked is added to a trust list of the first equipment to be networked; the second device to be networked obtains device information of the first device to be networked from the first device, and adds the first device to be networked to a trust list of the second device to be networked;
The first equipment to be networked and the second equipment to be networked are any two pieces of equipment in the second equipment.
For example, taking the device a, the device B and the device C shown in fig. 3 as an example, the device B obtains the device information of the device C from the device a and adds the device C to the trust list of the device B, the device C obtains the device information of the device B from the device a and adds the device B to the trust list of the device C, and at this time, mutual trust is completed between the device B and the device C, so that the ad hoc network of the device a, the device B and the device C can be completed, and authentication operations between the device B and the device C are reduced.
As another example, as shown in fig. 4, when the device a, the device B, the device C, and the device D perform ad hoc network, the device a is used as a first device, the device B, the device C, and the device D are used as a second device, the device a authenticates the device B, the device a authenticates the device C, and the device a authenticates the device D, the device a obtains device information of the device B, the device C, and the device D, and then the device B obtains device information of the device C, and the device D from the device a, the device C obtains device information of the device B, and the device D from the device a, and the device D performs ad hoc network based on the device information to complete the mutual trust of the device B and the device C, the mutual trust of the device B and the device D, and the mutual trust of the device C and the device D. The authentication between the equipment B and the equipment C is reduced, and the authentication between the equipment B and the equipment D, the authentication between the equipment C and the equipment D and the like are performed for a plurality of times.
In some embodiments, the first device to be networked obtains the device information of a second device to be networked from the first device, and adding the second device to be networked to a trust list of the first device to be networked includes:
The first equipment to be networked obtains equipment information of the second equipment to be networked from the first equipment, and verification information is obtained according to the equipment information of the second equipment to be networked;
The first equipment to be networked sends the verification information to the second equipment to be networked, the second equipment to be networked verifies the verification information, and if verification is correct, correct information is returned;
and the first equipment to be networked adds the second equipment to be networked to a trust list of the first equipment to be networked based on the correct information.
For example, taking the device a, the device B, and the device C shown in fig. 3 as an example, the device B obtains the device information of the device C from the device a, then obtains the verification information, such as the key, according to the device information of the device C through analysis processing, the device B sends the verification information to the device C, the device C verifies the received verification information, if the verification is correct, the device C returns correct information to the device B, and the device B adds the device C to the trust list of the device B after receiving the correct information returned by the device C. For example, after obtaining the key, the device B sends the key to the device C, the device C compares the received key with the local key to determine whether the key is consistent, if so, that is, the key is correct, the device C returns correct information to the device B, and after receiving the correct information returned by the device C, the device B adds the device C to the trust list of the device B.
In some embodiments, as shown in fig. 5, step S104 may be further included after step S102.
S104, the first equipment completes mutual trust among the second equipment according to the equipment information of the second equipment, and the first equipment and the second equipment conduct self-networking.
For example, still taking the ad hoc network of the device a, the device B and the device C as the first device, the device B and the device C as the second device, authenticating the device a and the device B, authenticating the device a and the device C, obtaining the device information of the device B and the device C by the device a, and then completing the mutual trust of the device B and the device C by the device a according to the device information of the device B and the device C, and performing the ad hoc network by the device a, the device B and the device C.
In some embodiments, the first device completes mutual trust between the second devices according to the device information of the second devices, including:
The first device obtains corresponding verification information according to the device information of each second device, sends the verification information to the corresponding second device, and the second device verifies the verification information, and returns correct information if the verification is correct;
And the first equipment completes mutual trust among the second equipment based on the correct information returned by the second equipment.
For example, still take the ad hoc network of the device a, the device B and the device C as the first device, the device B and the device C as the second device, the device a authenticates the device B, the device a authenticates the device a and the device C, the device a obtains the device information of the device B and the device C, then the device a analyzes and processes the device information according to the device information of the device B to obtain corresponding verification information, such as a key, sends the verification information to the device B, the device B verifies and validates the received verification information, if the verification and validation is correct, the device B returns correct information to the device a, and the device a records that the device B and the device C are mutually trusted after receiving the correct information returned by the device B. For example, the device a sends the key to the device B, the device B compares the received key with the local, and confirms whether the key is consistent, if so, that is, the device B returns correct information to the device a, the device a records that the device B and the device C are mutually trusted after receiving the correct information returned by the device B, and the device a, the device B and the device C perform ad hoc network, so that authentication operations between the device B and the device C are reduced.
Compared with the mode of carrying out authentication ad hoc network in pairs between multiple devices, the authentication times between the multiple devices are reduced, so that the resource consumption and the consumed time are reduced, and meanwhile, the reduction of the authentication times reduces the manual operation complexity of pin code verification and reduces the error probability.
In the above embodiment, the first device performs authentication with the plurality of second devices, after the authentication is successful, the first device establishes a data path with each second device, obtains device information of each second device based on the data path first device, and then each second device obtains device information of other second devices from the first device, so as to complete mutual trust between the second devices, and the first device and each second device perform ad hoc network, thereby reducing the times of authentication between the devices, and improving the efficiency of multi-device ad hoc network.
Referring to fig. 6, fig. 6 is a schematic block diagram of a multi-device ad hoc network device according to an embodiment of the present application.
As shown in fig. 6, the multi-device ad hoc network apparatus 200 may include a processor 211 and a memory 212, where the processor 211 and the memory 212 are connected through a bus, such as an I2C (Inter-INTEGRATED CIRCUIT) bus.
Specifically, the processor 211 may be a Micro-control unit (Micro-controllerUnit, MCU), a central processing unit (CentralProcessingUnit, CPU), or a digital signal processor (DIGITALSIGNAL PROCESSOR, DSP), etc.
Specifically, the Memory 212 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like. The memory 212 stores therein various computer programs for execution by the processor 211.
Wherein the processor 211 is configured to run a computer program stored in the memory processor 211 and to implement the following steps when the computer program is executed:
The method comprises the steps that a first device authenticates with a plurality of second devices respectively, and after authentication is successful, the first device establishes a data path with each second device;
acquiring device information of each second device based on the first device of the data path;
And each second device obtains the device information of other second devices from the first device so as to complete mutual trust among the second devices, and the first device and the second devices conduct ad hoc network.
In some embodiments, when implementing that each of the second devices obtains the device information of the other second devices from the first device to complete the mutual trust between the respective second devices, the processor 211 is configured to implement:
The method comprises the steps that first equipment to be networked obtains equipment information of second equipment to be networked from the first equipment, and the second equipment to be networked is added to a trust list of the first equipment to be networked; the second device to be networked obtains device information of the first device to be networked from the first device, and adds the first device to be networked to a trust list of the second device to be networked;
The first equipment to be networked and the second equipment to be networked are any two pieces of equipment in the second equipment.
In some embodiments, when implementing that the first device to be networked obtains the device information of a second device to be networked from the first device, the processor 211 is configured to, when adding the second device to be networked to a trust list of the first device to be networked:
The first equipment to be networked obtains equipment information of the second equipment to be networked from the first equipment, and verification information is obtained according to the equipment information of the second equipment to be networked;
The first equipment to be networked sends the verification information to the second equipment to be networked, the second equipment to be networked verifies the verification information, and if verification is correct, correct information is returned;
and the first equipment to be networked adds the second equipment to be networked to a trust list of the first equipment to be networked based on the correct information.
In some embodiments, the device information includes a device ID, the authentication information including a key.
In some embodiments, the processor 211 is configured to, after implementing the obtaining, by the first device based on the data path, device information of each of the second devices, implement:
and the first equipment completes mutual trust among the second equipment according to the equipment information of the second equipment, and the first equipment and the second equipment perform ad hoc network.
In some embodiments, when implementing that the first device completes mutual trust between the second devices according to the device information of the second devices, the processor 211 is configured to implement:
The first device obtains corresponding verification information according to the device information of each second device, sends the verification information to the corresponding second device, and the second device verifies the verification information, and returns correct information if the verification is correct;
And the first equipment completes mutual trust among the second equipment based on the correct information returned by the second equipment.
In some embodiments, the processor 211 is configured to, before implementing authentication between the first device and the plurality of second devices, respectively, and after the authentication is successful, establish a data path with each of the second devices, implement:
One communication device is selected from a plurality of communication devices to be determined as the first device, and the other communication devices are determined as the second device.
There is also provided in embodiments of the present application a device of the type including, but not limited to, a cell phone, a camera, a tablet, a wearable device, a vehicle-mounted device, an augmented reality (augmentedreality, AR)/virtual reality (virtualreality, VR) device, a notebook, a Personal Computer (PC), a netbook, a Personal Digital Assistant (PDA), etc., without any limitation in embodiments of the present application.
The device includes a multi-device ad hoc network apparatus, which may be the multi-device ad hoc network apparatus 200 described in the above embodiment, for example. The device may execute any multi-device ad hoc network method provided by the embodiment of the present application, so that the beneficial effects that any multi-device ad hoc network method provided by the embodiment of the present application can be achieved are detailed in the previous embodiments, and are not described herein.
The embodiment of the application also provides a storage medium, wherein the storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize the steps of the multi-device ad hoc network method provided by the embodiment. For example, the computer program is loaded by a processor, the following steps may be performed:
The method comprises the steps that a first device authenticates with a plurality of second devices respectively, and after authentication is successful, the first device establishes a data path with each second device;
acquiring device information of each second device based on the first device of the data path;
And each second device obtains the device information of other second devices from the first device so as to complete mutual trust among the second devices, and the first device and the second devices conduct ad hoc network.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The storage medium may be an internal storage unit of the multi-device ad hoc network apparatus or device of the foregoing embodiment, for example, a hard disk or a memory of the multi-device ad hoc network apparatus or device. The storage medium may also be an external storage device of the multi-device ad hoc network apparatus or device, such as a plug-in hard disk, a smart memory card (SMARTMEDIACARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASHCARD) or the like.
Because the computer program stored in the storage medium can execute any multi-device ad hoc network method provided by the embodiment of the present application, the beneficial effects that any multi-device ad hoc network method provided by the embodiment of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.