Iot device cooperation method and apparatus, and electronic device
By transmitting encrypted location data between IoT devices and using public and private keys to determine whether the devices are located in the same area, the problem of privacy information exposure during IoT device collaboration is solved, thus improving security and privacy protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2026-04-10
AI Technical Summary
During the collaboration process, the privacy information of IoT devices is easily exposed, resulting in low security.
The first IoT device sends encrypted parameters and public key data to the second IoT device to generate encrypted location data. The private key data of the first IoT device is used to determine whether the two are located in the same area, and a cooperation request is sent within the same area.
It reduces the risk of IoT device location information leakage, improves the security of collaboration, and protects user privacy.
Smart Images

Figure CN115834107B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of Internet of Things, in particular to an Internet of Things device cooperation method and device, and an electronic device. BACKGROUND
[0002] Internet of Things is a network extended and expanded on the basis of Internet, which is used to connect real-world objects with the network to realize the interconnection and intercommunication of multiple Internet of Things devices. With the rapid development of mobile communication technology, the application field of Internet of Things is more and more extensive, and the Internet of Things devices accessing Internet of Things are also more and more. Multiple Internet of Things devices transmit data through Internet of Things to realize mutual cooperation, which is convenient and fast. However, in the process of mutual cooperation, the privacy information of the Internet of Things device itself is also easy to be exposed, so the security of Internet of Things device cooperation is low. SUMMARY
[0003] Therefore, the present disclosure provides an Internet of Things device cooperation method and device, and an electronic device to solve the problem of low security of Internet of Things device cooperation.
[0004] In a first aspect, an Internet of Things device cooperation method is provided, applied to a first Internet of Things device. The Internet of Things device cooperation method comprises: sending an encryption parameter and public key data to a second Internet of Things device, so that the second Internet of Things device performs an encryption operation based on the encryption parameter, the public key data and location data of the second Internet of Things device to generate location encryption data of the second Internet of Things device, wherein the public key data is determined based on location data of the first Internet of Things device and private key data of the first Internet of Things device; receiving the location encryption data sent by the second Internet of Things device; determining whether the second Internet of Things device and the first Internet of Things device are located in the same area based on the location encryption data of the second Internet of Things device and the private key data of the first Internet of Things device; and if the second Internet of Things device and the first Internet of Things device are located in the same area, sending a cooperation request to the second Internet of Things device located in the same area.
[0005] In a second aspect, an Internet of Things device cooperation method is provided, applied to a second Internet of Things device. The Internet of Things device cooperation method comprises: receiving an encryption parameter and public key data sent by a first Internet of Things device, wherein the public key data is determined based on location data of the first Internet of Things device and private key data of the first Internet of Things device; performing an encryption operation based on the encryption parameter, the public key data and location data of the second Internet of Things device to generate location encryption data of the second Internet of Things device; and sending the location encryption data of the second Internet of Things device to the first Internet of Things device, so that the first Internet of Things device determines whether the second Internet of Things device and the first Internet of Things device are located in the same area based on the location encryption data of the second Internet of Things device and the private key data of the first Internet of Things device, and sends a cooperation request to the second Internet of Things device located in the same area.
[0006] In a third aspect, a device cooperation apparatus for a first IoT device is provided. The device cooperation apparatus comprises: a first sending module configured to send, to a second IoT device, encryption parameters and public key data, to cause the second IoT device to perform an encryption operation based on the encryption parameters, the public key data, and location data of the second IoT device, to generate location encryption data of the second IoT device, wherein the public key data is determined based on location data of the first IoT device and private key data of the first IoT device; a first receiving module configured to receive the location encryption data sent by the second IoT device; a same-area determining module configured to determine whether the second IoT device and the first IoT device are located in a same area based on the location encryption data of the second IoT device and the private key data of the first IoT device; and a second sending module configured to send, to the second IoT device located in the same area, a cooperation request if the second IoT device and the first IoT device are located in the same area.
[0007] In a fourth aspect, a device cooperation apparatus for a second IoT device is provided. The device cooperation apparatus comprises: a second receiving module configured to receive encryption parameters and public key data sent by a first IoT device, wherein the public key data is determined based on location data of the first IoT device and private key data of the first IoT device; an encryption data generating module configured to perform an encryption operation based on the encryption parameters, the public key data, and location data of the second IoT device, to generate location encryption data of the second IoT device; and a third sending module configured to send, to the first IoT device, the location encryption data of the second IoT device, to cause the first IoT device to determine whether the second IoT device and the first IoT device are located in a same area based on the location encryption data of the second IoT device and the private key data of the first IoT device, and to send, to the second IoT device located in the same area, a cooperation request.
[0008] In a fifth aspect, a computer-readable storage medium is provided. The storage medium stores instructions that, when executed, implement the method mentioned in the first aspect and the second aspect.
[0009] In a sixth aspect, a computer program product is provided. The computer program product includes instructions that, when executed, implement the method mentioned in the first aspect and the second aspect.
[0010] In a seventh aspect, an electronic device is provided. The electronic device includes a memory and a processor. The memory stores executable code. The processor is configured to execute the executable code to implement the method mentioned in the first aspect and the second aspect.
[0011] The method provided by the embodiment of the present disclosure comprises the following steps: a first Internet of Things device sends, to a second Internet of Things device, encryption parameters and public key data determined based on position data of the first Internet of Things device and private key data of the first Internet of Things device, so that the second Internet of Things device generates position encryption data and sends the position encryption data to the first Internet of Things device, thereby enabling the first Internet of Things device to determine, according to the position encryption data of the second Internet of Things device, whether the second Internet of Things device and the first Internet of Things device are located in the same area, so as to send a cooperation request. That is, the position data transmitted between the first Internet of Things device and the second Internet of Things device of the embodiment of the present disclosure is all encrypted position data, which reduces the risk of leakage of the position information of the first Internet of Things device and the position information of the second Internet of Things device, and improves the security of the cooperation of the Internet of Things devices. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 FIG. 1 is a schematic diagram of an application scenario of the method for cooperation of Internet of Things devices provided by an embodiment of the present disclosure.
[0013] Figure 2 FIG. 2 is a schematic diagram of an application scenario of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0014] Figure 3 FIG. 3 is a schematic diagram of an application scenario of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0015] Figure 4 FIG. 4 is a schematic diagram of an application scenario of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0016] Figure 5 FIG. 5 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by an embodiment of the present disclosure.
[0017] Figure 6 FIG. 6 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0018] Figure 7 FIG. 7 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0019] Figure 8 FIG. 8 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0020] Figure 9 FIG. 9 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0021] Figure 10 FIG. 10 is a schematic diagram of a flow of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure.
[0022] Figure 11FIG. 1 is a flowchart of a method for cooperation of Internet of Things devices according to an embodiment of the present disclosure.
[0023] Figure 12 FIG. 1 is a flowchart of a method for cooperation of Internet of Things devices according to an embodiment of the present disclosure.
[0024] Figure 13 FIG. 1 is a flowchart of a method for cooperation of Internet of Things devices according to an embodiment of the present disclosure.
[0025] Figure 14 FIG. 1 is a flowchart of a method for cooperation of Internet of Things devices according to an embodiment of the present disclosure.
[0026] Figure 15 FIG. 1 is a flowchart of a method for cooperation of Internet of Things devices according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all embodiments.
[0028] With the rapid development of mobile communication technology, the application field of Internet of Things is more and more extensive, and the Internet of Things devices accessing the Internet of Things are also more and more. Multiple Internet of Things devices transmit data through the Internet of Things to realize mutual cooperation, which is convenient and fast. However, in the process of mutual cooperation, the privacy information of the Internet of Things device itself is also easy to be exposed, so the security of the cooperation of the Internet of Things device is low. Specifically, the related technology is to transmit the privacy information (such as location information) of multiple Internet of Things devices directly to a third-party platform through the Internet of Things, and then find the Internet of Things devices located in the same area through the third-party platform, and then send a cooperation request to the Internet of Things devices located in the same area. If the third-party platform has data leakage or malicious use of data, the privacy information of the Internet of Things device will be exposed, causing loss to the user of the Internet of Things device.
[0029] The IoT device collaboration method provided in this disclosure involves a first IoT device sending encrypted parameters and public key data determined based on the location data and private key data of the first IoT device to a second IoT device. This enables the second IoT device to generate encrypted location data and send it to the first IoT device. The first IoT device can then determine whether the second IoT device and the first IoT device are located in the same area based on the encrypted location data, and thus send a collaboration request. In other words, the first and second IoT devices in this disclosure transmit encrypted location data, reducing the risk of leakage of the location information of both devices, improving the security of IoT device collaboration, and protecting the privacy of IoT device users.
[0030] The following is combined with Figures 1 to 4 Provide examples of application scenarios.
[0031] Figure 1 This is a schematic diagram illustrating an application scenario of an IoT device collaboration method provided in an embodiment of this disclosure. For example... Figure 1 As shown, the application scenario of this embodiment includes a first IoT device 110 and a second IoT device 120 that is communicatively connected to the first IoT device 110.
[0032] Specifically, the first IoT device 110 sends encryption parameters and public key data to the second IoT device 120. The second IoT device 120 performs encryption based on the encryption parameters, public key data, and the location data of the second IoT device, generating encrypted location data for the second IoT device, and sends this encrypted location data to the first IoT device 110. The first IoT device 110 receives the encrypted location data of the second IoT device and, based on the encrypted location data and the private key data of the first IoT device, determines whether the second IoT device and the first IoT device are located in the same area. If the second IoT device and the first IoT device are located in the same area, a cooperation request is sent to the second IoT device located in the same area.
[0033] Figure 2 This is a schematic diagram illustrating an application scenario of an IoT device collaboration method provided in another embodiment of this disclosure. For example... Figure 2 As shown, the application scenario of this embodiment includes a first IoT device 210, a blockchain network 220, and a second IoT device 230. Both the first IoT device 210 and the second IoT device 230 can communicate and connect through the blockchain network 220.
[0034] Specifically, the first IoT device 210 sends the encryption parameter and the public key data to the blockchain network 220. The blockchain network 220 further sends the encryption parameter and the public key data to the second IoT device 230. The subsequent method is the same as the application scenario shown in FIG. 2, which is not described here again. Figure 1 The application scenario shown in FIG. 3 is the same as that shown in FIG. 2, which is not described here again.
[0035] Figure 3 is a schematic diagram of an application scenario of the IoT device cooperation method provided by another embodiment of the present disclosure. As shown in Figure 3 The application scenario of the present embodiment is shown in FIG. 4, which includes a first vehicle IoT device 310 (i.e., a first IoT device) and a plurality of second vehicle IoT devices 320 (i.e., second IoT devices) in communication connection with the first vehicle IoT device 310. Figure 3 Regions A, B, C, and D are shown.
[0036] Specifically, if the user to which the first vehicle IoT device 310 belongs encounters a traffic dispute, it is necessary to find nearby passing vehicles, and then determine the responsible party according to the vehicle recorders (i.e., the second vehicle IoT devices 320) of the nearby passing vehicles. The first vehicle IoT device 310 can use the IoT device cooperation method of the present disclosure to determine the vehicle recorders (i.e., the second IoT devices located in the same region) of the nearby passing vehicles, and then send a cooperation request to the vehicle recorders (i.e., the 2 second vehicle IoT devices 320 located in region A) of the nearby passing vehicles to obtain the video of the vehicle recorders, so as to determine the responsible party. Figure 3
[0037] Figure 4 is a schematic diagram of an application scenario of the IoT device cooperation method provided by another embodiment of the present disclosure. As shown in Figure 4 The application scenario of the present embodiment is shown in FIG. 5, which includes a first shipping IoT device 410 (i.e., a first IoT device), a blockchain network 420, and a plurality of second shipping IoT devices 430 (i.e., second IoT devices). The first shipping IoT device 410 and the plurality of second shipping IoT devices 430 are in communication connection through the blockchain network 420, and the first shipping IoT device 410 and the plurality of second shipping IoT devices 430 are in communication connection. Figure 4 Regions E and F are shown.
[0038] Specifically, if the transport ship where the first shipping IoT device 410 is located encounters a failure, it needs to find nearby ships (i.e., the ships to which the second shipping IoT devices 430 belong) for rescue. The first shipping IoT device 410 can send the encryption parameter and the public key data to the blockchain network 420, and then the blockchain network 420 sends the encryption parameter and the public key data to the plurality of second shipping IoT devices 430. The plurality of second shipping IoT devices 430 generate respective location encryption data and send it to the first shipping IoT device 410. The first shipping IoT device 410 determines the nearby second shipping IoT devices 430 (i.e., the 2 second shipping IoT devices 430 located in the region E) according to the respective location encryption data of the plurality of second shipping IoT devices 430, and then sends a cooperation request to the nearby second shipping IoT devices 430 (or the users to which the second shipping IoT devices 430 belong) to obtain the rescue of the nearby ships. Figure 4
[0039] The following will be described in conjunction with Figure 5 to illustrate the IoT device cooperation method.
[0040] Figure 5 FIG. 1 is a flow diagram of an IoT device cooperation method provided by an embodiment of the present disclosure. Specifically, the present embodiment is applied to a first IoT device. As shown in FIG. 1, the IoT device cooperation method provided by the present embodiment includes the following steps. Figure 5
[0041] Step 510, send the encryption parameter and the public key data to the second IoT device.
[0042] The first IoT device and the second IoT device are both IoT devices. Illustratively, the first IoT device can be a vehicle IoT device or a shipping IoT device. The second IoT device can also be a vehicle IoT device or a shipping IoT device. The vehicle IoT device can be a driving recorder, a vehicle camera, etc. The shipping IoT device can be a radio frequency identification device, a sensor, a global positioning system, etc. on a ship.
[0043] The encryption parameter is a parameter used for encrypting the location data, and different encryption parameters can be selected according to different encryption algorithms. For example, when the ElGamal encryption algorithm is used for encryption, the encryption parameter can be a preset prime number P, a finite cyclic group G with a rank n, and a generator g. For another example, when the Diffie-Hellman key exchange algorithm is used for encryption, the encryption parameter can be a prime number q and an integer d, where d is a primitive root of q. The public key data is determined based on the location data of the first Internet of Things device and the private key data of the first Internet of Things device. The private key data of the first Internet of Things device can be set according to a specific encryption algorithm. For example, when the ElGamal encryption algorithm is used for encryption, the private key data of the first Internet of Things device can be a positive integer less than n selected at random. The location data of the first Internet of Things device can be latitude and longitude data, or an encoding (for example, a postal code) determined according to actual location information.
[0044] Specifically, after the first Internet of Things device sends the encryption parameter and the public key data to the second Internet of Things device, the second Internet of Things device performs an encryption operation based on the encryption parameter, the public key data, and the location data of the second Internet of Things device, generates location encryption data of the second Internet of Things device, and sends the location encryption data of the second Internet of Things device to the first Internet of Things device.
[0045] In an embodiment, the location data of the second Internet of Things device can be latitude and longitude data, or an encoding (for example, a postal code) determined according to actual location information.
[0046] In an embodiment, the location data of the first Internet of Things device can be a first region number. The location data of the second Internet of Things device can be a second region number. The first region number and the second region number are determined based on the same region numbering method. For example, the first region number is a postal code, and the second region number is also a postal code. For example, the Zhejiang Province is divided into 100,000 regions according to streets, and each region is numbered from 1 to 100,000. The first region number is a value from 1 to 100,000, and the second region number is also a value from 1 to 100,000. Using region numbers to represent location data further hides the real location data of the Internet of Things device, further improving the security of the location data of the Internet of Things device. In addition, using region numbers to represent location data does not require calculation of actual latitude and longitude data, has a small amount of calculation, and has high calculation efficiency.
[0047] In an embodiment, sending the encryption parameter and the public key data to the second Internet of Things device can be that the first Internet of Things device directly sends the encryption parameter and the public key data to the second Internet of Things device, or that the first Internet of Things device sends the encryption parameter and the public key data to the second Internet of Things device through a third-party platform or a blockchain network.
[0048] At step 520, the first IoT device receives the location encryption data sent by the second IoT device.
[0049] Specifically, after the second IoT device generates the location encryption data, the second IoT device can send the location encryption data of the second IoT device to the first IoT device, so that the first IoT device receives the location encryption data of the second IoT device.
[0050] At step 530, based on the location encryption data of the second IoT device and the private key data of the first IoT device, it is determined whether the second IoT device and the first IoT device are located in the same region.
[0051] Specifically, the first IoT device can decrypt the location encryption data of the second IoT device by using the private key data to obtain a decryption result, so as to determine whether the second IoT device and the first IoT device are located in the same region according to the decryption result.
[0052] At step 540, if the second IoT device and the first IoT device are located in the same region, a cooperation request is sent to the second IoT device located in the same region.
[0053] At step 550, if the second IoT device and the first IoT device are located in different regions, no cooperation request is sent to the second IoT device.
[0054] For example, the first IoT device receives the location encryption data of 10 second IoT devices, and based on the location encryption data of the 10 second IoT devices and the private key data of the first IoT device, it is respectively determined whether the 10 second IoT devices and the first IoT device are located in the same region. If 2 second IoT devices and the first IoT device are located in the same region, a cooperation request is sent to the 2 second IoT devices located in the same region. No cooperation request is sent to the remaining 8 second IoT devices located in different regions.
[0055] Specifically, if the second IoT device and the first IoT device are located in the same region, it means that the second IoT device is near the first IoT device, which is beneficial to assist the first IoT device to solve the problem from the geographical position, and therefore, the first IoT device can send a cooperation request to the second IoT device located in the same region. After receiving the cooperation request, the second IoT device can select whether to assist the first IoT device to solve the problem according to the actual situation of the second IoT device.
[0056] Exemplarily, the sending of the cooperation request to the second Internet of Things device located in the same region can be implemented as: the first Internet of Things device directly sending the cooperation request to the second Internet of Things device located in the same region. In this way, the transmission path of the request information is simplified, and the transmission speed is improved. The sending of the cooperation request to the second Internet of Things device located in the same region can also be implemented as: the first Internet of Things device sending the cooperation request to the second Internet of Things device located in the same region through a blockchain network. The blockchain network has the characteristics of anti-attack tampering, and in this way, the security of the transmission of the request information is improved.
[0057] The method provided by the embodiment of the present disclosure can send the encryption parameter and the public key data determined based on the location data of the first Internet of Things device and the private key data of the first Internet of Things device to the second Internet of Things device by the first Internet of Things device, so that the second Internet of Things device generates location encryption data and sends it to the first Internet of Things device, so that the first Internet of Things device can determine whether the second Internet of Things device and the first Internet of Things device are located in the same region according to the location encryption data of the second Internet of Things device, in order to send a cooperation request. That is, the first Internet of Things device and the second Internet of Things device of the embodiment of the present disclosure transmit all encrypted location data, which reduces the risk of leakage of the location information of the first Internet of Things device and the location information of the second Internet of Things device, and improves the security of the cooperation of the Internet of Things devices.
[0058] The following will be combined Figure 6 The specific manner in which the first Internet of Things device sends the encryption parameter and the public key data to the second Internet of Things device will be described by way of example.
[0059] Figure 6 is a flowchart of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure. As Figure 6 shown, the step of sending the encryption parameter and the public key data to the second Internet of Things device includes the following steps.
[0060] Step 610, sending the encryption parameter and the public key data to the blockchain network, so that the blockchain network forwards the encryption parameter and the public key data to the second Internet of Things device.
[0061] Specifically, the contact information of the second Internet of Things device is stored in the blockchain network. After the first Internet of Things device sends the encryption parameter and the public key data to the blockchain network, the blockchain network can send the encryption parameter and the public key data to the second Internet of Things device according to the contact information of the second Internet of Things device.
[0062] The blockchain network has the characteristics of anti-attack tampering, so that the use of the blockchain network to forward the encryption parameter and the public key data further improves the security of data transmission.
[0063] In order to clarify the specific determination manner of the public key data, the following will be combinedFigure 7 An example is made.
[0064] Figure 7 is a flowchart of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure. As shown in the figure, before the step of sending the public key data to the second Internet of Things device, the following steps are further included. Figure 7
[0065] Step 710, generating the public key data based on the encryption parameter, the location data of the first Internet of Things device and the private key data of the first Internet of Things device.
[0066] Specifically, the first Internet of Things device can first determine the encryption parameter, the location data and the private key data, and then generate the public key data according to the determined data.
[0067] In actual application, the determination of the encryption parameter, the location data and the private key data, and the generation of the public key data are all completed by the first Internet of Things device, without the participation of other devices, further avoiding the leakage of the location data of the first Internet of Things device.
[0068] In an embodiment, the generating of the public key data based on the encryption parameter, the location data of the first Internet of Things device and the private key data of the first Internet of Things device can include: generating the public key data based on the encryption parameter, the location data of the first Internet of Things device, the private key data of the first Internet of Things device and at least one random number.
[0069] Specifically, the encryption parameter includes a finite cyclic group with a rank of n. n is a positive integer, and each of the at least one random number is a positive integer less than n.
[0070] The more specific determination method of the public key data is illustrated below. Figure 8
[0071] Figure 8 is a flowchart of the method for cooperation of Internet of Things devices provided by another embodiment of the present disclosure. As shown in the figure, the step of generating the public key data based on the encryption parameter, the location data of the first Internet of Things device and the private key data of the first Internet of Things device includes the following steps. Figure 8
[0072] Step 811, determining the first public key data with the private key data of the first Internet of Things device as the exponent and the generating element as the base.
[0073] Step 812, respectively determining the second public key data corresponding to each of the at least one random number with the at least one random number as the exponent and the generating element as the base.
[0074] Step 813, determine third public key data based on the position data of the first Internet of Things device, the four arithmetic operation results of the private key data of the first Internet of Things device and at least one random number, and the generating element as the base number.
[0075] Step 814, determine public key data based on the first public key data, the second public key data corresponding to each of the at least one random number, the third public key data, and the preset prime number.
[0076] Specifically, the encryption parameter includes a preset prime number P, a finite cyclic group G of rank n, and a generating element g, where n is a positive integer. Steps 811 to 814 can be performed by the following formula (1), that is, the public key data can be generated by formula (1).
[0077] (A0, A1, A2) = (g^x, g^y, g^(xy+a)) mod P (1)
[0078] Where (A0, A1, A2) is the public key data, where A0 is the first public key data, A1 is the second public key data, and A2 is the third public key data. a is the position data of the first Internet of Things device, P is the preset prime number, g is the generating element, x is the private key data of the first Internet of Things device, y is the random number, x is a positive integer less than n, and y is a positive integer less than n.
[0079] In the process of generating the public key data, the embodiment adds a random number. Because the "random number" has randomness, the generated public key data is more difficult to crack, and the security of the public key data is improved. Because the public key data is generated based on the position data of the first Internet of Things device, the security of the position data of the first Internet of Things device is further improved.
[0080] The following will be combined Figure 9 , Figure 10 and Figure 11 to illustrate the specific implementation manner of determining whether the second Internet of Things device and the first Internet of Things device are located in the same area.
[0081] Figure 9 is a flowchart of an Internet of Things device cooperation method provided by another embodiment of the present disclosure. As Figure 9 shown, the step of determining whether the second Internet of Things device and the first Internet of Things device are located in the same area based on the position encryption data of the second Internet of Things device and the private key data of the first Internet of Things device includes the following steps.
[0082] Step 910, based on the position encryption data of the second Internet of Things device and the private key data of the first Internet of Things device, determine the decryption data corresponding to the second Internet of Things device.
[0083] Specifically, the decryption operation based on the location encryption data of the second IoT device and the private key data of the first IoT device can be a decryption operation on the location encryption data of the second IoT device using the private key data of the first IoT device. The decryption algorithm of the decryption operation is the same as the encryption algorithm of the encryption operation in the above embodiment. For example, the decryption operation and the encryption operation both use the ElGamal algorithm.
[0084] Exemplarily, the location encryption data of the second IoT device can be determined using the following formula (2).
[0085] (B0,B1)=(A1^r*g^s,(A2 / g^b)^r*A0^s)mod P (2)
[0086] wherein the encryption parameters include a preset prime number P, a finite cyclic group G of rank n, and a generator g, n is a positive integer. (B0, B1) is the location encryption data of the second IoT device, b is the location data of the second IoT device, r and s are random numbers, and r and s are both positive integers less than n. A0, A1, and A2 are public key data.
[0087] In an embodiment, as shown in Figure 10 The location encryption data of the second IoT device includes first location encryption data and second location encryption data, and the decryption operation based on the location encryption data of the second IoT device and the private key data of the first IoT device to determine the decryption data corresponding to the second IoT device includes the following steps.
[0088] Step 1010, determining an intermediate parameter with the first location encryption data as the base and the private key data of the first IoT device as the exponent.
[0089] Step 1020, calculating the decryption data corresponding to the second IoT device by dividing the second location encryption data by the intermediate parameter.
[0090] Steps 1010 and 1020 can be determined by the following formula (3), that is, the decryption data corresponding to the second IoT device can be determined by formula (3).
[0091] J=B1 / (B0^x) (3)
[0092] wherein J is the decryption data. B1 and B0 are the location encryption data of the second IoT device. x is the private key data of the first IoT device.
[0093] Exemplarily, there can be multiple second IoT devices, and for each second IoT device, the decryption data can be determined according to formulas (2) and (3).
[0094] At step 920, based on the decryption data corresponding to the second IoT device, it is determined whether the second IoT device and the first IoT device are located in the same region.
[0095] In an embodiment, as shown in FIG. 9, the step of determining whether the second IoT device and the first IoT device are located in the same region based on the decryption data corresponding to the second IoT device includes the following steps. Figure 11
[0096] At step 1110, based on the decryption data corresponding to the second IoT device, it is determined whether the value of the decryption data corresponding to the second IoT device is 1.
[0097] At step 1120, if the value of the decryption data corresponding to the second IoT device is 1, it is determined that the second IoT device and the first IoT device are located in the same region. Specifically, if the value of the decryption data J is 1, it indicates that the second IoT device and the first IoT device are located in the same region, and if the value of the decryption data J is not 1, it indicates that the second IoT device and the first IoT device are located in different regions.
[0098] Specifically, substituting A0, A1 and A2 in formula (1) into formula (2) can obtain the following formula (4).
[0099] (B0, B1) = (g^(yr+s), ((g^x)^(yr+s))*g^(r(a-b))) mod P (4)
[0100] Substituting formula (4) into formula (3) can obtain the following formula (5).
[0101] J = g^(r(a-b)) (5)
[0102] As can be seen from formula (5), if the position data a of the first IoT device and the position data b of the second IoT device are equal, the decryption data J = 1.
[0103] In this embodiment, based on the position encryption data of the second IoT device and the private key data of the first IoT device, decryption operation is performed to determine the decryption data corresponding to the second IoT device, and then based on the decryption data corresponding to the second IoT device, it is determined whether the second IoT device and the first IoT device are located in the same region. Only by determining whether the decryption data is a preset value (for example, the value 1) can it be determined whether the second IoT device and the first IoT device are located in the same region. The calculation method is simple and efficient.
[0104] The IoT device cooperation method applied to the second IoT device will be described below with examples. Figure 12
[0105] Figure 12 FIG. 1 is a flow diagram of a method for cooperation of IoT devices according to an embodiment of the present disclosure. The method can be performed by a first IoT device. As shown in FIG. 1, the method for cooperation of IoT devices includes the following steps. Figure 12
[0106] At step 1210, the encrypted parameter and the public key data sent by the first IoT device are received.
[0107] The public key data is determined based on the location data of the first IoT device and the private key data of the first IoT device.
[0108] Specifically, the encrypted parameter and the public key data sent by the first IoT device can be received directly by each of the plurality of second IoT devices, or can be received by each of the plurality of second IoT devices through a third-party platform or a blockchain network, or can be received directly by a part of the plurality of second IoT devices and received through a third-party platform or a blockchain network by another part of the plurality of second IoT devices.
[0109] At step 1220, an encryption operation is performed based on the encrypted parameter, the public key data, and the location data of the second IoT device to generate location encryption data of the second IoT device.
[0110] Exemplarily, the location encryption data of the second IoT device can be determined by using the above formula (2).
[0111] At step 1230, the location encryption data of the second IoT device is sent to the first IoT device.
[0112] Specifically, after sending the location encryption data of the second IoT device to the first IoT device, the first IoT device determines whether the second IoT device and the first IoT device are located in the same region based on the location encryption data of the second IoT device and the private key data of the first IoT device, and sends a cooperation request to the second IoT device located in the same region.
[0113] The method for cooperation of Internet of Things devices provided in this embodiment comprises the following steps: receiving encrypted parameters sent by a first Internet of Things device and public key data determined based on position data of the first Internet of Things device and private key data of the first Internet of Things device, performing an encryption operation based on the encrypted parameters, the public key data and position data of a second Internet of Things device, generating position encryption data of the second Internet of Things device, and sending the position encryption data of the second Internet of Things device to the first Internet of Things device. That is, the position data transmitted between the first Internet of Things device and the second Internet of Things device in this embodiment is all encrypted position data, which reduces the risk of leakage of the position information of the first Internet of Things device and the position information of the second Internet of Things device, and improves the security of cooperation of Internet of Things devices.
[0114] In an embodiment, the sending of the position encryption data of the second Internet of Things device to the first Internet of Things device can be performed by sending the position encryption data of the second Internet of Things device to a blockchain network, so that the blockchain network sends the position encryption data of the second Internet of Things device to the first Internet of Things device. The blockchain network has the characteristics of anti-attack tampering, so that the position data of the second Internet of Things device is further improved in security by using the blockchain network to forward the position encryption data of the second Internet of Things device.
[0115] In an embodiment, the encryption operation based on the encrypted parameters, the public key data and the position data of the second Internet of Things device to generate the position encryption data of the second Internet of Things device can be performed by performing the encryption operation based on the encrypted parameters, the public key data, the position data of the second Internet of Things device and at least one random number to generate the position encryption data of the second Internet of Things device. The encrypted parameters comprise a finite cyclic group with a rank n, and n is a positive integer. Each of the at least one random number is a positive integer less than n. Exemplarily, the position encryption data of the second Internet of Things device can be determined by using the above formula (2).
[0116] The method embodiments of the present disclosure are described in detail above Figures 5 to 12 , and the device embodiments of the present disclosure are described in detail below Figure 13 and Figure 14 . In addition, it should be understood that the description of the method embodiments corresponds to the description of the device embodiments, and therefore, the parts not described in detail can be referred to the foregoing method embodiments.
[0117] Figure 13 FIG. 1 is a structural schematic diagram of a device for cooperation of Internet of Things devices according to an embodiment of the present disclosure. The present embodiment is applied to a first Internet of Things device. As shown in FIG. 1, the device for cooperation of Internet of Things devices 1300 provided in this embodiment comprises a first sending module 1310, a first receiving module 1320, a same-area determining module 1330 and a second sending module 1340. Figure 13
[0118] Specifically, the first sending module 1310 is configured to send the encryption parameter and the public key data to the second Internet of Things device, so that the second Internet of Things device performs an encryption operation based on the encryption parameter, the public key data and location data of the second Internet of Things device to generate location encryption data of the second Internet of Things device, wherein the public key data is determined based on the location data of the first Internet of Things device and private key data of the first Internet of Things device. The first receiving module 1320 is configured to receive the location encryption data sent by the second Internet of Things device. The same area determining module 1330 is configured to determine whether the second Internet of Things device and the first Internet of Things device are located in the same area based on the location encryption data of the second Internet of Things device and the private key data of the first Internet of Things device. The second sending module 1340 is configured to send a cooperation request to the second Internet of Things device located in the same area if the second Internet of Things device and the first Internet of Things device are located in the same area.
[0119] In an embodiment, the first sending module 1310 is further configured to send the encryption parameter and the public key data to a blockchain network, so that the blockchain network forwards the encryption parameter and the public key data to the second Internet of Things device.
[0120] In an embodiment, as shown in FIG. 13B, the Internet of Things device cooperation apparatus 1300 provided by the embodiments of the present disclosure further includes a public key data generating module 1350. Figure 13
[0121] Specifically, the public key data generating module 1350 is configured to generate the public key data based on the encryption parameter, the location data of the first Internet of Things device and the private key data of the first Internet of Things device.
[0122] In an embodiment, the encryption parameter includes a finite cyclic group of rank n, and the public key data generating module 1350 is further configured to generate the public key data based on the encryption parameter, the location data of the first Internet of Things device, the private key data of the first Internet of Things device and at least one random number, wherein n is a positive integer, and each of the at least one random number is a positive integer less than n.
[0123] In an embodiment, the encryption parameter further includes a generator and a preset prime number, and the public key data generating module 1350 is further configured to determine a first public key data by taking the private key data of the first Internet of Things device as an exponent with the generator as a base; determine at least one second public key data corresponding to each of the at least one random number by taking the at least one random number as an exponent with the generator as a base; determine a third public key data by taking a result of four arithmetic operations of the location data of the first Internet of Things device, the private key data of the first Internet of Things device and the at least one random number as an exponent with the generator as a base; and determine the public key data by performing a modulo operation based on the first public key data, the at least one second public key data, the third public key data and the preset prime number.
[0124] In an embodiment, the same area determining module 1330 is further configured to perform a decryption operation based on the location encryption data of the second IoT device and the private key data of the first IoT device to determine decryption data corresponding to the second IoT device, and determine whether the second IoT device and the first IoT device are located in the same area based on the decryption data corresponding to the second IoT device.
[0125] In an embodiment, the location encryption data of the second IoT device includes first location encryption data and second location encryption data, and the same area determining module 1330 is further configured to determine an intermediate parameter by taking the first location encryption data as a base and the private key data of the first IoT device as an exponent, divide the second location encryption data by the intermediate parameter to calculate the decryption data corresponding to the second IoT device, and determine that the second IoT device and the first IoT device are located in the same area if the value of the decryption data corresponding to the second IoT device is 1.
[0126] Figure 14 FIG. 14 is a structural schematic diagram of an IoT device cooperation apparatus provided by another embodiment of the present disclosure. The present embodiment is applied to a second IoT device. As shown in FIG. 14, the IoT device cooperation apparatus 1400 provided by the embodiment of the present disclosure includes a second receiving module 1410, an encryption data generating module 1420, and a third sending module 1430. Figure 14
[0127] Specifically, the second receiving module 1410 is configured to receive the encryption parameter and the public key data sent by the first IoT device, wherein the public key data is determined based on the location data of the first IoT device and the private key data of the first IoT device. The encryption data generating module 1420 is configured to perform an encryption operation based on the encryption parameter, the public key data, and the location data of the second IoT device to generate the location encryption data of the second IoT device. The third sending module 1430 is configured to send the location encryption data of the second IoT device to the first IoT device, so that the first IoT device determines whether the second IoT device and the first IoT device are located in the same area based on the location encryption data of the second IoT device and the private key data of the first IoT device, and sends a cooperation request to the second IoT device located in the same area.
[0128] In an embodiment, the third sending module 1430 is further configured to send the location encryption data of the second IoT device to a blockchain network, so that the blockchain network sends the location encryption data of the second IoT device to the first IoT device.
[0129] In an embodiment, the encryption parameter comprises a finite cyclic group of rank n, and the encryption data generation module 1420 is further configured to perform an encryption operation based on the encryption parameter, the public key data, the location data of the second Internet of Things device, and at least one random number to generate the location encryption data of the second Internet of Things device, where n is a positive integer, and each of the at least one random number is a positive integer less than n.
[0130] Figure 15 FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 15 The electronic device 1500 shown may, for example, be a computing device having a computing function. For example, the electronic device 1500 may be a server. The electronic device 1500 may include a memory 1501 and a processor 1502. The memory 1501 may be used to store executable code. The processor 1502 may be used to execute the executable code stored in the memory 1501 to implement the steps in the various methods described above. In an embodiment, the electronic device 1500 may further include a network interface 1503, and data exchange between the processor 1502 and an external device may be achieved through the network interface 1503.
[0131] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0132] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments of the present disclosure can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.
[0133] In several embodiments provided by the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, another division manner can be used. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0134] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. can be located in one place or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.
[0135] In addition, each functional unit in each embodiment of the present disclosure can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit.
[0136] The above is merely a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A method for Internet of Things (IoT) device cooperation, applied to a first IoT device, comprising: sending, to a second IoT device, an encryption parameter and public key data, so that the second IoT device performs an encryption operation based on the encryption parameter, the public key data, and location data of the second IoT device to generate location encryption data of the second IoT device, wherein the public key data is determined based on location data of the first IoT device and private key data of the first IoT device; receiving the location encryption data sent by the second IoT device; determining whether the second IoT device and the first IoT device are located in a same region based on the location encryption data of the second IoT device and the private key data of the first IoT device; if the second IoT device and the first IoT device are located in the same region, sending a cooperation request to the second IoT device located in the same region; wherein the determining whether the second IoT device and the first IoT device are located in the same region based on the location encryption data of the second IoT device and the private key data of the first IoT device comprises: performing a decryption operation based on the location encryption data of the second IoT device and the private key data of the first IoT device to determine decryption data corresponding to the second IoT device; and determining whether the second IoT device and the first IoT device are located in the same region based on the decryption data corresponding to the second IoT device. 2.The method of claim 1, wherein the sending, to a second IoT device, an encryption parameter and public key data comprises: sending the encryption parameter and the public key data to a blockchain network, so that the blockchain network forwards the encryption parameter and the public key data to the second IoT device. 3.The method of claim 1, further comprising, before the sending, to a second IoT device, public key data: generating the public key data based on the encryption parameter, the location data of the first IoT device, and the private key data of the first IoT device. 4.The method of claim 3, wherein the encryption parameter comprises a finite cyclic group of rank n, and the generating the public key data based on the encryption parameter, the location data of the first IoT device, and the private key data of the first IoT device comprises: generating the public key data based on the encryption parameter, the location data of the first IoT device, the private key data of the first IoT device, and at least one random number, wherein n is a positive integer, and each of the at least one random number is a positive integer less than n. 5.The method of claim 4, wherein the encryption parameter further comprises a generator and a preset prime number, and the generating the public key data based on the encryption parameter, the location data of the first IoT device, the private key data of the first IoT device, and at least one random number comprises: determining first public key data with the generator as a base and the private key data of the first IoT device as an exponent. determining second public key data corresponding to each of the at least one random number respectively, by taking the generation element as a base number and the at least one random number as an index; determining third public key data by taking the generation element as a base number and a result of four arithmetic operations of the position data of the first IoT device, the private key data of the first IoT device and the at least one random number as an index; determining the public key data by performing a modulo operation based on the first public key data, the second public key data corresponding to each of the at least one random number respectively, the third public key data and the preset prime number.
6. The IoT device cooperation method of claim 1, the position encryption data of the second IoT device comprises first position encryption data and second position encryption data, the determining decryption data corresponding to the second IoT device based on the position encryption data of the second IoT device and the private key data of the first IoT device comprises: determining an intermediate parameter by taking the first position encryption data as a base number and the private key data of the first IoT device as an index; calculating the decryption data corresponding to the second IoT device by dividing the second position encryption data by the intermediate parameter; wherein the determining whether the second IoT device and the first IoT device are located in the same region based on the decryption data corresponding to the second IoT device comprises: if the value of the decryption data corresponding to the second IoT device is 1, determining that the second IoT device and the first IoT device are located in the same region. 7.The method of claim 1 to 5, wherein the location data of the first IoT device comprises a first zone number and the location data of the second IoT device comprises a second zone number, and wherein, the first region number and the second region number are determined based on the same region numbering method.
8. The IoT device cooperation method of any one of claims 1 to 5, the first IoT device comprises a vehicle IoT device or a shipping IoT device.
9. An IoT device cooperation method applied to a second IoT device, comprising: receiving encryption parameters and public key data sent by a first IoT device, wherein the public key data is determined based on position data of the first IoT device and private key data of the first IoT device; performing encryption operation based on the encryption parameters, the public key data and position data of the second IoT device to generate position encryption data of the second IoT device; sending the position encryption data of the second IoT device to the first IoT device, so that the first IoT device determines whether the second IoT device and the first IoT device are located in the same region based on the position encryption data of the second IoT device and the private key data of the first IoT device, and sends a cooperation request to the second IoT device located in the same region; wherein the determining whether the second IoT device and the first IoT device are located in the same region based on the position encryption data of the second IoT device and the private key data of the first IoT device comprises: performing decryption operation based on the position encryption data of the second IoT device and the private key data of the first IoT device to determine decryption data corresponding to the second IoT device; determine whether the second IoT device and the first IoT device are located in the same area based on decryption data corresponding to the second IoT device.
10. The IoT device cooperation method of claim 9, wherein the sending, to the first IoT device, the location encryption data of the second IoT device comprises: sending, to a blockchain network, the location encryption data of the second IoT device, so that the blockchain network sends the location encryption data of the second IoT device to the first IoT device.
11. The IoT device cooperation method of claim 9 or 10, wherein the encryption parameter comprises a finite cyclic group of rank n, and the generating the location encryption data of the second IoT device based on the encryption parameter, the public key data, and the location data of the second IoT device comprises: generating the location encryption data of the second IoT device based on the encryption parameter, the public key data, the location data of the second IoT device, and at least one random number, wherein n is a positive integer, and each of the at least one random number is a positive integer less than n.
12. The IoT device cooperation method of claim 11, wherein the encryption parameter further comprises a generator and a preset prime number, and the location encryption data of the second IoT device is generated according to the following formula: (B0, B1) = (A1^r g^s, (A2 / g^b)^r A0^s) mod P, wherein wherein B0 and B1 are the location encryption data of the second IoT device, A0, A1, and A2 are the public key data, b is the location data of the second IoT device, g is the generator, P is the preset prime number, and r and s are random numbers, and each of r and s is a positive integer less than n.
13. An IoT device cooperation apparatus applied to a first IoT device, comprising: a first sending module configured to send, to a second IoT device, an encryption parameter and public key data, so that the second IoT device generates location encryption data of the second IoT device based on the encryption parameter, the public key data, and location data of the second IoT device, wherein the public key data is determined based on location data of the first IoT device and private key data of the first IoT device; a first receiving module configured to receive the location encryption data sent by the second IoT device; an area determination module configured to determine whether the second IoT device and the first IoT device are located in the same area based on the location encryption data of the second IoT device and the private key data of the first IoT device; a second sending module configured to send, to the second IoT device located in the same area, a cooperation request if the second IoT device and the first IoT device are located in the same area; wherein the determining whether the second IoT device and the first IoT device are located in the same area based on the location encryption data of the second IoT device and the private key data of the first IoT device comprises: performing decryption operation based on the location encryption data of the second IoT device and the private key data of the first IoT device to determine decryption data corresponding to the second IoT device. determine, based on the decryption data corresponding to the second Internet of Things device, whether the second Internet of Things device and the first Internet of Things device are located in the same region.
14. An Internet of Things device cooperation apparatus applied to a second Internet of Things device, comprising: a second receiving module configured to receive encrypted parameters and public key data sent by a first Internet of Things device, wherein the public key data is determined based on location data of the first Internet of Things device and private key data of the first Internet of Things device; an encrypted data generation module configured to perform an encryption operation based on the encrypted parameters, the public key data and location data of the second Internet of Things device to generate location encrypted data of the second Internet of Things device; a third sending module configured to send the location encrypted data of the second Internet of Things device to the first Internet of Things device, so that the first Internet of Things device determines, based on the location encrypted data of the second Internet of Things device and the private key data of the first Internet of Things device, whether the second Internet of Things device and the first Internet of Things device are located in the same region, and sends a cooperation request to the second Internet of Things device located in the same region; wherein the determination of whether the second Internet of Things device and the first Internet of Things device are located in the same region based on the location encrypted data of the second Internet of Things device and the private key data of the first Internet of Things device comprises: performing a decryption operation based on the location encrypted data of the second Internet of Things device and the private key data of the first Internet of Things device to determine decryption data corresponding to the second Internet of Things device; determining, based on the decryption data corresponding to the second Internet of Things device, whether the second Internet of Things device and the first Internet of Things device are located in the same region.
15. An electronic device comprising a memory and a processor, the memory having stored therein executable code, and the processor configured to execute the executable code to implement the method of any one of claims 1 to 12.
Citation Information
Patent Citations
Access authentication method and device and server
CN112260995A