The content of the invention
In view of this, the invention provides a kind of control method and device of data transfer, any form can be received
Electric power data, and be encapsulated as subdata bag and be sent to big-dipper satellite.
Concrete technical scheme is as follows:
A kind of control method of electric power data transmission, methods described is applied to electric power data transmission terminal, including:
The electric power data transmission terminal is initialized;
When the packet of user terminal transmission is received, the electric power data in the packet is sealed according to preset rules
The subdata bag of one or more standard Big Dipper form is dressed up, the electric power data is the electric power data of any form;
The subdata bag is sent to big-dipper satellite, make the big-dipper satellite by the subdata bag be forwarded to it is described
The corresponding central user machine of the default address of storage in electric power data transmission terminal;
When the subdata bag sends failure, point out to send failure, and resend the subdata bag, if default
To send successfully then point out in number of times and send successfully, if not sent in preset times successfully, abandon all subdata bags.
Preferably, it is described that the electric power data transmission terminal is initialized, including:
To in structure, the structure is the data structure of the subdata bag to loading system parameter;
Timer, user terminal interactive program and electric power data transmission terminal interactive program are initialized.
Preferably, it is described the electric power data in the packet is packaged into according to preset rules it is one or more
Subdata bag, including:
The electric power data is parsed, valid data are extracted;
When of length no more than first preset length of the valid data, the length according to the valid data is by described in
Valid data are decomposed into the Sub Data Set of one or more second preset length;
When the length of the valid data is more than the first preset length, the significant figure of the first preset length is intercepted
According to, and the valid data of the first preset length are decomposed into the Sub Data Set of multiple second preset lengths;
The Sub Data Set is packaged according to structure form, generation includes frame head, station number, mark, Bale No., Zong Bao
The subdata bag of the standard Big Dipper form of number and Content of Communication.
Preferably, it is described to send to big-dipper satellite the subdata bag, including:
When timer timing reaches Preset Time, the subdata bag is sent to big-dipper satellite, and by the timing
Device resets.
Preferably, methods described also includes:
When the reporting position for receiving control centre's transmission is instructed, the electric power number is asked to pass eventually to the big-dipper satellite
The location information at end, the location information is sent when the location information of big-dipper satellite transmission is received to the control centre.
Preferably, methods described also includes:
When the modification for carrying central user machine address for receiving control centre is instructed, by default address modification
It is the central user machine address.
A kind of control device of electric power data transmission, described device is applied to electric power data transmission terminal, including:
Initialization unit, for being initialized to the electric power data transmission terminal;
Encapsulation unit, for when the packet of user terminal transmission is received, according to preset rules by the packet
In electric power data be packaged into the subdata bag of one or more standard Big Dipper form, the electric power data is any lattice
The electric power data of formula;
Transmitting element, for the subdata bag to be sent to big-dipper satellite, makes the big-dipper satellite by the subdata
Bag is forwarded to the central user machine corresponding with the default address stored in the electric power data transmission terminal;
Tip element, for when the subdata bag sends failure, pointing out to send failure, and resend the subnumber
According to bag, point out to send successfully if being sent in preset times successfully, if not sent in preset times successfully, abandon all
Subdata bag.
Preferably, the initialization unit includes:
Loading subelement, for loading system parameter to structure in, the structure is the data of the subdata bag
Structure;
Initialization subelement, for being carried out to timer, user terminal interactive program and electric power data transmission terminal interactive program
Initialization.
Preferably, the encapsulation unit includes:
Parsing subelement, for being parsed to the electric power data, extracts valid data;
First decomposes subelement, for when of length no more than first preset length of the valid data, according to described
The valid data are decomposed into the length of valid data the Sub Data Set of one or more second preset length;
Second decomposes subelement, for when the length of the valid data is more than the first preset length, interception first to be pre-
If the valid data of length, and the valid data of the first preset length are decomposed into the son of multiple second preset lengths
Data set;
Encapsulation subelement, for being packaged to the Sub Data Set according to structure form, generation includes frame head, stands
Number, mark, Bale No., the subdata bag of the standard Big Dipper form of total bag number and Content of Communication.
Preferably, the transmitting element specifically for:When timer timing reaches Preset Time, by the subdata bag
Send to big-dipper satellite, and the timer is reset.
Preferably, described device also includes:
Positioning unit, for when the reporting position for receiving control centre's transmission is instructed, being asked to the big-dipper satellite
The location information of the electric power data transmission terminal, sends when the location information of big-dipper satellite transmission is received to the control centre
The location information.
Preferably, described device also includes:
Modification unit, for when the modification for carrying central user machine address for receiving control centre is instructed, by institute
State default address and be revised as the central user machine address.
Relative to prior art, beneficial effects of the present invention are as follows:
The present invention provide electric power data transmission control method and device, can receive come user terminal with appoint
The packet of what form electric power data, and the electric power data is packaged into one or more standard according to preset rules
The subdata bag of Big Dipper form, meets the individual demand of user.The subdata bag is sent to big-dipper satellite, is made described
The subdata bag is forwarded to the center corresponding with the default address stored in the electric power data transmission terminal and used by big-dipper satellite
Family machine;When the subdata bag sends failure, point out to send failure, and resend the subdata bag, if at default time
To send successfully then point out in number and send successfully, if not sent in preset times successfully, abandon all subdata bags, the present invention
There is provided effective internal subpackage mechanism, the big data quantity transmission of electric power data is realized.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
Fig. 2 is referred to, present embodiment discloses a kind of control method of electric power data transmission, methods described is applied to electric power
Data transmission terminal, specifically includes following steps:
S101:The electric power data transmission terminal is initialized;
Specifically, step S101 implementation procedures are as follows:
To in structure, the structure is the data structure of the subdata bag to loading system parameter;
Timer, user terminal interactive program and electric power data transmission terminal interactive program are initialized.
It should be noted that the systematic parameter stored since Flash is loaded electric power data transmission terminal start i.e., just
Beginningization user terminal interactive program and electric power data transmission terminal interactive program, and timer initialization, after loading system parameter
Get primary systems parameter is to structure body weight in case subsequently using.Initialising subscriber terminal interaction program and electric power data transmission terminal are handed over
Mutual program also includes house dog initialization and the initialization of BD WAASs program parameter.
S102:When the packet of user terminal transmission is received, according to preset rules by the electric power in the packet
Data are packaged into the subdata bag of one or more standard Big Dipper form, and the electric power data is the electric power of any form
Data;
Specifically, referring to Fig. 3, the specific implementation procedure of step S102 is as follows:
S201:The electric power data is parsed, valid data are extracted;
S202:When of length no more than first preset length of the valid data, according to the length of the valid data
The valid data are decomposed into the Sub Data Set of one or more second preset length;
S203:When the length of the valid data is more than the first preset length, the described of the first preset length of interception has
Effect data, and the valid data of the first preset length are decomposed into the Sub Data Set of multiple second preset lengths;
S204:The Sub Data Set is packaged according to structure form, generation includes frame head, station number, mark, bag
Number, the subdata bag of the standard Big Dipper form of total bag number and Content of Communication.
It should be noted that in the control method of electric power data transmission disclosed in the present embodiment, user terminal is to electric power number
Electric power data in the packet that transmission terminal sends can be the electric power data of any form, be carried out by the electric power data
Parsing, extracts valid data, and the valid data are packaged into the subdata of one or more standard Big Dipper form
Bag.
First preset length can be 2048 bytes, when effective in the packet that the electric power data transmission terminal is received
When the length of data is more than the first preset length, the valid data for intercepting the first preset length are stored in SRAM, when by the electricity
In the packet that power data transmission terminal is received during of length no more than first preset length of valid data, directly by the significant figure
According to being stored in SRAM, the valid data for being then stored into SRAM are decomposed into the subnumber of one or more second preset length
According to collection, second preset length can be that the length of IC-card subtracts 5 bytes, that is, 65 bytes, and this 5 bytes are used for setting
Put header packet information as shown in the table.
Content |
Frame head |
Station number |
Mark |
Bale No. |
Total bag number |
Content of Communication |
Length |
8bit |
12bits |
4bits |
8bits |
8bits |
1~N bits |
Scope |
0xE0 |
1-4095 |
1-15 |
1-255 |
1-2555 |
|
It is understood that user can according to actual needs to first preset length and second preset length
Set.
What is stored in the mark and the electric power data transmission terminal of the electric power data transmission terminal of being stored with upper table, in mark is silent
Recognize address, the default address is the address of target's center's subscriber computer.
Also, it should be noted that user terminal is sent to the electric power data in the packet of electric power data transmission terminal, according to
The difference of the instruction of family terminal, can be used for being sent to big-dipper satellite, big-dipper satellite is forwarded to and institute the subdata bag
The corresponding central user machine of the default address stored in electric power data transmission terminal is stated, directly can also be carried out at corresponding data
Reason.
The serial ports of electric power data transmission terminal receives task treatment and is divided into the reception processing of Big Dipper serial ports and the reception of user terminal serial ports
Treatment, Big Dipper serial ports reception processing is responsible for receiving the information that Big Dipper serial ports sends, and is put into structure after parsing, in case to user
Terminal sends or as other treatment;Or directly carry out corresponding information processing.The reception processing of user terminal serial ports is responsible for
The information that user terminal serial ports sends is received, is put into structure after parsing, in case being sent to big-dipper satellite or as other
Treatment;Or directly carry out corresponding information processing.
The serial ports of electric power data transmission terminal sends task treatment and is divided into Big Dipper serial ports transmission processe and the transmission of user terminal serial ports
Treatment.Big Dipper serial ports transmission processe is responsible for receiving the received instruction of task treatment or other particular cases according to serial ports, to
Big-dipper satellite sends command adapted thereto.User terminal serial ports transmission processe be responsible for according to serial ports receive the instruction that is received of task or
Other particular cases, command adapted thereto is sent to user terminal.
S103:The subdata bag is sent to big-dipper satellite, the big-dipper satellite is forwarded to the subdata bag
The central user machine corresponding with the default address stored in the electric power data transmission terminal;
Specifically, the time interval of each packet of user terminal transmission should be greater than Preset Time, electric power data transmission terminal
The time interval of each subdata bag is sent for Preset Time to big-dipper satellite, and the acting as of timer records Preset Time, when
When timer timing reaches Preset Time, the subdata bag is sent to big-dipper satellite, and the timer is reset, timing
Device reclocking.
It is understood that the electric power data transmission terminal can also receive what is forwarded through big-dipper satellite from central user machine
Data, and by the data penetration transmission to user terminal, facilitate the subscriber computer order of user terminal responsing center, so as to be passed to electric power number
Terminal is operated.
S104:When the subdata bag sends failure, point out to send failure, and resend the subdata bag, if
To send successfully then point out in preset times and send successfully, if not sent in preset times successfully, abandon all subdatas
Bag.
It should be noted that send successfully message being:10 07 01 53 65 6E 64 4F 4B 25(SendOK);Hair
The failure message is sent to be:10 09 01 53 65 6E 64 46 61 69 6C 07(SendFail).User can be according to actual need
The preset times are set.
The control method of the electric power data transmission also includes:
When the reporting position for receiving control centre's transmission is instructed, the electric power number is asked to pass eventually to the big-dipper satellite
The location information at end, the location information is sent when the location information of big-dipper satellite transmission is received to the control centre.
Location information is started with 0xA0, and 0xA0 represents that following table is location information, length in following table using Big Dipper location data
With bit (position) as unit.
Note:When whether null value high be TRUE when, 3 byte elevation informations for height, when whether null value high be FALSE when, press
Format fields parsing in table.
The reporting position instruction is transmitted by way of code, and transmission content is:0xA2.
The control method of the electric power data transmission disclosed in the present embodiment, there is provided reported achievement on electric power data transmission terminal automated location
Can, it is to avoid in the prior art, control centre is in order to control each electric power data transmission terminal, it is necessary to artificial pass eventually to each electric power number
The position at end is surveyed, and to obtain the positional information of each electric power data transmission terminal, wastes the problem of substantial amounts of manpower and materials.
When the modification for carrying central user machine address for receiving control centre is instructed, by default address modification
It is the central user machine address.
The modification instruction is transmitted also by the mode of code, and the form of transmission content is:FZ+ central users machine ground
Location, wherein, central user machine address is 7 fixed length numeric strings, such as:0012455, a high position for central user machine address shortage seven
Zero padding is alignd.Example:If remotely modifying central user machine address is 40101, control centre sends to electric power data transmission terminal
" FZ0040101 " totally 9 modification instructions of byte.
The control method of the electric power data transmission disclosed in the present embodiment, there is provided control centre's remotely modifying electric power number is passed eventually
The function of the default address stored in end, it is to avoid change, increase standby central user machine, Yi Jiqi when central user machine occur
, it is necessary to the artificial central user machine to being prestored in electric power data transmission terminal when there is changing the situation of central user machine address in him
Address modify, the problem for wasting time and energy.
The present embodiment provide electric power data transmission control method, can receive come user terminal with any lattice
The packet of formula electric power data, and the electric power data is packaged into the one or more standard Big Dipper according to preset rules
The subdata bag of form, meets the individual demand of user.The subdata bag is sent to big-dipper satellite, makes the Big Dipper
The subdata bag is forwarded to the central user machine corresponding with the default address stored in the electric power data transmission terminal by satellite;
When the subdata bag sends failure, point out to send failure, and resend the subdata bag, if being sent out in preset times
To send successfully then point out and send successfully, if not sent in preset times successfully, abandon all subdata bags, the present embodiment is provided
Effective internal subpackage mechanism, realizes the big data quantity transmission of electric power data.
Based on the control method of electric power data transmission disclosed in above-described embodiment, Fig. 4 is referred to, the present embodiment correspondence is open
A kind of control device of electric power data transmission, described device is applied to electric power data transmission terminal, specifically includes:
Initialization unit 101, for being initialized to the electric power data transmission terminal;
Encapsulation unit 102, for when the packet of user terminal transmission is received, according to preset rules by the data
Electric power data in bag is packaged into the subdata bag of one or more standard Big Dipper form, and the electric power data is any
The electric power data of form;
Transmitting element 103, for the subdata bag to be sent to big-dipper satellite, makes the big-dipper satellite by the subnumber
The central user machine corresponding with the default address stored in the electric power data transmission terminal is forwarded to according to bag;
The transmitting element 103 specifically for:When timer timing reaches Preset Time, the subdata bag is sent
To big-dipper satellite, and the timer is reset.
Tip element 104, for when the subdata bag sends failure, pointing out to send failure, and resends described
Subdata bag, points out to send successfully if being sent in preset times successfully, if not sent in preset times successfully, abandons
All subdata bags.
Fig. 5 is referred to, the initialization unit 101 includes:
Loading subelement 107, for loading system parameter to structure in, the structure is the number of the subdata bag
According to structure;
Initialization subelement 108, for entering to timer, user terminal interactive program and electric power data transmission terminal interactive program
Row initialization.
The encapsulation unit 102 includes:
Parsing subelement 109, for being parsed to the electric power data, extracts valid data;
First decomposes subelement 110, for when of length no more than first preset length of the valid data, according to institute
The valid data are decomposed into the length for stating valid data the Sub Data Set of one or more second preset length;
Second decomposes subelement 111, for when the length of the valid data is more than the first preset length, intercepting first
The valid data of preset length, and the valid data of the first preset length are decomposed into multiple second preset lengths
Sub Data Set;
Encapsulation subelement 112, for being packaged to the Sub Data Set according to structure form, generation include frame head,
The subdata bag of the standard Big Dipper form of station number, mark, Bale No., total bag number and Content of Communication.
The control device of the electric power data transmission also includes:
Positioning unit 105, for when the reporting position for receiving control centre's transmission is instructed, being asked to the big-dipper satellite
The location information of the electric power data transmission terminal is sought, is sent out to the control centre when the location information of big-dipper satellite transmission is received
Send the location information.
Modification unit 106, for when the modification for carrying central user machine address for receiving control centre is instructed, inciting somebody to action
The default address is revised as the central user machine address.
After electric power data transmission terminal installs the control device of the electric power data transmission in the present embodiment, by big-dipper satellite electricity
Force data is transmitted transparently to customer center machine, and secondary software exploitation is carried out without user, is really achieved " connect and use ", Ke Yijie
The packet with any form electric power data for carrying out user terminal is received, and is encapsulated the electric power data according to preset rules
Into the subdata bag of one or more standard Big Dipper form, the individual demand of user is met.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or uses the present invention.
Various modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, the present invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The scope most wide for causing.