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 clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
A kind of compression method and network center's equipment of the network address are provided in the embodiment of the present invention, for realizing, the network address of the ammeter of power information acquisition system is compressed, in can attenuating system, transmit the amount of information of data, the data transmission efficiency in raising system.Below be elaborated respectively.
Embodiment mono-:
The invention provides a kind of compression method of the network address, for the ammeter network address to power information acquisition system, compress, as shown in Figure 1, above-mentioned compression method comprises:
101, network center preserves the complete network address of each ammeter in network block;
In the present embodiment, the length of the network address that each ammeter is complete is 6 bytes;
102, network center distributes a unique address compression according to predetermined rule to each above-mentioned ammeter; The length of above-mentioned address compression is N byte, and N is positive integer, and 2≤N≤5;
The length of 2 bytes can be supported about 65536(2
16) individual ammeter, and ammeter number in a network block may reach 1000 left and right, when therefore the length of address compression is 2 bytes, can meet the demand of existing network size, certainly, if along with the ammeter number in a network block is more, also can N value be set to other values according to actual situation;
Preferably, N=2, when N value is 2, the length of address compression is less, can improve to greatest extent the data transmission efficiency of power information acquisition system;
103, network center records unique address compression of above-mentioned each ammeter.
After distributing a unique address compression for each ammeter, use address compression as the mailing address of ammeter, compare the amount of information of using original complete network address to transmit data in can attenuating system, the data transmission efficiency in raising system.
Embodiment bis-:
The invention provides a kind of compression method of the network address, for the ammeter network address to power information acquisition system, compress, as shown in Figure 2, above-mentioned compression method comprises:
201, network center preserves the complete network address of each ammeter in network block;
In the present embodiment, the length of the network address that each ammeter is complete is 6 bytes;
202, above-mentioned network center judges whether the low order address of N byte of each ammeter in network block is all unique, if so, performs step 203, otherwise performs step 204; N is positive integer, and 2≤N≤5;
The low order address of an above-mentioned N byte refers to rear N byte in 6 bytes, take N=2 as example, the low order address of 2 bytes is last 2 bytes in 6 bytes, and if the complete network address of 6 bytes is 010000000000000001, the low order address of 2 bytes is 000001;
Preferably, N=2, when N value is 2, the length of address compression is less, can improve to greatest extent the data transmission efficiency of power information acquisition system;
203, the low order address of the N of each an ammeter byte is assigned as respectively to address compression;
Usually, the high address of each ammeter in a network block is identical, and low order address is different; If the low order address of the N of each an ammeter byte is all different in network block, can use the low order address of N byte of each ammeter as the address compression of each ammeter;
204, the low order address of N byte of an ammeter corresponding to unique is distributed to this ammeter as address compression; N corresponding at least two ammeters byte low order address distributed to any one in above-mentioned at least two ammeters as address compression, and the address compression of generation and other ammeter in above-mentioned network block all different address compression distribute to other ammeter in above-mentioned at least two ammeters as address compression;
In actual conditions, also may there is the identical situation of low order address of the different ammeters in consolidated network piece, in the case, if directly use low order address can cause conflict as address compression;
In the present embodiment, when there is the identical situation of the low order address of different ammeters, be divided into two kinds of situations and process:
There is not with other ammeter the ammeter conflicting in the low order address for N byte, the low order address of its N byte is assigned as to address compression;
For at least two ammeters that have the low order address of an identical N byte, the low order address of this N byte is distributed to one of them as address compression, the address compression that remaining at least one ammeter generates other by network center distributes, the address compression that certainly, need to guarantee each ammeter is all unique;
Take N=2 as example, as co-existed in 102 ammeters in network block, wherein the address of 100 is once 010000000000000101 to 010000000000000200, two other address is respectively 020000000000000101 and 020000000000000102, low order address 000001 and 000002 is respectively corresponding to two different ammeters, in this case, the address compression of 100 wherein can be assigned as respectively to 000101 to 000200, two other is assigned as 000201 and 000202;
205, network center records unique address compression of above-mentioned each ammeter.
After distributing a unique address compression for each ammeter, use address compression as the mailing address of ammeter, compare the amount of information of using original complete network address to transmit data in can attenuating system, the data transmission efficiency in raising system.
Embodiment tri-:
The invention provides a kind of compression method of the network address, for the ammeter network address to power information acquisition system, compress, as shown in Figure 3, above-mentioned compression method comprises:
301, network center preserves the complete network address of each ammeter in network block;
In the present embodiment, the length of the network address that each ammeter is complete is 6 bytes;
302, above-mentioned network center is 1,2,3 according to predetermined ordering rule by each ammeter number consecutively ... M; M is the ammeter sum in above-mentioned network block;
In the present embodiment, can to each ammeter, be numbered successively according to network address order from low to high or from high to low, can certainly to each ammeter, be numbered according to other suitable order;
303, distribute to corresponding ammeter as its address compression after the numbering of each ammeter being converted to the address of N byte; N is positive integer, and 2≤N≤5;
Preferably, N=2, when N value is 2, the length of address compression is less, can improve to greatest extent the data transmission efficiency of power information acquisition system;
304, network center records unique address compression of above-mentioned each ammeter.
After distributing a unique address compression for each ammeter, use address compression as the mailing address of ammeter, compare the amount of information of using original complete network address to transmit data in can attenuating system, the data transmission efficiency in raising system.
Embodiment tetra-:
It is the central apparatus of any one network block in power information acquisition system that the present invention also provides equipment ,Gai network center of a kind of network center equipment, and ,Gai network center equipment comprises as shown in Figure 4:
Memory module 10, for preserving the complete network address of each ammeter of network block;
In the present embodiment, the length of the network address that each ammeter is complete is 6 bytes;
Distribution module 20, distributes a unique address compression for the rule according to predetermined to each above-mentioned ammeter; The length of above-mentioned address compression is N byte, and N is positive integer, and 2≤N≤5;
Logging modle 30, for recording unique address compression of each above-mentioned ammeter.
After distributing a unique address compression for each ammeter, use address compression as the mailing address of ammeter, compare the amount of information of using original complete network address to transmit data in can attenuating system, the data transmission efficiency in raising system.
The length of 2 bytes can be supported about 65536(2
16) individual ammeter, and ammeter number in a network block may reach 1000 left and right, when therefore the length of address compression is 2 bytes, can meet the demand of existing network size, certainly, if along with the ammeter number in a network block is more, also can N value be set to other values according to actual situation;
Preferably, N=2, when N value is 2, the length of address compression is less, can improve to greatest extent the data transmission efficiency of power information acquisition system.
Particularly, as shown in Figure 5, distribution module 20 comprises:
Judging unit 201, for judging whether the low order address of N byte of each ammeter of network block is all unique;
Allocation units 202, for when judgment result is that of above-mentioned judging unit is, are assigned as respectively address compression by the low order address of the N of each an ammeter byte.
Usually, the high address of each ammeter in a network block is identical, and low order address is different; If the low order address of the N of each an ammeter byte is all different in network block, can use the low order address of N byte of each ammeter as the address compression of each ammeter.
Above-mentioned allocation units 202, also when when above-mentioned judging unit, the determination result is NO, the low order address of N byte of an ammeter corresponding to unique is distributed to this ammeter as address compression, N corresponding at least two ammeters byte low order address distributed to any one in above-mentioned at least two ammeters as address compression, generate from the address compression of other ammeter in above-mentioned network block all different address compression distribute to other ammeter in above-mentioned at least two ammeters as address compression.
In actual conditions, also may there is the identical situation of low order address of the different ammeters in consolidated network piece, in the case, if directly use low order address can cause conflict as address compression;
In the present embodiment, when there is the identical situation of the low order address of different ammeters, be divided into two kinds of situations and process:
There is not with other ammeter the ammeter conflicting in the low order address for N byte, the low order address of its N byte is assigned as to address compression;
For at least two ammeters that have the low order address of an identical N byte, the low order address of this N byte is distributed to one of them as address compression, the address compression that remaining at least one ammeter generates other by network center distributes, the address compression that certainly, need to guarantee each ammeter is all unique;
Take N=2 as example, as co-existed in 102 ammeters in network block, wherein the address of 100 is once 010000000000000101 to 010000000000000200, two other address is respectively 020000000000000101 and 020000000000000102, low order address 000001 and 000002 is respectively corresponding to two different ammeters, in this case, the address compression of 100 wherein can be assigned as respectively to 000101 to 000200, two other is assigned as 000201 and 000202.
Embodiment five:
It is the central apparatus of any one network block in power information acquisition system that the present invention also provides equipment ,Gai network center of a kind of network center equipment, and ,Gai network center equipment comprises as shown in Figure 4:
Memory module 10, for preserving the complete network address of each ammeter of network block;
In the present embodiment, the length of the network address that each ammeter is complete is 6 bytes;
Distribution module 20, distributes a unique address compression for the rule according to predetermined to each above-mentioned ammeter; The length of above-mentioned address compression is N byte, and N is positive integer, and 2≤N≤5;
Logging modle 30, for recording unique address compression of each above-mentioned ammeter.
Particularly, as shown in Figure 6, distribution module 20 comprises:
Numbered cell 203 is 1,2,3 for the ordering rule according to predetermined to each ammeter network address number consecutively ... M;
Allocation units 204 are distributed to corresponding ammeter as its address compression after the numbering of each ammeter being converted to the address of N byte; M is the ammeter sum in above-mentioned network block.
It should be noted that, numbered cell 203 can be numbered each ammeter successively according to network address order from low to high or from high to low, can certainly to each ammeter, be numbered according to other suitable order.
Preferably, N=2, when N value is 2, the length of address compression is less, can improve to greatest extent the data transmission efficiency of power information acquisition system.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to come the hardware that instruction is relevant to complete by program, this program can be stored in a computer-readable recording medium, storage medium can comprise: flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc.
The compression method of the network address above embodiment of the present invention being provided and network center's equipment are described in detail, applied specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.