CN107070910A - A kind of communication means and electronic equipment - Google Patents
A kind of communication means and electronic equipment Download PDFInfo
- Publication number
- CN107070910A CN107070910A CN201710221285.5A CN201710221285A CN107070910A CN 107070910 A CN107070910 A CN 107070910A CN 201710221285 A CN201710221285 A CN 201710221285A CN 107070910 A CN107070910 A CN 107070910A
- Authority
- CN
- China
- Prior art keywords
- data frame
- electronic equipment
- data
- frame format
- sent
- 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.)
- Granted
Links
Classifications
-
- 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/30—Definitions, standards or architectural aspects of layered protocol stacks
- H04L69/32—Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
- H04L69/322—Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
-
- 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/03—Protocol definition or specification
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a kind of communication means and electronic equipment, including:The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined, wherein, second electronic equipment is any one at least one electronic equipment that can be communicated with first electronic equipment;Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;The first data to be sent based on first data frame format are sent to second electronic equipment.There is the poor technical problem of versatility for solving intermediate layer protocol of the prior art in the technical scheme provided by the present invention.
Description
Technical field
The present invention relates to the communications field, more particularly to a kind of communication means and electronic equipment.
Background technology
In fields such as Industry Control, information household appliances, traffic administrations, the most frequently used wired communication mode is serial communication, string
In the row communication technology, communicating pair will normally be communicated, it is necessary to jointly in accordance with communication protocol, and the serial protocol communicated is only
Only it is that some agreements have been carried out to the electrical characteristic of communication line, the information such as form, the type of Content of Communication is not related to.That
In practical application, set up on the basis of these serial protocols, in addition it is also necessary to perform an intermediate layer protocol.
And this intermediate layer protocol is typically all to be consulted to formulate by communicating pair, versatility is not strong, such as:When a certain product is set
Standby to need to be equipped with a variety of mounting objects, these mounting objects are again using the serial communication intermediate layer protocol each formulated, then
In this case, it is necessary to change the software of the equipment, and various informative because of serial communication intermediate layer protocol, poor consistency is led
Cause debugging process longer.
It can be seen that, there is the poor technical problem of versatility in intermediate layer protocol of the prior art.
The content of the invention
The embodiment of the present invention provides a kind of communication means and electronic equipment, for solving intermediate layer protocol of the prior art
There is the poor technical problem of versatility, to reach the technique effect of dynamic configuration intermediate layer protocol.
On the one hand, the embodiment of the present application provides a kind of communication means, applied in the first electronic equipment, methods described bag
Include:
The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined, wherein,
Second electronic equipment is any one at least one electronic equipment that can be communicated with first electronic equipment
It is individual;
Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;
Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
The first data to be sent based on first data frame format are sent to second electronic equipment.
Optionally, it is described that the first data to be sent based on first data frame format are sent to second electronics
Equipment, including:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to second electronic equipment.
Optionally, described based at least one described content frame and first data frame format, generation first is to be sent
Data, including:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used for
Record the length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is treated
Send data.
It is optionally, described to be based on first frame length, at least one described content frame and first data frame format,
The first data to be sent are generated, including:
The second mark of the second places different from the first position in first data frame format is obtained, its
In, the second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, generation first is to be sent
Data.
Optionally, it is described to be based on first corresponding relation, it is determined that the first data corresponding with first device type
Frame format, including:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame corresponding with first device type
Form;
If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.
On the other hand, the embodiment of the present application also provides a kind of electronic equipment, including:
Housing;
Memory, is arranged in the housing, device type and data frame lattice for storing at least one electronic equipment
First corresponding relation of formula;
Processor, is arranged in the housing, is connected with the memory, for determining current time and the described first electricity
First device type of the second electronic equipment of sub- equipment connection, wherein, second electronic equipment is can be with described first
Any one at least one described electronic equipment that electronic equipment is communicated;Described first pair is obtained from the memory
It should be related to and based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
Dispensing device, for the first data to be sent based on first data frame format to be sent into second electricity
Sub- equipment.
Optionally, the processor is used for:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to by second electronic equipment by the dispensing device.
Optionally, the processor is used for:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used for
Record the length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is treated
Send data.
Optionally, the processor is used for:
The second mark of the second places different from the first position in first data frame format is obtained, its
In, the second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, generation first is to be sent
Data.
Optionally, the processor is used for:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame corresponding with first device type
Form;
If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.
Said one or multiple technical schemes in the embodiment of the present application, are at least imitated with following one or more technologies
Really:
First, due to the technical scheme in the embodiment of the present application, determine what current time was connected with first electronic equipment
First device type of the second electronic equipment, wherein, second electronic equipment is that can be carried out with first electronic equipment
Communication at least one electronic equipment in any one;Obtain the device type and data frame of at least one electronic equipment
First corresponding relation of form;Based on first corresponding relation, it is determined that the first data corresponding with first device type
Frame format;The first data to be sent based on first data frame format are sent to second electronic equipment.I.e. will not
As in the prior art, when connecting the second electronic equipment, it is necessary to install for receiving centre corresponding with the second electronic equipment
The signal procedure of layer protocol instruction, in addition it is also necessary to spend the time to be debugged, whole process is complex, and in the technical program
In, as long as determining the device type of the second electronic equipment, then data frame format corresponding with the second electronic equipment is can determine that, subsequently
Just can the data frame format based on determination generate data to be sent, without installing corresponding signal procedure.Thus it is possible to effectively
Solution intermediate layer protocol of the prior art there is the poor technical problem of versatility, and then reach that dynamic configuration intermediate layer is assisted
The technique effect of view.
2nd, due to the technical scheme in the embodiment of the present application, determine in first corresponding relation with the presence or absence of described the
One device type;If in the presence of based on first corresponding relation, it is determined that the first data corresponding with first device type
Frame format;If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.I.e. in the technical program, there is new device type correspondence
Data frame format when, then can update the first corresponding relation, with obtain update after the first corresponding relation, and then reach satisfaction not
With the technique effect of the demand of equipment.
Brief description of the drawings
A kind of communication means that Fig. 1 provides for the embodiment of the present application first aspect implements flow chart;
Fig. 2 be the embodiment of the present application first aspect in data frame format schematic diagram;
Fig. 3 includes the schematic diagram of content for frame format typing instruction in the embodiment of the present application first aspect;
Fig. 4 is the schematic diagram of the data to be sent generated in the embodiment of the present application first aspect;
The structural representation for a kind of electronic equipment that Fig. 5 provides for the embodiment of the present application second aspect.
Embodiment
The embodiment of the present application provide technical scheme, for solve intermediate layer protocol of the prior art exist versatility compared with
The technical problem of difference, to reach the technique effect of dynamic configuration intermediate layer protocol.
Technical scheme in the embodiment of the present application is in order to solve the above technical problems, general thought is as follows:
The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined, wherein,
Second electronic equipment is any one at least one electronic equipment that can be communicated with first electronic equipment
It is individual;
Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;
Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
The first data to be sent based on first data frame format are sent to second electronic equipment.
In the above-mentioned technical solutions, the of the second electronic equipment that current time is connected with first electronic equipment is determined
One device type, wherein, second electronic equipment is at least one electricity that can be communicated with first electronic equipment
Any one in sub- equipment;Obtain the device type of at least one electronic equipment and the first corresponding pass of data frame format
System;Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;Will be based on described
First data to be sent of the first data frame format are sent to second electronic equipment.I.e. will not be as in the prior art, even
When connecing the second electronic equipment, it is necessary to which the communication journey for receiving intermediate layer protocol instruction corresponding with the second electronic equipment is installed
Sequence, in addition it is also necessary to spend the time to be debugged, whole process is complex, and in the technical program, as long as determining the second electronics
The device type of equipment, then can determine that data frame format corresponding with the second electronic equipment, subsequently just being capable of the number based on determination
Data to be sent are generated according to frame format, without installing corresponding signal procedure.Thus it is possible to effectively solve of the prior art
There is the poor technical problem of versatility in intermediate layer protocol, and then reach the technique effect of dynamic configuration intermediate layer protocol.
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
In addition, the terms "and/or", only a kind of incidence relation for describing affiliated partner, represents there may be
Three kinds of relations, for example, A and/or B, can be represented:Individualism A, while there is A and B, these three situations of individualism B.Separately
Outside, character "/" herein, unless otherwise specified, it is a kind of relation of "or" to typically represent forward-backward correlation object.
First aspect
Fig. 1 is refer to, a kind of communication means provided for the application, applied in the first electronic equipment, methods described bag
Include:
S101:The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined,
Wherein, second electronic equipment is times at least one electronic equipment that can be communicated with first electronic equipment
Meaning one;
S102:Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;
S103:Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
S104:The first data to be sent based on first data frame format are sent to second electronic equipment.
The embodiment of the present application provide a kind of communication means, can be applied to Industry Control, traffic administration, information household appliances or
The embedded device in the fields such as household intelligent control.In the embodiment of the present application, the first electronic equipment is by taking device A as an example, device A
It can be communicated with other electronic equipment B, C, D, and equipment B, C, D have different interlayer communication agreements from device A.
How to ensure that device A on the premise of different communication program is not installed, is communicated with equipment B, C, D, then can use this Shen
Please embodiment provide technical scheme.
In the embodiment of the present application, step S101 is first carried out:Determine that current time is connected with first electronic equipment
The second electronic equipment the first device type, wherein, second electronic equipment is can enter with first electronic equipment
Row communication at least one electronic equipment in any one.
In the embodiment of the present application, when the first electronic equipment and the second electronic equipment are set up and be connected, the first electronic equipment
Can be according to the level of connecting interface, come the device type of the second electronic equipment for determining connection, specifically, such as:The electricity of interface
Put down as 0, device type is 1;Interface level is 1, and device type is 2.
In the embodiment of the present application, setting for the second electronic equipment can also be determined by the device identification of the second electronic equipment
Standby type.During implementing, when the first electronic equipment and the second electronic equipment are set up and be connected, the second electronic equipment can
So that the device identification of itself is sent into the first electronic equipment.Receive what is sent by the second electronic equipment in the first electronic equipment
After device identification, then the device type of the second electronic equipment can be determined based on the device identification, such as:Device identification is 00
When, corresponding device type is 1;When device identification is 01, corresponding device type is 2;It is corresponding to set when device identification is 10
Standby type is 3 etc..For above two implementation, it is not especially limited in the embodiment of the present application.
In the embodiment of the present application, after execution of step S101, then step S102 is performed:Obtain at least one described electricity
The device type of sub- equipment and the first corresponding relation of data frame format.
In the embodiment of the present application, the first corresponding relation of device type and data frame format can be stored in the first electronics
In equipment, in other electronic equipments that the connection of the first electronic equipment can also be present in, when needed, from other electronic equipments
Obtain, or using other storage modes, be not especially limited in the embodiment of the present application.
Every kind of data frame format in should being related to all corresponds to a kind of communication protocol, is generated according to the form corresponding to be sent
Data.First corresponding relation of device type and data frame format, specifically, first corresponding relation can be a form,
In form it is corresponding by:Device type is 1, and the numbering of data frame format is 1;Device type is 2, and the numbering of data frame format is
2;Device type is 3, and the numbering of data frame format is 3 etc., or using the first corresponding relation is presented otherwise, in the application
It is not especially limited in embodiment.
After execution of step S102, then step S103 is performed:Based on first corresponding relation, it is determined that with described
Corresponding first data frame format of one device type.
In the embodiment of the present application, process is implemented for step S103, specifically included:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame corresponding with first device type
Form;
If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.
In the embodiment of the present application, it is first determined in the first corresponding relation whether there is the first device type, if in the presence of,
Determine the first data frame format corresponding with the first device type.
During implementing, device type is corresponding exemplified by 1, first data frame corresponding with device type 1
Form, refer to Fig. 2, in the schematic diagram, and frame format includes three row contents, and first row is classified as in frame format to be had comprising each several part
The mark held in vivo, specifically, the first lattice in first row are 2, represents that frame head uses frame head table in the data frame format
Second in lattice;The 3rd lattice in first row are 2, represent the command word used in the data frame format in command word form
Second etc..During implementing, due to message length-byte number and check byte this two parts due to content not
It is fixed value, but calculated in the transmission process of actual command by certain algorithm, so, in corresponding data
What is stored in frame format is the mark for calculating the contents of the section, such as:The second lattice are 2 in first row, represent the data frame lattice
The message length-byte number of formula uses second algorithm;Lattice second from the bottom are 1 in first row, identify in the data frame format and verify
Length is calculated using the first algorithm.In the embodiment of the present application, message length-byte number is specifically as follows:Include verification data
Or not comprising verification data;The computational algorithm of check byte is specifically as follows:Exclusive or check, sum check, redundancy check or
For other checking algorithm, those of ordinary skill in the art can be selected as needed, not make to have in the embodiment of the present application
Body is limited.
Secondary series in frame format is then the byte length of each several part content in first row, such as:Frame head is 2 byte lengths;
The length of command word is 1 byte length etc..
The 3rd row in frame format, represent transmission order of each several part content when sending, such as:Frame head transmission order be
1, then it represents that sent at the first moment, the transmission order of message-length is 2, comes and is sent behind frame head, the transmission of command word
Order is 3, by that analogy.
In the embodiment of the present application, if in the absence of the first device type, in the first corresponding relation, adding the equipment class
The numbering of type and corresponding data frame format.During implementing, Fig. 3 is refer to, is frame format typing instruction, the part
Mainly include the digital table in 7 partial contents, (2,1,7A, 7A), (2,43), (3), (N), (5), (N), (4), figure in blockage
Show the transmission order of each several part content, it is not necessary to which that the field used is then inserted is N.Accordingly, in Input Process, according to logical
Data frame format, comprising three row, first row then inserts mark corresponding with frame format each several part content, such as:With 7A 7A couple
That answers is designated 2;Equations of The Second Kind is the length byte number of each several part content;3rd is classified as the order of each several part content transmission, that is, fills out
Enter the data in blockage in frame format typing instruction.And the particular content of each several part is then entered into agreement investigation inquiry in frame format
In form, for subsequent query.
In the embodiment of the present application, after execution of step S103, then step S104 is performed:Will be based on the described first number
Second electronic equipment is sent to according to the first data to be sent of frame format.
During implementing, process is implemented for step S104, following steps are specifically included:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to second electronic equipment.
During concrete implementation, the second corresponding relation of data frame format and content frame, then by frame format
Mark correspondence in first row, with continued reference to Fig. 2, the first lattice in first row are 2, then it represents that this frame data is in frame head form
In serial number 2, that is, represent to use second in frame head form, command word is used second in command word form
Kind.
In the embodiment of the present application, due to message length-byte number and this two parts of check byte because content is not fixed
Value, but calculated in the transmission process of actual command by certain algorithm, so, during implementing,
The algorithm for determining to calculate this two parts content is first had to, therefore, during implementing, for described based on described at least one
Individual content frame and first data frame format, generate the first data to be sent, including:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used for
Record the length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is treated
Send data.
Further, it is described to be based on first frame length, at least one described content frame and the first data frame lattice
Formula, generates the first data to be sent, including:
The second mark of the second places different from the first position in first data frame format is obtained, its
In, the second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, generation first is to be sent
Data.
In the embodiment of the present application, the first position in the first data frame format is at message-length and checksum location,
Because this two parts content is not fixed, but need what is calculated according to corresponding computational algorithm, therefore, according to the
The mark of at the one position and second place can not directly find specific content, and calculating can only be determined according to mark
Algorithm, then according to the algorithm determined, calculate corresponding particular content.
During implementing, please continue to refer to Fig. 2, first position is corresponding to be designated 2, then it represents that use second
Plant the length that algorithm calculates the data to be sent;The second place is designated 1 in the first data frame format, then it represents that use
1st kind of algorithm calculates the check word joint number of the data to be sent.
It is determined that in frame format after each several part content, then according to the transmission order of each several part content specified in frame format
Be together in series transmission.Place is put specifically, frame head is placed above the other things, message-length is placed on the second place, and command word is then put
In the 3rd position, message content is then placed on the 4th position, and verification is then placed on the 5th position, is then sent out according to front and back position order
Send, specifically refer to Fig. 4.
Second aspect
Fig. 5 is refer to, the embodiment of the present application also provides a kind of electronic equipment, including:
Housing 50;
Memory 51, is arranged in the housing 50, device type and data for storing at least one electronic equipment
First corresponding relation of frame format;
Processor 52, is arranged in the housing 50, is connected with the memory 51, for determine current time with it is described
First device type of the second electronic equipment of the first electronic equipment connection, wherein, second electronic equipment is can be with institute
State any one at least one described electronic equipment that the first electronic equipment is communicated;Obtain described from the memory
First corresponding relation and based on first corresponding relation, it is determined that the first data frame lattice corresponding with first device type
Formula;
Dispensing device 53, for the first data to be sent based on first data frame format to be sent into described second
Electronic equipment.
Optionally, the processor is used for:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to by second electronic equipment by the dispensing device.
Optionally, the processor is used for:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used for
Record the length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is treated
Send data.
Optionally, the processor is used for:
The second mark of the second places different from the first position in first data frame format is obtained, its
In, the second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, generation first is to be sent
Data.
Optionally, the processor is used for:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame corresponding with first device type
Form;
If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.
Said one or multiple technical schemes in the embodiment of the present application, are at least imitated with following one or more technologies
Really:
First, due to the technical scheme in the embodiment of the present application, determine what current time was connected with first electronic equipment
First device type of the second electronic equipment, wherein, second electronic equipment is that can be carried out with first electronic equipment
Communication at least one electronic equipment in any one;Obtain the device type and data frame of at least one electronic equipment
First corresponding relation of form;Based on first corresponding relation, it is determined that the first data corresponding with first device type
Frame format;The first data to be sent based on first data frame format are sent to second electronic equipment.I.e. will not
As in the prior art, when connecting the second electronic equipment, it is necessary to install for receiving centre corresponding with the second electronic equipment
The signal procedure of layer protocol instruction, in addition it is also necessary to spend the time to be debugged, whole process is complex, and in the technical program
In, as long as determining the device type of the second electronic equipment, then data frame format corresponding with the second electronic equipment is can determine that, subsequently
Just can the data frame format based on determination generate data to be sent, without installing corresponding signal procedure.Thus it is possible to effectively
Solution intermediate layer protocol of the prior art there is the poor technical problem of versatility, and then reach that dynamic configuration intermediate layer is assisted
The technique effect of view.
2nd, due to the technical scheme in the embodiment of the present application, determine in first corresponding relation with the presence or absence of described the
One device type;If in the presence of based on first corresponding relation, it is determined that the first data corresponding with first device type
Frame format;If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.I.e. in the technical program, there is new device type correspondence
Data frame format when, then can update the first corresponding relation, with obtain update after the first corresponding relation, and then reach satisfaction not
With the technique effect of the demand of equipment.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Specifically, the corresponding computer program instructions of communication means in the embodiment of the present application can be stored in light
On disk, hard disk, the storage medium such as USB flash disk, when in storage medium computer program instructions corresponding with communication means by an electronics
When equipment reads or is performed, comprise the following steps:
The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined, wherein,
Second electronic equipment is any one at least one electronic equipment that can be communicated with first electronic equipment
It is individual;
Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;
Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
The first data to be sent based on first data frame format are sent to second electronic equipment.
Optionally, stored in the storage medium and step:It is described by based on first data frame format first
Data to be sent are sent to second electronic equipment, and corresponding computer instruction is including as follows during specific be performed
Step:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to second electronic equipment.
Optionally, stored in the storage medium and step:It is described based at least one described content frame and described the
One data frame format, generates the first data to be sent, and corresponding computer instruction is during specific be performed, including following step
Suddenly:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used for
Record the length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is treated
Send data.
Optionally, stored in the storage medium and step:It is described based on first frame length, it is described at least one
Content frame and first data frame format, generate the first data to be sent, and corresponding computer instruction was performed specifically
Cheng Zhong, comprises the following steps:
The second mark of the second places different from the first position in first data frame format is obtained, its
In, the second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, generation first is to be sent
Data.
Optionally, stored in the storage medium and step:It is described be based on first corresponding relation, it is determined that with it is described
Corresponding first data frame format of first device type, corresponding computer instruction is including as follows during specific be performed
Step:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame corresponding with first device type
Form;
If being not present, by the corresponding relation of first device type and first data frame format added to described the
In one corresponding relation, with the first corresponding relation after being updated.
Described above, above example is only described in detail to the technical scheme to the application, but implements above
The explanation of example is only intended to the method and its core concept for helping to understand the present invention, should not be construed as limiting the invention.This
Those skilled in the art the invention discloses technical scope in, the change or replacement that can be readily occurred in should all be covered
Within protection scope of the present invention.
Claims (10)
1. a kind of communication means, applied in the first electronic equipment, it is characterised in that methods described includes:
The first device type of the second electronic equipment that current time is connected with first electronic equipment is determined, wherein, it is described
Second electronic equipment is any one at least one electronic equipment that can be communicated with first electronic equipment;
Obtain the device type and the first corresponding relation of data frame format of at least one electronic equipment;
Based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
The first data to be sent based on first data frame format are sent to second electronic equipment.
2. the method as described in claim 1, it is characterised in that described pending by first based on first data frame format
Data are sent to be sent to second electronic equipment, including:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to second electronic equipment.
3. method as claimed in claim 2, it is characterised in that described to be counted based at least one described content frame and described first
According to frame format, the first data to be sent are generated, including:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used to record
The length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is to be sent
Data.
4. method as claimed in claim 3, it is characterised in that described to be based on first frame length, at least one described frame
Content and first data frame format, generate the first data to be sent, including:
The second mark of the second places different from the first position in first data frame format is obtained, wherein,
The second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, the first data to be sent are generated.
5. the method as described in claim 1, it is characterised in that described to be based on first corresponding relation, it is determined that with described the
Corresponding first data frame format of one device type, including:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
If being not present, the corresponding relation of first device type and first data frame format is added to described first pair
In should being related to, with the first corresponding relation after being updated.
6. a kind of electronic equipment, including:
Housing;
Memory, be arranged in the housing, device type and data frame format for storing at least one electronic equipment
First corresponding relation;
Processor, is arranged in the housing, is connected with the memory, for determining that current time sets with first electronics
First device type of the second electronic equipment of standby connection, wherein, second electronic equipment is can be with first electronics
Any one at least one described electronic equipment that equipment is communicated;First correspondence is obtained from the memory to close
It is and based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
Dispensing device, sets for the first data to be sent based on first data frame format to be sent into second electronics
It is standby.
7. electronic equipment as claimed in claim 6, it is characterised in that the processor is used for:
Obtain the second corresponding relation of data frame format and content frame;
Based on second corresponding relation, it is determined that at least one content frame corresponding with first data frame format;
Based at least one described content frame and first data frame format, the first data to be sent are generated;
Described first data to be sent are sent to by second electronic equipment by the dispensing device.
8. electronic equipment as claimed in claim 7, it is characterised in that the processor is used for:
The first mark of the first position in first data frame format is obtained, wherein, the first position is used to record
The length of the first data frame corresponding with first data frame format;
Obtain the first algorithm for being used to calculate the length of first data frame corresponding with the described first mark;
Based on first algorithm, the first frame length of first data frame is calculated;
Based on first frame length, at least one described content frame and first data frame format, generation first is to be sent
Data.
9. electronic equipment as claimed in claim 8, it is characterised in that the processor is used for:
The second mark of the second places different from the first position in first data frame format is obtained, wherein,
The second place is used for the check value for recording first data frame;
Obtain the second algorithm for being used to calculate the first data frame check value corresponding with the described second mark;
Based on second algorithm, the first check value of first data frame is calculated;
Based on first check value, first frame length and at least one described content frame, the first data to be sent are generated.
10. electronic equipment as claimed in claim 6, it is characterised in that the processor is used for:
Determine to whether there is first device type in first corresponding relation;
If in the presence of based on first corresponding relation, it is determined that the first data frame format corresponding with first device type;
If being not present, the corresponding relation of first device type and first data frame format is added to described first pair
In should being related to, with the first corresponding relation after being updated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710221285.5A CN107070910B (en) | 2017-04-06 | 2017-04-06 | Communication method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710221285.5A CN107070910B (en) | 2017-04-06 | 2017-04-06 | Communication method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107070910A true CN107070910A (en) | 2017-08-18 |
CN107070910B CN107070910B (en) | 2021-06-01 |
Family
ID=59602560
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710221285.5A Active CN107070910B (en) | 2017-04-06 | 2017-04-06 | Communication method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107070910B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110113323A (en) * | 2019-04-20 | 2019-08-09 | 深圳瀚星翔科技有限公司 | A kind of communication means, electronic equipment and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101917520A (en) * | 2007-07-04 | 2010-12-15 | 华为技术有限公司 | Conversion/backup method, equipment and system for mobile terminal data |
CN102480674A (en) * | 2010-11-26 | 2012-05-30 | 中国移动通信集团北京有限公司 | Data pushing method and state perceiving and pushing module as well as data pushing system |
WO2016003586A1 (en) * | 2014-07-02 | 2016-01-07 | Qualcomm Incorporated | Frame format supporting enhanced features in a communication network |
-
2017
- 2017-04-06 CN CN201710221285.5A patent/CN107070910B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101917520A (en) * | 2007-07-04 | 2010-12-15 | 华为技术有限公司 | Conversion/backup method, equipment and system for mobile terminal data |
CN102480674A (en) * | 2010-11-26 | 2012-05-30 | 中国移动通信集团北京有限公司 | Data pushing method and state perceiving and pushing module as well as data pushing system |
WO2016003586A1 (en) * | 2014-07-02 | 2016-01-07 | Qualcomm Incorporated | Frame format supporting enhanced features in a communication network |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110113323A (en) * | 2019-04-20 | 2019-08-09 | 深圳瀚星翔科技有限公司 | A kind of communication means, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107070910B (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105610938B (en) | Logging state synchronous method and system | |
US20100095159A1 (en) | Apparatus and method for automatic testing of software or digital devices | |
CN106843942A (en) | The firmware upgrade method and Wearable of Wearable | |
CN103036739B (en) | Formalization method for verification and performance analysis of high reliable communication system | |
CN103441861B (en) | A kind of data record generation method and device | |
CN104516838B (en) | Manage determining method of path and device | |
CN107368272A (en) | A kind of double screen is different to touch different aobvious method, apparatus and computer-readable recording medium | |
CN103327051A (en) | Long-distance desktop management system and method | |
CN110502464A (en) | A kind of hot-swappable processing method, device, equipment, system and readable storage medium storing program for executing | |
CN104021081A (en) | Debugging method and device for browser | |
CN107078806A (en) | Optical transceiver apparatus and method | |
CN108200387A (en) | A kind of transmission method of file, system and camera | |
CN108696475A (en) | A kind of distribution power automation terminal automatic registration method and device with safety certification | |
CN105137842A (en) | Stage adaptive coupling device | |
CN109753639B (en) | Front-background unified verification method and device, storage medium and electronic equipment | |
CN111756858A (en) | Remote development processing system, method and device of embedded equipment | |
CN114780519A (en) | DBC file generation method, device, equipment and medium based on CAN communication | |
CN110392096A (en) | A kind of method, apparatus of file distributing, master controller and storage medium | |
CN107070910A (en) | A kind of communication means and electronic equipment | |
CN109901664A (en) | Method, apparatus, system, equipment and the readable storage medium storing program for executing of clock signal are provided | |
CN107147719A (en) | A kind of hardware update method, master node, slave node and server cluster | |
CN113986600B (en) | Test method and device for chip serial interface and chip | |
CN110515604A (en) | The acquisition methods and device of the executable program file of verification environment | |
CN105956230B (en) | A kind of electric parameter compensation method and device | |
CN111045681B (en) | Equipment topology display method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |