CN110113323A - A kind of communication means, electronic equipment and computer readable storage medium - Google Patents
A kind of communication means, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110113323A CN110113323A CN201910321557.8A CN201910321557A CN110113323A CN 110113323 A CN110113323 A CN 110113323A CN 201910321557 A CN201910321557 A CN 201910321557A CN 110113323 A CN110113323 A CN 110113323A
- Authority
- CN
- China
- Prior art keywords
- data
- electronic equipment
- mentioned
- data packet
- transport protocol
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Communication Control (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the present application discloses a kind of communication means, electronic equipment and computer readable storage medium, and wherein method includes: that the first electronic equipment receives the first data packet from above-mentioned second electronic equipment;First electronic equipment obtains preset data transport protocol, and the packet frame structure of above-mentioned Data Transport Protocol includes opening flag, order, data length, data, check code and end mark;First electronic equipment parses above-mentioned first data packet according to above-mentioned preset data transport protocol and obtains the first data.The embodiment of the present application promotes the scalability of the control to electronic cigarette by that can operate by intelligent electronic device to carry out fine control to electronic cigarette.
Description
Technical field
This application involves field of communication technology more particularly to a kind of communication means, electronic equipment and computer-readable storage
Medium.
Background technique
With the development of electronic cigarette and universal, people have been not limited to the function of electronic cigarette itself to the function of electronic cigarette
Can, it is some to wish that it have the appearance of the idea of some additional functions.Simultaneously with the intelligent development of electronic product, more
People wishes can be by the other modes such as intelligent electronic device control electronic cigarette more abundant.Intelligent electronic device can be at present
The progress of electronic cigarette is simply controlled by Bluetooth communication.But it at present can only by the method for Bluetooth control electronic cigarette
It realizes most basic control, such as the control of switch control, amount of smoke size, menu switching, cannot achieve precise controlling, it is expansible
Property is poor.
Summary of the invention
The embodiment of the present application provides a kind of communication means, perfect data transmission between electronic cigarette equipment and smart machine
Agreement improves intelligence to realize that smart machine carries out fine control to electronic cigarette equipment by the Data Transport Protocol
Scalability of the equipment to electronic cigarette equipment control function.
In a first aspect, the embodiment of the present application provides a kind of communication means, this method comprises:
First electronic equipment receives the first data packet from the second electronic equipment;
First electronic equipment obtains preset data transport protocol, and the packet frame structure of the Data Transport Protocol includes opening
Begin mark, order, data length, data, check code and end mark;
First electronic equipment parses first data packet according to the preset data transport protocol and obtains the first data.
In a kind of optional embodiment, parsed in first electronic equipment according to the preset data transport protocol
Before first data packet obtains the first data, the method also includes:
First electronic equipment verifies first data packet according to the check code in first data packet;
First electronic equipment is executed if verifying successfully according to preset data transport protocol parsing described first
Data packet obtains the first data.
In a kind of optional embodiment, first electronic equipment is according to the check code pair in first data packet
First data packet is verified, comprising:
First electronic equipment calculate opening flag in first data packet, order, data length, data it is different
Or value;
First electronic equipment judges that the check code in the exclusive or value and first data packet is matching, if
Match, then verify success, if mismatching, verifies failure.
It is described in the case where verifying failure to first data packet in a kind of optional embodiment
First electronic equipment is according to the order and the Data Transport Protocol the second data of generation in first data packet
Packet, the second electronic equipment of Xiang Suoshu send second data packet, and second data packet is for prompting second electronics to set
The standby first data packet reception failure.
In a kind of optional embodiment, first electronic equipment parses institute according to the preset data transport protocol
It states the first data packet and obtains the first data, comprising:
First electronic equipment parses the command field pair in first data packet according to the Data Transport Protocol
The first order answered, the order report order, text including order of shaking hands, parameter notification command, parameter setting order, electronic cigarette
Part can pass order, file transmission order, long message order or bluetooth and exit command;
First electronic equipment, first data packet according to the Data Transport Protocol and first command analysis
In corresponding first data of data field.
Second aspect, the embodiment of the present application provide another communication means, this method comprises:
Second electronic equipment receives the first data, and first data are to believe for controlling the data of the first electronic equipment
Breath;
Second electronic equipment obtains preset data transport protocol, the packet frame structure packet of the preset data transport protocol
Include opening flag, order, data length, data, check code and end mark;
The control data are packaged according to the preset data transport protocol and generate the first number by second electronic equipment
According to packet, first data packet is sent to first electronic equipment.
In a kind of optional embodiment, the method also includes:
Second electronic equipment receives the second data packet from first electronic equipment;
Second electronic equipment parses second data packet according to the transport protocol and obtains the second data.
In a kind of optional embodiment, in second electronic equipment according to transport protocol parsing described second
Before data packet obtains the second data, the method also includes:
Second electronic equipment verifies second data packet according to the check code in second data packet;
Second electronic equipment is executed if verifying successfully to be obtained according to transport protocol parsing second data packet
To the second data.
In a kind of optional embodiment, second electronic equipment is according to the check code pair in second data packet
Second data packet is verified, comprising:
Second electronic equipment calculate opening flag in second data packet, order, data length, data it is different
Or value;
Second electronic equipment judges that the check code in the exclusive or value and second data packet is matching, if
Match, then verify success, if mismatching, verifies failure.
In a kind of optional embodiment, in the case where verifying failure to second data packet, second electricity
Sub- equipment is according to the order and Data Transport Protocol generation third data packet in first data packet, the first electricity of Xiang Suoshu
Sub- equipment sends the third data packet, and the third data packet is for prompting the second data packet described in first electronic equipment
Reception failure.
In a kind of optional embodiment, second electronic equipment parses institute according to the preset data transport protocol
It states the second data packet and obtains the second data, comprising:
Second electronic equipment parses the command field pair in second data packet according to the Data Transport Protocol
The first order answered, the order report order, text including order of shaking hands, parameter notification command, parameter setting order, electronic cigarette
Part can pass order, file transmission order, long message order or bluetooth and exit command;
Second electronic equipment, second data packet according to the Data Transport Protocol and first command analysis
In corresponding second data of data field.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes:
Transmit-Receive Unit, for receiving the first data packet from second electronic equipment;
Acquiring unit, for obtaining preset data transport protocol, the packet frame structure of the Data Transport Protocol includes
Opening flag, order, data length, data, check code and end mark;
Resolution unit obtains the first data for parsing first data packet according to the preset data transport protocol.
In a kind of optional embodiment, the electronic equipment further include:
Verification unit, for being verified according to the check code in first data packet to first data packet;
The resolution unit is specifically used for if the verification unit verifies successfully according to the preset data transport protocol
It parses first data packet and obtains the first data.
In a kind of optional embodiment, the verification unit, comprising:
Computing unit you, for calculate the opening flag in first data packet, order, data length, data it is different
Or value;
Judging unit, for judging that the check code in the exclusive or value and first data packet is matching, if matching,
It verifies successfully, if mismatching, verifies failure.
In a kind of optional embodiment, in the case where verifying failure to first data packet, the electronics is set
It is standby further include:
Generation unit, for according to the order and the Data Transport Protocol the second data of generation in first data packet
Packet;
The Transmit-Receive Unit, for sending second data packet, second data packet to second electronic equipment
For prompting the first data packet reception failure described in second electronic equipment.
In a kind of optional embodiment, the resolution unit, for according to Data Transport Protocol parsing
Corresponding first order of command field in first data packet, the order are set including order of shaking hands, parameter notification command, parameter
Set order, electronic cigarette reports order, file can pass order, file transmission is ordered, long message order or bluetooth exit command;According to
Corresponding first number of data field in first data packet described in the Data Transport Protocol and first command analysis
According to.
Fourth aspect, the embodiment of the present application provide another electronic equipment, which includes:
Transmit-Receive Unit, for receiving the first data, first data are to believe for controlling the data of the first electronic equipment
Breath;
Acquiring unit, for obtaining preset data transport protocol, the packet frame structure of the preset data transport protocol
Including opening flag, order, data length, data, check code and end mark;
Packaged unit generates the first data for being packaged the control data according to the preset data transport protocol
Packet;
The Transmit-Receive Unit, for first data packet to be sent to first electronic equipment.
In a kind of optional embodiment, the Transmit-Receive Unit is also used to receive from first electronic equipment
Second data packet;
The electronic equipment further include:
Resolution unit obtains the second data for parsing second data packet according to the transport protocol.
In a kind of optional embodiment, the electronic equipment further include:
Verification unit, for being verified according to the check code in second data packet to second data packet;
The resolution unit, for parsing described second according to the transport protocol if the verification unit verifies successfully
Data packet obtains the second data.
In a kind of optional embodiment, the verification unit, comprising:
Computing unit, for calculate the opening flag in second data packet, order, data length, data exclusive or
Value;
Judging unit, for judging that the check code in the exclusive or value and second data packet is matching, if matching,
It verifies successfully, if mismatching, verifies failure.
In a kind of optional embodiment, in the case where verifying failure to second data packet, the electronics is set
It is standby further include:
Generation unit, for according to the order and Data Transport Protocol generation third data in first data packet
Packet;
The Transmit-Receive Unit, for sending the third data packet, the third data packet to first electronic equipment
For prompting the second data packet reception failure described in first electronic equipment.
In a kind of optional embodiment, the resolution unit, for according to Data Transport Protocol parsing
Corresponding first order of command field in second data packet, the order are set including order of shaking hands, parameter notification command, parameter
Set order, electronic cigarette reports order, file can pass order, file transmission is ordered, long message order or bluetooth exit command;According to
Corresponding second number of data field in second data packet described in the Data Transport Protocol and first command analysis
According to.
Fourth aspect, the embodiment of the present application provide another electronic equipment, including processor, input equipment, output are set
Standby and memory, wherein the memory is used to store the computer program for supporting electronic equipment to execute the above method, the meter
Calculation machine program includes program instruction, and the processor is configured for calling described program instruction, to execute above-mentioned first party
The method of face or second aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer storage medium
It is stored with computer program, the computer program includes program instruction, and described program instruction is when being executed by processor, to hold
The method of the above-mentioned first aspect of row or second aspect.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in embodiment description
Attached drawing is briefly described.
Fig. 1 is a kind of schematic flow diagram of communication means provided by the embodiments of the present application;
Fig. 2 is the schematic flow diagram of another communication means provided by the embodiments of the present application;
Fig. 3 is the schematic flow diagram of another communication means provided by the embodiments of the present application;
Fig. 4 is the schematic block diagram of a kind of electronic equipment provided by the embodiments of the present application;
Fig. 5 is the schematic block diagram of another electronic equipment provided by the embodiments of the present application;
Fig. 6 is a kind of electronic equipment schematic block diagram that another embodiment of the application provides.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment
And be not intended to limit the application.As present specification and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
It is a kind of schematic flow diagram of communication means provided by the embodiments of the present application, the party as shown in the figure referring to Fig. 1, Fig. 1
Method can include:
101: the first electronic equipments receive the first data packet from the second electronic equipment.
In the embodiment of the present application, above-mentioned first electronic equipment includes electronic cigarette equipment, and being also possible to other can pass through
The electronic equipment that intelligent electronic device (such as mobile phone) is controlled, such as the household appliance that can be connect by bluetooth with mobile phone
Deng.Above-mentioned second electronic equipment includes cell phone, tablet computer, personal digital assistant (PersonalDigital
Assistant, PDA), mobile internet device (Mobile Internet Device, MID), intelligent wearable device (as intelligence
Wrist-watch, Intelligent bracelet) etc. various electronic equipments, the embodiment of the present application be not construed as limiting.In the present embodiment, preferably the first electronic equipment
For electronic cigarette, the second electronic equipment is smart phone.
Data of above-mentioned first data packet for being controlled above-mentioned first electronic equipment, such as various parameters setting,
The order such as inquiry and the data with the commands match, or file data needed for being also possible to above-mentioned first electronic equipment etc..
Specifically, the first electronic equipment above-mentioned first and the second electronic equipment need to establish communication connection.It is communicated establishing
After connection, when user needs to send the first data to the first electronic equipment by above-mentioned second electronic equipment, such as pass through
Second electronic equipment sends the order such as parameter setting, inquiry to the first electronic equipment, and above-mentioned second electronic equipment will need to send
Data according to preset Data Transport Protocol be packaged to above-mentioned first data packet, the first data packet is then sent to the
One electronic equipment so that the first electronic equipment receives the first data packet, and performs corresponding processing.Wherein, above-mentioned first electronics
Equipment and the second electronic equipment can be established by bluetooth to be communicated to connect.
For example, above-mentioned first electronic equipment is electronic cigarette, and above-mentioned second electronic equipment is mobile phone, electronic cigarette and mobile phone
It is established and is communicated to connect by bluetooth, having on mobile phone can be to electricity for controlling electronic cigarette the application APP, APP of above-mentioned electronic cigarette
The model of sub- cigarette inquiry or setting electronic cigarette, electronic cigarette ID, electronic cigarette state, electronic cigarette power, supply voltage, atomizer electricity
The parameters such as resistance, battery capacity and the amount of sucking.When user needs to suck electronic cigarette, user can open the electronics on mobile phone
APP, then the parameter for currently needing to suck is arranged by the APP in user, after mobile phone receives the setting parameter of user, by pre-
If data communication protocol above-mentioned feeding parameters are packaged, the feeding parameters after packing are then sent to electricity by bluetooth
Sub- cigarette.
102: the first electronic equipments obtain preset data transport protocol, the packet frame structure packet of above-mentioned Data Transport Protocol
Include opening flag, order, data length, data, check code and end mark.
In the embodiment of the present application, since above-mentioned first data packet is to be passed by above-mentioned second electronic equipment according to preset data
What defeated agreement obtained after being packaged to the first data;So when the first electronic equipment receives what above-mentioned second electronic equipment was sent
After first data, the first electronic equipment needs to obtain above-mentioned Preset Transfer agreement to parse to above-mentioned first data packet.
In the embodiment of the present application, above-mentioned preset data transport protocol has fixed frame structure, and above-mentioned preset data passes
The frame structure of defeated agreement may include: opening flag, order, data length, data, check code and end mark.Above-mentioned data
Transport protocol is based on the packing agreement of byte type information transmission, i.e., each section of its frame structure is as unit of byte, bottom
Layer can be the data of any byte type transmission, and bottom can be used serial communication protocol, be also possible to other communication protocols, example
Such as TCP/IP.
The frame structure of above-mentioned Data Transport Protocol can be as shown in table 1, in the frame structure of above-mentioned Data Transport Protocol, respectively
Hexadecimal representation can be used in partial value.Above-mentioned opening flag is fixed data, and length is generally a byte, for referring to
0x55 expression can be used according to beginning in registration.Above-mentioned end mark is also fixed data, and length is generally a byte, is used for
Designation date terminates, and 0x55 expression can be used.It may include at least one data in the field of above-mentioned data, i.e., above-mentioned data
Field in may include multiple data parameters information.The length of above-mentioned check code is a byte, for carrying out to data packet
Verification, value are the end value of the exclusive or of opening flag, order, data length and data;For example, opening flag, order, data
Length and data are respectively 0x55,0x21,0x01 and 0x3, then check code is 0x76=0x55^0x21^0x01^0x3, wherein
" ^ " indicates exclusive or.Mentioned order can be set according to the concrete function of above-mentioned first electronic equipment, when above-mentioned first electronics is set
When for being electronic cigarette, mentioned order can include but is not limited to shake hands order, parameter notification command, parameter setting order, electronics
Cigarette reports order, file that can pass order, file transmission order, long message order or bluetooth and exits command.
The frame structure of 1 preset data transport protocol of table
Frame structure | Length | Value |
Opening flag | 1 | 0x55 |
Order | 1 | |
Data length | 1 | The length of data |
Data | It is indefinite | |
Check code | 1 | Opening flag, order, data length and data exclusive or value |
End mark | 1 | 0x55 |
As an alternative embodiment, data may be caused to lose due to various reasons in the transmission process of data
Lose or occur mistake.Therefore, after above-mentioned first electronic equipment receives above-mentioned first data packet, above-mentioned first electronic equipment
It needs to verify the first data packet received, to judge whether above-mentioned first data packet normally receives.
Specifically, after above-mentioned first electronic equipment receives above-mentioned first data packet, above-mentioned first electronic equipment root
The check code field in above-mentioned first data packet is determined according to the frame structure of above-mentioned preset data transport protocol, to obtain the first data
Then check code in packet calculates opening flag before the check code in above-mentioned first data packet, order, data length, number
According to exclusive or value, then judge whether the check code in the exclusive or value and above-mentioned first data packet matches, if matching, it is determined that on
It states the first data packet to normally receive, continues to execute step 103, if mismatching, it is determined that the first data packet abnormal reception, i.e., the
There may be loss of data or mistakes in one data packet, and the first electronic equipment is then according to the order in above-mentioned first data packet at this time
Field and data field generate the second data packet, and send second data packet to the second electronic equipment, to notify the second electronics
The above-mentioned first data packet abnormal reception of equipment.
103: the first electronic equipments parse above-mentioned first data packet according to above-mentioned preset data transport protocol and obtain the first number
According to.
In the embodiment of the present application, after getting above-mentioned preset data transport protocol, above-mentioned first electronic equipment then root
Above-mentioned first data packet is parsed according to above-mentioned preset data transport protocol, to obtain first in above-mentioned first data packet
Data, so that the first electronic equipment executes operation relevant to above-mentioned first data.
Specifically, above-mentioned first electronic equipment is according to above-mentioned present count after getting above-mentioned preset data transport protocol
The corresponding hexadecimal values of command field in above-mentioned first data packet are obtained according to the frame structure of transport protocol, then according to above-mentioned
Preset data transport protocol determines corresponding first order of the corresponding hexadecimal values of the command field;Then above-mentioned first electricity
Sub- equipment obtains data in above-mentioned first data packet according to the frame structure and above-mentioned first order of above-mentioned preset data transport protocol
Corresponding hexadecimal first data of field.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
Referring to fig. 2, Fig. 2 is the schematic flow diagram of another communication means provided by the embodiments of the present application, as shown in the figure should
Method can include:
201: the second electronic equipments receive the first data, and above-mentioned first data are the data for controlling the first electronic equipment
Information.
In the embodiment of the present application, above-mentioned first electronic equipment includes electronic cigarette equipment, and being also possible to other can pass through
The electronic equipment that intelligent electronic device (such as mobile phone) is controlled, such as the household appliance that can be connect by bluetooth with mobile phone
Deng.Above-mentioned second electronic equipment includes cell phone, tablet computer, personal digital assistant (PersonalDigital
Assistant, PDA), mobile internet device (Mobile Internet Device, MID), intelligent wearable device (as intelligence
Wrist-watch, Intelligent bracelet) etc. various electronic equipments, the embodiment of the present application be not construed as limiting.
In the embodiment of the present application, above-mentioned first data packet is used for the data controlled above-mentioned second electronic equipment,
Such as order and the data with the commands match such as various parameters setting, inquiry, or it is also possible to above-mentioned second electronic equipment
Required file data etc..
Specifically, the second electronic equipment above-mentioned first and the first electronic equipment need to establish communication connection.It is communicated establishing
After connection, when user needs to send the first data to the first electronic equipment by above-mentioned second electronic equipment, such as pass through
Second electronic equipment sends the order such as parameter setting, inquiry to the first electronic equipment, and user can be set by above-mentioned second electronics
Standby input equipment carries out corresponding operation, such as inputs parameter setting order by display screen.
202: the second electronic equipments obtain preset data transport protocol, the data packet frame knot of above-mentioned preset data transport protocol
Structure includes opening flag, order, data length, data, check code and end mark.
In the embodiment of the present application, after above-mentioned second electronic equipment receives above-mentioned first data, above-mentioned second electronics is set
It is standby to need for above-mentioned first data to be packaged, so that the first data after being packaged are sent to above-mentioned first electronic equipment.And
Above-mentioned first data are carried out to be packaged the communication protocol needed to follow between above-mentioned second electronic equipment and the first electronic equipment, with
Just the first electronic equipment can parse it after receiving the first data after above-mentioned packing to obtain above-mentioned first number
According to.Therefore, before above-mentioned second electronic equipment is packaged above-mentioned first data, need to obtain preset data transmission association
View, to be packaged according to the preset data transport protocol to above-mentioned first data.
In the embodiment of the present application, above-mentioned preset data transport protocol has fixed frame structure, and above-mentioned preset data passes
The frame structure of defeated agreement may include: opening flag, order, data length, data, check code and end mark.Above-mentioned data
Transport protocol is based on the packing agreement of byte type information transmission, i.e., each section of its frame structure is as unit of byte, bottom
Layer can be the data of any byte type transmission, and bottom can be used serial communication protocol, be also possible to other communication protocols, example
Such as TCP/IP.
The frame structure of above-mentioned Data Transport Protocol can be as shown in table 1 in embodiment one, in above-mentioned Data Transport Protocol
In frame structure, hexadecimal representation is can be used in the value of each section.Above-mentioned opening flag is fixed data, and length is generally one
Byte is used to indicate data and starts, and 0x55 expression can be used.Above-mentioned end mark is also fixed data, and length is generally one
A byte, is used to indicate end of data, and 0x55 expression can be used.It may include at least one number in the field of above-mentioned data
According to may include multiple data parameters information in the field of that is, above-mentioned data.The length of above-mentioned check code is a byte, is used for
Data packet is verified, value is the end value of the exclusive or of opening flag, order, data length and data;For example, starting to mark
Will, order, data length and data are respectively 0x55,0x21,0x01 and 0x3, then check code is 0x76=0x55^0x21^
0x01^0x3, wherein " ^ " indicates exclusive or.Mentioned order can be set according to the concrete function of above-mentioned second electronic equipment, when
When above-mentioned second electronic equipment is electronic cigarette, mentioned order can include but is not limited to shake hands order, parameter notification command, parameter
Setting command, electronic cigarette report order, file that can pass order, file transmission order, long message order or bluetooth and exit command.
For example, above-mentioned first electronic equipment is electronic cigarette, and above-mentioned secondth electronic equipment is mobile phone, electronic cigarette and hand
Machine is established by bluetooth and is communicated to connect, and has on mobile phone electronic cigarette application APP, APP for controlling above-mentioned electronic cigarette can be to
The model of electronic cigarette inquiry or setting electronic cigarette, electronic cigarette ID, electronic cigarette state, electronic cigarette power, supply voltage, atomizer electricity
The parameters such as resistance, battery capacity and the amount of sucking.When user needs to suck electronic cigarette, user can open the electronics on mobile phone
APP, then the parameter for currently needing to suck is arranged by the APP in user, after mobile phone receives the setting parameter of user, by pre-
If data communication protocol above-mentioned feeding parameters are packaged, the feeding parameters after packing are then sent to electricity by bluetooth
Sub- cigarette.
203: above-mentioned control data are packaged according to above-mentioned preset data transport protocol and generate the by above-mentioned second electronic equipment
Above-mentioned first data packet is sent to above-mentioned first electronic equipment by one data packet.
In the embodiment of the present application, after above-mentioned second electronic equipment gets above-mentioned Data Transport Protocol, then according to upper
It states preset data transport protocol to be packaged above-mentioned first data, to obtain the first data packet, then send out the first data packet
Give above-mentioned first electronic equipment.
Specifically, above-mentioned second electronic equipment is above-mentioned first data according to the frame structure of above-mentioned preset data transport protocol
The value of corresponding command field is matched, the length of above-mentioned first data is then calculated, to obtain the data length word in frame structure
The value of section, then according to the value of data field into above-mentioned frame structure of above-mentioned first data, then to beginning attribute field
Value, the value of order, the carry out exclusive or of the value of the value of data length field and data field obtain check code in above-mentioned frame structure
The value of field finally obtains above-mentioned first data packet plus opening flag and ending mark, and above-mentioned first data packet is sent
To above-mentioned first electronic equipment.
204: the second electronic equipments receive the second data packet from above-mentioned first electronic equipment, according to above-mentioned transport protocol
It parses above-mentioned second data packet and obtains the second data.
In the embodiment of the present application, above-mentioned first electronic equipment just obtains after receiving above-mentioned first data packet
Preset data transport protocol is stated, then the first data packet is parsed according to the preset data transport protocol to obtain above-mentioned
One data, and corresponding operation is executed according to above-mentioned first data.
As an alternative embodiment, above-mentioned first data packet that above-mentioned first electronic equipment receives is in transmission
In the process it is possible that loss of data or other mistakes, therefore go out in the first data packet that above-mentioned first electronic equipment receives
When existing mistake, above-mentioned first electronic equipment can send the second number to above-mentioned first idea equipment according to the first data packet received
According to packet, which is used to indicate above-mentioned first data packet abnormal reception.Then above-mentioned second electronic equipment is receiving
To after above-mentioned second data packet, it is parsed to obtain according to above-mentioned preset data transport protocol indicates above-mentioned first data packet
Second data of abnormal reception state the second electronic equipment then up and retransmit above-mentioned first data packet.
As an alternative embodiment, when above-mentioned first electronic equipment needs to send the to above-mentioned second electronic equipment
When two data, above-mentioned first electronic equipment will need the second data packet sent according to above-mentioned preset data transport protocol to above-mentioned
Second data are packaged to obtain the second data packet, are stated the second electronic equipment then up and are sent above-mentioned first electronic equipment.On
Stating the second data can be above-mentioned first electronic equipment to the feedback of above-mentioned first data, be also possible to above-mentioned first electronic equipment
The state parameter etc. of the equipment of itself sent to above-mentioned second electronic equipment, can also be other data.For example, above-mentioned first electricity
When sub- equipment is electronic cigarette, when above-mentioned first data are parameter setting order, above-mentioned second data can be the setting knot of parameter
Fruit;Alternatively, above-mentioned second data are the electronic cigarette abnormality etc. that electronic cigarette is sent to above-mentioned first equipment.In above-mentioned second electricity
After sub- equipment receives above-mentioned second data packet, just the second data packet is parsed according to above-mentioned preset data transport protocol
To obtain above-mentioned second data, and corresponding processing is done according to the second obtained data.
Wherein, above-mentioned second electronic equipment, which carries out parsing to above-mentioned second data packet, can specifically include: above-mentioned second electricity
Sub- equipment obtains command field corresponding 16 in above-mentioned second data packet according to the frame structure of above-mentioned preset data transport protocol
Then binary value determines the corresponding hexadecimal values of the command field corresponding according to above-mentioned preset data transport protocol
One order;Then above-mentioned second electronic equipment is obtained according to the frame structure and above-mentioned first order of above-mentioned preset data transport protocol
Corresponding hexadecimal second data of data field in above-mentioned first data packet.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
It is the schematic flow diagram of another communication means provided by the embodiments of the present application referring to Fig. 3, Fig. 3, as shown in the figure should
Method can include:
In the embodiment of the present application, electronic cigarette is established Bluetooth communication with mobile phone and is connect, and electronic cigarette application is installed on mobile phone
It include preset data transport protocol in APP, electronic cigarette APP.User can control electronic cigarette by electronic cigarette APP, such as
It is arranged or checks the parameter of electronic cigarette by electronic cigarette APP, receives the status information etc. that electronic cigarette reports.
301: mobile phone is established Bluetooth communication with electronic cigarette and is connect.
302: mobile phone sends order of shaking hands to electronic cigarette.
In the embodiment of the present application, above-mentioned order of shaking hands is the life of shaking hands that mobile phone is generated according to preset data transport protocol
It enables, which establishes relationship of shaking hands for mobile phone and electronic cigarette, to determine that mobile phone and electronic cigarette are successfully established communication link
It connects.Preset data transport protocol can be with reference to the description in above-mentioned Fig. 1 and Fig. 2 embodiment.
Specifically, above-mentioned order hexadecimal representation of shaking hands, above-mentioned order of shaking hands are as follows: 0x550x11 0x01 0x01
0x44 0x55.Wherein, 0x55 indicates opening flag and end, and 0x11 indicates order of shaking hands, and first 0x01 indicates data length
For 1 byte, second 0x01 expression is shaken hands, and 0x44 indicates check code.Check code 0x44=0x55^0x11^0x01^0x01,
" ^ " indicates exclusive or.
303: electronic cigarette receives above-mentioned order of shaking hands, and obtains preset data transport protocol and carry out parsing school to order of shaking hands
It tests.
In the embodiment of the present application, when electronic cigarette receive it is above-mentioned shake hands instruction after, according to preset data transport protocol pair
Order of shaking hands carries out parsing verification.
In the embodiment of the present application, above-mentioned preset data transport protocol has fixed frame structure, and above-mentioned preset data passes
The frame structure of defeated agreement may include: opening flag, order, data length, data, check code and end mark.Above-mentioned data
Transport protocol is based on the packing agreement of byte type information transmission, i.e., each section of its frame structure is as unit of byte, bottom
Layer can be the data of any byte type transmission, and bottom can be used serial communication protocol, be also possible to other communication protocols, example
Such as TCP/IP.
The frame structure of above-mentioned Data Transport Protocol can be as shown in table 1, in the frame structure of above-mentioned Data Transport Protocol, respectively
Hexadecimal representation can be used in partial value.Above-mentioned opening flag is fixed data, and length is generally a byte, for referring to
0x55 expression can be used according to beginning in registration.Above-mentioned end mark is also fixed data, and length is generally a byte, is used for
Designation date terminates, and 0x55 expression can be used.It may include at least one data in the field of above-mentioned data, i.e., above-mentioned data
Field in may include multiple data parameters information.The length of above-mentioned check code is a byte, for carrying out to data packet
Verification, value are the end value of the exclusive or of opening flag, order, data length and data;For example, opening flag, order, data
Length and data are respectively 0x55,0x21,0x01 and 0x3, then check code is 0x76=0x55^0x21^0x01^0x3, wherein
" ^ " indicates exclusive or.Mentioned order can be set according to the concrete function of above-mentioned electronic cigarette, for example, mentioned order may include
But the order that is not limited to shake hands, parameter notification command, parameter setting order, electronic cigarette report that order, file can pass order, file passes
Defeated order, long message order or bluetooth exit command.
As shown in table 2, between mobile phone and electronic cigarette shake hands order with promise.Electronic cigarette is according to the life of shaking hands received
The check code of order verifies order of shaking hands, if verifying successfully, is carried out according to preset data transport protocol to order of shaking hands
Parsing, and life feeds back success of shaking hands to mobile phone, can be carried out data transmission after mobile phone receives and shakes hands successfully feedback.If verification
Failure is then shaken hands unsuccessfully to mobile phone feedback.
Table 2 is shaken hands order
304: after above-mentioned electronic cigarette and mobile phone are shaken hands successfully, above-mentioned mobile phone is to electronic cigarette the first data packet of transmission, this
One data packet includes that parameter setting order, electronic cigarette report command processing result, file that can pass order, file transmission order or long
The data packets such as message command processing result.
In the embodiment of the present application, after electronic cigarette and mobile phone are shaken hands successfully, above-mentioned hand can be made according to the needs of users
Machine to electronic cigarette send the first data packet, first data packet include parameter notification command promise data packet, parameter setting life
It enables, electronic cigarette reports command processing result, file can pass order, file transmission is ordered or the data such as long message command processing result
Packet.
As shown in table 3, in preset data transport protocol parameter setting order with promise.As shown in table 3, parameter setting
The model, the state of electronic cigarette, electronic cigarette ID, electronic cigarette power, remaining battery electricity of electronic cigarette can be arranged in order by mobile phone
Measure the information such as percentage, tobacco tar amount percentage, the taste mode of electronic cigarette, heating wire temperature, atomizer resistance value, smoking port number.
3 parameter setting order of table
Such as the data packet of the temperature of electronic cigarette is set by hand, i.e., mobile phone sends the data packet that temperature is arranged to electronic cigarette
It can be with are as follows:
In the data packet of above-mentioned temperature setting, it is divided into four temperature setting data packets, respectively pre-add hot arc temperature number
According to setting, the setting of first segment temperature data, the setting of second segment temperature data and the setting of third section temperature data.
As shown in table 4, table 5 and table 6, the file respectively in preset data transport protocol can pass order, file transmission life
It enables and long message order.Document transmission process are as follows: the electronic cigarette APP on mobile phone sends order and shows the filename that can be passed (after band
Sew) and file size, electronic cigarette carry out order reply;Electronic cigarette then sends file content transmission instruction, querying command packet
Filename, total packet number and the packet serial number for requiring transmitting are included, current packet serial number and content are replied to electronic cigarette by APP.Wherein picture
File default is RGB565 format.
4 file of table can pass order
The transmission order of 5 file of table
6 long message order of table
305: electronic cigarette receives above-mentioned first data packet, and according to above-mentioned preset data transport protocol to above-mentioned first data
Scholar carries out verification parsing.
In the embodiment of the present application, after electronic cigarette receives above-mentioned first data packet, if being verified successfully to the first data packet,
The corresponding hexadecimal of command field in above-mentioned first data packet is then obtained according to the frame structure of above-mentioned preset data transport protocol
Then numerical value determines corresponding first life of the corresponding hexadecimal values of the command field according to above-mentioned preset data transport protocol
It enables;Then above-mentioned electronic cigarette obtains above-mentioned first number according to the frame structure and above-mentioned first order of above-mentioned preset data transport protocol
According to corresponding hexadecimal first data of data field in packet.
306: electronic cigarette sends the second data packet to mobile phone, and the second data packet includes parameter notification command, parameter setting knot
The order of feedback data packet long message or indigo plant that fruit data packet, electronic cigarette report order, file command data packet, file that can pass
Tooth exits command.
As shown in table 7, in preset data transport protocol parameter notification command with promise.Parameter notice as shown in table 7
Order can notify electronic cigarette model, the electronic cigarette ID, electronic cigarette power, battery capacity percentage, tobacco tar amount percentage of electronic cigarette
Than, information such as the taste mode of electronic cigarette, heating wire temperature.
In the embodiment of the present application, when transmitting data between electronic cigarette and mobile phone, multiple data can be once transmitted, it can also
Once to transmit a data.For example, electronic cigarette sends the data packet of three sections of heating wire setting temperature to mobile phone are as follows: beginning 55,
Two command word 21, data length 0C, first segment temperature designated character 31, subdata length 02, first segment temperature bytes 00
00, second segment temperature designated character 32, subdata length 02, two byte 01F4 of second segment temperature, third section temperature designated word
Symbol 33, two 64 0C of byte of third section temperature, check code XX, terminates 55 at subdata length 02.It is also possible to electronic cigarette difference
Every section of heating wire setting temperature data packet is sent to mobile phone, is respectively as follows: beginning 55, command word 21, data length 04, first segment temperature
It spends designated character 31, subdata length 02, two bytes 00 00 of first segment temperature, check code XX, terminate 55;Start 55, order
Word 21, data length 04, second segment temperature designated character 32, subdata length 02, second segment temperature two bytes 00 00, schools
It tests a yard XX, terminate 55;Start 55, command word 21, data length 04, second segment temperature designated character 33, subdata length 02, the
Two sections of temperature, two bytes 00 00, terminate 55 at check code XX.
7 parameter notification command of table
As shown in table 8, it exits command for the bluetooth in preset data transport protocol.Bluetooth exits command to be set for electronic cigarette
For electronic cigarette APP when closing bluetooth equipment on notice mobile phone.
8 bluetooth of table exits command
307: mobile phone receives above-mentioned second data packet, and is solved according to above-mentioned preset data transport protocol to the second data
Analysis.
In the embodiment of the present application, after mobile phone receives above-mentioned second data packet, if being verified successfully to the second data packet,
The corresponding hexadecimal number of command field in above-mentioned second data packet is obtained according to the frame structure of above-mentioned preset data transport protocol
Then value determines corresponding second life of the corresponding hexadecimal values of the command field according to above-mentioned preset data transport protocol
It enables;Then above-mentioned first electronic equipment obtains above-mentioned according to the frame structure and above-mentioned second order of above-mentioned preset data transport protocol
Corresponding hexadecimal second data of data field in second data packet.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
The embodiment of the present application also provides a kind of electronic equipment, which is used to execute the list of any one of aforementioned method
Member.Specifically, referring to fig. 4, Fig. 4 is the schematic block diagram of a kind of electronic equipment provided by the embodiments of the present application.The electricity of the present embodiment
Sub- equipment includes: Transmit-Receive Unit 401, acquiring unit 402, resolution unit 403.
Transmit-Receive Unit 401, for receiving the first data packet from above-mentioned second electronic equipment;
Acquiring unit 402, for obtaining preset data transport protocol, the packet frame structure packet of above-mentioned Data Transport Protocol
Include opening flag, order, data length, data, check code and end mark;
Resolution unit 403 obtains the first number for parsing above-mentioned first data packet according to above-mentioned preset data transport protocol
According to.
In a kind of optional embodiment, above-mentioned electronic equipment further include:
Verification unit, for being verified according to the check code in above-mentioned first data packet to above-mentioned first data packet;
Above-mentioned resolution unit 403 is specifically used for being transmitted if above-mentioned verification unit verifies successfully according to above-mentioned preset data
Above-mentioned first data packet of protocol analysis obtains the first data.
In a kind of optional embodiment, above-mentioned verification unit, comprising:
Computing unit you, for calculate the opening flag in above-mentioned first data packet, order, data length, data it is different
Or value;
Judging unit, for judging that the check code in above-mentioned exclusive or value and above-mentioned first data packet is matching, if matching,
It verifies successfully, if mismatching, verifies failure.
In a kind of optional embodiment, in the case where verifying failure to above-mentioned first data packet, above-mentioned electronics is set
It is standby further include:
Generation unit, for according to the order and above-mentioned Data Transport Protocol the second data of generation in above-mentioned first data packet
Packet;
Above-mentioned Transmit-Receive Unit 401, for sending above-mentioned second data packet, above-mentioned second data to above-mentioned second electronic equipment
Packet is for prompting the above-mentioned first data packet reception failure of above-mentioned second electronic equipment.
In a kind of optional embodiment, above-mentioned resolution unit 403, for being parsed according to above-mentioned Data Transport Protocol
Corresponding first order of command field in the first data packet is stated, mentioned order includes shake hands order, parameter notification command, parameter
Setting command, electronic cigarette report order, file that can pass order, file transmission order, long message order or bluetooth and exit command;Root
According to the data field corresponding above-mentioned first in above-mentioned Data Transport Protocol and above-mentioned first data packet of above-mentioned first command analysis
Data.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
The embodiment of the present application also provides a kind of electronic equipment, which is used to execute the list of any one of aforementioned method
Member.It specifically, is the schematic block diagram of another electronic equipment provided by the embodiments of the present application referring to Fig. 5, Fig. 5.The present embodiment
Electronic equipment includes: Transmit-Receive Unit 501, acquiring unit 502, packaged unit 503.
Transmit-Receive Unit 501, for receiving the first data, above-mentioned first data are the data for controlling the first electronic equipment
Information;
Acquiring unit 502, for obtaining preset data transport protocol, the data packet frame knot of above-mentioned preset data transport protocol
Structure includes opening flag, order, data length, data, check code and end mark;
Packaged unit 503 generates the first number for being packaged above-mentioned control data according to above-mentioned preset data transport protocol
According to packet;
Above-mentioned Transmit-Receive Unit 501, for above-mentioned first data packet to be sent to above-mentioned first electronic equipment.
In a kind of optional embodiment, above-mentioned Transmit-Receive Unit is also used to receive from above-mentioned first electronic equipment
Second data packet;
Above-mentioned electronic equipment further include:
Resolution unit obtains the second data for parsing above-mentioned second data packet according to above-mentioned transport protocol.
In a kind of optional embodiment, above-mentioned electronic equipment further include:
Verification unit, for being verified according to the check code in above-mentioned second data packet to above-mentioned second data packet;
Above-mentioned resolution unit, for parsing above-mentioned second according to above-mentioned transport protocol if above-mentioned verification unit verifies successfully
Data packet obtains the second data.
In a kind of optional embodiment, above-mentioned verification unit, comprising:
Computing unit, for calculate the opening flag in above-mentioned second data packet, order, data length, data exclusive or
Value;
Judging unit, for judging that the check code in above-mentioned exclusive or value and above-mentioned second data packet is matching, if matching,
It verifies successfully, if mismatching, verifies failure.
In a kind of optional embodiment, in the case where verifying failure to above-mentioned second data packet, above-mentioned electronics is set
It is standby further include:
Generation unit, for according to the order and above-mentioned Data Transport Protocol generation third data in above-mentioned first data packet
Packet;
Above-mentioned Transmit-Receive Unit, for sending above-mentioned third data packet, above-mentioned third data packet to above-mentioned first electronic equipment
For prompting the above-mentioned second data packet reception failure of above-mentioned first electronic equipment.
In a kind of optional embodiment, above-mentioned resolution unit is above-mentioned for being parsed according to above-mentioned Data Transport Protocol
Corresponding first order of command field in second data packet, mentioned order are set including order of shaking hands, parameter notification command, parameter
Set order, electronic cigarette reports order, file can pass order, file transmission is ordered, long message order or bluetooth exit command;According to
Corresponding above-mentioned second number of data field in above-mentioned Data Transport Protocol and above-mentioned second data packet of above-mentioned first command analysis
According to.
In the embodiment of the present application, the preset data transmission association with fixed frame structure format is stored in the electronic device
View passes after being packaged the data for needing to transmit between electronic cigarette and intelligent electronic device according to preset transport protocol
It is defeated, then parsed further according to Data Transport Protocol, to realize the communication between intelligent electronic device and electronic cigarette, in addition by
It can be various orders or parameter etc. in the data that can be transmitted.Therefore, electronic cigarette can be carried out by intelligent electronic device
Fine control operation, such as various parameters setting etc..Finally due to the data that can transmit there is no limit, so, to electronic cigarette
Control scalability it is also fine.
It is a kind of electronic equipment schematic block diagram that another embodiment of the application provides referring to Fig. 6, Fig. 6.Sheet as shown in the figure
Electronic equipment in embodiment may include: one or more processors 601;One or more input equipments 602, one or more
A output equipment 603 and memory 604.Above-mentioned processor 601, input equipment 602, output equipment 603 and memory 604 pass through
Bus 605 connects.For memory 602 for storing computer program, above-mentioned computer program includes program instruction, processor 601
For executing the program instruction of the storage of memory 602.
Wherein, when the electronic equipment as above-mentioned first electronic equipment in use, processor 601 is configured in calling
State program instruction execution: the first electronic equipment receives the first data packet from above-mentioned second electronic equipment;First electronic equipment
Obtain preset data transport protocol, the packet frame structure of above-mentioned Data Transport Protocol includes that opening flag, order, data are long
Degree, data, check code and end mark;First electronic equipment parses above-mentioned first data according to above-mentioned preset data transport protocol
Packet obtains the first data.
Wherein, when the electronic equipment as above-mentioned second electronic equipment in use, processor 601 is configured in calling
State program instruction execution: the second electronic equipment receives the first data, and above-mentioned first data are for controlling the first electronic equipment
Data information;Second electronic equipment obtains preset data transport protocol, the packet frame structure of above-mentioned preset data transport protocol
Including opening flag, order, data length, data, check code and end mark;Above-mentioned second electronic equipment is according to above-mentioned default
Above-mentioned control data are packaged and generate the first data packet by Data Transport Protocol, and above-mentioned first data packet is sent to above-mentioned first electricity
Sub- equipment.
It should be appreciated that in the embodiment of the present application, alleged processor 601 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at
Reason device is also possible to any conventional processor etc..
Input equipment 602 may include that Trackpad, fingerprint adopt sensor (for acquiring the finger print information and fingerprint of user
Directional information), microphone etc., output equipment 603 may include display (LCD etc.), loudspeaker etc..
The memory 604 may include read-only memory and random access memory, and to processor 601 provide instruction and
Data.The a part of of storage 604 can also include nonvolatile RAM.For example, memory 604 can also store
The information of device type.
In the specific implementation, processor 601, input equipment 602 described in the embodiment of the present application, output equipment 603 can
Implementation described in the first embodiment and second embodiment of a kind of communication means provided by the embodiments of the present application is executed,
Also the implementation of electronic equipment described in the embodiment of the present application can be performed, details are not described herein.
A kind of computer readable storage medium, above-mentioned computer-readable storage medium are provided in another embodiment of the application
Matter is stored with computer program, and above-mentioned computer program includes program instruction, and above procedure instructs realization when being executed by processor:
First electronic equipment receives the first data packet from above-mentioned second electronic equipment;First electronic equipment obtains preset data transmission
Agreement, the packet frame structure of above-mentioned Data Transport Protocol include opening flag, order, data length, data, check code and knot
Bundle flag;First electronic equipment parses above-mentioned first data packet according to above-mentioned preset data transport protocol and obtains the first data.
Alternatively, realization when above procedure instruction is executed by processor: the second electronic equipment the first data of reception, above-mentioned first
Data are the data information for controlling the first electronic equipment;Second electronic equipment obtains preset data transport protocol, above-mentioned pre-
If the packet frame structure of Data Transport Protocol includes opening flag, order, data length, data, check code and end mark;
Above-mentioned control data are packaged according to above-mentioned preset data transport protocol and generate the first data packet by above-mentioned second electronic equipment, will be upper
It states the first data packet and is sent to above-mentioned first electronic equipment.
Above-mentioned computer readable storage medium can be the storage inside list of the above-mentioned electronic equipment of aforementioned any embodiment
Member, such as the hard disk or memory of electronic equipment.Above-mentioned computer readable storage medium is also possible to the outside of above-mentioned electronic equipment
The plug-in type hard disk being equipped in storage equipment, such as above-mentioned electronic equipment, intelligent memory card (Smart Media Card, SMC),
Secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, above-mentioned computer-readable to deposit
Storage media can also both including above-mentioned electronic equipment internal storage unit and also including External memory equipment.It is above-mentioned computer-readable
Storage medium is for other programs and data needed for storing above-mentioned computer program and above-mentioned electronic equipment.Above-mentioned computer
Readable storage medium storing program for executing can be also used for temporarily storing the data that has exported or will export.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware
With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This
A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially
Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not
It is considered as beyond scope of the present application.
It is apparent to those skilled in the art that for convenience of description and succinctly, the end of foregoing description
The specific work process of equipment and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed electronic equipment and method, Ke Yitong
Other modes are crossed to realize.For example, the apparatus embodiments described above are merely exemplary, for example, said units are drawn
Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can
To combine or be desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed
Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING of device or unit or
Communication connection is also possible to electricity, mechanical or other form connections.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.Some or all of unit therein can be selected to realize the embodiment of the present application scheme according to the actual needs
Purpose.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, is also possible to two or more units and is integrated in one unit.It is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment above method of the application
Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any
Those familiar with the art within the technical scope of the present application, can readily occur in various equivalent modifications or replace
It changes, these modifications or substitutions should all cover within the scope of protection of this application.Therefore, the protection scope of the application should be with right
It is required that protection scope subject to.
Claims (12)
1. a kind of communication means characterized by comprising
First electronic equipment receives the first data packet from the second electronic equipment;
First electronic equipment obtains preset data transport protocol, and the packet frame structure of the Data Transport Protocol includes starting to mark
Will, order, data length, data, check code and end mark;
First electronic equipment parses first data packet according to the preset data transport protocol and obtains the first data.
2. the method according to claim 1, wherein being passed in first electronic equipment according to the preset data
Before first data packet described in defeated protocol analysis obtains the first data, the method also includes:
First electronic equipment verifies first data packet according to the check code in first data packet;
First electronic equipment is executed if verifying successfully, and first data are parsed according to the preset data transport protocol
Packet obtains the first data.
3. according to the method described in claim 2, it is characterized in that, first electronic equipment is according in first data packet
Check code first data packet is verified, comprising:
First electronic equipment calculate opening flag in first data packet, order, data length, data exclusive or
Value;
First electronic equipment judges that the check code in the exclusive or value and first data packet is matching, if matching,
It verifies successfully, if mismatching, verifies failure.
4. according to the method described in claim 3, it is characterized in that, to first data packet verify fail in the case where,
First electronic equipment according in first data packet order and the Data Transport Protocol generate the second data packet, to
Second electronic equipment sends second data packet, and second data packet is for prompting described in second electronic equipment
The failure of first data receiver.
5. method according to claim 1-4, which is characterized in that
First electronic equipment parses first data packet according to the preset data transport protocol and obtains the first data, wraps
It includes:
It is corresponding that first electronic equipment according to the Data Transport Protocol parses the command field in first data packet
First order, the order report order, file can including order of shaking hands, parameter notification command, parameter setting order, electronic cigarette
Order, file transmission order, long message order or bluetooth is passed to exit command;
First electronic equipment is in the first data packet according to the Data Transport Protocol and first command analysis
Corresponding first data of data field.
6. a kind of communication means characterized by comprising
Second electronic equipment receives the first data, and first data are the data information for controlling the first electronic equipment;
Second electronic equipment obtains preset data transport protocol, and the packet frame structure of the preset data transport protocol includes opening
Begin mark, order, data length, data, check code and end mark;
The control data are packaged according to the preset data transport protocol and generate the first data packet by second electronic equipment,
First data packet is sent to first electronic equipment.
7. according to the method described in claim 6, it is characterized in that, the method also includes:
Second electronic equipment receives the second data packet from first electronic equipment;
Second electronic equipment parses second data packet according to the transport protocol and obtains the second data.
8. a kind of electronic equipment, which is characterized in that used as the first electronic equipment, including for executing such as claim 1-5
The unit of method described in any claim.
9. a kind of electronic equipment, which is characterized in that used as the second electronic equipment, including for executing such as claim 6-7
The unit of method described in any claim.
10. a kind of electronic equipment, which is characterized in that used as the first electronic equipment, including processor, input equipment, output
Equipment and memory, wherein the memory is for storing computer program, and the computer program includes program instruction, institute
It states processor to be configured for calling described program instruction, to execute the method according to claim 1 to 5.
11. a kind of electronic equipment, which is characterized in that used as the second electronic equipment, including processor, input equipment, output
Equipment and memory, wherein the memory is for storing computer program, and the computer program includes program instruction, institute
It states processor to be configured for calling described program instruction, to execute such as the described in any item methods of claim 6-7.
12. a kind of computer readable storage medium, which is characterized in that the computer storage medium is stored with computer program,
The computer program includes program instruction, and described program instruction makes the processor execute such as right when being executed by a processor
It is required that 1-5 or the described in any item methods of claim 6-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910321557.8A CN110113323A (en) | 2019-04-20 | 2019-04-20 | A kind of communication means, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910321557.8A CN110113323A (en) | 2019-04-20 | 2019-04-20 | A kind of communication means, electronic equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110113323A true CN110113323A (en) | 2019-08-09 |
Family
ID=67486055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910321557.8A Pending CN110113323A (en) | 2019-04-20 | 2019-04-20 | A kind of communication means, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110113323A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111026646A (en) * | 2019-11-21 | 2020-04-17 | 中国航空工业集团公司西安航空计算技术研究所 | Graphic command pre-decoding method based on SystemVerilog |
CN111367852A (en) * | 2020-03-23 | 2020-07-03 | 广州视源电子科技股份有限公司 | Operation method, device, equipment and storage medium of equipment |
CN112463672A (en) * | 2020-11-04 | 2021-03-09 | 贵州电网有限责任公司 | Data transmission method, device and medium |
CN112637355A (en) * | 2020-12-25 | 2021-04-09 | 新天科技股份有限公司 | Wireless data processing method, device, equipment and storage medium |
CN112787978A (en) * | 2019-11-07 | 2021-05-11 | 上海哔哩哔哩科技有限公司 | Data acquisition method and device, computer equipment and computer-readable storage medium |
CN113360433A (en) * | 2020-03-06 | 2021-09-07 | Oppo广东移动通信有限公司 | Data communication method and device |
CN113360440A (en) * | 2020-03-06 | 2021-09-07 | Oppo广东移动通信有限公司 | Processor communication control method and related product |
CN113472786A (en) * | 2021-06-30 | 2021-10-01 | 京东方科技集团股份有限公司 | Data transmission method, device, equipment and medium based on multiple radio frequency communication modules |
CN113766009A (en) * | 2021-08-07 | 2021-12-07 | 深圳盈特创智能科技有限公司 | Lamp panel control method, system, device and storage medium |
CN114449060A (en) * | 2021-12-27 | 2022-05-06 | 重庆九洲星熠导航设备有限公司 | Data transmission method and device |
CN115314485A (en) * | 2022-07-06 | 2022-11-08 | 武汉海微科技有限公司 | Expression animation transmission method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120327939A1 (en) * | 2011-06-27 | 2012-12-27 | Lsis Co., Ltd. | Communication method of gateway device supporting mutual communication of can and modbus and gateway device using the same |
CN104503252A (en) * | 2014-12-16 | 2015-04-08 | 广东美的厨房电器制造有限公司 | Household appliance, control method thereof, and information interaction system for household appliance |
CN105453598A (en) * | 2013-05-20 | 2016-03-30 | Sis资源有限公司 | Application development for a network with an electronic cigarette |
CN106126293A (en) * | 2016-06-30 | 2016-11-16 | 深圳市合元科技有限公司 | Electronic cigarette firmware upgrade method and system |
CN106681765A (en) * | 2016-12-24 | 2017-05-17 | 深圳市思拓微电子有限公司 | Intelligent APP application system of electronic Bluetooth cigarette |
CN106880084A (en) * | 2017-03-27 | 2017-06-23 | 云南中烟工业有限责任公司 | A kind of Intelligent electronic cigarette system and its control method based on radio communication |
CN107070910A (en) * | 2017-04-06 | 2017-08-18 | 四川九洲电器集团有限责任公司 | A kind of communication means and electronic equipment |
CN109413625A (en) * | 2018-08-21 | 2019-03-01 | 深圳瀚星翔科技有限公司 | A kind of transmission method and terminal, server of electronic cigarette data |
-
2019
- 2019-04-20 CN CN201910321557.8A patent/CN110113323A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120327939A1 (en) * | 2011-06-27 | 2012-12-27 | Lsis Co., Ltd. | Communication method of gateway device supporting mutual communication of can and modbus and gateway device using the same |
CN105453598A (en) * | 2013-05-20 | 2016-03-30 | Sis资源有限公司 | Application development for a network with an electronic cigarette |
CN104503252A (en) * | 2014-12-16 | 2015-04-08 | 广东美的厨房电器制造有限公司 | Household appliance, control method thereof, and information interaction system for household appliance |
CN106126293A (en) * | 2016-06-30 | 2016-11-16 | 深圳市合元科技有限公司 | Electronic cigarette firmware upgrade method and system |
CN106681765A (en) * | 2016-12-24 | 2017-05-17 | 深圳市思拓微电子有限公司 | Intelligent APP application system of electronic Bluetooth cigarette |
CN106880084A (en) * | 2017-03-27 | 2017-06-23 | 云南中烟工业有限责任公司 | A kind of Intelligent electronic cigarette system and its control method based on radio communication |
CN107070910A (en) * | 2017-04-06 | 2017-08-18 | 四川九洲电器集团有限责任公司 | A kind of communication means and electronic equipment |
CN109413625A (en) * | 2018-08-21 | 2019-03-01 | 深圳瀚星翔科技有限公司 | A kind of transmission method and terminal, server of electronic cigarette data |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112787978B (en) * | 2019-11-07 | 2023-04-07 | 上海哔哩哔哩科技有限公司 | Data acquisition method and device, computer equipment and computer-readable storage medium |
CN112787978A (en) * | 2019-11-07 | 2021-05-11 | 上海哔哩哔哩科技有限公司 | Data acquisition method and device, computer equipment and computer-readable storage medium |
CN111026646B (en) * | 2019-11-21 | 2023-06-30 | 中国航空工业集团公司西安航空计算技术研究所 | Graphical command pre-decoding method based on SystemVerilog |
CN111026646A (en) * | 2019-11-21 | 2020-04-17 | 中国航空工业集团公司西安航空计算技术研究所 | Graphic command pre-decoding method based on SystemVerilog |
CN113360433B (en) * | 2020-03-06 | 2024-05-17 | Oppo广东移动通信有限公司 | Data communication method and device |
CN113360440A (en) * | 2020-03-06 | 2021-09-07 | Oppo广东移动通信有限公司 | Processor communication control method and related product |
CN113360433A (en) * | 2020-03-06 | 2021-09-07 | Oppo广东移动通信有限公司 | Data communication method and device |
CN111367852B (en) * | 2020-03-23 | 2021-08-10 | 广州视源电子科技股份有限公司 | Operation method, device, equipment and storage medium of equipment |
CN111367852A (en) * | 2020-03-23 | 2020-07-03 | 广州视源电子科技股份有限公司 | Operation method, device, equipment and storage medium of equipment |
CN112463672A (en) * | 2020-11-04 | 2021-03-09 | 贵州电网有限责任公司 | Data transmission method, device and medium |
CN112637355B (en) * | 2020-12-25 | 2023-05-23 | 新天科技股份有限公司 | Multi-concurrency single-channel based wireless data processing method, device, equipment and medium |
CN112637355A (en) * | 2020-12-25 | 2021-04-09 | 新天科技股份有限公司 | Wireless data processing method, device, equipment and storage medium |
CN113472786A (en) * | 2021-06-30 | 2021-10-01 | 京东方科技集团股份有限公司 | Data transmission method, device, equipment and medium based on multiple radio frequency communication modules |
CN113766009A (en) * | 2021-08-07 | 2021-12-07 | 深圳盈特创智能科技有限公司 | Lamp panel control method, system, device and storage medium |
CN113766009B (en) * | 2021-08-07 | 2024-01-30 | 深圳盈特创智能科技有限公司 | Lamp panel control method, system, device and storage medium |
CN114449060A (en) * | 2021-12-27 | 2022-05-06 | 重庆九洲星熠导航设备有限公司 | Data transmission method and device |
CN115314485A (en) * | 2022-07-06 | 2022-11-08 | 武汉海微科技有限公司 | Expression animation transmission method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110113323A (en) | A kind of communication means, electronic equipment and computer readable storage medium | |
WO2015149339A1 (en) | Information interaction method and system applying to electronic cigarettes | |
CN105915527B (en) | It is a kind of to control the method and apparatus of mobile terminal, mobile terminal | |
CN105472430B (en) | Method, equipment and the system of mobile terminal jingle bell are controlled by smart television | |
CN104317255A (en) | Internet-of-things-based intelligent household control system | |
CN105519071A (en) | Electronic device using logical channels for communication | |
CN108375924A (en) | A kind of control method and device of smart machine | |
CN106937158A (en) | Live display methods, apparatus and system | |
CN104714817B (en) | Upgrade method, system and the control terminal of home appliance software by infrared signal | |
KR20040104305A (en) | Converting apparatus of home network system | |
WO2016100631A1 (en) | Methods for enabling delay-awareness in the constrained application protocol (coap) | |
CN108737259A (en) | Gateway device, data transmission method and storage medium | |
CN104821929B (en) | Multi-medium data sharing method and terminal | |
CN108540565A (en) | A method of the mobile terminal push based on MQTT agreements and statistics | |
WO2012075885A1 (en) | Data transmission method and device | |
CN109257138A (en) | A kind of data transfer control method and relevant device | |
CN108306938A (en) | A kind of method, apparatus and gateway of Internet of Things product automatic networking | |
CN109411063A (en) | A kind of medical health service system and method | |
CN107171912A (en) | A kind of method of intelligent domestic system, terminal and Internet of Things connection | |
CN108076058A (en) | Heterogeneous network communications protocol method for amalgamation processing based on self-adapting changeable long codes | |
CN108196674A (en) | Physical model for virtually sensing reality, system and implementation method by virtual unit sensing real model | |
CN105137750A (en) | Method realizing data transmission of intelligent watch, device and intelligent watch | |
CN107483148A (en) | Error treating method and device | |
CN108449246A (en) | A kind of intelligent domestic system based on instant message applications Yu Internet of Things Network Communication | |
CN206020972U (en) | Multifunction teaching control 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190809 |