CN114697410A - Data transmission packaging method and device, electronic equipment and storage medium - Google Patents

Data transmission packaging method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114697410A
CN114697410A CN202011593838.8A CN202011593838A CN114697410A CN 114697410 A CN114697410 A CN 114697410A CN 202011593838 A CN202011593838 A CN 202011593838A CN 114697410 A CN114697410 A CN 114697410A
Authority
CN
China
Prior art keywords
equipment
data packet
packaging
sdk
binding information
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.)
Pending
Application number
CN202011593838.8A
Other languages
Chinese (zh)
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.)
Midea Group Co Ltd
GD Midea Air Conditioning Equipment Co Ltd
Original Assignee
Midea Group Co Ltd
GD Midea Air Conditioning Equipment 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 Midea Group Co Ltd, GD Midea Air Conditioning Equipment Co Ltd filed Critical Midea Group Co Ltd
Priority to CN202011593838.8A priority Critical patent/CN114697410A/en
Publication of CN114697410A publication Critical patent/CN114697410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Abstract

The invention relates to the technical field of communication, and provides a data transmission packaging method, a data transmission packaging device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a first data packet sent by intelligent equipment; calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment; calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information; and generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment. The mobile terminal and the intelligent equipment can have a uniform SDK packaging interface, the equipment identification and the equipment binding information can be transmitted between the mobile terminal and the intelligent equipment through the same standard interface, the mobile terminal is prevented from acquiring and processing equipment fields and binding information fields of each kind of intelligence, the equipment data format requirements of different intelligent equipment manufacturers are met, and meanwhile confidentiality is also carried out on the equipment fields and the binding information fields of the intelligent equipment manufacturers.

Description

Data transmission packaging method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for packaging data transmission, an electronic device, and a storage medium.
Background
With the vigorous development of the internet of things technology, the intelligent equipment is popularized, a user can check the state of the equipment through the mobile phone remote control equipment, a series of intelligent scenes brought by equipment linkage can be enjoyed, and abundant intelligent experience is given to the user.
Equipment networking is the first step of intellectuality, and the more net mode of joining in marriage at present has two kinds: the intelligent equipment and the router establish wireless communication to directly acquire distribution network information and equipment binding information; the intelligent device and the intelligent mobile terminal directly establish communication to obtain distribution network information and device binding information. The two modes relate to the interaction of sensitive information such as equipment information, distribution network binding information and the like, and data confidentiality among different manufacturers is an urgent problem to be solved.
Because the intelligent device manufacturer is not the same as the mobile terminal or the router manufacturer, in order to realize the packaging of the distribution network information and the device binding information: a mobile terminal manufacturer and an intelligent device manufacturer need to communicate specific details such as a device field, a binding information field and the like, but sometimes the intelligent device manufacturer does not want to reveal the information; because the structure and the length of the equipment field and the binding information field of each intelligent equipment manufacturer are different, the whole packet is encrypted and decrypted, and the mobile terminal manufacturer needs to process different equipment fields and binding information fields, so that the compatibility cannot be realized.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a packaging method for data transmission, which enables a mobile terminal and intelligent equipment to have a uniform SDK packaging interface, can transmit equipment identification and equipment binding information between the mobile terminal and the intelligent equipment by using the same standard interface, avoids the mobile terminal from acquiring and processing each intelligent equipment field and binding information field, realizes the compatibility with the equipment data format requirements of different intelligent equipment manufacturers, and simultaneously keeps the equipment field and the binding information field of the intelligent equipment manufacturers secret.
The invention also provides a data transmission package device, electronic equipment and a storage medium.
The method for packaging data transmission in the first aspect of the invention is applied to a mobile terminal, and comprises the following steps:
acquiring a first data packet sent by intelligent equipment, wherein the first data packet is generated based on an equipment identifier of the intelligent equipment;
calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment;
calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information;
generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
The packet packing method for data transmission provided by the invention also has the following additional technical characteristics:
further, the calling the second SDK encapsulation interface to encapsulate the device identifier to obtain the device binding information includes:
generating a binding information structure body according to the equipment identifier;
generating a first ciphertext according to the first symmetric key, the first initialization vector and the binding information structure body; the first symmetric secret key is randomly configured by the intelligent equipment, and the first initialization vector is randomly generated in a symmetric encryption algorithm;
and packaging according to the first ciphertext and the first initialization vector to obtain the equipment binding information.
Further, the generating a second data packet according to the device binding information and the distribution network information includes:
generating a shared secret key according to the first symmetric secret key and the first public key;
generating a combined data packet according to the equipment binding information and the distribution network information;
generating a second ciphertext according to the shared secret key, the second initialization vector and the combined data packet;
and packaging according to the second ciphertext, the first public key and the second initialization vector to obtain a second data packet.
Further, the invoking the first SDK encapsulation interface to analyze the first data packet to obtain the device identifier of the smart device includes:
performing packet processing on the first data packet to obtain an equipment field and a mobile terminal definition field;
performing inverse splicing processing on the equipment field to obtain a third ciphertext and a third initialization vector;
decrypting the third ciphertext to obtain a first symmetric secret key, a third initialization vector and a first plaintext;
performing inverse splicing processing on the first plaintext to obtain a second public key and an equipment identifier structural body;
and obtaining the equipment identifier according to the equipment identifier structural body.
The method for packaging data transmission in the second aspect of the invention is applied to intelligent equipment, and comprises the following steps:
packaging the equipment identification of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet, and sending the first data packet to the mobile terminal;
acquiring a second data packet sent by the mobile terminal, and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information;
establishing connection with a cloud end through a router according to the distribution network information, and sending the equipment binding information to the cloud end;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
Further, the encapsulating the device identifier of the smart device by using the first SDK encapsulation interface to generate the first data packet includes:
generating an equipment identifier structural body according to the equipment identifier;
generating a first plaintext according to the second public key and the equipment identification structural body;
generating a third ciphertext according to the first symmetric key, the third initialization vector and the first plaintext;
generating a device field according to the third ciphertext and the third initialized vector;
and generating a first data packet according to the equipment field and the mobile terminal definition field.
Further, the analyzing the second data packet by using the second SDK encapsulation interface to obtain distribution network information and device binding information, including:
performing packet processing on the second data packet to obtain a second ciphertext, a first public key and a second initialization vector;
decrypting the second ciphertext to obtain a shared secret key, a second initialization vector and a combined data packet;
and performing sub-packet processing on the combined data packet to obtain equipment binding information and distribution network information.
The packet packing device for data transmission in the third aspect of the present invention is applied to a mobile terminal, and includes:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first data packet sent by the intelligent device, and the first data packet is generated based on the device identifier of the intelligent device;
the first analysis module is used for calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment;
the first packaging module is used for calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information;
the generating module is used for generating a second data packet according to the equipment binding information and the distribution network information and sending the second data packet to the intelligent equipment;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
The invention relates to a data transmission group packing device, which is applied to intelligent equipment and comprises:
the second packaging module is used for packaging the equipment identifier of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet and sending the first data packet to the mobile terminal;
the second analysis module is used for acquiring a second data packet sent by the mobile terminal and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information;
the processing module is used for establishing connection with a cloud end through a router according to the distribution network information and sending the equipment binding information to the cloud end;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
The electronic device of the fifth aspect of the present invention comprises a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the packaging method for data transmission as described above when executing the program.
A non-transitory computer-readable storage medium of a sixth aspect of the invention, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the group packaging method for data transmission as described above.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for packaging data transmissions in accordance with the present invention;
FIG. 2 is a schematic diagram of a second packet generation process according to the present invention;
FIG. 3 is another flow chart of the method for packaging data transmissions according to the present invention;
FIG. 4 is a schematic diagram of a first packet generation process according to the present invention;
FIG. 5 is a schematic diagram of a data transmission group packing apparatus according to the present invention;
FIG. 6 is a schematic diagram of the structure of a data transmission group packing device according to the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 shows a flow chart of a packet packing method for data transmission provided by the present invention, and referring to fig. 1, the method is applied to a mobile terminal, and includes the following steps:
11. acquiring a first data packet sent by intelligent equipment, wherein the first data packet is generated based on equipment identification of the intelligent equipment;
12. calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment;
13. calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information;
14. generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment;
the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
As to steps 11 to 14, it should be noted that, in the present invention, after the intelligent device enters the distribution network state, the intelligent device establishes communication with the mobile terminal, and transmits the device identifier to the mobile terminal. The mobile terminal judges whether a non-inductive distribution network is supported or not through the equipment identifier, and if the non-inductive distribution network is supported, the distribution network information and the equipment binding information are transmitted to the intelligent equipment. The intelligent device acquires the distribution network information to be connected with the router, then is connected with the cloud end through the router, and transmits the device binding information. The cloud interacts with the mobile terminal, the equipment binding information is verified, and equipment right confirmation is completed.
In the above description, the smart device needs to send the device identifier to the mobile terminal. In order to avoid that the intelligent equipment manufacturer informs the mobile terminal manufacturer of the format of the equipment identifier in advance, the method needs to package the equipment identifier on the intelligent equipment, wherein an SDK packaging interface is adopted to package the equipment identifier, the equipment identifier is packaged into a data packet (namely the first data packet mentioned in the step), and then the data packet is sent to the mobile terminal.
In the present invention, an SDK, a Software Development Kit, refers to a collection of Development tools used by a Software engineer to build application Software for a particular Software package, Software framework, hardware platform, operating system, etc.
In the invention, two SDK packaging interfaces, namely a first SDK packaging interface and a second SDK packaging interface, are provided and configured by an intelligent terminal manufacturer in the mobile terminal. The first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
The data packet received by the mobile terminal is obtained by processing the equipment identifier by adopting the first SDK packaging interface. The first SDK packaging interface is used for carrying out reverse processing on the received data packet so as to obtain the equipment identification of the intelligent equipment.
Therefore, the mobile terminal receives the data packet sent by the intelligent equipment, and the first SDK packaging interface is called to analyze the first data packet to obtain the equipment identifier of the intelligent equipment.
In the above description, the mobile terminal needs to feed back, to the smart device, device binding information for the smart device, where the device binding information is used for determining the right of the cloud and the mobile terminal to the smart device.
The intelligent device manufacturer is prevented from informing the mobile terminal manufacturer of the format of the device binding information in advance. The method of the invention needs equipment binding information to be packaged, wherein, an SDK packaging interface is also adopted to package the equipment binding information, and then the equipment binding information and distribution network information (SSID and password of a router) are packaged into a data packet (namely the second data packet mentioned in the step), and then the data packet is sent to the intelligent equipment.
In the invention, in order to distinguish the working property of the SDK packaging interface, the second SDK packaging interface is used for packaging the equipment identifier to obtain the equipment binding information.
Therefore, the mobile terminal calls the second SDK packaging interface to package the equipment identification to obtain the equipment binding information.
The method for packaging data transmission enables the mobile terminal and the intelligent equipment to have a uniform SDK packaging interface, can transmit the equipment identification and the equipment binding information between the mobile terminal and the intelligent equipment by using the same standard interface, avoids the mobile terminal from acquiring and processing each intelligent equipment field and binding information field, realizes the compatibility with the equipment data format requirements of different intelligent equipment manufacturers, and keeps the equipment field and the binding information field of the intelligent equipment manufacturers secret.
In the further method of the present invention, the explanation is mainly given to the processing procedure of obtaining the device binding information by calling the second SDK encapsulation interface to encapsulate the device identifier, specifically as follows:
generating a binding information structure body according to the equipment identifier;
generating a first ciphertext according to the first symmetric key, the first initialization vector and the binding information structure body; the first symmetric secret key is randomly configured by the intelligent equipment, and the first initialization vector is randomly generated in a symmetric encryption algorithm;
and packaging according to the first ciphertext and the first initialization vector to obtain the equipment binding information.
In this regard, it should be noted that, in the present invention, a second SDK encapsulation interface provided by the smart device vendor is called to generate a binding information structure for device binding based on the smart device vendor specification and the device identifier, and then a set of initialization vectors (i.e., first initialization vectors) is randomly generated.
And then, symmetrically encrypting the binding information structure body by using a symmetric key (namely a first pair of key) and an initialization vector sent by the intelligent equipment to generate a ciphertext (namely a first ciphertext), splicing the generated ciphertext and the initialization vector through an algorithm, and packaging the ciphertext and the initialization vector into equipment binding information.
According to the method, the binding information structure body for binding the equipment generated based on the manufacturer specification and the equipment identification of the intelligent equipment is encrypted and spliced through the SDK packaging interface, so that the equipment binding information transmitted between the mobile terminal and the intelligent equipment through the same standard interface is obtained, and the intelligent equipment can use the information conveniently.
In the further method of the present invention, the explanation of the processing procedure for generating the second data packet according to the device binding information and the distribution network information is mainly as follows:
generating a shared secret key according to the first symmetric secret key and the first public key;
generating a combined data packet according to the equipment binding information and the distribution network information;
generating a second ciphertext according to the shared secret key, the second initialization vector and the combined data packet;
and packaging according to the second ciphertext, the first public key and the second initialization vector to obtain a second data packet.
In contrast, in the present invention, after obtaining the device binding information, the mobile terminal needs to send the device binding information and the distribution network information to the intelligent device, so that the intelligent device is connected to the router according to the distribution network information, and further connected to the cloud. Here, the device binding information and the distribution network information need to be encapsulated and packaged to obtain a data packet, and then the data packet is sent to the intelligent device.
The mobile terminal firstly generates a group of public and private key pairs for key exchange randomly through a key generation algorithm, namely a first public key and a first private key.
And generating a shared secret key by using the first symmetric secret key and the first public key, and then generating a combined data packet by using the equipment binding information and the distribution network information, wherein the combined data packet represents that the equipment binding information and the distribution network information are used as one data packet.
And symmetrically encrypting according to the shared secret key, the second initialization vector and the combined data packet to generate a second ciphertext. And then, a second data packet is obtained by packaging according to the second ciphertext, the first public key and the second initialization vector.
In the further method, as the distribution network information is in the configuration format of the router, the data transmission can be realized by reasonably encrypting and packaging the distribution network information and the equipment binding information under the condition that the intelligent equipment has the distribution network requirement.
In the further method of the present invention, the explanation is mainly given to the processing procedure of calling the first SDK encapsulation interface to analyze the first data packet to obtain the device identifier of the intelligent device, which is specifically as follows:
performing packet processing on the first data packet to obtain an equipment field and a mobile terminal definition field;
performing inverse splicing processing on the equipment field to obtain a third ciphertext and a third initialization vector;
decrypting the third ciphertext to obtain a first symmetric secret key, a third initialization vector and a first plaintext;
performing inverse splicing processing on the first plaintext to obtain a second public key and an equipment identification structural body;
and obtaining the equipment identifier according to the equipment identifier structural body.
To this end, it should be noted that, in the present invention, the first data packet is obtained by the intelligent device encapsulating and packaging the device identifier by using the first SDK encapsulation interface, and for this reason, the mobile terminal invokes the same first SDK encapsulation interface to perform the reverse operation on the first data packet, so as to obtain the device identifier.
Table 1 shows the structure content of the first packet. Table 2 shows the structural content of the second packet.
TABLE 1
Figure BDA0002869385970000101
TABLE 2
Figure BDA0002869385970000102
The following explains the generation process of the second data packet by using a specific example, which specifically includes the following steps:
after receiving a first data packet sent by the intelligent device, the mobile terminal analyzes a packaged device field F1 by adopting a first SDK packaging (SDK1) interface, an SDK1 integrates a data analysis algorithm, firstly, reverse splicing processing is carried out to obtain an initialization vector iv3 and a ciphertext E1, the ciphertext E1 is decrypted by using symmetric secret keys K1 and iv3 to obtain a plaintext C1, after reverse splicing processing, a public key N1 and a device identification structure S1 of device end key exchange are obtained, an device identification structure S1 is analyzed to judge whether the device supports a noninductive distribution network, and a judgment result and the public key N1 are used as standard output of the SDK1 interface and fed back to the mobile terminal.
Referring to fig. 2, the mobile terminal receives the determination result, if the smart device does not support the non-inductive distribution network, the mobile terminal does not process the first data packet, if the smart device supports the non-inductive distribution network, the mobile terminal invokes a second SDK encapsulation interface (SDK2) provided by the smart device manufacturer to generate a set of binding information structure S2 for device binding according to the specification of the smart device manufacturer, and while invoking, the SDK2 synchronously transmits the binding information structure S2 to the cloud of the smart device manufacturer for backup through the mobile terminal. The mobile terminal simultaneously generates a group of initialization vectors iv1 randomly, S2 is symmetrically encrypted by using symmetric keys K1 and iv1 at the device end, and generated ciphertexts E2 and iv2 are spliced and encapsulated into device binding information F2 through an algorithm.
The mobile phone end encrypts the connected distribution network information R1 (SSID, password, channel, etc. of the router) and the device binding information F2 encapsulated by the SDK2 through a key exchange algorithm to generate an encrypted data packet G2.
Generating a shared key K2 by a key generation algorithm according to a symmetric key K1 and a public key N1, then generating a ciphertext E3 by the shared key K2, an initialization vector iv2 and a data packet G2, and then packaging according to the ciphertext E3, the public key N2 and the initialization vector iv3 to obtain a second data packet.
Fig. 3 shows a flow chart of a packet packing method for data transmission provided by the present invention, referring to fig. 3, the method is applied to an intelligent terminal, and includes the following steps:
31. packaging the equipment identification of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet, and sending the first data packet to the mobile terminal;
32. acquiring a second data packet sent by the mobile terminal, and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information;
33. establishing connection with a cloud terminal through a router according to the distribution network information, and sending the device binding information to the cloud terminal;
the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
With respect to step S31 and step S32, it should be noted that, in the present invention, after the intelligent device enters the distribution network state, the intelligent device establishes communication with the mobile terminal and transmits the device identifier to the mobile terminal.
In order to avoid that the intelligent device manufacturer informs the mobile terminal manufacturer of the format of the device identifier in advance, the intelligent device encapsulates the device identifier by using an SDK encapsulation interface, packages the device identifier into a data packet (i.e., the first data packet mentioned in the step), and then sends the data packet to the mobile terminal.
In the invention, two SDK packaging interfaces, namely a first SDK packaging interface and a second SDK packaging interface, are provided and configured by an intelligent terminal manufacturer in the mobile terminal. The first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
The processing of the first data packet and the generation of the second data packet by the mobile terminal are described in detail in the above description, and are not described herein again.
And the mobile terminal feeds the second data packet back to the intelligent equipment, and the intelligent equipment analyzes the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information.
And then, the intelligent device establishes connection with the cloud terminal through the router according to the distribution network information and sends the device binding information to the cloud terminal.
The method comprises the following specific steps: after the intelligent device receives the transmitted second data packet, the data packet is decrypted through a key exchange algorithm to obtain distribution network information and device binding information, and then the device binding information is analyzed to obtain a binding information structure. The intelligent device logs in the cloud end through the distribution network information connection router, transmits the binding information structure body to the cloud end, and checks the binding information structure body sent to the cloud end by the mobile terminal to complete binding.
The method for packaging data transmission enables the mobile terminal and the intelligent equipment to have a uniform SDK packaging interface, can transmit the equipment identification and the equipment binding information between the mobile terminal and the intelligent equipment by using the same standard interface, avoids the mobile terminal from acquiring and processing each intelligent equipment field and binding information field, realizes the compatibility with the equipment data format requirements of different intelligent equipment manufacturers, and keeps the equipment field and the binding information field of the intelligent equipment manufacturers secret.
In the further method of the present invention, the explanation is mainly given to a processing procedure of encapsulating the device identifier of the smart device by using the first SDK encapsulation interface to generate the first data packet, which is specifically as follows:
generating an equipment identification structural body according to the equipment identification;
generating a first plaintext according to the second public key and the equipment identification structural body;
generating a third ciphertext according to the first symmetric key, the third initialization vector and the first plaintext;
generating a device field according to the third ciphertext and the third initialized vector;
and generating a first data packet according to the equipment field and the mobile terminal definition field.
In this regard, it should be noted that, in the present invention, the smart device configures the device identifier into the device identifier structure according to the specification file. And then, encrypting the equipment identification structure body by using a public key in a public and private key pair which is randomly generated to generate a plaintext. The plaintext is then used to generate a ciphertext based on the symmetric key and the initialization vector. And generating a device field by the ciphertext and the previous initialization vector, generating a first data packet by the device field and the mobile terminal definition field, and sending the first data packet to the mobile terminal.
The following explains the generation process of the first data packet by using a specific example, which specifically includes the following steps:
referring to fig. 4, after the smart device enters a distribution network mode, a public and private key pair N2 and D2 for key exchange is randomly generated through a key generation algorithm and stored, a public key N2 and unique identification structure body data of the device defined by a device manufacturer are spliced through a certain algorithm to generate a plaintext C1, the splicing algorithm is formulated by the smart device manufacturer, and the smart phone manufacturer does not need to know the splicing algorithm.
The manufacturer of the intelligent device generates a group of symmetric encryption keys K1 in advance and stores the keys in the intelligent device, and the keys need to be kept secret and cannot be leaked. A group of initialization vectors iv1 is generated through a random number algorithm, C1 is symmetrically encrypted through symmetric keys K1 and iv1, ciphertexts E1 and iv1 generated through encryption are spliced through an algorithm to generate an intelligent device field F1, then a first data packet is generated through the device field and a mobile terminal definition field, and the first data packet is sent to the mobile terminal.
In the further method of the present invention, the explanation is mainly given to the processing procedure of analyzing the second data packet by using the second SDK encapsulation interface to obtain the distribution network information and the device binding information, which is specifically as follows:
performing packet processing on the second data packet to obtain a second ciphertext, a first public key and a second initialization vector;
decrypting the second ciphertext to obtain a shared secret key, a second initialization vector and a combined data packet;
and performing sub-packet processing on the combined data packet to obtain equipment binding information and distribution network information.
After receiving the second data packet transmitted by the mobile phone, the smart device first decrypts the second data packet through a key exchange algorithm to obtain a ciphertext E3, a public key N2, and an initialization vector iv 3. The ciphertext E3 is then decrypted to obtain the shared key K2, the initialization vector iv2, and the data packet G2.
Processing the data packet G2 by adopting an SDK packaging interface to obtain distribution network information and equipment binding information, analyzing the equipment binding information to obtain a symmetrically encrypted initialization vector iv2 and a symmetrically encrypted ciphertext E2, and decrypting the ciphertext E2 by using the symmetric keys K1 and iv1 to obtain an equipment binding information structure S2. The intelligent device logs in the cloud end through the distribution network information connection router, transmits the binding information structure body to the cloud end, and checks the binding information structure body sent to the cloud end by the mobile terminal to complete binding.
Fig. 5 shows a schematic structural diagram of a group packaging apparatus for data transmission provided in the present invention, referring to fig. 5, the apparatus includes a first obtaining module 51, a first parsing module 52, a first encapsulating module 53, and a generating module 54, where:
a first obtaining module 51, configured to obtain a first data packet sent by an intelligent device, where the first data packet is generated based on a device identifier of the intelligent device;
the first parsing module 52 is configured to invoke a first SDK encapsulation interface to parse the first data packet, so as to obtain an equipment identifier of the intelligent equipment;
the first encapsulation module 53 is configured to invoke the second SDK encapsulation interface to encapsulate the device identifier to obtain device binding information;
a generating module 54, configured to generate a second data packet according to the device binding information and the distribution network information, and send the second data packet to the smart device;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
In the further apparatus of the present invention, the first encapsulating module, in a process of calling the second SDK encapsulation interface to encapsulate the device identifier to obtain the device binding information, is specifically configured to:
generating a binding information structure body according to the equipment identifier;
generating a first ciphertext according to the first symmetric key, the first initialization vector and the binding information structure body; the first symmetric secret key is randomly configured by the intelligent equipment, and the first initialization vector is randomly generated in a symmetric encryption algorithm;
and packaging according to the first ciphertext and the first initialization vector to obtain the equipment binding information.
In the further apparatus of the above invention, the generating module, in the process of generating the second data packet according to the device binding information and the distribution network information, is specifically configured to:
generating a shared secret key according to the first symmetric secret key and the first public key;
generating a combined data packet according to the equipment binding information and the distribution network information;
generating a second ciphertext according to the shared secret key, the second initialization vector and the combined data packet;
and packaging according to the second ciphertext, the first public key and the second initialization vector to obtain a second data packet.
In the further apparatus of the foregoing invention, the first parsing module, in a process of calling a first SDK encapsulation interface to parse the first data packet to obtain the device identifier of the smart device, is specifically configured to:
performing packet processing on the first data packet to obtain an equipment field and a mobile terminal definition field;
performing inverse splicing processing on the equipment field to obtain a third ciphertext and a third initialization vector;
decrypting the third ciphertext to obtain a first symmetric secret key, a third initialization vector and a first plaintext;
performing inverse splicing processing on the first plaintext to obtain a second public key and an equipment identification structural body;
and obtaining the equipment identifier according to the equipment identifier structural body.
Since the inventive apparatus has the same principle as the inventive method described above, further explanation is omitted here.
It should be noted that, in the present invention, the relevant functional modules may be implemented by a hardware processor (hardware processor).
The data transmission packaging device provided by the embodiment enables the mobile terminal and the intelligent device to have a uniform SDK packaging interface, and can transmit the device identifier and the device binding information between the mobile terminal and the intelligent device through the same standard interface, so that the mobile terminal is prevented from acquiring and processing each intelligent device field and binding information field, the device data format requirements of different intelligent device manufacturers are met, and meanwhile, confidentiality is also provided for the device field and the binding information field of the intelligent device manufacturer.
Fig. 6 shows a schematic structural diagram of a group packaging apparatus for data transmission provided by the present invention, referring to fig. 6, the apparatus includes a second encapsulation module 61, a second parsing module 62 and a processing module 63, where:
the second encapsulation module 61 is configured to encapsulate the device identifier of the smart device by using the first SDK encapsulation interface, generate a first data packet, and send the first data packet to the mobile terminal;
a second parsing module 62, configured to obtain a second data packet sent by the mobile terminal, and parse the second data packet by using a second SDK encapsulation interface to obtain distribution network information and device binding information;
the processing module 63 is configured to establish connection with a cloud terminal through a router according to the distribution network information, and send the device binding information to the cloud terminal;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
In the further apparatus of the above invention, the second encapsulating module, in the process of encapsulating the device identifier of the smart device by using the first SDK encapsulating interface and generating the first data packet, is specifically configured to:
generating an equipment identifier structural body according to the equipment identifier;
generating a first plaintext according to the second public key and the equipment identification structural body;
generating a third ciphertext according to the first symmetric key, the third initialization vector and the first plaintext;
generating a device field according to the third ciphertext and the third initialized vector;
and generating a first data packet according to the equipment field and the mobile terminal definition field.
In the further apparatus of the present invention, the second parsing module, in the process of parsing the second data packet by using the second SDK encapsulation interface to obtain the distribution network information and the device binding information, is specifically configured to:
performing packet processing on the second data packet to obtain a second ciphertext, a first public key and a second initialization vector;
decrypting the second ciphertext to obtain a shared secret key, a second initialization vector and a combined data packet;
and performing sub-packet processing on the combined data packet to obtain equipment binding information and distribution network information.
Since the inventive apparatus has the same principle as the inventive method described above, further explanation is omitted here.
It should be noted that, in the present invention, the relevant functional modules may be implemented by a hardware processor (hardware processor).
The data transmission packaging device provided by the embodiment enables the mobile terminal and the intelligent device to have a uniform SDK packaging interface, and can transmit the device identifier and the device binding information between the mobile terminal and the intelligent device through the same standard interface, so that the mobile terminal is prevented from acquiring and processing each intelligent device field and binding information field, the device data format requirements of different intelligent device manufacturers are met, and meanwhile, confidentiality is also provided for the device field and the binding information field of the intelligent device manufacturer.
Fig. 7 illustrates a physical structure diagram of an electronic device, and as shown in fig. 7, the electronic device may include: a processor (processor)71, a communication Interface (Communications Interface)72, a memory (memory)73 and a communication bus 74, wherein the processor 71, the communication Interface 72 and the memory 73 are communicated with each other via the communication bus 74. Processor 71 may call logic instructions in memory 73 to perform the following method: acquiring a first data packet sent by intelligent equipment, wherein the first data packet is generated based on equipment identification of the intelligent equipment; calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment; calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information; generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment; the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
In addition, the logic instructions in the memory 73 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which 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) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the method provided in the foregoing embodiments when executed by a processor, and the method includes: acquiring a first data packet sent by intelligent equipment, wherein the first data packet is generated based on equipment identification of the intelligent equipment; calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment; calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information; generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment; the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
The present invention provides an electronic device, which may include: the system comprises a processor (processor), a communication Interface (communication Interface), a memory (memory) and a communication bus, wherein the processor, the communication Interface and the memory are communicated with each other through the communication bus. The processor may call logic instructions in memory to perform the following method: packaging the equipment identification of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet, and sending the first data packet to the mobile terminal; acquiring a second data packet sent by the mobile terminal, and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information; establishing connection with a cloud terminal through a router according to the distribution network information, and sending the equipment binding information to the cloud terminal; the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
In addition, the logic instructions in the memory may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the method provided in the foregoing embodiments when executed by a processor, and the method includes: packaging the equipment identification of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet, and sending the first data packet to the mobile terminal; acquiring a second data packet sent by the mobile terminal, and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information; establishing connection with a cloud terminal through a router according to the distribution network information, and sending the device binding information to the cloud terminal; the first SDK packaging interface and the second SDK packaging interface are constructed based on the specification files of equipment manufacturers.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A method for packaging data transmission is applied to a mobile terminal and comprises the following steps:
acquiring a first data packet sent by intelligent equipment, wherein the first data packet is generated based on an equipment identifier of the intelligent equipment;
calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment;
calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information;
generating a second data packet according to the equipment binding information and the distribution network information, and sending the second data packet to the intelligent equipment;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
2. The method for packaging data transmission according to claim 1, wherein the step of calling the second SDK encapsulation interface to encapsulate the device identifier to obtain the device binding information includes:
generating a binding information structure body according to the equipment identifier;
generating a first ciphertext according to the first symmetric key, the first initialization vector and the binding information structure body; the first symmetric secret key is randomly configured by the intelligent equipment, and the first initialization vector is randomly generated in a symmetric encryption algorithm;
and packaging according to the first ciphertext and the first initialization vector to obtain the equipment binding information.
3. The method for packaging data transmission according to claim 1, wherein the generating a second data packet according to the device binding information and the distribution network information comprises:
generating a shared secret key according to the first symmetric secret key and the first public key;
generating a combined data packet according to the equipment binding information and the distribution network information;
generating a second ciphertext according to the shared secret key, the second initialization vector and the combined data packet;
and packaging according to the second ciphertext, the first public key and the second initialization vector to obtain a second data packet.
4. The method for packaging data transmission according to claim 1, wherein the invoking the first SDK encapsulation interface to parse the first data packet to obtain the device identifier of the smart device includes:
performing packet processing on the first data packet to obtain an equipment field and a mobile terminal definition field;
performing inverse splicing processing on the equipment field to obtain a third ciphertext and a third initialization vector;
decrypting the third ciphertext to obtain a first symmetric secret key, a third initialization vector and a first plaintext;
performing inverse splicing processing on the first plaintext to obtain a second public key and an equipment identification structural body;
and obtaining the equipment identifier according to the equipment identifier structural body.
5. A method for packaging data transmission is applied to intelligent equipment and comprises the following steps:
packaging the equipment identification of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet, and sending the first data packet to the mobile terminal;
acquiring a second data packet sent by the mobile terminal, and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information;
establishing connection with a cloud end through a router according to the distribution network information, and sending the equipment binding information to the cloud end;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
6. The method for packaging data transmission according to claim 5, wherein the packaging the device identifier of the smart device using the first SDK packaging interface to generate the first data packet includes:
generating an equipment identifier structural body according to the equipment identifier;
generating a first plaintext according to the second public key and the equipment identification structural body;
generating a third ciphertext according to the first symmetric key, the third initialization vector and the first plaintext;
generating a device field according to the third ciphertext and the third initialized vector;
and generating a first data packet according to the equipment field and the mobile terminal definition field.
7. The data transmission packaging method according to claim 5, wherein the analyzing the second data packet by using the second SDK encapsulation interface to obtain distribution network information and device binding information includes:
performing packet processing on the second data packet to obtain a second ciphertext, a first public key and a second initialization vector;
decrypting the second ciphertext to obtain a shared secret key, a second initialization vector and a combined data packet;
and performing sub-packet processing on the combined data packet to obtain equipment binding information and distribution network information.
8. A group packing device for data transmission is applied to a mobile terminal and comprises:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first data packet sent by the intelligent device, and the first data packet is generated based on the device identifier of the intelligent device;
the first analysis module is used for calling a first SDK packaging interface to analyze the first data packet to obtain an equipment identifier of the intelligent equipment;
the first packaging module is used for calling a second SDK packaging interface to package the equipment identifier to obtain equipment binding information;
the generation module is used for generating a second data packet according to the equipment binding information and the distribution network information and sending the second data packet to the intelligent equipment;
wherein the first SDK encapsulation interface and the second SDK encapsulation interface are constructed based on a specification file of a device manufacturer.
9. A data transmission's group package device, its characterized in that is applied to smart machine, includes:
the second packaging module is used for packaging the equipment identifier of the intelligent equipment by adopting a first SDK packaging interface to generate a first data packet and sending the first data packet to the mobile terminal;
the second analysis module is used for acquiring a second data packet sent by the mobile terminal and analyzing the second data packet by adopting a second SDK packaging interface to obtain distribution network information and equipment binding information;
the processing module is used for establishing connection with a cloud end through a router according to the distribution network information and sending the equipment binding information to the cloud end;
the first SDK packaging interface and the second SDK packaging interface are constructed based on a specification file of a device manufacturer.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the method for packaging data transfers according to any one of claims 1 to 4 or performs the steps of the method for packaging data transfers according to any one of claims 5 to 7.
11. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for packaging of data transfers according to any one of claims 1 to 4, or carries out the steps of the method for packaging of data transfers according to any one of claims 5 to 7.
CN202011593838.8A 2020-12-29 2020-12-29 Data transmission packaging method and device, electronic equipment and storage medium Pending CN114697410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011593838.8A CN114697410A (en) 2020-12-29 2020-12-29 Data transmission packaging method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011593838.8A CN114697410A (en) 2020-12-29 2020-12-29 Data transmission packaging method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114697410A true CN114697410A (en) 2022-07-01

