CN105757878B - The encoding and decoding method, apparatus and air conditioner of communication data - Google Patents
The encoding and decoding method, apparatus and air conditioner of communication data Download PDFInfo
- Publication number
- CN105757878B CN105757878B CN201610094800.3A CN201610094800A CN105757878B CN 105757878 B CN105757878 B CN 105757878B CN 201610094800 A CN201610094800 A CN 201610094800A CN 105757878 B CN105757878 B CN 105757878B
- Authority
- CN
- China
- Prior art keywords
- data
- target data
- value
- initial
- count value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F24—HEATING; RANGES; VENTILATING
- F24F—AIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
- F24F11/00—Control or safety arrangements
- F24F11/30—Control or safety arrangements for purposes related to the operation of the system, e.g. for safety or monitoring
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F24—HEATING; RANGES; VENTILATING
- F24F—AIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
- F24F11/00—Control or safety arrangements
- F24F11/62—Control or safety arrangements characterised by the type of control or by internal processing, e.g. using fuzzy logic, adaptive control or estimation of values
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F24—HEATING; RANGES; VENTILATING
- F24F—AIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
- F24F11/00—Control or safety arrangements
- F24F11/62—Control or safety arrangements characterised by the type of control or by internal processing, e.g. using fuzzy logic, adaptive control or estimation of values
- F24F11/63—Electronic processing
Abstract
The present invention provides the encoding and decoding method, apparatus and air conditioner of a kind of communication data, wherein the coding method of communication data, including:Sender obtains initial data to be sent;The initial data is converted into corresponding target data;The target data is sent to recipient, wherein the recipient is reduced to the initial data after receiving the target data, by the target data.Technical scheme of the present invention improves the difficulty that communication data is cracked and analyzes, and the safety of communication data has been effectively ensured, while also can effectively reduce the calculated load of control chip.
Description
Technical field
The present invention relates to data communication technology fields, in particular to a kind of coding method of communication data, Yi Zhongtong
Interrogate coding/decoding method, a kind of code device of communication data, a kind of decoding apparatus of communication data and a kind of air conditioner of data.
Background technology
Multi-gang air-conditioner is generally by multiple assembly modules such as interior machine, outer machine, central controller or host computer monitoring software, line control machine
It forms, is communicated according to certain communications protocol between various components module.Currently, between the module of most of multi-connected machines all
It is to be communicated by RS232/RS485 communication protocols, the data frame of transmission generally uses " frame head+data+check code+frame
The form of tail ", and the data transmitted are transmitted with " actual value ", and so-called " actual value " the i.e. data value passes required for being exactly
The original value for the data sent, not by encryption or other processing.There are the safety of transmission data for this mode for exchanging data
Sex chromosome mosaicism.
Fig. 1 shows that interior machine is transmitted to the structural schematic diagram of a frame data frame of outer machine.Wherein, data 1=2 represents air conditioner
Operational mode be refrigeration mode, it is 17 DEG C that data 2=17, which represents set temperature, and data 3=25 represents indoor temperature as 25 DEG C.
If not handling data frame, unauthorized personnel may just be easier to send out by the data transmitted in monitored data bus
Meaning (such as temperature, pattern, interior board number, the degree of superheat) in existing data frame representated by each byte, understands containing for these data
After justice, then by continuously monitoring and analyzing these data, it is possible to find and derive some control logics of multi-connected machine product
And rule, for example outer machine starts moving law, outer the machine method etc. of distributing address automatically to interior machine of platform.
Although can solve the problems, such as that data frame is stolen by the high data encryption algorithm of degree of safety, due to general
Encryption Algorithm it is more complicated, data calculation amount is larger, can cause each assembly module of multi-connected machine control chip (as calculate speed
Spend slow, the more limited microcontrollers of RAM) increase additional computing cost, to influence the performance of product.
Therefore, it how under the premise of not increasing additional calculated load, improves communication data and is cracked and analyzes
Difficulty, ensure communication data safety become technical problem urgently to be resolved hurrily.
Invention content
The present invention is directed to solve at least one of the technical problems existing in the prior art or related technologies.
For this purpose, an object of the present invention is to provide a kind of encoding scheme of new communication data, communication is improved
The difficulty that data are cracked and analyze has been effectively ensured the safety of communication data, while also can effectively reduce control chip
Calculated load.
A kind of decoding scheme of communication data is proposed it is another object of the present invention to opposite.
A further object of the present invention is to propose a kind of air conditioner.
To achieve the above object, a kind of embodiment according to the first aspect of the invention, it is proposed that coding of communication data
Method, including:Sender obtains initial data to be sent;The initial data is converted into corresponding target data;By institute
It states target data and is sent to recipient, wherein the recipient is after receiving the target data, also by the target data
Originally it was the initial data.
The coding method of communication data according to an embodiment of the invention, sender is by turning initial data to be sent
It is changed to corresponding target data, target data is sent to recipient, when recipient is after receiving target data, then by mesh
Mark data convert is initial data so that the communication data that sending direction recipient sends conceals its original meaning, even if logical
Data are interrogated by malicious intercepted, the accurate meaning of communication data can not be also got, improve communication data and be cracked and analyze
Difficulty, the safety of communication data has been effectively ensured;Simultaneously as the high data encryption algorithm of degree safe to use is not needed,
Therefore the calculated load of control chip also can effectively be reduced.
The coding method of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the step of initial data being converted into corresponding target data, specifically
Including:Obtain the count value of preset coincidence counter;According to the value of the initial data and the count value, determines and search institute
State the index information of target data;According to the index information, the target data is searched in preset tables of data.
The coding method of communication data according to an embodiment of the invention, by obtaining the count value of coincidence counter, and
The index information for searching target data is determined according to the value of initial data and count value, to be preset according to determining index information
Tables of data in search target data, enabling can be realized as converting raw data into number of targets by simply calculating
According to additional computation burden will not be increased.Simultaneously as the process for converting raw data into target data has used synchronometer
The count value and preset tables of data of number device, are if desired reduced to initial data by target data, also need to get synchronous counting
The count value of device and preset tables of data, therefore the difficulty that communication data is cracked and analyzes is also increased to a certain extent,
Be conducive to improve the safety of communication data.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;According to the value of the initial data and the count value, the step of determining the index information for searching the target data,
It specifically includes:Calculate the initial data value and the count value and value, and regard described and value as the target data
Position Number in the tables of data.
According to one embodiment of present invention, the data in the tables of data are different.
In this embodiment, by keeping the data in tables of data different so that initial data and target data are one
The relationship of one mapping, and then ensure that target data can obtain accurate reproduction.
According to one embodiment of present invention, the count value of the coincidence counter is with the secondary of described sender transmission data
It counts and changes.
In this embodiment, the count value of coincidence counter changes by with the number of sender's transmission data so that
Even identical data, when sending twice, obtained target data is also different, it is ensured that communication data is being converted
When have erratic behavior, can also increase the difficulty that communication data is cracked and analyzes to a certain extent, improve communication number
According to safety.
Embodiment according to a second aspect of the present invention, it is also proposed that a kind of coding/decoding method of communication data, including:Recipient
Receive the target data that sender sends, wherein described sender, will be described original after getting initial data to be sent
Data are converted to the target data;The target data is reduced to the initial data by the recipient.
The coding/decoding method of communication data according to an embodiment of the invention, sender is by turning initial data to be sent
It is changed to corresponding target data, target data is sent to recipient, when recipient is after receiving target data, then by mesh
Mark data convert is initial data so that the communication data that sending direction recipient sends conceals its original meaning, even if logical
Data are interrogated by malicious intercepted, the accurate meaning of communication data can not be also got, improve communication data and be cracked and analyze
Difficulty, the safety of communication data has been effectively ensured;Simultaneously as the high data encryption algorithm of degree safe to use is not needed,
Therefore the calculated load of control chip also can effectively be reduced.
The coding/decoding method of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the step of target data being reduced to the initial data, it is specific to wrap
It includes:The count value of preset coincidence counter is obtained, and determines index information of the target data in preset tables of data;
According to the index information and the count value, the value of the initial data is determined.Target data is reduced in the embodiment
The process of initial data is the inverse process that sender converts raw data into target data.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;According to the index information and the count value, the step of determining the value of the initial data, specifically include:It calculates
The difference of the Position Number and the count value, and using the difference as the value of the initial data.
Embodiment according to a third aspect of the present invention, it is also proposed that a kind of code device of communication data is suitable for sending
Side, including:First acquisition unit, for obtaining initial data to be sent;Converting unit, for converting the initial data
For corresponding target data;Transmission unit, for the target data to be sent to recipient, wherein the recipient is connecing
After receiving the target data, the target data is reduced to the initial data.
The code device of communication data according to an embodiment of the invention, sender is by turning initial data to be sent
It is changed to corresponding target data, target data is sent to recipient, when recipient is after receiving target data, then by mesh
Mark data convert is initial data so that the communication data that sending direction recipient sends conceals its original meaning, even if logical
Data are interrogated by malicious intercepted, the accurate meaning of communication data can not be also got, improve communication data and be cracked and analyze
Difficulty, the safety of communication data has been effectively ensured;Simultaneously as the high data encryption algorithm of degree safe to use is not needed,
Therefore the calculated load of control chip also can effectively be reduced.
The code device of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the converting unit includes:Second acquisition unit, it is preset same for obtaining
The count value of step counter;Determination unit is used for the value according to the initial data and the count value, determines and searches the mesh
Mark the index information of data;Searching unit, for according to the index information, the number of targets to be searched in preset tables of data
According to.
The code device of communication data according to an embodiment of the invention, by obtaining the count value of coincidence counter, and
The index information for searching target data is determined according to the value of initial data and count value, to be preset according to determining index information
Tables of data in search target data, enabling can be realized as converting raw data into number of targets by simply calculating
According to additional computation burden will not be increased.Simultaneously as the process for converting raw data into target data has used synchronometer
The count value and preset tables of data of number device, are if desired reduced to initial data by target data, also need to get synchronous counting
The count value of device and preset tables of data, therefore the difficulty that communication data is cracked and analyzes is also increased to a certain extent,
Be conducive to improve the safety of communication data.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;The determination unit is specifically used for:Calculate the initial data value and the count value and value, and will it is described and
It is worth the Position Number as the target data in the tables of data.
According to one embodiment of present invention, the data in the tables of data are different.
In this embodiment, by keeping the data in tables of data different so that initial data and target data are one
The relationship of one mapping, and then ensure that target data can obtain accurate reproduction.
According to one embodiment of present invention, the count value of the coincidence counter is with the secondary of described sender transmission data
It counts and changes.
In this embodiment, the count value of coincidence counter changes by with the number of sender's transmission data so that
Even identical data, when sending twice, obtained target data is also different, it is ensured that communication data is being converted
When have erratic behavior, can also increase the difficulty that communication data is cracked and analyzes to a certain extent, improve communication number
According to safety.
Embodiment according to a fourth aspect of the present invention, it is also proposed that a kind of decoding apparatus of communication data is suitable for receiving
Side, including:Receiving unit, for receive sender transmission target data, wherein described sender get it is to be sent
After initial data, the initial data is converted into the target data;Processing unit, for the target data to be reduced to
The initial data.
The decoding apparatus of communication data according to an embodiment of the invention, sender is by turning initial data to be sent
It is changed to corresponding target data, target data is sent to recipient, when recipient is after receiving target data, then by mesh
Mark data convert is initial data so that the communication data that sending direction recipient sends conceals its original meaning, even if logical
Data are interrogated by malicious intercepted, the accurate meaning of communication data can not be also got, improve communication data and be cracked and analyze
Difficulty, the safety of communication data has been effectively ensured;Simultaneously as the high data encryption algorithm of degree safe to use is not needed,
Therefore the calculated load of control chip also can effectively be reduced.
The decoding apparatus of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the processing unit includes:Acquiring unit, for obtaining preset synchronometer
The count value of number device;First determination unit, for determining index information of the target data in preset tables of data;Second
Determination unit, for according to the index information and the count value, determining the value of the initial data.By mesh in the embodiment
Mark data convert is that the process of initial data is the inverse process that sender converts raw data into target data.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;Second determination unit is specifically used for:Calculate the difference of the Position Number and the count value, and by the difference
It is worth the value as the initial data.
Embodiment according to a fifth aspect of the present invention, it is also proposed that a kind of air conditioner, including:As any in above-described embodiment
The code device of communication data described in;And the decoding apparatus of the communication data as described in any one of above-described embodiment.
Specifically, such as the communication between the outer machine and central controller of communication, air conditioner between the interior machine of air conditioner and outer machine
Etc. above-mentioned coding and decoding scheme can be sampled.
The additional aspect and advantage of the present invention will be set forth in part in the description, and will partly become from the following description
Obviously, or practice through the invention is recognized.
Description of the drawings
The above-mentioned and/or additional aspect and advantage of the present invention will become in the description from combination following accompanying drawings to embodiment
Obviously and it is readily appreciated that, wherein:
Fig. 1 show in the related technology in machine be transmitted to outer machine a frame data frame structural schematic diagram;
Fig. 2 shows the schematic flow diagrams of the coding method of communication data according to an embodiment of the invention;
Fig. 3 shows the schematic block diagram of the code device of communication data according to an embodiment of the invention;
Fig. 4 shows the schematic flow diagram of the coding/decoding method of communication data according to an embodiment of the invention;
Fig. 5 shows the schematic block diagram of the decoding apparatus of communication data according to an embodiment of the invention;
Fig. 6 shows the schematic block diagram of air conditioner according to an embodiment of the invention;
Fig. 7 shows the frame structure schematic diagram of data frame according to an embodiment of the invention;
Fig. 8 shows the processing procedure schematic diagram of transmitting terminal according to an embodiment of the invention;
Fig. 9 shows the processing procedure schematic diagram of receiving terminal according to an embodiment of the invention.
Specific implementation mode
To better understand the objects, features and advantages of the present invention, below in conjunction with the accompanying drawings and specific real
Mode is applied the present invention is further described in detail.It should be noted that in the absence of conflict, the implementation of the application
Feature in example and embodiment can be combined with each other.
Many details are elaborated in the following description to facilitate a thorough understanding of the present invention, still, the present invention may be used also
To be implemented different from other modes described here using other, therefore, protection scope of the present invention is not by described below
Specific embodiment limitation.
Fig. 2 shows the schematic flow diagrams of the coding method of communication data according to an embodiment of the invention.
As shown in Fig. 2, the coding method of communication data according to an embodiment of the invention, including:
Step 202, sender obtains initial data to be sent;
Step 204, the initial data is converted into corresponding target data;
Step 206, the target data is sent to recipient, wherein the recipient is receiving the number of targets
According to rear, the target data is reduced to the initial data.
Specifically, sender by initial data to be sent by being converted to corresponding target data, by target data
It is sent to recipient, when recipient is reduced to initial data after receiving target data, then by target data so that sender
The communication data sent to recipient conceals its original meaning, even if communication data by malicious intercepted, can not also be got
The accurate meaning of communication data improves the difficulty that communication data is cracked and analyzes, the safety of communication data has been effectively ensured
Property;Simultaneously as not needing the high data encryption algorithm of degree safe to use, therefore it also can effectively reduce the calculating of control chip
Load.
The coding method of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the step of initial data being converted into corresponding target data, specifically
Including:Obtain the count value of preset coincidence counter;According to the value of the initial data and the count value, determines and search institute
State the index information of target data;According to the index information, the target data is searched in preset tables of data.
By obtaining the count value of coincidence counter, and is determined according to the value of initial data and count value and search target data
Index information, to search target data in preset tables of data according to determining index information, enabling by simple
Calculating can be realized as converting raw data into target data, additional computation burden will not be increased.Simultaneously as by former
The process that beginning data are converted to target data has used the count value of coincidence counter and preset tables of data, if desired by target
Data convert is initial data, also needs the count value for getting coincidence counter and preset tables of data, therefore to a certain degree
On also increase the difficulty that communication data is cracked and analyzes, be conducive to improve communication data safety.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;According to the value of the initial data and the count value, the step of determining the index information for searching the target data,
It specifically includes:Calculate the initial data value and the count value and value, and regard described and value as the target data
Position Number in the tables of data.
According to one embodiment of present invention, the data in the tables of data are different.
In this embodiment, by keeping the data in tables of data different so that initial data and target data are one
The relationship of one mapping, and then ensure that target data can obtain accurate reproduction.
According to one embodiment of present invention, the count value of the coincidence counter is with the secondary of described sender transmission data
It counts and changes.
In this embodiment, the count value of coincidence counter changes by with the number of sender's transmission data so that
Even identical data, when sending twice, obtained target data is also different, it is ensured that communication data is being converted
When have erratic behavior, can also increase the difficulty that communication data is cracked and analyzes to a certain extent, improve communication number
According to safety.
Fig. 3 shows the schematic block diagram of the code device of communication data according to an embodiment of the invention.
As shown in figure 3, the code device 300 of communication data according to an embodiment of the invention, is suitable for sender, packet
It includes:
First acquisition unit 302, for obtaining initial data to be sent;Converting unit 304 is used for the original number
According to being converted to corresponding target data;Transmission unit 306, for the target data to be sent to recipient, wherein described to connect
Debit is reduced to the initial data after receiving the target data, by the target data.
Specifically, sender by initial data to be sent by being converted to corresponding target data, by target data
It is sent to recipient, when recipient is reduced to initial data after receiving target data, then by target data so that sender
The communication data sent to recipient conceals its original meaning, even if communication data by malicious intercepted, can not also be got
The accurate meaning of communication data improves the difficulty that communication data is cracked and analyzes, the safety of communication data has been effectively ensured
Property;Simultaneously as not needing the high data encryption algorithm of degree safe to use, therefore it also can effectively reduce the calculating of control chip
Load.
The code device 300 of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the converting unit 304 includes:Second acquisition unit 3042, for obtaining
The count value of preset coincidence counter;Determination unit 3044 is used for the value according to the initial data and the count value, really
Surely the index information of the target data is searched;Searching unit 3046 is used for according to the index information, in preset tables of data
It is middle to search the target data.
By obtaining the count value of coincidence counter, and is determined according to the value of initial data and count value and search target data
Index information, to search target data in preset tables of data according to determining index information, enabling by simple
Calculating can be realized as converting raw data into target data, additional computation burden will not be increased.Simultaneously as by former
The process that beginning data are converted to target data has used the count value of coincidence counter and preset tables of data, if desired by target
Data convert is initial data, also needs the count value for getting coincidence counter and preset tables of data, therefore to a certain degree
On also increase the difficulty that communication data is cracked and analyzes, be conducive to improve communication data safety.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;The determination unit 3044 is specifically used for:Calculate the initial data value and the count value and value, and by institute
State and be worth the Position Number as the target data in the tables of data.
According to one embodiment of present invention, the data in the tables of data are different.
In this embodiment, by keeping the data in tables of data different so that initial data and target data are one
The relationship of one mapping, and then ensure that target data can obtain accurate reproduction.
According to one embodiment of present invention, the count value of the coincidence counter is with the secondary of described sender transmission data
It counts and changes.
In this embodiment, the count value of coincidence counter changes by with the number of sender's transmission data so that
Even identical data, when sending twice, obtained target data is also different, it is ensured that communication data is being converted
When have erratic behavior, can also increase the difficulty that communication data is cracked and analyzes to a certain extent, improve communication number
According to safety.
Fig. 4 shows the schematic flow diagram of the coding/decoding method of communication data according to an embodiment of the invention.
As shown in figure 4, the coding/decoding method of communication data according to an embodiment of the invention, including:
Step 402, recipient receive sender send target data, wherein described sender get it is to be sent
Initial data after, the initial data is converted into the target data;
Step 404, the target data is reduced to the initial data by the recipient.
Specifically, sender by initial data to be sent by being converted to corresponding target data, by target data
It is sent to recipient, when recipient is reduced to initial data after receiving target data, then by target data so that sender
The communication data sent to recipient conceals its original meaning, even if communication data by malicious intercepted, can not also be got
The accurate meaning of communication data improves the difficulty that communication data is cracked and analyzes, the safety of communication data has been effectively ensured
Property;Simultaneously as not needing the high data encryption algorithm of degree safe to use, therefore it also can effectively reduce the calculating of control chip
Load.
The coding/decoding method of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the step of target data being reduced to the initial data, it is specific to wrap
It includes:The count value of preset coincidence counter is obtained, and determines index information of the target data in preset tables of data;
According to the index information and the count value, the value of the initial data is determined.Target data is reduced in the embodiment
The process of initial data is the inverse process that sender converts raw data into target data.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;According to the index information and the count value, the step of determining the value of the initial data, specifically include:It calculates
The difference of the Position Number and the count value, and using the difference as the value of the initial data.
Fig. 5 shows the schematic block diagram of the decoding apparatus of communication data according to an embodiment of the invention.
As shown in figure 5, the decoding apparatus 500 of communication data according to an embodiment of the invention, is suitable for recipient, packet
It includes:
Receiving unit 502, for receive sender transmission target data, wherein described sender get it is pending
After the initial data sent, the initial data is converted into the target data;Processing unit 504 is used for the number of targets
According to being reduced to the initial data.
Specifically, sender by initial data to be sent by being converted to corresponding target data, by target data
It is sent to recipient, when recipient is reduced to initial data after receiving target data, then by target data so that sender
The communication data sent to recipient conceals its original meaning, even if communication data by malicious intercepted, can not also be got
The accurate meaning of communication data improves the difficulty that communication data is cracked and analyzes, the safety of communication data has been effectively ensured
Property;Simultaneously as not needing the high data encryption algorithm of degree safe to use, therefore it also can effectively reduce the calculating of control chip
Load.
The decoding apparatus 500 of communication data according to the abovementioned embodiments of the present invention can also have following technical characteristic:
According to one embodiment of present invention, the processing unit 504 includes:Acquiring unit 5042, it is default for obtaining
Coincidence counter count value;First determination unit 5044, for determining the target data in preset tables of data
Index information;Second determination unit 5046, for according to the index information and the count value, determining the initial data
Value.The process that target data is reduced to initial data in the embodiment is that sender converts raw data into target data
Inverse process.
According to one embodiment of present invention, the index information includes position of the target data in the tables of data
Set number;Second determination unit 5046 is specifically used for:Calculate the difference of the Position Number and the count value, and by institute
State value of the difference as the initial data.
Fig. 6 shows the schematic block diagram of air conditioner according to an embodiment of the invention.
As shown in fig. 6, air conditioner according to an embodiment of the invention, including:The coding of communication data as shown in Figure 3
Device 300;And the decoding apparatus 500 of communication data as shown in Figure 5.
Specifically, such as the communication between the outer machine and central controller of communication, air conditioner between the interior machine of air conditioner and outer machine
Etc. above-mentioned coding and decoding scheme can be sampled.
Technical scheme of the present invention described further below.
Technical scheme of the present invention mainly proposes a kind of encoding and decoding method of communication data, wherein coding staff
Method be by initial data to be sent after conversion, re-send in bus, hide its original meaning, increase data broken
The difficulty of solution and analysis, to protect the control logic and rule of product.Simultaneously as technical scheme of the present invention pass through it is simple
Change coincidence counter and data lookup table to realize, the calculated load of the control chip (such as microcontroller) of product will not be increased.
Fig. 7 shows the frame structure schematic diagram of data frame according to an embodiment of the invention.
1, as shown in fig. 7, adding several coincidence counters inside a frame data, each coincidence counter is a word
Section, 0~255 variation (in the present embodiment only as an example, the present invention is not especially limited this).Transmitting terminal is being sent
Before data, first each data of 1~data of initial data N are converted, along with frame head, postamble after conversion, calculate school
It is sent to receiving terminal after testing code, coincidence counter.
2, the method that transmitting terminal carries out data conversion:Each initial data is converted by way of tabling look-up.256 word
During the conversion table of section (in the present embodiment only as an example, the present invention is not especially limited this) is generated in advance,
The value of each byte is not mutually equal in table, and initial data is in 0~255 (in the present embodiment only as an example, the present invention couple
This is not especially limited) between change.Each original value in table there are one unique mapping value, while each mapping value
Also only there are one initial value is corresponding.Coincidence counter is variation, and often sending a sub-value will change.
Correspondence is when tabling look-up:" data original value A "+coincidence counter B "=" mapping value is in conversion table
Position N " (if N is more than 255, N=N -255).
That is N=A+B;
The value for finally taking nth byte in conversion table obtains transformed data, i.e.,
The value of nth byte in transformed data=conversion table;
Even in this way, the same initial value, if the value of coincidence counter changes when converting twice, what is obtained reflects
It is also different to penetrate value, the data frame finally transmitted in bus also can be different.
3, the generation method of conversion table.
Conversion table is stored in as data code in the ROM or EEPROM of microcontroller.Conversion table one shares 256 (in this reality
Apply in example only as an example, the present invention is not especially limited this) a byte, the value ranging from 0~255 of each byte,
The generation of table meets the following conditions:
(1) each data value in table is different.Purpose is to ensure that the data one of initial data and mapping are a pair of
It answers, the data after mapping can restore.
(2) value data of each data and the front is non-conterminous, such as:Table [7]=55, then Table [6] cannot
56 cannot be equal to equal to 54, Table [8].The purpose for the arrangement is that in order to ensure data after conversion with less regularity, as before
Beginning data value is continuous, and discontinuous value is reformed into after conversion.
According to two above-mentioned conditions, the quantity for the conversion table that may be generated is:
As it can be seen that potential conversion table enormous amount, therefore multiple conversion tables can be generated previously according to the above method,
Using when, different conversion tables may be used in the communication between disparate modules, with a table such as between interior machine and outer machine, outside
Just with another table between machine and central controller.Or the product of different models can also use different conversion tables, ensure production
The otherness of product, to increase the difficulty that the data transmitted on data/address bus in whole system are identified by unauthorized persons.
In addition, same transmission frame can also use one or more conversion tables according to real data frame length, than in full
According in frame, wherein the data of half are converted when conversion with one of table, the other half data are turned with another table
It changes.
4, reduction of the coincidence counter for the data encoding and transmitting terminal of receiving terminal, the variation range of coincidence counter
It is 0~255 (in the present embodiment only as an example, the present invention is not especially limited this), transmitting terminal completes primary hair
After sending, coincidence counter just changes once, and changing rule can do simple plus-minus according to actual demand, can also pass through it
He (such as changes according to set sequence of values to change, or calculates the coincidence counter of next time by a formula rule
Value etc.), the changing rule of coincidence counter is more complicated, and transformed data regularity is lower.
Meanwhile by the multiple coincidence counters of increase, data being made to have more variations, it can be according to real data frame length
Use one or more coincidence counters, for example, data frame half data when conversion with one of synchronous counting
Device is converted, the other half data are converted with another coincidence counter.
It can be seen from the above, when having one value variation in initial data, coincidence counter, conversion table, transformation result will
Variation.Receiving terminal is when restoring data, it is necessary to according to identical coincidence counter and conversion table ability when being converted with transmission
Data are correctly restored.Specifically:
After receiving terminal receives a frame data according to communications protocol, first the data received are verified, verification passes through
Afterwards, then by the numerical value of each byte in data frame (including 1~data N of data) it restores one by one, process is as follows:
Firstly, since each of conversion table value is unique, position N of the value for being reduced data in table is found out, then
Value N is subtracted the value of coincidence counter B, and (if there is negative, then for result plus 255), what is obtained is exactly its raw value
A。
Specifically, the processing procedure of transmitting terminal is as shown in figure 8, be specially:Initial data A is added to the value of coincidence counter
B obtains N, then inquires the value of n-th data in conversion table, (exists the value of n-th data in conversion table as target data
The data sent in bus).Wherein, if N is more than 255, N=N -255.
The processing procedure of receiving terminal is as shown in figure 9, be specially:According to target data (data received in bus)
Position of the target data in conversion table is inquired, obtains N, then value B that N is subtracted to coincidence counter obtains initial data A (such as
There is negative in fruit, then result is plus 255).
Pass through above scheme so that every in bus after conversion even if the initial data of transmitting terminal is in the case of constant
The data of secondary transmission also will appear variation, and the change rate of front and back data is 100%.
The above-mentioned technical proposal of the present invention converts initial data by changing the look-up method of coincidence counter, makes
Dynamic change is presented when sending in identical/different initial data in bus, and the meaning and rule of initial data are hidden, and improves
The difficulty that initial data is analyzed and identified, to protecting some control logics and the controlling party in multi-connected unit control system
Method improves the Information Security of product.
It is described in detail technical scheme of the present invention above in association with attached drawing, the present invention proposes a kind of new communication data
Encoding and decoding scheme improves the difficulty that communication data is cracked and analyzes, the safety of communication data has been effectively ensured, together
When also can effectively reduce control chip calculated load.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (7)
1. a kind of coding method of communication data, which is characterized in that including:
Sender obtains initial data to be sent;
The initial data is converted into corresponding target data;
The target data is sent to recipient, wherein the recipient is after receiving the target data, by the mesh
Mark data convert is the initial data;
The step of initial data is converted to corresponding target data, specifically includes:
Obtain the count value of preset coincidence counter;
According to the value of the initial data and the count value, the index information for searching the target data is determined;
According to the index information, the target data is searched in preset tables of data;
The index information includes Position Number of the target data in the tables of data;
According to the value of the initial data and the count value, the step of determining the index information for searching the target data, tool
Body includes:
Calculate the initial data value and the count value and value, and will described and value as the target data described
Position Number in tables of data.
2. the coding method of communication data according to claim 1, it is characterised in that:
Data in the tables of data are different;And/or
The count value of the coincidence counter changes with the number of described sender transmission data.
3. a kind of coding/decoding method of communication data, which is characterized in that including:
Recipient receive sender send target data, wherein described sender after getting initial data to be sent,
The initial data is converted into the target data;
The target data is reduced to the initial data;
The step of target data is reduced to the initial data, specifically includes:
The count value of preset coincidence counter is obtained, and determines index letter of the target data in preset tables of data
Breath;
According to the index information and the count value, the value of the initial data is determined;
The index information includes Position Number of the target data in the tables of data;
According to the index information and the count value, the step of determining the value of the initial data, specifically include:
The difference of the Position Number and the count value is calculated, and using the difference as the value of the initial data.
4. a kind of code device of communication data is suitable for sender, which is characterized in that including:
First acquisition unit, for obtaining initial data to be sent;
Converting unit, for the initial data to be converted to corresponding target data;
Transmission unit, for the target data to be sent to recipient, wherein the recipient is receiving the number of targets
According to rear, the target data is reduced to the initial data;
The converting unit includes:
Second acquisition unit, the count value for obtaining preset coincidence counter;
Determination unit is used for the value according to the initial data and the count value, determines the index for searching the target data
Information;
Searching unit, for according to the index information, the target data to be searched in preset tables of data;
The index information includes Position Number of the target data in the tables of data;
The determination unit is specifically used for:Calculate the initial data value and the count value and value, and will described and value
As Position Number of the target data in the tables of data.
5. the code device of communication data according to claim 4, it is characterised in that:
Data in the tables of data are different;And/or
The count value of the coincidence counter changes with the number of described sender transmission data.
6. a kind of decoding apparatus of communication data is suitable for recipient, which is characterized in that including:
Receiving unit, the target data for receiving sender's transmission, wherein described sender get it is to be sent original
After data, the initial data is converted into the target data;
Processing unit, for the target data to be reduced to the initial data;
The processing unit includes:
Acquiring unit, the count value for obtaining preset coincidence counter;
First determination unit, for determining index information of the target data in preset tables of data;
Second determination unit, for according to the index information and the count value, determining the value of the initial data;
The index information includes Position Number of the target data in the tables of data;
Second determination unit is specifically used for:Calculate the difference of the Position Number and the count value, and by the difference
Value as the initial data.
7. a kind of air conditioner, which is characterized in that including:
The code device of communication data as described in claim 4 or 5;And
The decoding apparatus of communication data as claimed in claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610094800.3A CN105757878B (en) | 2016-02-19 | 2016-02-19 | The encoding and decoding method, apparatus and air conditioner of communication data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610094800.3A CN105757878B (en) | 2016-02-19 | 2016-02-19 | The encoding and decoding method, apparatus and air conditioner of communication data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105757878A CN105757878A (en) | 2016-07-13 |
CN105757878B true CN105757878B (en) | 2018-07-27 |
Family
ID=56329822
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610094800.3A Active CN105757878B (en) | 2016-02-19 | 2016-02-19 | The encoding and decoding method, apparatus and air conditioner of communication data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105757878B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113179522A (en) * | 2021-03-31 | 2021-07-27 | 德氪微电子(深圳)有限公司 | Method and device for data transmission between unmanned aerial vehicle main body and suspension camera |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02171048A (en) * | 1988-12-24 | 1990-07-02 | Mitsubishi Electric Corp | Communication control equipment |
CN1246008A (en) * | 1998-08-26 | 2000-03-01 | 英业达股份有限公司 | Privacy method for multimedium data |
CN1413398A (en) * | 1999-10-25 | 2003-04-23 | 塞弗曼克斯顾问有限公司 | Method for making data processing resistant to extraction of data by analysis of unintended side-channel signals |
CN1820449A (en) * | 2003-07-07 | 2006-08-16 | 西门子公司 | Method for encoded data transmission via a communication network |
-
2016
- 2016-02-19 CN CN201610094800.3A patent/CN105757878B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02171048A (en) * | 1988-12-24 | 1990-07-02 | Mitsubishi Electric Corp | Communication control equipment |
CN1246008A (en) * | 1998-08-26 | 2000-03-01 | 英业达股份有限公司 | Privacy method for multimedium data |
CN1413398A (en) * | 1999-10-25 | 2003-04-23 | 塞弗曼克斯顾问有限公司 | Method for making data processing resistant to extraction of data by analysis of unintended side-channel signals |
CN1820449A (en) * | 2003-07-07 | 2006-08-16 | 西门子公司 | Method for encoded data transmission via a communication network |
Also Published As
Publication number | Publication date |
---|---|
CN105757878A (en) | 2016-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104463007A (en) | Data authentication method and apparatus thereof | |
CN107113180B (en) | Packet transmission device, packet reception device, and storage medium | |
CN103647717A (en) | Message accurate recognition-based substation communication network deterministic path switching method | |
CN105471917A (en) | Data transmission method and system | |
CN105912679A (en) | Method and device for data query | |
CN101976365B (en) | Safe radio frequency identification system | |
CN105757878B (en) | The encoding and decoding method, apparatus and air conditioner of communication data | |
CN114900480A (en) | Communication safety management and control system based on data platform | |
Mo et al. | Anomaly detection of vehicle CAN network based on message content | |
CN106657145B (en) | A kind of database automatic discovering method based on communication protocol and SQL syntax | |
CN104272625B (en) | Communication apparatus and communication method | |
Deng et al. | A lightweight sender identification scheme based on vehicle physical layer characteristics | |
CN116800518A (en) | Method and device for adjusting network protection strategy | |
CN105897401A (en) | Bit-based universal differential power consumption analysis method and system | |
CN110287662A (en) | A kind of engineering machinery electronics identification system and recognition methods | |
CN105468267A (en) | Gesture recognition method and system as well as mobile terminal | |
CN108763114A (en) | A kind of cipher card and its working method based on PCIe104 interfaces | |
CN102012978A (en) | Method and system for safely upgrading ISO (International Standard Code) file | |
CN102624733B (en) | Combination method for combined information source and combined access method for Internet of things information source | |
CN101159641A (en) | CAN bus network and CAN bus extension method | |
CN110995650A (en) | Multi-terminal checking early warning system based on industrial control base line | |
CN109951820A (en) | A kind of data transmission method and relevant apparatus | |
CN108847954A (en) | A kind of customer data multiterminal processing system | |
EP3979590A1 (en) | Method and device for identifying abnormal message | |
CN116909161B (en) | Smart home control method and system based on wearable equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |