Invention content
The technical problem to be solved in the present invention is that:For technical problem of the existing technology, the present invention provides one
Kind algorithm is simple, it is easy to accomplish, the nothing for Conbined public or double key field that INTEGER MATRICES summation collision problem can be solved perfectly is asked
With collision INTEGER MATRICES production method.
In order to solve the above technical problems, technical solution proposed by the present invention is:A kind of nothing for Conbined public or double key field is asked
With collision INTEGER MATRICES production method, for given any 2h×2kRank matrix, line number are 0 to 2h- 1, row number is 0 to 2k- 1,
Construction includes the following steps without summation collision INTEGER MATRICES:
S1. each element in the matrix is indicated with binary integer, and the binary integer is drawn by bit
It is divided into low level area, the areas Zhong Wei and high-order area, the low level area of each element in the matrix includes LlA bit, the areas Zhong Wei packet
Containing LmA bit, high-order area include LhA bit;
S2. the value in binary integer low level area is constructed so that account for low level area ratio in low level area for 1 number of bits
The preset percentage of special digit, and for any two element in the matrix, the value in low level area is all different;
S3. the value in the areas the binary integer Zhong Wei is constructed so that the value of the lowest bit position in the areas Zhong Wei is 1,
The value of remaining bit is 0;
S4. the value in binary integer high position area is constructed so that the high-order area of any two element in the matrix
Value is all different;
S5. in the matrix each binary number be the matrix element value, obtain without summation collide INTEGER MATRICES.
As a further improvement on the present invention, the number of bits in the low level area meets as shown in formula (1),
Ll≥2×(h+k) (1)
In formula (1), LlFor the number of bits in low level area, h is the values of powers of the matrix line number, and k is the matrix columns
Values of powers.
As a further improvement on the present invention, the specific steps of the step S2 include:
S2.1. by integer 0 to 2h+k- 1 is expressed as including the binary number of h+k bit, and by this 2h+kA binary system
Integer inserts the matrix 2 at randomh+kIn the high h+k bit in a element low level area;
S2.2. the number of bits that the high h+k bit intermediate value in each element low level area is 1 in the matrix is obtained successively,
And in the low L in low level arealAn appropriate number of 1 is inserted at random in (h+k) a bit so that the ratio that low level area intermediate value is 1
Special digit meets the preset percentage.
As a further improvement on the present invention, the number of bits that low level area intermediate value is 1 accounts for low level area number of bits
Preset percentage be 48% to 52%.
As a further improvement on the present invention, shown in the number of bits such as formula (2) in the areas Zhong Wei,
Lm≥h+1 (2)
In formula (2), LmFor the bit number in the areas Zhong Wei, h is the values of powers of the matrix line number.
As a further improvement on the present invention, the number of bits in the high-order area meets as shown in formula (3),
Lh≥(k+1)×2h (3)
In formula (3), LhFor the number of bits in high-order area, h is the values of powers of the matrix line number, and k is the matrix columns
Values of powers.
As a further improvement on the present invention, the specific steps of the step S4 include:
S4.1. for the matrix any row, optionally k+1 and the selected bit of other rows from the high-order area
Different bit, and from 1 to 2k+1Appoint in -1 and takes 2kA mutually different number and with the binary number table of k+1 bit
Show, the value of each bit is successively filled from low to high in k+1 selected bit;
S4.2. the bit that do not chosen in the high-order area is inserted 0.
As a further improvement on the present invention, in the step S4.1, it is described from the high-order area optionally k+1 and its
The different bit of the selected bit of its row the specific steps are:For the i-th row of the matrix, high-order area is selected
(k+1) × i is a to -1 total k+1 bit of (k+1) × (i+1).
As a further improvement on the present invention, the number of bits in the high-order area meets as shown in formula (4),
Lh≥(k+2)×2h (4)
In formula (4), LhFor the number of bits in high-order area, h is the values of powers of the matrix line number, and k is the matrix columns
Values of powers;
The high-order area is in turn divided into fill area, tectonic province and random area, the construction by bit from high to low
Shown in the number of bits in area such as formula (5),
Lg=k+1, (5)
In formula (5), LgFor the number of bits of the tectonic province, k is the values of powers of the matrix columns;
Shown in the number of bits such as formula (6) in the random area,
Lri=Lg× i+i=(k+2) × i (6)
In formula (6), LriFor the number of bits in the random area, LgFor the tectonic province number of bits, i is the element in institute
State the line number in matrix;
The value of any two element tectonic province with identical line number is all different in the matrix.
As a further improvement on the present invention, the specific steps of the step S4 include:
S4.1a. for the i-th row of the matrix, from 1 to 2k+1Appoint in -1 and takes 2kA mutually different binary number dj(j∈
(0,2k- 1)), and by djValue be assigned to the tectonic province of the matrix, as shown in formula (7),
gij=dj (7)
In formula (7), gijFor the tectonic province binary number that line number in the matrix is the element that i row numbers are j, djIt is selected
The two of j-th of number are into expression;
S4.2a. whenIt is 0 by the highest order value in the random area of the matrix when more than 0, other positions can value be arbitrarily 0
Or 1;
S4.3a. each bit in the fill area is inserted 0.
Compared with the prior art, the advantages of the present invention are as follows:The present invention solves insurmountable INTEGER MATRICES always
Summation collision problem, has algorithm simple, it is easy to accomplish the advantages of.
Specific implementation mode
Below in conjunction with Figure of description and specific preferred embodiment, the invention will be further described, but not therefore and
It limits the scope of the invention.
As shown in Figure 1, a kind of production method without summation collision INTEGER MATRICES for Conbined public or double key field, for given
Any 2h×2kRank matrix, line number are 0 to 2h- 1, row number is 0 to 2k- 1, construction includes as follows without summation collision INTEGER MATRICES
Step:S1. with each element in binary integer representing matrix, and by binary integer by bit be divided into low level area,
The low level area in the areas Zhong Wei and high-order area, each element in matrix includes LlA bit, the areas Zhong Wei include LmA bit is high
Position area includes LhA bit;S2. the value in construction binary integer low level area so that accounted for for 1 number of bits in low level area
The preset percentage of low level area number of bits, and for any two element in matrix, the value in low level area is all different;S3.
Construct the value in the areas binary integer Zhong Wei so that the value of the lowest bit position in the areas Zhong Wei is 1, and the value of remaining bit is 0;
S4. the value in construction binary integer high position area so that the value in the high-order area of any two element is all different in matrix;S5. square
Each binary number is the value of matrix element in battle array, obtains colliding INTEGER MATRICES without summation.
In the present embodiment, it is a h=3 without summation collision INTEGER MATRICES to need to construct, the 2 of k=73×27Rank matrix,
Include altogether 8 × 128=1024 element, each element therein is indicated with binary integer, as shown in Fig. 2, and should
Binary integer carries out block by bit and is divided into low level area, the areas Zhong Wei and high-order area, and it is every that blockette constructs binary integer
The value of a bit ultimately generates the INTEGER MATRICES without summation collision, reduces difficulty of the construction without summation collision INTEGER MATRICES,
So that the construction algorithm of matrix is more simple.
Wherein, the number of bits in low level area meets as shown in formula (1),
Ll≥2×(h+k) (1)
In formula (1), LlFor the number of bits in low level area, h is the values of powers of matrix line number, and k is the values of powers of matrix columns.
In the present embodiment, construction low level area the specific steps are:S2.1. by integer 0 to 2h+k- 1 is expressed as including h+k
The binary number of a bit, and by this 2h+kA binary integer inserts matrix 2 at randomh+kHigh h+k of a element low level area
In bit;S2.2. the number of bits that the high h+k bit intermediate value in each element low level area is 1 in acquisition matrix successively, and
The low L in low level arealAn appropriate number of 1 is inserted at random in (h+k) a bit so that the number of bits that low level area intermediate value is 1 is full
Sufficient preset percentage.
For current embodiment require that the matrix constructed, low level area includes at least 2 (3+7)=20 bits, 0~1023
The binary number that this 1024 integers are write as 10 bits is filled into the height in the low level area of 1024 elements of INTEGER MATRICES at random
10 bits, number when being write as binary system less than 10 bits are allowed to meet the form of 10 bits then to a high position by 0,
Such as decimal integer 2,10 are represented in binary as, when with the binary representations of 10 bits, is needed in high-order 8
A bit mends 0, is write as 0000000010 form.0 is filled out to other bits selection in the low level area of each element in matrix
Or 1, and so that, for any one element in the matrix, the number for the bit that low level area intermediate value is 1 accounts for low level area ratio
The 48% to 52% of special digit, preferably 50%.In the present embodiment, preset percentage is 50%, such as some member in the matrix
It is 0000000010 in 10 high-order bits in plain low level area, i.e. decimal number is 2, then for the element low level
Other bits in area need 8 bits of arbitrary selection filling 1, remaining 2 bits filling 0, then the element low level area
Binary form is 00000000101111111100, naturally it is also possible to it is other forms, such as 00000000100011111111,
Either other arbitrary forms, it is only necessary to meet the bit that low level area is 1 and account for the 50% of low level area number of bits.This
Sample construction result meet to any two element in matrix, the value in low level area is all different, i.e., low level area at least one
Bit is different.
In the present embodiment, shown in the number of bits in the areas Zhong Wei such as formula (2),
Lm≥h+1 (2)
In formula (2), LmFor the bit number in the areas Zhong Wei, h is the values of powers of matrix line number.
The areas Ji Zhongwei include at least 4 bits, and the bit value of the areas Zhong Wei lowest order is 1, remaining each bit
Position is 0, i.e., the areas Zhong Wei of all elements are 0001 form in matrix.
In the present embodiment, different makes can be used to high-order area's bit so that any two element in matrix
The value in high-order area be all different.
The first high-order area bit make, the number of bits in high-order area meet as shown in formula (3),
Lh≥(k+1)×2h (3)
In formula (3), LhFor the number of bits in high-order area, h is the values of powers of matrix line number, and k is the values of powers of matrix columns.I.e. originally
The number of bits in embodiment high position area is at least (k+1) × 2h=(7+1) × 23=64.
The present embodiment the specific steps are:S4.1. for matrix any row, from high-order area optional k+1 with it is other
The selected different bit of bit of row, and from 1 to 2k+1Appoint in -1 and takes 2kA mutually different number is simultaneously compared with k+1
The binary number representation of special position successively fills the value of each bit in k+1 selected bit from low to high;
S4.2. the bit that do not chosen in high-order area is inserted 0.I.e. for arbitrary a line of the matrix, in the ratio of high-order area selection
Special position is different from other arbitrary selected bits of row,
In the make in the high position area, the case where higher bit position is invalid 0 is not considered, sets high-order area as comprising (k
+1)×2h=(7+1) × 23The binary integer of=64 bits.Selection marker is set separately for 64 bits, first
Under beginning state, the selection marker of each bit is unselected state, for arbitrary a line in the matrix, 64 from high-order area
It is unselected status bits as constructing position that k+1=7+1=8 mark is arbitrarily selected in a bit, and by 8 bits
Mark be set as having selected state.And from 1 to 2k+1- 1=28Appoint in -1=255 and takes 2k=27=128 mutually different numbers, it is selected
The each number selected corresponds to each element in the matrix row.By selected each number with the two of 8 bits
The form of system number indicates, to the binary number less than 8 bits, 0 is mended to a high position.It is 4 as one of selected number,
Binary form is 100, then the form of 8 bits is 00000100, successively from low level to a high position by the value of 8 bits
In 8 selected bits of filling, and remaining non-selected bit is filled out 0, that is, completes the construction to high-order area.
In order to further decrease the complexity of algorithm, the present embodiment selects the bit in high-order area in accordance with the following steps:It is right
In the i-th row of matrix, select (the k+1) × i in high-order area a to -1 total k+1 bit of (k+1) × (i+1).In this reality
It applies in example, from 1 to 27+1128 integers are arbitrarily chosen in -1=255, and are indicated with the binary form of 8 bits, to not
The binary number of 8 bits of foot, fills into 0 to a high position, is allowed to meet the form of 8 bits.In the present embodiment, for this
0th row of matrix selects 1 to 128 totally 128 integers, and by this 128 integers with the binary form of 8 bits, such as right
In selected ten into integer 3, binary system 11, the form for being write as 8 bits is 00000011, and by selected 1 to
The binary number of 128 8 bits successively fills in 128 elements of the row, i.e. the 0th element of the 0th row, high-order area
0th bit is to the 7th bit, and the binary number of filling is 00000001, remaining bit fills out 0, the 1st of the row
Element, the 0th bit in high-order area is to the 7th bit, and the binary number of filling is 00000010, remaining bit is filled out
0, and so on, complete the construction in one's own profession whole element high position area.Similarly, each element in the other rows of the matrix can be sequentially completed
The construction in high-order area.To end, be completed the low level area of each element in the matrix, the construction in the areas Zhong Wei and high-order area, by this three
Represented by a area two into line number value, each element is (k+1) × 2hThe binary system of+h+1+2 × (h+k) a bit
Number, the as value of the element.
Due to arbitrary 2hThe sum that the identical binary number of a number of bits is added, h at most more than the bit of addend.It is right
In the matrix that the present embodiment is constructed, appoint in every row and an element is taken to be added, low level be area and most ratios than former low level area
Special digit is h more, by this present embodiment, the lowest order in the areas Zhong Wei is 1, remaining h is zero, therefore, and in summation, low level
The carry that area is added can only at most influence the areas Zhong Wei, be had an impact without the bit to high-order area.Again since matrix is arbitrary
The high-order area of two elements is all different, and therefore, as long as the ranks value in value twice is not exactly the same, and is worth centainly not
It is identical, it thus obtains colliding INTEGER MATRICES without summation.
Second of high-order area bit make of the present embodiment:The number of bits in the high position area meets such as formula (4) institute
Show,
Lh≥(k+2)×2h (4)
In formula (4), LhFor the number of bits in high-order area, h is the values of powers of the matrix line number, and k is the matrix columns
Values of powers;
As shown in figure 3, high-order area is in turn divided into fill area, tectonic province and random area, structure by bit from high to low
Shown in the number of bits such as formula (5) for making area,
Lg=k+1, (5)
In formula (5), LgFor the number of bits of tectonic province, k is the values of powers of matrix columns;
Shown in the number of bits such as formula (6) in random area,
Lri=Lg× i+i=(k+2) × i (6)
In formula (6),For the number of bits in random area, LgFor tectonic province number of bits, i is the row of the element in a matrix
Number;The value of any two element tectonic province with identical line number is all different in matrix.
The specific steps of step S4 include:S4.1a. for the i-th row of matrix, from 1 to 2k+1Appoint in -1 and takes 2kIt is a different
Binary number dj(j∈(0,2k- 1)), and by djValue be assigned to the tectonic province of matrix, as shown in formula (7),
gij=dj (7)
In formula (7), gijFor the tectonic province binary number that line number in matrix is the element that i row numbers are j, djFor selected jth
The binary representation of number;S4.2a. work as LriIt is 0 by the highest order value in the random area of matrix, other positions can arbitrarily take when more than 0
Value is 0 or 1;S4.3a. each bit in fill area is inserted 0.
Second of high-order area make of the present embodiment, for 23×27The matrix of rank, by high-order area by bit from up to
Low to be in turn divided into fill area, tectonic province and random area, tectonic province includes 8 bits, the bit of fill area and random area
Number is variation, for the different elements in matrix, since the line number of the element is different, the bit of fill area and random area
Number also differs, and for the i-th row in matrix, the number of bits in random area is (7+2) × i, in addition to tectonic province and random area,
Remaining bit is fill area.Such as the 0th row of matrix, the number of bits in random area is 0, i.e., without random area, only fill area
Tectonic province, the 0th to the 7th of high-order area is tectonic province, and the 8th to the is fill area, the 1st row of matrix, random area
Number of bits is 9, i.e., high-order area is random area from low level to high-order the 0th to the 8th, and the 9th to the 16th is tectonic province,
The rest may be inferred, is that every a line of matrix divides corresponding tectonic province and random area.When the number of bits in random area is not 0, i.e.,
Other than the 0th row of matrix, the highest order value in random area is 0, and other positions can arbitrarily take 0 or take 1.
For tectonic province, from 1 to 2k+1- 1=28Appoint in -1=255 and takes 2k=27=128 mutually different numbers, it is selected
Each number be each element corresponded in the matrix row.By selected each number with the two of 8 bits into
The form of number processed indicates, to the binary number less than 8 bits, 0 is mended to a high position.As one of select decimal number for
4, binary form 100, then the form of 8 bits is 00000100, and the value of 8 bits is successively filled construction
Area completes the construction to tectonic province bit.
For fill area, it is only necessary to fill out 0 on each bit so that for arbitrary element in the matrix, binary number
Bit all same.
The make in second of high-order area, since high-order area further includes having random area, so by second high-order area's construction
What mode was constructed is existed with what is constructed than the first make without summation collision INTEGER MATRICES without summation collision INTEGER MATRICES
When for Conbined public or double key, there is stronger safety.
Above-mentioned only presently preferred embodiments of the present invention, is not intended to limit the present invention in any form.Although of the invention
Disclosed above with preferred embodiment, however, it is not intended to limit the invention.Therefore, every without departing from technical solution of the present invention
Content, technical spirit any simple modifications, equivalents, and modifications made to the above embodiment, should all fall according to the present invention
In the range of technical solution of the present invention protection.