Family

ID=82133259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011593838.8A Pending CN114697410A (en) 2020-12-29 2020-12-29 Data transmission packaging method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114697410A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211691A1 (en) * 2004-09-09 2007-09-13 Barber Ronald W Method, system and computer program using standard interfaces for independent device controllers
CN105306676A (en) * 2015-09-14 2016-02-03 北京奇虎科技有限公司 Method, apparatus and system for accessing intelligent device
CN105357629A (en) * 2015-11-20 2016-02-24 青岛海尔股份有限公司 Method and device used for binding mobile terminal with intelligent household electrical appliance
CN109976173A (en) * 2019-03-18 2019-07-05 中国联合网络通信集团有限公司 Control method, device, equipment and the readable storage medium storing program for executing of smart home device
CN111935681A (en) * 2019-05-13 2020-11-13 阿里巴巴集团控股有限公司 Intelligent equipment network configuration implementation system, method and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211691A1 (en) * 2004-09-09 2007-09-13 Barber Ronald W Method, system and computer program using standard interfaces for independent device controllers
CN105306676A (en) * 2015-09-14 2016-02-03 北京奇虎科技有限公司 Method, apparatus and system for accessing intelligent device
CN105357629A (en) * 2015-11-20 2016-02-24 青岛海尔股份有限公司 Method and device used for binding mobile terminal with intelligent household electrical appliance
CN109976173A (en) * 2019-03-18 2019-07-05 中国联合网络通信集团有限公司 Control method, device, equipment and the readable storage medium storing program for executing of smart home device
CN111935681A (en) * 2019-05-13 2020-11-13 阿里巴巴集团控股有限公司 Intelligent equipment network configuration implementation system, method and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李伟伟等: "智能家电互联互通的技术发展与云平台", 《质量与认证》 *

Similar Documents

Publication Publication Date Title
KR102597224B1 (en) Method and apparatus for installing profile
CN109041052B (en) Safe communication method and system based on identification algorithm
CN111133779A (en) Techniques for remote SIM provisioning
US11218873B2 (en) Communication system and method
CN104703176A (en) Configuration method of wireless network, intelligent terminal and wireless network equipment
JP7174156B2 (en) Ensuring Secure Attachment in Size-Limited Authentication Protocols
CN104619040A (en) Method and system for quickly connecting WIFI equipment
CN110620762A (en) RDMA (remote direct memory Access) -based data transmission method, network card, server and medium
CN109831775B (en) Processor, baseband chip and SIM card information transmission method
CN111935109B (en) Secure communication module remote agent system, private protocol implementation method and device
CN111818517B (en) Multi-channel secure communication module, communication system and method
EP1942625A2 (en) Methods and apparatuses for performing security error recovery in a wireless communications system
CN113613227A (en) Data transmission method and device of Bluetooth equipment, storage medium and electronic device
CN114697410A (en) Data transmission packaging method and device, electronic equipment and storage medium
CN106301529A (en) A kind of short message transmission method, server, terminal and communication system
CN111212044B (en) Data transmission method, device and storage medium
KR101886367B1 (en) Generation of device individual session key in inter-object communication network and verification of encryption and decryption function between devices using it
EP3955607B1 (en) Method for transmitting and/or for using a profile information or at least parts thereof, system, client communication device, server entity, program and computer program product
CN114500167B (en) Information processing method and device, electronic equipment and storage medium
US20220400405A1 (en) Methods and apparatus for reducing communications delay
US20230336998A1 (en) Safe mode configuration method, device and system, and computer-readable storage medium
CN115988453A (en) Data receiving and transmitting system and method
CN116017346A (en) V2X communication method and system
CN115037504A (en) Communication method and device
CN117220914A (en) Encryption and decryption method and device

Legal Events

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