CN105045108B - Smart home data transmission method in power carrier and ad hoc network radio frequency system - Google Patents
Smart home data transmission method in power carrier and ad hoc network radio frequency system Download PDFInfo
- Publication number
- CN105045108B CN105045108B CN201510273806.2A CN201510273806A CN105045108B CN 105045108 B CN105045108 B CN 105045108B CN 201510273806 A CN201510273806 A CN 201510273806A CN 105045108 B CN105045108 B CN 105045108B
- Authority
- CN
- China
- Prior art keywords
- data
- instruction
- length
- new
- equipment operation
- 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
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B15/00—Systems controlled by a computer
- G05B15/02—Systems controlled by a computer electric
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM]
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/26—Pc applications
- G05B2219/2642—Domotique, domestic, home control, automation, smart house
Abstract
The present invention provides the smart home data transmission methods in power carrier and ad hoc network radio frequency system, including:Sending device by equipment operation instruct in director data carry out high coding compression;Local manipulation equipment receives compressed equipment operation instruction, carries out low level coding decompression to the director data in equipment operation instruction, obtains decoded equipment operation instruction;Local manipulation equipment carries out control operation according to the instruction of decoded equipment operation.To which the present invention solves under power carrier and ad hoc network radio communication transmission conditions, for smart home system feature, the problem of the length of data frame is effectively reduced, improves efficiency of transmission.Therefore, it is possible to prevente effectively from subpackage problem in transmission process, ensures the accuracy and real-time of data transmission, the performance of smart home system under power carrier and ad hoc network radio communication transmission conditions is improved.
Description
Technical field
The present invention relates to the controls of smart home and system to implement field, more particularly, to power carrier and ad hoc network radio frequency
Smart home data transmission method in system.
It sees
Background technique
Smart home is designed using house as platform using comprehensive wiring technology, network communication technology, smart home-system
Scheme Security precautionary technology, automatic control technology, audio and video technology integrate the related facility of home life, and building is efficient firmly
The management system of residence facility and family's schedule affairs promotes house security, convenience, comfort, artistry, and realizes environmental protection
Energy-efficient living environment.In smart home system, the control of various home equipments is particularly important, and one of weight
The aspect wanted is exactly:The transmission of various instructions.Currently, the transmission technology to home wiring control is more, as WIFI, bluetooth, 2G, 3G,
ZigBEE etc., but power carrier (PLC, Power line CommunicationPLC) and ad hoc network radio communication are passed
Defeated research and application is less.Electrical carrier is combined together with ad hoc network radio communication, is had and is avoided villa, spring layer building wall
More features.However, there is also obvious disadvantages for this method:In the community that user is intensive, information is easy to appear decaying;Especially
Longer data frame is communicated, packet loss is more serious.Therefore, under power carrier and ad hoc network radio communication transmission conditions, such as
What is directed to smart home system feature, is effectively reduced the length of data frame, improves efficiency of transmission, become one urgently research and
It solves the problems, such as
Summary of the invention
For above-mentioned defect in the prior art, the present invention solves power carrier and ad hoc network radio communication transmission conditions
Under, for smart home system feature, the problem of the length of data frame is effectively reduced, improves efficiency of transmission.
In order to achieve the above object, the present invention provides the following technical solutions:
Smart home data transmission method in power carrier and ad hoc network radio frequency system, which is characterized in that including:
Step S101 is decoded the instruction frame format in equipment operation instruction, extracts the director data of present encoding,
The digit of the director data of the present encoding is 16;
The director data of the present encoding is converted to 64 from 16 by step S102, carries out high coding compression;
Step S103 is encapsulated as the instruction of compressed equipment operation to send data packet;
The transmission data packet is sent local manipulation equipment by step S104;
Step S105, local manipulation equipment receives the compressed equipment operation instruction, in equipment operation instruction
Director data carry out low level coding decompression, obtain the instruction of decoded equipment operation;
Step S106, local manipulation equipment carry out control operation according to the decoded equipment operation instruction;
Random length coding compression algorithm in the step S102 is:
If the instruction of input is Instruction, if the instruction exported after compression is New_Instruction, after compression
Remainder bytes digit be REST, setting output after command length be New_Length, the first array of definition be Instr_Data,
Instr_Data is the data for including in Instruction, and the second array of definition is New_Instr_Data, the New_Instr_
Data defines 16 systems and converts 64 system tables as B, defining XOR is verification for storing compressed Instr_Data data
With;
Step S1021:New_Length=0, REST=0 is arranged in initialization;
Step S1022:Instruction is read in, the length in Instruction is obtained and is Length, is arranged
N number of director data in Instruction is Data_1 to Data_N;
It calculates and updates compressed code length, variable X 1 is set:
Enable X1=Length*2;
Judge whether X1 is 0, if being into step 1026, otherwise,
New_Length=(X1MOD 3)+(X1/3) * 2;
N number of director data is saved:
By N number of director data Data_1, Data_2 ..., Data_N is successively stored in Instr_Data;
Step S1023:Data in Instr_Data are compressed, by 3 16 scale codings every in Instr_Data
2 64 scale codings of boil down to;
3 characters are successively read in from Instr_Data, it is assumed that three characters are followed successively by a1, a2, a3, then
Enable Sum=a1*16*16+a2*16+a3;
Enable b1=Sum/64;B2=Sum MOD 64;
According to table B, b1 is searched in table B, and finds 64 scale coding value c1 corresponding to b1;
According to table B, b2 is searched in table B, and finds 64 scale coding value c2 corresponding to b2;
C1 and c2 are sequentially written in New_Instr_Data;
To untreated 16 scale coding is left, the numerical value of Length MOD 3 is judged;
If Length MOD 3=1, is arranged REST=1, it is assumed that the character of reading is d1,
According to table B, d1 is searched in number column, and finds 64 scale coding value c3 corresponding to a1;
C3 is appended in New_Instr_Data;
If Length MOD 3=2, is arranged REST=2;
Take out last two characters e1, e2 of Instruction;
Enable Sum 1=e1*16+e2;
Enable f1=Sum 1/64;F2=Sum1MOD 64;
According to table B, f1 is searched in table B, and finds 64 scale coding value c4 corresponding to f1;
According to table B, f2 is searched in table B, and finds 64 scale coding value c5 corresponding to f2;
C4 and c5 are sequentially written in New_Instr_Data;
Step S1024:XOR operation is successively carried out to the data in Instruction, and is recorded as XOR;
Step S1025:In conjunction with table B, New_Length is expressed as to 1 64 scale coding data New_Length1;
Step S1026:By all data in Instruction, it is combined into New_Instruction;
Step S1027:Export New_Instruction.
In a preferred embodiment, include in the step S105:
Step S1051, local manipulation equipment receives the compressed equipment operation instruction, from equipment operation instruction
Instruction frame format be decoded, extract director data;
Step S1052 carries out low level coding decompression to described instruction data.
In a preferred embodiment, include in the step S1052:
Described instruction data are converted to 16 from 64, carry out low level coding decompression, obtain decoded equipment operation and refer to
It enables.
In a preferred embodiment, described that the director data is converted to 16 from 64, carry out low level coding
Decompression, obtaining the step of decoded equipment operation instructs includes:
Director data is extracted from the described director data, control 64 is converted to 16 correspondence tables, which is referred to
It enables data be converted to 16 from 64, carries out low level coding decompression.
In a preferred embodiment, include in the step S102:
Step S1021, local manipulation equipment receives the compressed equipment operation instruction, from equipment operation instruction
Instruction frame format be decoded, extract director data;
Step S1022 carries out low level coding decompression to described instruction data.
In a preferred embodiment, include in the step S1022:
Described instruction data are converted to 16 from 64, carry out low level coding decompression, obtain decoded equipment operation and refer to
It enables.
In a preferred embodiment, described that the director data is converted to 16 from 64, carry out low level coding
Decompression, obtaining the step of decoded equipment operation instructs includes:
Director data is extracted from the described director data, control 64 is converted to 16 correspondence tables, which is referred to
It enables data be converted to 16 from 64, carries out low level coding decompression.
In a preferred embodiment, further include after the step S105:
If the byte number of the decoded equipment operation instruction is greater than detection byte number, to sending device sending device
The repeating transmission of operational order is requested.
Of the invention has the beneficial effect that:The present invention is according to intelligence under power carrier and ad hoc network radio communication transmission conditions
The characteristics of house system, 64 coding schedules of customized Intelligent housing instruction;Customized transport protocol;Electricity is invented
The random length coding compression algorithm that smart home instructs under power carrier wave and ad hoc network radio communication transmission conditions;Electric power load is invented
The random length compression coding algorithm that smart home instructs under wave and ad hoc network radio communication transmission conditions.It is possible to prevente effectively from transmission
Subpackage problem in the process ensures the accuracy and real-time of data transmission, improves power carrier and ad hoc network radio communication
The performance of smart home system under transmission conditions.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is that the smart home data in one embodiment of the present invention, in power carrier and ad hoc network radio frequency system pass
The flow diagram of transmission method.
Specific embodiment
Below in conjunction with attached drawing of the invention, technical solution of the present invention is clearly and completely described, it is clear that institute
The embodiment of description is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention,
Every other embodiment obtained by those of ordinary skill in the art without making creative efforts, belongs to this hair
The range of bright protection.
As shown in Figure 1, the smart home data transmission method in power carrier and ad hoc network radio frequency system, including:
Step S101, by equipment operation instruct in director data carry out high coding compression.
In this step, sending device by equipment operation instruct in director data carry out high coding compression, will compress
Equipment operation instruction afterwards is sent to smart home device.
Step S102 obtains decoded equipment operation instruction.
In this step, local manipulation equipment receives the compressed equipment operation instruction, instructs to the equipment operation
In director data carry out low level coding decompression, obtain the instruction of decoded equipment operation;
Step S103, local manipulation equipment carry out control operation according to the decoded equipment operation instruction.
In a preferred embodiment, include in the step S101:
Step S1011 is decoded the instruction frame format in equipment operation instruction, extracts the instruction number of present encoding
According to;
Step S1012 carries out high coding compression to the director data of the present encoding;
Step S1013 is encapsulated as the instruction of compressed equipment operation to send data packet;
The transmission data packet is sent local manipulation equipment by step S1014.
In a preferred embodiment, the digit of the director data of the present encoding is 16.
In a preferred embodiment, include in the step S1012:
By the director data of the present encoding, 64 are converted to from 16, carry out high coding compression.
In a preferred embodiment, the director data by the present encoding is converted to 64 from 16,
Carry out high coding compression the step of include:
Director data is extracted from the present encoding, control 16 is converted to 64 correspondence tables, which is instructed
Data are converted to 64 from 16, carry out high coding compression.
In a preferred embodiment, further include in the step S101:
If equipment operation instruction encapsulation after data byte, be greater than setting byte, then by equipment operation instruct in instruction
Data carry out high coding compression, send smart home device for the instruction of compressed equipment operation.
In a preferred embodiment, include in the step S102:
Step S1021, local manipulation equipment receives the compressed equipment operation instruction, from equipment operation instruction
Instruction frame format be decoded, extract director data;
Step S1022 carries out low level coding decompression to described instruction data.
In a preferred embodiment, include in the step S1022:
Described instruction data are converted to 16 from 64, carry out low level coding decompression, obtain decoded equipment operation and refer to
It enables.
In a preferred embodiment, described that the director data is converted to 16 from 64, carry out low level coding
Decompression, obtaining the step of decoded equipment operation instructs includes:
Director data is extracted from the described director data, control 64 is converted to 16 correspondence tables, which is referred to
It enables data be converted to 16 from 64, carries out low level coding decompression.
In a preferred embodiment, further include after the step S102:
If the byte number of the decoded equipment operation instruction is greater than detection byte number, to sending device sending device
The repeating transmission of operational order is requested.
Specific example is set forth below to be described the above method, the transferring content and requirement in the present invention are:Need handle
The instruction of various equipment is sorted out, and carries out function declaration, and carry out 16 scale codings, and instruction number no more than 64, but
32 are not less than.Wherein, including protocol type be:C telemetering, T remote regulating, K remote control, X remote signalling, concrete function are as follows.
Instruct frame format definition as shown in table 1 in transport protocol in the present invention
Table 1. instructs frame format definition
Header | Length | Dev_ID | In_Code | SubDev_ID | REST | Data_1 | Data_2 | … | Data_N | XOR |
Frame structure resolves to:
Header:Frame head, 4Byte, downlink are defined as:A5A5A5A5;Uplink is defined as:F0F0F0F0;
Length:Frame length, 1Byte indicate the total amount of byte from Data_1 to Data_N.
Dev_ID:Equipment unique identifier, 4Byte, from 0X00000002~0XFFFFFFFE
In_Code:Command code, 1Byte
SubDev_ID:Sub- device type coding, 1Byte
REST:For compressed remainder bytes digit, value { 0,1,2 }, 1Byte.
Data_1-Data_N:Director data, 1~20Byte
XOR:Verification and, 1Byte, to Dev_ID, In_Code, SubDev_ID, REST, Data_1, Data_2 ...,
The byte-by-byte exclusive or value of Data_N.
The compression encoding process of transport protocol in the present invention is:
Under power carrier and ad hoc network radio communication transmission conditions, after portion transfers data is packaged, total data packet
It can exceed that ×× byte, need to carry out subpackage processing.However, once carrying out subpackage, packet loss will lead to, influence to smart home
The control of product and user experience.In order to handle above situation, need to data area Data_1, Data_ in command frame
2 ..., the transmission data in Data_N carry out compressed encoding processing.Original transmission data are using 16 scale codings, such as
Fruit will reduce the entire length of transmission data using 64 codings.Therefore, we construct following 16 system to 64 systems
Transform coding table (as shown in table 2).
2.16 system of table turns 64 scale coding tables
Number | 16 systems | 64 systems | Number | 16 systems | 64 systems | Number | 16 systems | 64 systems | Number | 16 systems | 64 systems |
0 | 0X00 | 0 | 16 | 0X10 | g | 32 | 0X20 | w | 48 | 0X30 | M |
1 | 0X01 | 1 | 17 | 0X11 | h | 33 | 0X21 | x | 49 | 0X31 | N |
2 | 0X02 | 2 | 18 | 0X12 | i | 34 | 0X22 | y | 50 | 0X32 | O |
3 | 0X03 | 3 | 19 | 0X13 | j | 35 | 0X23 | z | 51 | 0X33 | P |
4 | 0X04 | 4 | 20 | 0X14 | k | 36 | 0X24 | A | 52 | 0X34 | Q |
5 | 0X05 | 5 | 21 | 0X15 | l | 37 | 0X25 | B | 53 | 0X35 | R |
6 | 0X06 | 6 | 22 | 0X16 | m | 38 | 0X26 | C | 54 | 0X36 | S |
7 | 0X07 | 7 | 23 | 0X17 | n | 39 | 0X27 | D | 55 | 0X37 | T |
8 | 0X08 | 8 | 24 | 0X18 | o | 40 | 0X28 | E | 56 | 0X38 | U |
9 | 0X09 | 9 | 25 | 0X19 | p | 41 | 0X29 | F | 57 | 0X39 | V |
10 | 0X0A | a | 26 | 0X1A | q | 42 | 0X2A | G | 58 | 0X3A | W |
11 | 0X0B | b | 27 | 0X1B | r | 43 | 0X2B | H | 59 | 0X3B | X |
12 | 0X0C | c | 28 | 0X1C | s | 44 | 0X2C | I | 60 | 0X3C | Y |
13 | 0X0D | d | 29 | 0X1D | t | 45 | 0X2D | J | 61 | 0X3D | Z |
14 | 0X0E | e | 30 | 0X1E | u | 46 | 0X2E | K | 62 | 0X3E | [ |
15 | 0X0F | f | 31 | 0X1F | v | 47 | 0X2F | L | 63 | 0X3F | ] |
Following algorithms 1 can specifically be passed through:Smart home instructs under power carrier and ad hoc network radio communication transmission conditions
Random length coding compression algorithm, which is given, to be realized.
Input:1 instruction Instruction (instruction format is referring to table 1)
Output:Compressed command N ew_Instruction
Step 1:Initialization:New_Length=0;REST=0;
Step 2:Instruction Instruction is read in, length Length, the N number of director data in Instruction are obtained
Data_1-—Data_N.
2.1 update compressed code length:
Enable Int X1=Length*2;
IF X1==0 THEN goes to step 6;
ELSE New_Length=(X1 MOD 3)+(X1/3) * 2;
END IF
2.2 save N number of director data:
Define arrays Instr_Data, by N number of director data Data_1, Data_2 ..., Data_N be successively stored in array
In Instr_Data.
Define arrays New_Instr_Data, for storing compressed data.
Step 3:Data in New_Instr_Data are compressed:16 systems are converted to 64 systems.
3.1 are successively handled, 2 64 scale codings of every 3 16 scale coding boil down tos.
FOR k=1 TO Length/3 DO
3 characters are successively read in from Instr_Data, it is assumed that three characters are followed successively by a1, a2, a3, then
Enable Sum=a1*16*16+a2*16+a3*;
Enable b1=Sum/64;B2=Sum MOD 64;
According to table 2, b1 is searched in number column, and finds 64 scale coding value c1 corresponding to b1;
According to table 2, b2 is searched in number column, and finds 64 scale coding value c2 corresponding to b2;
C1 and c2 are sequentially written in array New_Instr_Data.
END FOR
3.2 there are also untreated 16 scale coding.
IF Length MOD 3==1 THEN
REST=1;
Assuming that the character read in is d1,
According to table 2, d1 is searched in number column, and finds 64 scale coding value c3 corresponding to a1;
C3 is written in array New_Instr_Data.
END IF
IF Length MOD 3==2 THEN
REST=2;
Take out last two characters e1, e2 of Instruction;
Enable Sum 1=e1*16+e2*;
Enable f1=Sum 1/64;F2=Sum1 MOD 64;
According to table 2, f1 is searched in number column, and finds 64 scale coding value c4 corresponding to f1;
According to table 2, f2 is searched in number column, and finds 64 scale coding value c5 corresponding to f2;
C4 and c5 are sequentially written in array New_Instr_Data.
END IF
Step 4:Data in Dev_ID, In_Code, SubDev_ID, REST, New_Instr_Data are successively carried out
XOR operation, and it is recorded as XOR.
Step 5:In conjunction with table 2, New_Length is expressed as to 1 64 scale coding data New_Length1.
Step 6:By other numbers in New_Length1, New_Instr_Data, REST, XOR and Instruction
According to being combined into a new command N ew_Instruction.
Step 7:Export New_Instruction.
Example 1:
Assuming that one 16 systems instruction of input:Instruction=
Header=A5A5A5A5;
Length=000A;
Dev_ID=00000004;
In_Code=2B;
SubDev_ID=33;
REST=0;
Data_1--Data_N={ 56,03,23, a3,31,4c, 30,48,10,53 };
XOR=0;}
Instruction is input to algorithm 1,
New_Length=20, New_Length=14;REST=2;
Data_1--Data_N can be stored as:
Re_Data [20]={ 5,6,0,3,2,3, a, 3,3,1,4, c, 3,0,4,8,1,0,5,3 };
5,6,0→21,32→xO;3,2,3→12,35→cz;a,3,3→40,51→EP;1,4,c→5,12→5i;
3,0,4→12,4→c4;8,1,0→32,1→w1;5,3→1j;
New_Instr_Data [14]={ xO, cz, EP, 5i, c4, w1,1j };
Finally obtain instruction Instruction compression result be:New_Instruction=
Header=A5A5A5A5;
Length=e;
Dev_ID=00000004;
In_Code=2B;
SubDev_ID=33;
REST=2;
Data_1--Data_N={ xO, cz, EP, 5i, c4, w1,1j };
XOR=1;}
In table 1, there is an identification byte REST, the character digit for finally needing to retain when for recording decompression.In conjunction with
The instruction definition of table 1 can design the Coding Compression Algorithm of a transport protocol.The algorithm can compile 16 systems of random length
Code is compressed, and every 3 16 system numbers can be compressed into 2 64 system numbers.Compression ratio reaches 2/3=66%.
The random length that can be instructed by smart home under following 2 power carriers of algorithm and ad hoc network radio communication transmission conditions
The compression coding of compression coding algorithm realization transport protocol.
Input:1 compressed instruction Instruction (as shown in table 1)
Output:Instruction Re_Instruction after decompression
Step 1:Initialization:Re_Length=0;
Step 2:Instruction Instruction is read in, the length Length obtained in Instruction (2 switchs to by tabling look-up
Numerical value), REST, N number of director data Data_1--Data_N.
2.1 update the code length after decompression:
Enable Int X1=Length;
IF X1==0 THEN goes to step 6;
ELSE Re_Length=(X1--REST) * 3/2+REST;
END IF
2.2 save N number of director data:
Define arrays Re_Data, by N number of director data Data_1, Data_2 ..., Data_N be successively stored in array Re_
In Data.
Define arrays New_Re_Data, for storing the data after decompressing.
Step 3:Data in New_ReData are decompressed:64 systems are converted to 16 systems.
3.1 (integral multiples that the length of initial data is 3)
IF REST==0 THEN
FOR k=1 TO Length/2 DO
2 characters are successively read in from Re_Data, and this 2 characters are switched into corresponding numerical value c1, c2, then:
Enable Sum=c1*64+c2;
Enable b1=Sum/16;B2=Sum MOD 16;
B3=Sum/16;B4=Sum MOD 16;
According to table 2, b3 is searched in number column, and finds 16 scale coding value a1 corresponding to b3;
According to table 2, b4 is searched in number column, and finds 16 scale coding value a2 corresponding to b4;
According to table 2, b1 is searched in number column, and finds 16 scale coding value a3 corresponding to b1;
A1, a2 and a3 are sequentially written in array New_Re_Data.
END FOR
Not 3.2 (length of initial data is not 3 integral multiple)
IF REST==1 THEN
For Re_Length--REST before in Instruction, the same operation with 3.1 is executed;In addition, knot
Table 2 is closed, last 1 is tabled look-up and 2 obtains 16 scale codings, is written in array New_Re_Data.
END IF
IF REST==2 THEN
For Re_Length--REST before in Instruction, the same operation with 3.1 is executed;In addition, knot
Table 2 is closed, switchs to 2 16 scale codings for last 1 of Instruction, is written in array New_Re_Data.
END IF
Step 4:XOR operation is successively carried out to the data in New_Re_Data, and is recorded as XOR.
Step 5:In conjunction with table 2, Re_Length/2 is expressed as to 2 16 scale coding data Re_Length1.
Step 6:By other data in Re_Length1, New_Re_Data, XOR and Instruction, it is combined into
One new instruction Re_Instruction.
Step 7:Export Re_Instruction.
Example 2,
In algorithm 2, input command N ew_Instruction=
Header=A5A5A5A5;
Length=e;
Dev_ID=00000004;
In_Code=2B;
SubDev_ID=33;
REST=2;
Data_1--Data_N={ xO, cz, EP, 5i, c4, w1,1j };
XOR=1;}
Can be obtained former instruction Instruction=
Header=A5A5A5A5;
Length=000A;
Dev_ID=00000004;
In_Code=2B;
SubDev_ID=33;
REST=0;
Data_1--Data_N={ 56,03,23, a3,31,4c, 30,48,10,53 };
XOR=0;}
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (5)
1. the smart home data transmission method in power carrier and ad hoc network radio frequency system, which is characterized in that including:
Step S101 is decoded the instruction frame format in equipment operation instruction, extracts the director data of present encoding, described
The digit of the director data of present encoding is 16;
The director data of the present encoding is converted to 64 from 16 by step S102, carries out high coding compression;
Step S103 is encapsulated as the instruction of compressed equipment operation to send data packet;
The transmission data packet is sent local manipulation equipment by step S104;
Step S105, local manipulation equipment receives the compressed equipment operation instruction, to the finger in equipment operation instruction
It enables data carry out low level coding decompression, obtains decoded equipment operation instruction;
Step S106, local manipulation equipment carry out control operation according to the decoded equipment operation instruction;
High coding compression in the step S102 uses random length coding compression algorithm, the random length coding compression algorithm
For:
It is compressed surplus if the instruction exported after compression is New_Instruction if the instruction of input is Instruction
Remaining byte digit is REST, and command length is New_Length after setting output, and the first array of definition is Instr_Data,
Instr_Data is the data for including in Instruction, and the second array of definition is New_Instr_Data, the New_Instr_
Data defines 16 systems and converts 64 system tables as B, defining XOR is verification for storing compressed Instr_Data data
With;
Step S1021:New_Length=0, REST=0 is arranged in initialization;
Step S1022:Instruction is read in, the length in Instruction is obtained and is Length, Instruction is set
In N number of director data be Data_1 to Data_N;
It calculates and updates compressed code length, variable X 1 is set:
Enable X1=Length*2;
Judge whether X1 is 0, if being into step 1026, otherwise,
New_Length=(X1MOD 3)+(X1/3) * 2;
N number of director data is saved:
By N number of director data Data_1, Data_2 ..., Data_N is successively stored in Instr_Data;
Step S1023:Data in Instr_Data are compressed, 3 16 scale codings every in Instr_Data are compressed
For 2 64 scale codings;
3 characters are successively read in from Instr_Data, it is assumed that three characters are followed successively by a1, a2, a3, then
Enable Sum=a1*16*16+a2*16+a3;
Enable b1=Sum/64;B2=Sum MOD 64;
According to table B, b1 is searched in table B, and finds 64 scale coding value c1 corresponding to b1;
According to table B, b2 is searched in table B, and finds 64 scale coding value c2 corresponding to b2;
C1 and c2 are sequentially written in New_Instr_Data;
To untreated 16 scale coding is left, the numerical value of Length MOD 3 is judged;
If Length MOD 3=1, is arranged REST=1, it is assumed that the character of reading is d1,
According to table B, d1 is searched in number column, and finds 64 scale coding value c3 corresponding to a1;
C3 is appended in New_Instr_Data;
If Length MOD 3=2, is arranged REST=2;
Take out last two characters e1, e2 of Instruction;
Enable Sum 1=e1*16+e2;
Enable f1=Sum 1/64;F2=Sum1MOD 64;
According to table B, f1 is searched in table B, and finds 64 scale coding value c4 corresponding to f1;
According to table B, f2 is searched in table B, and finds 64 scale coding value c5 corresponding to f2;
C4 and c5 are sequentially written in New_Instr_Data;
Step S1024:XOR operation is successively carried out to the data in Instruction, and is recorded as XOR;
Step S1025:In conjunction with table B, New_Length is expressed as to 1 64 scale coding data New_Length1;
Step S1026:By all data in Instruction, it is combined into New_Instruction;
Step S1027:Export New_Instruction.
2. the smart home data transmission method in power carrier according to claim 1 and ad hoc network radio frequency system,
It is characterized in that, includes in the step S105:
Step S1051, local manipulation equipment receive the compressed equipment operation instruction, the finger from equipment operation instruction
It enables frame format be decoded, extracts director data;
Step S1052 carries out low level coding decompression to described instruction data.
3. the smart home data transmission method in power carrier according to claim 2 and ad hoc network radio frequency system,
It is characterized in that, includes in the step S1052:
Described instruction data are converted to 16 from 64, carry out low level coding decompression, obtain decoded equipment operation instruction.
4. the smart home data transmission method in power carrier according to claim 3 and ad hoc network radio frequency system,
It is characterized in that, it is described that the director data is converted to 16 from 64, low level coding decompression is carried out, decoded equipment is obtained
The step of operational order includes:
Director data is extracted from the described director data, control 64 is converted to 16 correspondence tables, which is instructed number
According to being converted to 16 from 64, low level coding decompression is carried out.
5. the smart home data transmission method in power carrier according to claim 2 and ad hoc network radio frequency system,
It is characterized in that, further includes after the step S105:
If the byte number of the decoded equipment operation instruction is greater than detection byte number, operated to sending device sending device
The repeating transmission of instruction is requested.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510273806.2A CN105045108B (en) | 2015-05-26 | 2015-05-26 | Smart home data transmission method in power carrier and ad hoc network radio frequency system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510273806.2A CN105045108B (en) | 2015-05-26 | 2015-05-26 | Smart home data transmission method in power carrier and ad hoc network radio frequency system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105045108A CN105045108A (en) | 2015-11-11 |
CN105045108B true CN105045108B (en) | 2018-11-20 |
Family
ID=54451728
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510273806.2A Active CN105045108B (en) | 2015-05-26 | 2015-05-26 | Smart home data transmission method in power carrier and ad hoc network radio frequency system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105045108B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104898450A (en) * | 2015-06-16 | 2015-09-09 | 重庆本原致创科技发展有限公司 | Smart home data transmission method in a power line communication and Ad-Hoc network radiofrequency system |
CN109979183B (en) * | 2019-05-05 | 2024-04-09 | 长沙优力电驱动系统有限公司 | Signal transmitting method, receiving method and signal transmission equipment based on current carrier |
CN114024787B (en) * | 2021-10-08 | 2023-07-14 | 中移(杭州)信息技术有限公司 | Remote control method, device, equipment and storage medium for smart home |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1301002A (en) * | 2000-12-12 | 2001-06-27 | 尹国兴 | Encoding of natural things, conversion between any two digital systems, and their application |
CN1874474A (en) * | 2006-06-28 | 2006-12-06 | 中国移动通信集团公司 | Equipment of TV set |
CN101895724A (en) * | 2009-05-20 | 2010-11-24 | Tcl集团股份有限公司 | Remote controller with visual intercom function and visual intercom system thereof |
CN102014141A (en) * | 2010-12-30 | 2011-04-13 | 电子科技大学 | Method for realizing security of network terminal equipment |
CN203057380U (en) * | 2012-12-21 | 2013-07-10 | 康佳集团股份有限公司 | Signal pile processing device for expanding controllable functions of remote controller and system thereof |
CN104424778A (en) * | 2013-08-29 | 2015-03-18 | 珠海格力电器股份有限公司 | Remote control for air conditioner |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104270293A (en) * | 2014-09-17 | 2015-01-07 | 国家电网公司 | Smart home system based on power line carriers |
-
2015
- 2015-05-26 CN CN201510273806.2A patent/CN105045108B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1301002A (en) * | 2000-12-12 | 2001-06-27 | 尹国兴 | Encoding of natural things, conversion between any two digital systems, and their application |
CN1874474A (en) * | 2006-06-28 | 2006-12-06 | 中国移动通信集团公司 | Equipment of TV set |
CN101895724A (en) * | 2009-05-20 | 2010-11-24 | Tcl集团股份有限公司 | Remote controller with visual intercom function and visual intercom system thereof |
CN102014141A (en) * | 2010-12-30 | 2011-04-13 | 电子科技大学 | Method for realizing security of network terminal equipment |
CN203057380U (en) * | 2012-12-21 | 2013-07-10 | 康佳集团股份有限公司 | Signal pile processing device for expanding controllable functions of remote controller and system thereof |
CN104424778A (en) * | 2013-08-29 | 2015-03-18 | 珠海格力电器股份有限公司 | Remote control for air conditioner |
Also Published As
Publication number | Publication date |
---|---|
CN105045108A (en) | 2015-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105045108B (en) | Smart home data transmission method in power carrier and ad hoc network radio frequency system | |
CN104429069B (en) | Equipment for identifying leading picture | |
CN104898450A (en) | Smart home data transmission method in a power line communication and Ad-Hoc network radiofrequency system | |
CN103609117B (en) | Code and decode the method and device of image | |
CN104756483A (en) | System and method for a self adaptive multi-user program guide | |
CN106408923A (en) | A remote wireless infrared transponding control system based on cloud infrared code base data | |
CN102968897A (en) | Household appliance remote control method based on handheld equipment | |
CN107027037A (en) | The complexity reduction of availability graph code | |
CN101867825A (en) | Device for circularly monitoring multi-channel video and method thereof | |
CN107493214A (en) | A kind of plug and play realizes smart home Internet of Things network control system and method | |
CN106899594A (en) | For the sub- device management method and system of smart home platform | |
CN103561310B (en) | Method, device and system for data processing | |
CN108268329A (en) | A kind of data processing method and device of the grouting automatic recorder network terminal | |
US8134454B2 (en) | Receiver module with dual mode capability | |
CN114501025A (en) | Video transcoding method, device, equipment and medium | |
CN203057380U (en) | Signal pile processing device for expanding controllable functions of remote controller and system thereof | |
CN104854855A (en) | Smart home access device | |
CN101743748B (en) | Bitstream decoding device and method having decoding solution | |
CN100401671C (en) | Method for transmitting files | |
CN103179029A (en) | Wireless home multimedia gateway | |
CN104777792A (en) | Intelligent home control box | |
CN103209250A (en) | Universal remote control system | |
CN103209251A (en) | Universal remote control system | |
CN114023058A (en) | Remote control method, device, system, equipment and storage medium based on Bluetooth broadcast | |
CN207010876U (en) | A kind of device of live resource-sharing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 401147 Chongqing city Yubei District Longxi street new irrigation Road No. 6 Building 9 12-15 are the first station Applicant after: CHONGQING FANGHUI TECHNOLOGY CO., LTD. Address before: 401120, Yubei District, Chongqing red street street 99, Huang Guandong and garden C1 building 13-4 Applicant before: CHONGQING FANGHUI TECHNOLOGY CO., LTD. |
|
CB03 | Change of inventor or designer information | ||
CB03 | Change of inventor or designer information |
Inventor after: Guo Yajun Inventor before: Shu Haidong |
|
GR01 | Patent grant | ||
GR01 | Patent grant |