CN112804102B - Equipment binding method, device and terminal - Google Patents

Equipment binding method, device and terminal Download PDF

Info

Publication number
CN112804102B
CN112804102B CN202110037687.6A CN202110037687A CN112804102B CN 112804102 B CN112804102 B CN 112804102B CN 202110037687 A CN202110037687 A CN 202110037687A CN 112804102 B CN112804102 B CN 112804102B
Authority
CN
China
Prior art keywords
terminal
network port
port
data
binding
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.)
Active
Application number
CN202110037687.6A
Other languages
Chinese (zh)
Other versions
CN112804102A (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.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development 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 Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN202110037687.6A priority Critical patent/CN112804102B/en
Publication of CN112804102A publication Critical patent/CN112804102A/en
Application granted granted Critical
Publication of CN112804102B publication Critical patent/CN112804102B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • 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)
  • Computer And Data Communications (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the disclosure provides a device binding method, a device and a terminal, and the method, the device and the terminal determine a target network port in a local area network where a first terminal is currently located; broadcast data is sent through a local area network; receiving device binding data sent by a second terminal through a target network port, wherein the device binding data is used for requesting to bind a first terminal and the second terminal; and controlling the binding of the first terminal and the second terminal according to the device binding data. The target network port can be automatically searched through the first terminal equipment, so that the second terminal sends equipment binding data through the network port, the situation of binding failure caused by the occupation of the fixed network port can be avoided, the success rate of the binding process is improved, in addition, the equipment binding data is automatically received through the target network port, the binding can be completed without manually setting related attributes, and the equipment binding efficiency can be improved.

Description

Equipment binding method, device and terminal
Technical Field
The embodiment of the disclosure relates to the technical field of the internet of things, in particular to a device binding method, a device and a terminal.
Background
With the continuous development of internet of things, through combining sensor technology and internet technology, realized everything interconnection, intelligent life's experience, people are to intelligent detection, and intelligent recognition's demand is also more and more, in above-mentioned scene, all need bind intelligent terminal and internet of things equipment to realize terminal equipment and internet of things equipment's data interaction.
At present, when binding of the internet of things equipment is performed, related attributes of two to-be-bound equipment are usually set manually, then related data of the two to-be-bound equipment are transmitted through a fixed network port, and when the related data of the two to-be-bound equipment meet certain requirements, the binding of the two to-be-bound equipment can be achieved. However, the above method needs to designate a fixed network port to transmit binding data, when the port is occupied, binding failure occurs, so that the device binding success rate is low, and the binding efficiency is low due to manually setting the related attribute of the device to be bound.
Disclosure of Invention
The embodiment of the disclosure provides a device binding method, device and terminal, which are used for solving the technical problems of low device binding success rate and low device binding efficiency in the prior art.
In a first aspect, an embodiment of the present disclosure provides a device binding method, applied to a first terminal, including:
determining a target network port in a local area network where a first terminal is currently located;
transmitting broadcast data through a local area network, wherein the broadcast data comprises port information of a target network port;
receiving device binding data sent by a second terminal through a target network port, wherein the device binding data is used for requesting to bind a first terminal and the second terminal;
And controlling the binding of the first terminal and the second terminal according to the device binding data.
In a second aspect, an embodiment of the present disclosure provides a device binding method, applied to a second terminal, including:
receiving broadcast data sent by a first terminal through a local area network where a second terminal is currently located, wherein the broadcast data comprises port information of a target network port;
and sending device binding data to the first terminal through the target network port according to the broadcast data, wherein the device binding data is used for requesting to bind the first terminal and the second terminal.
In a third aspect, an embodiment of the present disclosure provides a device binding apparatus, applied to a first terminal, including:
the determining module is used for determining a target network port in a local area network where the first terminal is currently located;
the transmitting module is used for transmitting broadcast data through the local area network, wherein the broadcast data comprises port information of a target network port;
the receiving module is used for receiving equipment binding data sent by the second terminal through the target network port, wherein the equipment binding data is used for requesting to bind the first terminal and the second terminal;
and the processing module is used for controlling the binding of the first terminal and the second terminal according to the equipment binding data.
In a fourth aspect, an embodiment of the present disclosure provides a device binding apparatus applied to a second terminal, the device binding apparatus including:
the receiving module is used for receiving broadcast data sent by the first terminal through a local area network where the second terminal is currently located, wherein the broadcast data comprises port information of a target network port;
and the sending module is used for sending device binding data to the first terminal through the target network port according to the broadcast data, wherein the device binding data is used for requesting to bind the first terminal and the second terminal.
In a fifth aspect, embodiments of the present disclosure provide a terminal, including: a memory and a processor;
the memory is used for storing program instructions;
the processor is configured to invoke program instructions in the memory to perform the method according to the first or second aspect.
In a sixth aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon;
the computer program, when executed, implements the method as described in the first or second aspect.
In a seventh aspect, embodiments of the present disclosure provide a computer program product for implementing a method according to the first or second aspect when the computer program is executed by a processor.
The disclosure provides a device binding method, a device and a terminal, which are used for determining a target network port in a local area network where a first terminal is currently located; broadcast data is sent through a local area network; receiving device binding data sent by a second terminal through a target network port, wherein the device binding data is used for requesting to bind a first terminal and the second terminal; and controlling the binding of the first terminal and the second terminal according to the device binding data. The target network port can be automatically searched through the first terminal equipment, so that the second terminal sends equipment binding data through the network port, the situation of binding failure caused by the occupation of the fixed network port can be avoided, the success rate of the binding process is improved, in addition, the equipment binding data is automatically received through the target network port, the binding can be completed without manually setting related attributes, and the equipment binding efficiency can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a diagram illustrating an example of a scenario of a device binding method provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a device binding method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a data format of broadcast data according to an embodiment of the disclosure;
FIG. 4 is a flowchart of a device binding method according to another embodiment of the present disclosure;
FIG. 5 is a flowchart of a device binding method according to another embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a data format of first data according to an embodiment of the disclosure;
FIG. 7 is a schematic structural diagram of a device binding apparatus according to an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of a device binding apparatus according to another embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Along with development of computer and network technology, the network of everything interconnection age brings convenience for everyone, through combining sensor technology and internet technology, has realized everything interconnection, and intelligent life's experience, people are to intelligent detection, and intelligent identification's demand is also more and more, in above-mentioned scene, all need bind intelligent terminal and thing networking equipment to realize terminal equipment and thing networking equipment's data interaction. For example, in an intelligent detection scenario, it is often necessary to bind a network camera with an intelligent terminal device, then capture an image to be detected using the network camera, and send the captured image to the intelligent terminal, so as to implement detection of image data through the intelligent terminal, so that how to bind the network camera with the terminal device is important.
At present, when two devices of the internet of things are bound, related attributes of the two devices to be bound are usually set manually, then related data of the two devices to be bound are transmitted through a fixed network port, and when the related data of the two devices to be bound meet certain requirements, the two devices to be bound can be bound. However, the above method needs to specify a fixed network port to transmit binding data, when the port is occupied, a binding failure occurs, and the binding efficiency is low due to manually setting the related attribute of the device to be bound.
In view of this, an embodiment of the present disclosure provides a device binding method, an apparatus, and a terminal, where in a first terminal portion, by automatically searching a target network port in a local area network, broadcasting and transmitting port information of the target network port in the local area network, and then receiving device binding request data sent by a second terminal through the target network port, so as to control binding between the first terminal and the second terminal according to the device binding request data. The target network port can be automatically searched through the first terminal equipment, so that the second terminal sends equipment binding data through the network port, the situation of binding failure caused by the occupation of the fixed network port can be avoided, the success rate of the binding process is improved, in addition, the equipment binding data is automatically received through the target network port, the binding can be completed without manually setting related attributes, and the equipment binding efficiency can be improved.
Fig. 1 is a diagram illustrating a scenario of a device binding method according to an embodiment of the present disclosure. As shown in fig. 1, the scenario includes: a first terminal 101 and a second terminal 102.
In an embodiment of the present disclosure, the first terminal 101 may be any type of terminal, for example, may be a user equipment for machine type communication. The first terminal 101 may also be referred to as a User Equipment (UE), a Mobile Station (MS), a mobile terminal (terminal), a terminal (terminal), etc., and the terminal may be, for example, a desktop computer, a notebook computer, a personal digital assistant (Personal Digital Assistant, PDA), a smart phone, a tablet computer, etc. The first terminal in the embodiment of the disclosure is exemplified by a smart phone.
The second terminal 102 may be any type of internet of things device, such as a smart home, a smart home appliance, a smart wearable device, a webcam, etc. The second terminal 102 in the embodiment of the present disclosure is illustrated by using a network camera as an example.
In the embodiment of the present disclosure, the number of the first terminals 101 and the second terminals 102 may be plural, and the embodiment of the present disclosure is described by taking the case that the number of the first terminals 101 and the second terminals 102 is uniform.
In practical applications, the first terminal 101 and the second terminal 102 are in the same lan, and after the first terminal 101 determines the target network port in the lan, broadcast data is sent in the lan, where the broadcast data includes port information of the target network port.
After receiving the broadcast data, the second terminal 102 determines port information of the target network port according to the broadcast data, and determines a target network port corresponding to the port information according to the port information, so as to send the device binding data to the first terminal 101 through the target network port. Wherein the device binding data comprises identity information of the second terminal 102.
Further, after the first terminal 101 receives the device binding data, identity information of the second terminal 102 is verified, and when the identity information verification passes, the first terminal 101 and the second terminal 102 are controlled to bind.
It should be noted that, the solution provided by the embodiment of the present disclosure may be applied to various scenarios, and the application scenario is not specifically limited by the present disclosure. For example, in a network contract scene, in order to ensure the security in the network contract service, an image pickup device is often installed in the network contract to collect the information in the vehicle, so that it is necessary to bind a terminal device such as a mobile phone of a driver of the network contract or a mobile phone of a manager with the image pickup device.
Taking the first terminal 101 as a mobile phone of a driver of a network bus, the second terminal 102 as a camera device on the network bus, firstly, the camera device and the mobile phone are connected in the same local area network, wherein the local area network can be a local area network established by camera, a local area network established by the mobile phone, a local area network established by other devices, such as a routing device, and the like.
Further, the mobile phone is controlled to enter a state to be bound, and it is to be noted that in an alternative scheme, when the mobile phone or the camera device is connected to the same local area network, the mobile phone or the camera device automatically enters the state to be bound; in another alternative, the state to be bound may be entered in response to an indication operation to enter the bound state. For example, for a mobile phone, a user can enable the mobile phone to enter a to-be-bound state by operating corresponding application software in the mobile phone; for the camera device, a user can enable the camera device to enter a state to be bound by operating a button on the camera device so as to finish binding of the camera device and the camera device. The binding process between the mobile phone and the camera device can refer to the scheme of the disclosure, and is not repeated here.
The following describes in detail, with specific embodiments, a technical solution of an embodiment of the present disclosure and how the technical solution of the present disclosure solves the foregoing technical problems. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a device binding method according to an embodiment of the present disclosure. The execution body of the embodiment of the present disclosure may be the first terminal described above. As shown in fig. 2, the method of the embodiment of the present disclosure includes the steps of:
s201, determining a target network port in a local area network where the first terminal is currently located.
It should be noted that the target network port may be a port in a transmission control protocol/internet protocol (Transmission Control Protocol/Internet Protocol, abbreviated as TCP) or an internet protocol (Internet Protocol, abbreviated as IP). In practical application, determining the target network port in the local area network where the first terminal is currently located may include the following ways:
in one possible implementation, an unoccupied one of the network ports within the local area network is determined to be a target network port.
Specifically, all unoccupied network ports in the local area network are searched, and one network port is randomly determined as a target network port from the unoccupied network ports. By the scheme, all ports in the local area network are searched, the situation that the target network port cannot be acquired when the occupancy rate of the ports in the local area network is high can be avoided, so that the success rate of acquiring the target network port is improved, and the success rate of binding equipment is finally improved.
In another possible implementation manner, the first terminal of the terminal device may determine the target network port from the partial network ports preset in the local area network.
In practical application, because the number of network ports in the local area network is large, the target network port is determined from all the network ports, and the time consumption is long, the efficiency is low, so that the target network port can be determined from only part of the network ports.
Specifically, an initial value of the search port number is obtained. The initial value of the search port number is used to determine a preset partial network port. Taking the network port as a port in the TCP/IP protocol as an example, the range of the port number is 0 to 65535, and by setting the initial value of the search port number, for example, the initial value is 5000, the preset partial network ports are the network ports with the port numbers of 5000 to 65535.
It should be noted that, for the initial value of the search port number, the embodiments of the present disclosure are not limited in particular, and on one hand, the initial value of the search port number may be a fixed value, such as 5000 as described above; on the other hand, the network port can be determined according to the occupancy rate of the network port in the local area network, and if the occupancy rate is larger than the preset value, and the probability of finding the unoccupied network port is smaller at this time, the searching range can be expanded, namely the initial value of the searching port number is reduced, so that the success rate of obtaining the target network port is improved, and the equipment binding success rate is finally improved; if the occupancy rate is smaller than the preset value, at the moment, the probability of finding the unoccupied network port is larger, the initial value of the search port number can be increased by narrowing the search range, so that the efficiency of obtaining the target network port is improved, and finally the binding efficiency of the equipment is improved;
further, it is determined whether the network port corresponding to the search port number is occupied. The specific scheme for determining whether the network port is occupied may refer to a scheme in the prior art, and embodiments of the present disclosure are not specifically limited.
If the network port is not occupied, determining the network port corresponding to the search network port number as a target network port.
If the network port is occupied, accumulating the search port number by a preset value, and determining whether the network port corresponding to the search port number is occupied or not again. The accumulated preset value is not particularly limited, for example, the preset value may be a fixed value, and exemplary, the preset value may be 1000.
The above scheme will be described below taking an example that the initial value of the search port number is 5000 and the accumulated preset value is 1000.
Inquiring whether a network port with a port number of 5000 is occupied, if not, determining the network port with the port number of 5000 as a target network port; if the network port with the port number of 5000 is currently occupied, accumulating the value of the search port number by 1000, and determining whether the network port corresponding to the accumulated search port number is occupied according to the accumulated search port number, namely whether the port with the search port number of 6000 is occupied; if not occupied, determining the network port with the port number of 6000 as a target network port, and if occupied, repeating the searching according to the mode until the unoccupied network port is searched.
In some scenarios, for example, the network port occupancy rate in the lan is high, and the situation that the target network port cannot be searched still by traversing the preset part of the network ports in a manner of accumulating the preset value may occur, so that the device cannot implement binding. When this occurs, the target network port may be determined in the following manner.
In one aspect, the target network port may be determined from other network ports not included in the preset portion of network ports.
Specifically, the initial value of the search port number is subtracted by a first preset value, and for the size of the first preset value, the embodiment of the disclosure is not specifically limited, and exemplary, the first preset value may be 800.
Taking 5000 as an initial value of the search port number as an example, when the target network port is not searched in the preset partial network ports, accumulating the value of the search port number by a first preset value, determining whether the port corresponding to the accumulated port number is occupied, namely determining whether the network port with the port number of 4200 is occupied, if not, determining the network port with the port number of 4200 as the target network port, and if so, accumulating and subtracting in sequence according to the mode until the unoccupied network port is determined.
On the other hand, the size of the preset value can be reduced, and in the preset part of network ports, the unoccupied network ports are searched again according to the reduced size of the preset value.
Still take the initial value of the search port number as 5000 and the preset value as 1000 as an example, when the target network port is not searched in the preset part of network ports, the value of the preset value is reduced, and the value of the reduced preset value is not particularly limited, for example, may be 500. For example, the value of the search port number is accumulated 500, and then whether the network port corresponding to the accumulated search port number is occupied or not is determined according to the accumulated search port number, namely, whether the port with the search port number of 5500 is occupied or not is determined; if not occupied, determining the network port with the port number of 5500 as a target network port, and if occupied, repeating the searching according to the mode until the unoccupied network port is searched.
According to the scheme, as only the target network ports in the preset partial network ports are searched and all network ports in the local area network are not required to be traversed, the time consumption for determining the target network ports can be reduced, the determination efficiency of the target network ports is improved, and the binding efficiency of the equipment is further improved. In addition, when the target network port is not searched in the preset part of network ports, the preset value is adjusted, or the target network port is redetermined in other network ports, so that the situation that the equipment binding fails due to the fact that the network port cannot be determined is prevented, the reliability of the determination of the target network port is ensured, and the success rate of the equipment binding process is finally improved.
S202, sending broadcast data through a local area network.
In this step, after determining the target network port, broadcast data is sent in the lan, where the broadcast data includes port information of the target network port.
As an alternative, the broadcast data further includes: identity information, address information, etc. of the first terminal.
In practical applications, in order to ensure the security of data, encryption processing needs to be performed on the data, for example, in this step, broadcast data needs to be encrypted and then sent through a local area network, so that the security of the data is ensured, and the requirement of privacy protection calculation is met. As for the encryption method, the embodiment of the present disclosure is not particularly limited, and by way of example, broadcast data may be encrypted by an RSA encryption algorithm.
Fig. 3 is a schematic diagram of a data format of broadcast data according to an embodiment of the disclosure. As shown in fig. 3, the broadcast data includes an algorithm identification bit, encryption data, and an algorithm end bit.
Wherein, the field of 0-64 bits in the encrypted data is the identity information of the first terminal, and the identity information may be, for example, the serial number of the first terminal; the 64-96 bit field in the encrypted data is address information of the first terminal, and may be, for example, an IP address of the first terminal; the 96-112 bit field in the encrypted data is the port information of the target network port; 112-256 bits of field in the encrypted data reserves a field for the space.
It should be noted that fig. 3 is an alternative to the data format of the broadcast data, and in practical application, the embodiment of the disclosure is not limited to the broadcast data format specifically.
Correspondingly, after the second terminal receives the broadcast data, the broadcast data is analyzed to obtain the identity information, the address information and the port information of the target network port of the first terminal in the broadcast data.
S203, receiving the device binding data sent by the second terminal through the target network port.
In this step, after the identity information and the address information of the first terminal pass the verification, device binding data is sent to the first terminal according to the port information of the target network port, where the device binding data is used to request to bind the first terminal and the second terminal.
Correspondingly, the first terminal monitors whether the target network port receives the request binding data in real time, and if so, acquires the request binding data.
Wherein requesting binding data may include: identity information of the second terminal, such as a serial number of the second terminal, address information of the second terminal, such as an IP address of the second terminal, etc.
S204, according to the device binding data, the first terminal is controlled to bind with the second terminal.
In the step, after the first terminal receives the device binding data, the identity information of the second terminal in the request binding data is checked, and when the identity information passes the verification, the first terminal and the second terminal are controlled to bind.
In some embodiments, after the binding is completed, the binding result may be sent to the second terminal, specifically, according to the address information of the second terminal, the binding result is sent to the second terminal. Through the scheme, the second terminal can be prevented from being bound with other terminals again, and the binding success rate of the first terminal and the second terminal is improved.
In the embodiment of the disclosure, determining a target network port in a local area network where a first terminal is currently located; broadcast data is sent through a local area network; receiving device binding data sent by a second terminal through a target network port, wherein the device binding data is used for requesting to bind a first terminal and the second terminal; and controlling the binding of the first terminal and the second terminal according to the device binding data. The target network port can be automatically searched through the first terminal equipment, so that the second terminal sends equipment binding data through the network port, the situation of binding failure caused by the occupation of the fixed network port can be avoided, the success rate of the binding process is improved, in addition, the equipment binding data is automatically received through the target network port, the binding can be completed without manually setting related attributes, and the equipment binding efficiency can be improved.
Fig. 4 is a flowchart of a device binding method according to another embodiment of the present disclosure. The execution body of the embodiment of the present disclosure may be the above-described second terminal. As shown in fig. 4, the method of the embodiment of the present disclosure includes the steps of:
s401, receiving broadcast data sent by the first terminal through a local area network where the second terminal is currently located. In practical application, the second terminal and the first terminal are in the same local area network, whether broadcast data exist in the local area network is monitored in real time through the second terminal, and whether the broadcast data can be analyzed is judged after the broadcast data are monitored.
On the other hand, if the analysis is possible, the port information of the target network port in the broadcast data is acquired.
On the other hand, if the analysis is impossible, the broadcast data is discarded.
It should be noted that, because the broadcast data used for the first terminal and the second terminal are in the preset format, when the second terminal cannot analyze the broadcast data in the current format, it is indicated that the broadcast data is not used for binding the first terminal and the second terminal, and at this time, after discarding the broadcast data, the broadcast data sent by the first terminal device is continuously monitored until the broadcast data that can be analyzed by the second terminal is monitored. The specific format of the broadcast data is described in the embodiments shown in fig. 2 and 3, and is not repeated here.
S402, according to the broadcast data, the device binding data is sent to the first terminal through the target network port.
Specifically, port information of a target network port and address information of a first terminal are determined according to broadcast data, and when identity information and address information of the first terminal pass verification, a second terminal sends device binding data to the first terminal through the target network port according to the address information of the first terminal, wherein the device binding data is used for requesting to bind the first terminal and the second terminal.
Correspondingly, the first terminal receives the device binding data sent by the second terminal through the target network port, and controls the first terminal to bind with the second terminal according to the device binding data. In the embodiment of the disclosure, broadcast data sent by a first terminal is received through a local area network where a second terminal is currently located, wherein the broadcast data comprises port information of a target network port; and sending device binding data to the first terminal through the target network port according to the broadcast data, wherein the device binding data is used for requesting to bind the first terminal and the second terminal. Because the target network port is automatically searched by the first terminal equipment, the binding failure caused by the occupation of the fixed network port can be avoided, so that the success rate of the binding process is improved.
Fig. 5 is a flowchart of a device binding method according to another embodiment of the present disclosure. On the basis of the foregoing embodiments, the present embodiment describes the technical solution of the present disclosure in more detail, as shown in fig. 5, and the device binding method provided by the embodiment of the present disclosure may include the following steps:
s501, the first terminal determines a target network port in a local area network where the first terminal is currently located.
S502, the first terminal sends broadcast data through the local area network, wherein the broadcast data comprises port information of a target network port.
It should be noted that, steps S501 to S502 are similar to steps S201 to S202 in the embodiment shown in fig. 2, and specific reference may be made to the steps in the embodiment shown in fig. 2, and the details are not repeated here.
S503, the second terminal receives the broadcast data sent by the first terminal through the local area network where the second terminal is currently located, wherein the broadcast data comprises port information of a target network port.
It should be noted that, step S503 is similar to step S401 in the embodiment shown in fig. 4, and specific reference may be made to the steps in the embodiment shown in fig. 4, which are not repeated here.
S504, the second terminal encapsulates the device binding data into first data according to a preset format.
Specifically, the device binding data is encrypted according to a preset encryption algorithm;
in practical application, in order to ensure the security of data, encryption processing needs to be performed on the data, for example, in this step, the device binding data needs to be encrypted and then sent to the first terminal through the local area network, so that the security of the data is ensured, and the requirement of privacy protection calculation is met. As for the encryption method, the embodiment of the present disclosure is not particularly limited, and by way of example, broadcast data may be encrypted by an RSA encryption algorithm.
Further, the encrypted device binding data is encapsulated as first data. It should be noted that, in order to enable the first terminal to identify the device binding data, it needs to be encapsulated into a preset format to obtain the encapsulated first data, and the specific structure of the preset format is not specifically limited in the embodiment of the present disclosure, and an optional data format of the first data is described below with reference to fig. 6.
Fig. 6 is a schematic diagram of a data format of first data according to an embodiment of the disclosure. As shown in fig. 6, the first data includes an algorithm identification bit, encryption data, and an algorithm end bit.
The encrypted data refers to encrypted device binding data, a field with 0-64 bits in the encrypted data is identity information of the second terminal, a field with 64-96 bits in the encrypted data is address information of the second terminal, and a field with 96-256 bits in the encrypted data is a spare reserved field.
It should be noted that fig. 6 is an alternative scheme of the data format of the first data, and in practical application, the embodiment of the disclosure does not specifically limit the data format of the first data. The device binding data is packaged into the preset format, so that the first terminal can quickly identify the device binding data, and the binding is completed, so that the device binding efficiency is improved.
S505, the second terminal sends the first data to the first terminal through the target network port.
S506, the first terminal receives the first data sent by the second terminal through the target network port.
S507, if the data format of the first data is the preset format, determining that the first data includes the device binding data.
S508, the first terminal decrypts the equipment binding data according to a preset decryption algorithm to obtain the identity information of the second terminal.
It should be noted that, the preset decryption algorithm corresponds to an encryption algorithm used when the device binding data is encrypted, and the embodiment of the disclosure is not limited specifically.
S509, if the identity information of the second terminal passes verification, binding the first terminal and the second terminal.
S510, the first terminal sends the binding result to the second terminal according to the address information of the second terminal.
In some embodiments, after the binding is completed, the binding result may be sent to the second terminal, specifically, according to the address information of the second terminal, the binding result is sent to the second terminal. Through the scheme, the second terminal can be prevented from being bound with other terminals again, and the binding success rate of the first terminal and the second terminal is improved.
Fig. 7 is a schematic structural diagram of a device binding apparatus according to an embodiment of the present disclosure. As shown in fig. 7, the device binding apparatus 70 includes:
a determining module 701, configured to determine a target network port in a local area network where the first terminal is currently located;
a transmitting module 702, configured to transmit broadcast data through a local area network, where the broadcast data includes port information of a target network port;
a receiving module 703, configured to receive, through a target network port, device binding data sent by the second terminal, where the device binding data is used to request binding of the first terminal and the second terminal;
and the processing module 704 is configured to control the first terminal to bind with the second terminal according to the device binding data.
It can be understood that the device binding apparatus provided by the embodiments of the present disclosure may be used to implement the technical scheme of any of the method embodiments described above, and the implementation principle and technical effects are similar, and reference may be made to the method embodiment shown in fig. 2 and not be repeated herein.
In one possible implementation manner, the determining module 701 is specifically configured to determine the target network port from the preset partial network ports in the local area network.
In one possible implementation manner, the determining module 701 is specifically configured to obtain an initial value of the search port number;
determining whether a network port corresponding to the search port number is occupied;
if not occupied, determining the network port corresponding to the search network port number as a target network port;
if the network port is occupied, accumulating the search port number by a preset value, and determining whether the network port corresponding to the search port number is occupied or not again.
In one possible implementation, the determining module 701 is specifically configured to determine that an unoccupied network port in the lan is a target network port.
In a possible implementation manner, the receiving module 703 is specifically configured to receive, through the target network port, the first data sent by the second terminal;
if the data format of the first data is the preset format, determining that the first data comprises the equipment binding data.
In one possible implementation manner, the device binding data includes identity information of the second terminal, and the processing module is specifically configured to decrypt the device binding data according to a preset decryption algorithm to obtain the identity information of the second terminal;
And if the identity information of the second terminal passes the verification, binding the first terminal with the second terminal.
In one possible implementation, the device binding data further includes address information of the second terminal;
the sending module 702 is further configured to send a binding result to the second terminal according to the address information of the second terminal.
It can be understood that the message processing apparatus provided in this embodiment may be used to execute the technical scheme of any of the above method embodiments, and the implementation principle and technical effects are similar, and specific reference may be made to the method embodiment shown in fig. 5 and will not be repeated herein.
Fig. 8 is a schematic structural diagram of a device binding apparatus according to another embodiment of the present disclosure. As shown in fig. 8, the device binding apparatus 80 includes:
a receiving module 801, configured to receive, through a local area network where the second terminal is currently located, broadcast data sent by the first terminal, where the broadcast data includes port information of a target network port;
the sending module 802 is configured to send, according to the broadcast data, device binding data to the first terminal through the target network port, where the device binding data is used to request binding of the first terminal and the second terminal.
It can be understood that the message processing apparatus provided in this embodiment may be used to execute the technical scheme of any of the above method embodiments, and the implementation principle and technical effects are similar, and specific reference may be made to the method embodiment shown in fig. 4 and will not be repeated here.
In one possible implementation, the sending module 802 is specifically configured to package the device binding data into the first data according to a preset format;
and sending the first data to the first terminal through the target network port.
In one possible implementation, the sending module 802 is specifically configured to encrypt the device binding data according to a preset encryption algorithm;
and encapsulating the encrypted device binding data into first data.
It can be understood that the message processing apparatus provided in this embodiment may be used to execute the technical scheme of any of the above method embodiments, and the implementation principle and technical effects are similar, and specific reference may be made to the method embodiment shown in fig. 5 and will not be repeated herein.
Fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure. As shown in fig. 9, a terminal 90 of an embodiment of the present disclosure may be used to implement the method described in any of the method embodiments described above, with particular reference to the description of the method embodiments described above.
The terminal 90 may comprise one or more processors 901, which processors 901 may also be referred to as processing units, may implement certain control or processing functions. The processor 901 may be a general purpose processor or a special purpose processor, etc. For example, a baseband processor, or a central processing unit. The baseband processor may be used to process data and the central processor may be used to control the terminal 90, execute software programs, and process data of the software programs.
In one possible design, processor 901 may also store instructions or data (e.g., device binding data, broadcast data, etc.). Wherein the instructions may be executable by the processor 901 to cause the terminal 90 to perform a method corresponding to the first terminal or the second terminal described in the above method embodiments.
In yet another possible design, terminal 90 may include circuitry that may perform the functions of transmitting or receiving or communicating in the foregoing method embodiments.
In one possible implementation, the terminal 90 may include one or more memories 902 on which instructions may be stored that are executable on the processor 901 to cause the terminal 90 to perform the methods described in the method embodiments above.
In one possible implementation, the memory 902 may also have data stored therein. The processor 901 and the memory 902 may be provided separately or may be integrated.
In one possible implementation, the terminal 90 may also include a receiver 903 and/or a transmitter 904. The processor 901 may be referred to as a processing unit for controlling the terminal 90. The receiver 903 may be referred to as a receiving unit, a receiver, a receiving circuit, or the like, for implementing a receiving function of the terminal 90.
The specific implementation process of the processor 901, the receiver 903, and the transmitter 904 may be referred to the related descriptions of the above embodiments, which are not repeated herein.
The processor 901, the receiver 903, and the transmitter 904 described in this disclosure may be implemented on an integrated circuit (integrated circuit, abbreviated as IC), an analog IC, a radio frequency integrated circuit (radio frequency integrated circuit, abbreviated as RFIC), a mixed signal IC, an application specific integrated circuit (application specific integrated circuit, abbreviated as ASIC), a printed circuit board (printed circuit board, abbreviated as PCB), an electronic device, or the like.
It will be appreciated by those skilled in the art that the configuration of the terminal shown in fig. 9 is not limiting of the present terminal and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
It should be noted that, the above terminal provided by the present disclosure is configured to implement the method described in the above method embodiment, and may achieve the same technical effects, and specific details of the same parts and beneficial effects as those of the method embodiment in this embodiment are not repeated here.
Embodiments of the present disclosure also provide a computer-readable storage medium, which when executed by a processor of a terminal device, enables the processor to perform the device binding method in the method embodiments described above.
Embodiments of the present disclosure also provide a computer program product, including a computer program, which when executed by a processor implements the device binding method in the above method embodiments.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods of the various embodiments of the disclosure. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random AccessMemory, RAM), magnetic disk or optical disk, etc.
In the embodiment of the server described above, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. The steps of a method disclosed in connection with the present disclosure may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. The embodiments of the present disclosure are intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A device binding method, applied to a first terminal, the method comprising:
determining a target network port in a local area network where the first terminal is currently located;
transmitting broadcast data through the local area network, wherein the broadcast data comprises port information of the target network port;
receiving device binding data sent by a second terminal through the target network port, wherein the device binding data is used for requesting to bind the first terminal and the second terminal;
According to the equipment binding data, the first terminal is controlled to bind with the second terminal;
the determining the target network port in the local area network where the first terminal is currently located includes:
acquiring an initial value of a search port number according to the occupancy rate of a network port in the local area network; the initial value of the search port number is used for determining a preset partial network port;
determining whether a network port corresponding to an initial value of the search port number is occupied;
if not occupied, determining the network port corresponding to the search network port number as a target network port;
if the network port is occupied, accumulating the search port number by a preset value, and determining whether the network port corresponding to the search port number is occupied or not again.
2. The method of claim 1, wherein the receiving, via the target network port, the device binding request sent by the second terminal, comprises:
receiving first data sent by the second terminal through the target network port;
and if the data format of the first data is a preset format, determining that the first data comprises the equipment binding data.
3. A device binding method, applied to a second terminal, the method comprising:
Receiving broadcast data sent by a first terminal through a local area network where the second terminal is currently located, wherein the broadcast data comprises port information of a target network port; the target network port is a network port number corresponding to the initial value of the search port number, which is unoccupied and determined, obtained by the first terminal according to the occupancy rate of the network port in the local area network; the initial value of the search port number is used for determining a preset partial network port;
and sending device binding data to the first terminal through the target network port according to the broadcast data, wherein the device binding data is used for requesting to bind the first terminal and the second terminal.
4. A device binding apparatus, applied to a first terminal, the device binding apparatus comprising:
the determining module is used for determining a target network port in a local area network where the first terminal is currently located;
a transmitting module, configured to transmit broadcast data through the local area network, where the broadcast data includes port information of the target network port;
the receiving module is used for receiving equipment binding data sent by a second terminal through the target network port, wherein the equipment binding data is used for requesting to bind the first terminal and the second terminal;
The processing module is used for controlling the first terminal to bind with the second terminal according to the equipment binding data;
the determining module is specifically configured to obtain an initial value of a search port number according to an occupancy rate of a network port in the local area network; the initial value of the search port number is used for determining a preset partial network port; determining whether a network port corresponding to an initial value of the search port number is occupied; if not occupied, determining the network port corresponding to the search network port number as a target network port; if the network port is occupied, accumulating the search port number by a preset value, and determining whether the network port corresponding to the search port number is occupied or not again.
5. A device binding apparatus, applied to a second terminal, the device binding apparatus comprising:
the receiving module is used for receiving broadcast data sent by the first terminal through the local area network where the second terminal is currently located, wherein the broadcast data comprises port information of a target network port; the target network port is a network port number corresponding to the initial value of the search port number, which is unoccupied and determined, obtained by the first terminal according to the occupancy rate of the network port in the local area network; the initial value of the search port number is used for determining a preset partial network port;
And the sending module is used for sending equipment binding data to the first terminal through the target network port according to the broadcast data, wherein the equipment binding data is used for requesting to bind the first terminal and the second terminal.
6. A terminal, comprising: a memory and a processor;
the memory is used for storing program instructions;
the processor is configured to invoke program instructions in the memory to perform the method of any of claims 1-3.
7. A computer readable storage medium having a computer program stored thereon; the computer program, when executed, implements the method of any of claims 1-3.
CN202110037687.6A 2021-01-12 2021-01-12 Equipment binding method, device and terminal Active CN112804102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110037687.6A CN112804102B (en) 2021-01-12 2021-01-12 Equipment binding method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110037687.6A CN112804102B (en) 2021-01-12 2021-01-12 Equipment binding method, device and terminal

Publications (2)

Publication Number Publication Date
CN112804102A CN112804102A (en) 2021-05-14
CN112804102B true CN112804102B (en) 2023-05-16

Family

ID=75810134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110037687.6A Active CN112804102B (en) 2021-01-12 2021-01-12 Equipment binding method, device and terminal

Country Status (1)

Country Link
CN (1) CN112804102B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056076B (en) * 2022-07-21 2023-10-20 荣耀终端有限公司 Communication system, method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580265A (en) * 2015-02-13 2015-04-29 小米科技有限责任公司 Equipment binding method and equipment binding device
CN104639549A (en) * 2015-02-05 2015-05-20 小米科技有限责任公司 Equipment binding method and equipment binding device
CN105472148A (en) * 2015-11-23 2016-04-06 珠海格力电器股份有限公司 Method for terminal to bind household equipment and apparatus thereof
CN106102051A (en) * 2016-08-26 2016-11-09 北京方研矩行科技有限公司 A kind of method that in LAN, safety finds smart machine

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103941666B (en) * 2013-12-31 2016-08-31 海尔集团公司 Judgement control instruction for home appliance sends the method and system of result
CN105228125A (en) * 2014-05-27 2016-01-06 中兴通讯股份有限公司 A kind of smart card dynamic binding method, apparatus and system
CN104394067A (en) * 2014-12-11 2015-03-04 北京奇虎科技有限公司 Local area network communication method and device
CN106535187B (en) * 2016-10-27 2020-02-04 上海斐讯数据通信技术有限公司 Intelligent household equipment access method and system based on wireless routing terminal
CN106961426B (en) * 2017-03-09 2020-04-24 深圳创维-Rgb电子有限公司 Communication method and device of intelligent equipment
CN108521857B (en) * 2017-07-25 2021-08-03 北京小米移动软件有限公司 NB-IoT equipment binding method and IOT control system
CN107707439A (en) * 2017-09-29 2018-02-16 深圳市艾特智能科技有限公司 Control method, system, storage medium and the computer equipment of intelligent home device
CN109815110A (en) * 2018-12-11 2019-05-28 北京城市网邻信息技术有限公司 A kind of network port management method, device, terminal device and storage medium
CN109672683B (en) * 2018-12-25 2021-07-20 深圳市安信认证系统有限公司 Binding method and binding device of Internet of things equipment and terminal equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639549A (en) * 2015-02-05 2015-05-20 小米科技有限责任公司 Equipment binding method and equipment binding device
CN104580265A (en) * 2015-02-13 2015-04-29 小米科技有限责任公司 Equipment binding method and equipment binding device
CN105472148A (en) * 2015-11-23 2016-04-06 珠海格力电器股份有限公司 Method for terminal to bind household equipment and apparatus thereof
CN106102051A (en) * 2016-08-26 2016-11-09 北京方研矩行科技有限公司 A kind of method that in LAN, safety finds smart machine

Also Published As

Publication number Publication date
CN112804102A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN107612909B (en) Information interaction method, device and equipment about Internet of things equipment
CN111131544B (en) Method for realizing NAT traversal
US9258305B2 (en) Authentication method, transfer apparatus, and authentication server
US20180041893A1 (en) Method and system of multi-terminal mapping to a virtual sim card
CN104137618A (en) Shared network access via a peer-to-peer link
US20130181819A1 (en) Physical tag-based subscription services
CN111865731B (en) Intelligent equipment adding method and device, intelligent household control panel and storage medium
WO2015100990A1 (en) Inter-terminal image sharing method, terminal device and communication system
CN112333268A (en) Data transmission method and device
CN114710524B (en) Data interaction method, device and equipment of in-vehicle local area network and storage medium
CN112804102B (en) Equipment binding method, device and terminal
CN105592019A (en) Method for bidirectional access to application between dual execution environments
KR20080088535A (en) Mobile terminal and method for operating a mobile terminal
CN111464653B (en) Method, system and device for interconnecting vehicle-mounted equipment
CN111263113B (en) Data packet sending method and device and data packet processing method and device
KR101794200B1 (en) Method for transmitting and receiving protocol packet using packet processor based LINUX in distributed packet transport network
CN112383617B (en) Method, device, terminal equipment and medium for performing long connection
CN108718346B (en) Resource processing method and device
CN109792459B (en) Method for transmitting data to at least one device, data transmission control server, storage server, processing server and system
CN110769065A (en) Remote management method, system, terminal equipment and server
CN112584378A (en) Identity card information reading method and system
CN112492274B (en) National secret encryption transmission equipment based on common network camera
CN111385372B (en) Network service discovery method, client, server and electronic equipment
US20230064688A1 (en) Method for operations of virtual machines in monitoring cloud activities, system, and device applying the method
CN110769264B (en) Multimedia transmission method, apparatus, medium, and system thereof

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