CN108491318A - A kind of sequence detecting method, electronic equipment and storage medium - Google Patents

A kind of sequence detecting method, electronic equipment and storage medium Download PDF

Info

Publication number
CN108491318A
CN108491318A CN201810123306.4A CN201810123306A CN108491318A CN 108491318 A CN108491318 A CN 108491318A CN 201810123306 A CN201810123306 A CN 201810123306A CN 108491318 A CN108491318 A CN 108491318A
Authority
CN
China
Prior art keywords
sequence
test
measured
strategy
test strategy
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.)
Pending
Application number
CN201810123306.4A
Other languages
Chinese (zh)
Inventor
顾中磊
黄佳琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Luocool Mdt Infotech Ltd
Original Assignee
Shenzhen Luocool Mdt Infotech Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Luocool Mdt Infotech Ltd filed Critical Shenzhen Luocool Mdt Infotech Ltd
Priority to CN201810123306.4A priority Critical patent/CN108491318A/en
Publication of CN108491318A publication Critical patent/CN108491318A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention discloses a kind of sequence detecting methods, including:Sequence to be measured is obtained, sequence to be measured is binary sequence;According in sequence selection test bag to be measured Test Strategy and selected Test Strategy execute sequence;Sequencing row are treated according to selected Test Strategy and execution sequence to be tested, to judge the randomness of sequence to be measured.The invention also discloses a kind of electronic equipment and storage mediums.Sequence detecting method, electronic equipment and storage medium provided by the invention, according in sequence selection test bag to be measured Test Strategy and execute sequence, remove redundancy testing strategy, select optimal testing sequence to be detected sequence, to improve testing efficiency.Test Strategy is divided into primary test bag, intermediate test bag and advanced test packet, grade quantizing is carried out so as to treat sequencing row.

Description

A kind of sequence detecting method, electronic equipment and storage medium
Technical field
The present invention relates to statistics field more particularly to a kind of sequence detecting method, electronic equipment and storage mediums.
Background technology
Currently, random sequence uses extensively in computer software and security fields.Cipher application, internet communication, Internet of Things Net facility etc. is required to the random number of high quality, for key generation, digital signature and authentication protocol etc., defective random number Sequence may lead to great security risk.
Actual random number sequence is generated often through being simulated to some physical processes, as mouse currently moves The behavior such as hard disk of coordinate position, the noise signal generated in circuit, computer system access and network request etc. come generate with Machine number.Using pseudorandom number generator come to generate some pseudo-random number sequences as random as possible be another random number sequence Generating mode.All there is certain defect in both modes, the former may look as actually implying certain regularity at random, The latter produces the sequence with period behavior.Therefore, it can detect that the Test Strategy of drawbacks described above becomes particularly significant.
The principle of random test is the AD HOC of detection sequence, if a certain pattern is occurred with unusual probability, then it is assumed that wait for Sequencing row do not pass through the corresponding statistics random test of the pattern.It is various to count random test quantity, therefore would generally be from numerous Subset is selected to form test bag in test, which needs the random attribute of detection sequence as necessary as possible.Most often at present Random test is surrounded by the GM/T of the SP 800-22 standards and China of National Institute of Standards and Technology (NIST) publication 0005-2012《Randomness inspection criterion》Deng.
The sequence detecting method that above-mentioned random test packet uses exists following insufficient during the test:Survey is not fully considered Influence of the independence to test executive sequence between the characteristic attribute and test of examination;Do not consider test executive sequence to testing efficiency It influences, leading to the execution tested, there are redundancies;Do not consider sequence to be measured length and testing requirement to testing the influence of selection, survey It tries less efficient.
Invention content
For overcome the deficiencies in the prior art, one of the objects of the present invention is to provide a kind of sequence detecting methods, with solution Certainly existing sequence detecting method has that redundancy, testing efficiency are low during the test.
The second object of the present invention is to provide a kind of electronic equipment, to solve existing sequence detecting method in test process It is middle to there is a problem of that redundancy, testing efficiency are low.
An object of the present invention adopts the following technical scheme that realization:
A kind of sequence detecting method, including:
Sequence to be measured is obtained, the sequence to be measured is binary sequence;
According in the sequence selection test bag to be measured Test Strategy and selected Test Strategy execute sequence;
The sequence to be measured is tested according to selected Test Strategy and execution sequence, to wait being sequenced described in judgement The randomness of row.
Further, the Test Strategy according in the sequence selection test bag to be measured and selected Test Strategy Execution sequence include:
According to the independence of the Test Strategy in test bag described in the sequential test to be measured;
The Test Strategy in test bag is selected according to the independence.
Further, the Test Strategy according in the sequence selection test bag to be measured and selected Test Strategy Execution sequence further include:
The information gain of selected Test Strategy is calculated according to the sequence to be measured;
Sequence is executed according to what described information gain determined selected Test Strategy.
Further, described that the sequence to be measured is tested according to selected Test Strategy and execution sequence, with Judge that the randomness of the sequence to be measured includes:
Primary test is executed to the sequence to be measured according to selected Test Strategy and execution sequence;
If the sequence to be measured by the primary test, does not terminate test.
Further, described that primary test is executed to the sequence to be measured according to selected Test Strategy and execution sequence Further include later:
If the sequence to be measured is by the primary test, according to selected Test Strategy and execution sequence to described Sequence to be measured executes middle rank test;
If the sequence to be measured is not tested by the middle rank, test is terminated.
Further, described that middle rank test is executed to the sequence to be measured according to selected Test Strategy and execution sequence Further include later:
If the sequence to be measured is tested by the middle rank, according to selected Test Strategy and execution sequence to described Sequence to be measured executes advanced test.
Further, the independence according to the Test Strategy in test bag described in the sequential test to be measured includes:
Choose the sequence to be measured of preset length and preset quantity;
According to the sequence to be measured of selection, the Test Strategy is analyzed using principal component analytical method and own coding dimension reduction method Independence.
Further, further include before the information gain for calculating selected Test Strategy:
Using the Test Strategy that correlation coefficient process and variance back-and-forth method removal related coefficient and variance are too small.
The second object of the present invention adopts the following technical scheme that realization:
A kind of electronic equipment, including:Processor;Memory;And program, wherein described program are stored in the storage It in device, and is configured to be executed by processor, described program includes for executing above-mentioned method.
The invention further relates to a kind of computer readable storage mediums, are stored thereon with computer program, the computer journey Sequence is executed by processor above-mentioned method.
Compared with prior art, the beneficial effects of the present invention are:According to the Test Strategy in sequence selection test bag to be measured With execution sequence, redundancy testing strategy is removed, selects optimal testing sequence to be detected sequence, to improve testing efficiency.
Description of the drawings
Fig. 1 is sequence detecting method flow chart provided in an embodiment of the present invention;
Fig. 2 is the Test Strategy provided in an embodiment of the present invention according in sequence selection test bag to be measured and selected survey Try the flow chart of the execution sequence of strategy;
Fig. 3 be it is provided in an embodiment of the present invention according to selected Test Strategy and execution sequence treat sequencing row surveyed The flow chart of examination;
Fig. 4 is the schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific implementation mode
In the following, in conjunction with attached drawing and specific implementation mode, the present invention is described further, it should be noted that not Under the premise of conflicting, new implementation can be formed between various embodiments described below or between each technical characteristic in any combination Example.
As shown in Figure 1, sequence detecting method provided in an embodiment of the present invention, including:
Step S101:Sequence to be measured is obtained, the sequence to be measured is binary sequence.
Specifically, sequence to be measured is the random sequence that randomizer generates, it is { 0,1 } sequence.
Step S102:According in the sequence selection test bag to be measured Test Strategy and selected Test Strategy hold Row sequence.
As shown in Fig. 2, the step includes:
Step S201:According to the independence of the Test Strategy in test bag described in the sequential test to be measured.
The step includes:
Step S2011:Choose the sequence to be measured of preset length and preset quantity;For example, it is 200 bits to choose J length Sequence to be measured.
Step S2012:According to the sequence to be measured of selection, using principal component analytical method and own coding dimension reduction method inspection institute State the independence of Test Strategy.
Specifically, Test Strategy is the strategy whether random for analytical sequence, for example, common Test Strategy has digital ratio Frequency is tested in special frequency test, grouping group, the distance of swimming is tested, the test of the longest distance of swimming, serially inspection, cumulative and test, two in group The test of system rank of matrix, discrete Fourier transform test, approximate entropy test, random walk test, random walk test variant, line Property complexity test, " general statistical " test of overlap scheme matching test, Maurer and non-overlapping pattern matching test etc..Root According to the characteristic of Test Strategy, multiple Test Strategy composition test bags, the independence packet of the Test Strategy in verification test packet are chosen Include principal component analytical method and own coding dimension reduction method.
Independence test inputs:The quantity of Test Strategy in test bag is K, and sequence to be measured is J.Each sequence is equal Execute test bag in K Test Strategy, obtain the statistic under each Test Strategy, the statistic Normal Distribution or Chi square distribution.All statistics of K test are correspondingly formed the matrix X of a J*K, and often the corresponding sequence of row, each column correspond to One test.
Principal component analytical method:
Following steps are executed to X:1. a couple X is standardized;2. calculating the covariance matrix Σ of X;3. pair ∑ carries out Diagonalization of matrix obtains matrix B;4. examining diagonal entry λ 1 in B, the value of λ 2 ... λ K, if there are m<K so that meet (λ 1+ λ 2+..λm)/(λ1+λ2+..λK)>=0.99, then it is assumed that K Test Strategy does not pass through the independence test.
Own coding dimension reduction method:
Build full Connection Neural Network so that there are hidden layers to include m hidden unit, m<K.It inputs X and trains nerve net Network parameter so that the reconstructed error of input and output is optimal value.Reconstructed error is examined, if reconstructed error is less than preset value, Then think K Test Strategy not by the independence test.
If above-mentioned independence test passes through, illustrates that K Test Strategy is independent, execute step S203.Conversely, executing step S202。
Step S202:The Test Strategy in test bag is selected according to the independence.
If any independence test method does not pass through in principal component analytical method and own coding dimension reduction method, illustrate to survey There are redundancies for K Test Strategy in examination packet.K test in test bag is executed to above-mentioned J sequence.To each test, often A sequence obtains a Probability p value.If K p value is all higher than preset value, corresponding output 1.If one of p value is less than default Value, then corresponding output 0.J { 0,1 } output constitutes the vectorial Y of J*1.
Using the Test Strategy that correlation coefficient process and variance back-and-forth method removal related coefficient and variance are too small.Specially:Meter Pearson correlation coefficients of the X to Y is calculated, the too small corresponding Test Strategy of row of related coefficient absolute value is rejected.It is each in calculating matrix X The variance of a row rejects the too small corresponding Test Strategy of row of variance.Wherein, the calculating process of Pearson correlation coefficient and variance It is the prior art, details are not described herein.
Step S203:The information gain of selected Test Strategy is calculated according to the sequence to be measured.
For X and Y, information gain g (Y, Xj)=H (Y)-H (Y | Xj) is calculated, wherein H (Y) is the comentropy of Y, is indicated pair The uncertainty of the random sex determination of sequence.H (Y | Xj) it is conditional entropies of Y under the conditions of given Xj, indicate the knot in Test Strategy j The uncertainty that sequence randomness is judged under conditions of fruit is given.The big Test Strategy of information gain is examined with stronger sequence Survey ability.
Step S204:Sequence is executed according to what described information gain determined selected Test Strategy.
Specifically, executing the Test Strategy in test bag from big to small according to information gain.
Step S103:The sequence to be measured is tested according to selected Test Strategy and execution sequence, to judge The randomness of the sequence to be measured.
Specifically, according to the parameter characteristic of Test Strategy, by Test Strategy be divided into primary test bag, intermediate test bag and Advanced test packet.The test of execution primary test bag, intermediate test bag and advanced test packet is selected according to the characteristic of sequence to be measured Strategy, it is corresponding to execute primary test, middle rank test and advanced test.The characteristic of sequence to be measured includes the length of sequence to be measured, waits for The local characteristics of row and the randomness grade etc. needed for global property, sequence to be measured are sequenced.Such as sequence length be 100 bits extremely 1000 bits choose primary test;Sequence length is 1000 bits to 1000000 bits, chooses middle rank test;Sequence length is big In 1000000 bits, advanced test is chosen;If sequence length to be measured is more than 1000000 bits, can be according to the test of sequence to be measured Demand selects corresponding test bag, such as the global randomness of advanced test detection sequence, primary test and middle rank test to detect The local randomness of sequence.
As preferred embodiment, as shown in figure 3, step S103 includes:
Step S301:Primary test is executed to the sequence to be measured according to selected Test Strategy and execution sequence.
Specifically, selecting Test Strategy in primary test bag according to the method for step S102 and executing sequence, execute just Grade test.Wherein, the Test Strategy of primary test bag has single-bit frequency to test, frequency is tested in grouping group, the distance of swimming is tested, group Interior longest distance of swimming test, serial inspection and cumulative and test.
The test of single-bit frequency is used in the sequence of calculation 0,1 number, to eliminate 0 excessive or 1 excessive sequence.If waiting for Sequencing row T is { 0,1 } sequence to be measured, and length n, then corresponding { -1, the 1 } sequences of sequence T are A, Ai=2Ti- 1,1≤i≤n, Wherein, AiFor the bit in sequence A, TiFor the bit in sequence T.Counting statistics amountWherein t obeys normal state point Cloth calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is to be preset by the test if p value is less than Value, then illustrate sequence T to be measured not by the test.
Frequency test is for examining whether the 0 of local sequence, 1 number meets the requirements in grouping group.Sequence T to be measured is pressed According to N number of subsequence is sequentially divided into successively, each sub-sequence length is M, Counting statistics amount
Wherein πiThe frequency occurred in subsequence i 1,1≤i≤N.
Statistic t obeys chi square distribution, calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is Illustrate sequence T to be measured not by the test if p value is less than preset value by the test.
Distance of swimming test is used for testing the number of runs in sequence to be measured, 1 (being from beginning to end 0) continuously occurs or 0 (head and the tail continuously occurs It is known as the distance of swimming for section 1).Counting statistics amount
Wherein,
Statistic t Normal Distributions calculate the Probability p value of t, if p value is more than preset value, illustrate that sequence T to be measured is Illustrate sequence T to be measured not by the test if p value is less than preset value by the test.
The test of the longest distance of swimming is used for longest run length in Test segment in group.In sequence successively by sequence T to be measured It is divided into N number of subsequence, each sub-sequence length is M, the length of every group of longest distance of swimming 1 is calculated, for example, sequence 11010111 1 length of the longest distance of swimming is 3.Different run lengths is fallen into different set, shares R+1 set.Include in set i Element number is vi, i=0,1 ... R, Counting statistics amount
Wherein, πiThe probability of set i is fallen into for the run length of subsequence.
Statistic t obeys chi square distribution, calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is Illustrate sequence T to be measured not by the test if p value is less than preset value by the test.
The serial frequency for examining all patterns for the sequence for being used for detecting specific length to occur in sequence to be measured.Specific length The sequence of degree is binary sequence, all arrangement modes that all patterns of the sequence of specific length are 0 and 1, more specifically, Ai For all patterns for the binary sequence that length is m, i=0,1 ... 2m-1.By the preceding m-1 additions of n-bit sequence T to be measured To the end of sequence, the new sequence that a length is n+m-1 is made.The new sequence of bit-by-bit search, the element in new sequence TjTj+1,…,Tj+m-1=AiWhen, ViIncrease by 1, calculates
Similarly calculate
It calculates
t1And t2It is the statistic for obeying chi square distribution, calculates t1And t2Probability p value, if p value is all higher than preset value, Then illustrate that sequence T to be measured is, if p value is less than preset value, to illustrate sequence T to be measured not by the test by the test.
Frequency that is cumulative and testing preceding k (or k latter) appearance 0,1 for examining sequence to be measured.Calculate sequence T to be measured Corresponding { -1,1 } sequence A, Ai=2Ti- 1,1≤i≤n, n are the length of sequence to be measured.
It calculatesK=1,2 ... n.Counting statistics amountT obeys probability-distribution functionT corresponding Probability p values under the distribution are calculated, if p value is more than preset value, illustrate that sequence T to be measured is logical The test is crossed, if p value is less than preset value, illustrates sequence T to be measured not by the test.
Step S302:If the sequence to be measured by the primary test, does not terminate test, judge that sequence to be measured is non- At random.
Step S303:If the sequence to be measured is by the primary test, according to selected Test Strategy and execution Sequence executes middle rank test to the sequence to be measured.
Specifically, selecting Test Strategy in intermediate test bag according to the method for step S102 and executing sequence, in execution Grade test, wherein the Test Strategy that intermediate test bag includes has binary matrix order to test, discrete Fourier transform is tested and close It is tested like entropy.
The test of binary matrix order is used for weighing linear dependence between sequence part, by sequence T to be measured in sequence according to It is secondary to be divided into the subsequence that N number of length is M*Q, the element of each subsequence is put by row in the matrix of M*Q successively, is calculated each Rank of matrix ri, i=1,2 ... N.Counting statistics amount t is
Wherein, FM=| { ri|ri=min { M, Q } } |, FM-1=| { ri|ri=min { M, Q } -1 } |, | | indicate of set Number, such as FMIndicate the matrix number of full rank.FM-2=N-FM-FM-1, πMFor riThe probability of=min { M, Q }, πM-1For ri=min M, Q } -1 probability, πM-2=1- πMM-1
T obeys chi square distribution, calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is by this Test illustrates sequence T to be measured not by the test if p value is less than preset value.
Discrete Fourier transform test passes through the cyclic attributes to sequence progress Fourier transformation checking sequence.It will wait being sequenced Corresponding { -1,1 } the sequence A of row T do discrete Fourier transform and obtain sequence F, the element F in sequence FjForJ=0 ..., n-1.
Counting statistics amount
Statistic t Normal Distributions calculate the Probability p value of t, if p value is more than preset value, illustrate that sequence T to be measured is logical The test is crossed, if p value is less than preset value, illustrates sequence T to be measured not by the test.
Approximate entropy test the frequency that occurs in sequence to be measured to all patterns of specific length sequence from the angle of entropy into Row calculates.By the end of the sequence of the preceding m-1 additions of n-bit sequence T to be measured, it is the new of n+m-1 to make a length Sequence.The new sequence of bit-by-bit search, the element T in new sequencejTj+1,…,Tj+m-1=AiWhen, ViIncrease by 1.
Similarly calculate
To calculate statistic t=2n [log2-ApEn (m)].
Statistic t obeys chi square distribution, calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is Illustrate sequence T to be measured not by the test if p value is less than preset value by the test.
Step S304:If the sequence to be measured is not tested by the middle rank, test is terminated, judges that sequence to be measured is non- At random.
Step S305:If the sequence to be measured is tested by the middle rank, according to selected Test Strategy and execution Sequence executes advanced test to the sequence to be measured.
Specifically, user chooses whether to execute advanced test according to sequence signature and testing requirement, if executing advanced test, Then Test Strategy is selected in advanced test packet according to the method for step S102 and execute sequence, execute advanced test, wherein high The Test Strategy that grade test bag includes has random walk test, random walk test variant, linear complexity test, overlapping mould Formula matching test, " general statistical " test of Maurer and non-overlapping pattern matching test.
The actual frequency and theory apart from the position of origin specific length are reached in random walk test verification random walk The deviation of value.Calculate sequence T to be measured corresponding { -1,1 } sequence A, Ai=2Ti- 1,1≤i≤n, n are the length of sequence to be measured.Meter It calculatesIt is { 0, S to construct new sequence S1,S2,..Sn,0}.The positions occurred by 0 new sequence S are divided into J sub- sequences Row.There is the frequency of integer x, -4≤x≤- 1,1≤x≤4, v in statistics subsequencek(x) occur j subsequence for integer x Quantity, there is calculating by j times more than j time in integer x.To each x, Counting statistics amount
Wherein, πk(x) k probability occurs for numerical value x in random distribution.Statistic t obeys chi square distribution, calculates t's Probability p value illustrates that sequence T to be measured is, if p value is less than preset value, to illustrate to wait for by the test if p value is more than preset value Sequencing row T does not pass through the test.
Random walk tests variant, first with J new sequence S of random walk test configuration.To integer x, calculates x in S and go out Existing number ξ (x), -9≤x≤- 1,1≤x≤9.To each x, the corresponding probability of ξ (x) is calculated:
Wherein erfc is complementary error function.
Linear complexity is tested, and the shortest length for the linear feedback shift register for generating sequence to be measured is examined.
Sequence T to be measured is divided into the subsequence that N number of length is M, calculates the linear complexity L of each subsequencei, i= 1 .., N.Wherein, linear complexity is calculated as existing algorithm.
Calculate Ti=(- 1)M*(Li- μ)+2/9,
Wherein,
By TiIt is worth identical subsequence to be put into a set, total R set, each gathering the subsequence quantity for including is vj, j=0 ..R-1.Counting statistics amountWherein, πjThe probability of set j is fallen into for subsequence.System Measure t and obey chi square distribution, calculate the Probability p value of t, if p value is more than preset value, illustrate sequence T to be measured be by the test, If p value is less than preset value, illustrate sequence T to be measured not by the test.
Whether the occurrence number that overlap scheme matching test detects presetting module is excessive.Sequence T to be measured is divided into N number of length For the subsequence of M, presetting module is set, which is binary sequence, and each subsequence is since first and pre- If module is matched, if matching, i.e., continuous digit is identical as presetting module in subsequence, then subsequence moves forward one, if It mismatches, subsequence also moves forward one.Each subsequence and the matched number of presetting module are obtained with this.It will be with presetting module It is put into the same set with the identical subsequence of number, total R set, the subsequence number in each set is vi, calculate StatisticWherein, πiThe probability of specific collection is fallen into for subsequence.Statistic t obeys card side point Cloth calculates the Probability p value of t, if p value is more than preset value, illustrates that sequence T to be measured is to be preset by the test if p value is less than Value, then illustrate sequence T to be measured not by the test.Non-overlapping pattern matching test is similar with overlap scheme matching test, difference For when such a match occurs, the seats non-overlapping pattern matching test Forward m sequence, m is the length of presetting module.
The digit of spacing distance between " general statistical " test verification model identical of Maurer.Sequence T to be measured is divided into length Degree is the subsequence of L, and part of the tail of sequence less than L is removed.Preceding Q subsequence is for initializing.Presetting module is the positions L two System sequence, corresponding decimal value are j.Q initializes in subsequence before record, the group that each presetting module finally occurs Number be Gj(j=0,1...2L-1).When presetting module does not occur in preceding Q groups subsequence, corresponding G values are 0.
For rear U groups subsequence, Counting statistics amount
Statistic t Normal Distributions calculate the Probability p value of t, if p value is more than preset value, illustrate that sequence T to be measured is Illustrate sequence T to be measured not by the test if p value is less than preset value by the test.
Sequence detecting method provided in this embodiment, before test, by the independence and the calculating that detect Test Strategy Information gain, Test Strategy and Test Strategy are selected from test bag executes sequence, to remove redundancy testing strategy, selects Optimal execution sequence, saves the testing time, improves efficiency.And Test Strategy is respectively divided into primary test bag, middle rank test Packet and advanced test packet execute primary test, middle rank test and advanced test according to sequence signature and testing requirement selection, to Sequencing row can be treated according to output result carries out grade judgement.
As shown in figure 4, electronic equipment provided in an embodiment of the present invention, including:Processor 11, memory 12 and program, Its Program is stored in memory 12, and is configured to be executed by processor 11, and program includes above-mentioned for executing Sequence detecting method.
The method in electronic equipment and previous embodiment in the present embodiment is based on two sides under same inventive concept Face is in front described in detail method implementation process, so those skilled in the art can be clear according to foregoing description The implementation process for understanding to Chu the electronic equipment in the present embodiment, in order to illustrate the succinct of book, details are not described herein again.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can It is realized by the mode of software plus required general hardware platform.Based on this understanding, technical scheme of the present invention essence On in other words the part that contributes to existing technology can be expressed in the form of software products.The invention further relates to one kind Computer readable storage medium, such as ROM/RAM, magnetic disc, CD, are stored thereon with computer program, and computer program is located Reason device executes above-mentioned sequence detecting method.
Sequence detecting method, electronic equipment and storage medium provided by the invention, according in sequence selection test bag to be measured Test Strategy and execute sequence, remove redundancy testing strategy, select optimal testing sequence to be detected sequence, to improve Testing efficiency.Test Strategy is divided into primary test bag, intermediate test bag and advanced test packet, so as to treat sequencing arrange into Row grade quantizing.
The above embodiment is only the preferred embodiment of the present invention, and the scope of protection of the present invention is not limited thereto, The variation and replacement for any unsubstantiality that those skilled in the art is done on the basis of the present invention belong to institute of the present invention Claimed range.

Claims (10)

1. a kind of sequence detecting method, which is characterized in that including:
Sequence to be measured is obtained, the sequence to be measured is binary sequence;
According in the sequence selection test bag to be measured Test Strategy and selected Test Strategy execute sequence;
The sequence to be measured is tested according to selected Test Strategy and execution sequence, to judge the sequence to be measured Randomness.
2. sequence detecting method according to claim 1, which is characterized in that described to be tested according to the sequence selection to be measured Test Strategy and selected Test Strategy in packet execution sequence include:
According to the independence of the Test Strategy in test bag described in the sequential test to be measured;
The Test Strategy in test bag is selected according to the independence.
3. sequence detecting method according to claim 2, which is characterized in that described to be tested according to the sequence selection to be measured Test Strategy and selected Test Strategy in packet execution sequence further include:
The information gain of selected Test Strategy is calculated according to the sequence to be measured;
Sequence is executed according to what described information gain determined selected Test Strategy.
4. sequence detecting method according to claim 1, which is characterized in that described according to selected Test Strategy and holding Row sequence tests the sequence to be measured, to judge that the randomness of the sequence to be measured includes:
Primary test is executed to the sequence to be measured according to selected Test Strategy and execution sequence;
If the sequence to be measured by the primary test, does not terminate test.
5. sequence detecting method according to claim 4, which is characterized in that described according to selected Test Strategy and holding Row sequence executes after primary is tested the sequence to be measured:
If the sequence to be measured is by the primary test, according to selected Test Strategy and execution sequence to described to be measured Sequence executes middle rank test;
If the sequence to be measured is not tested by the middle rank, test is terminated.
6. sequence detecting method according to claim 5, which is characterized in that described according to selected Test Strategy and holding Row sequence executes after middle rank is tested the sequence to be measured:
If the sequence to be measured is tested by the middle rank, according to selected Test Strategy and execution sequence to described to be measured Sequence executes advanced test.
7. sequence detecting method according to claim 2, which is characterized in that described according to described in the sequential test to be measured The independence of Test Strategy in test bag includes:
Choose the sequence to be measured of preset length and preset quantity;
According to the sequence to be measured of selection, the only of the Test Strategy is analyzed using principal component analytical method and own coding dimension reduction method Vertical property.
8. sequence detecting method according to claim 3, which is characterized in that the letter for calculating selected Test Strategy Further include before breath gain:
Using the Test Strategy that correlation coefficient process and variance back-and-forth method removal related coefficient and variance are too small.
9. a kind of electronic equipment, which is characterized in that including:Processor;Memory;And program, wherein described program are stored It in the memory, and is configured to be executed by processor, described program includes requiring 1-8 any one for perform claim Method described in.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program It is executed by processor the method as described in claim 1-8 any one.
CN201810123306.4A 2018-02-07 2018-02-07 A kind of sequence detecting method, electronic equipment and storage medium Pending CN108491318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810123306.4A CN108491318A (en) 2018-02-07 2018-02-07 A kind of sequence detecting method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810123306.4A CN108491318A (en) 2018-02-07 2018-02-07 A kind of sequence detecting method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108491318A true CN108491318A (en) 2018-09-04

Family

ID=63344656

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810123306.4A Pending CN108491318A (en) 2018-02-07 2018-02-07 A kind of sequence detecting method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108491318A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617653A (en) * 2018-12-06 2019-04-12 四川长虹电器股份有限公司 The optimization implementation method of sequential test
CN109905338A (en) * 2019-01-25 2019-06-18 晶晨半导体(上海)股份有限公司 A kind of control method of the multi-stage equalizing device gain of Gbps serial receiver
CN110531957A (en) * 2019-09-11 2019-12-03 北京智芯微电子科技有限公司 The online test method of randomizer
CN111371547A (en) * 2020-03-03 2020-07-03 江苏芯盛智能科技有限公司 Method, system, equipment and computer storage medium for detecting overlapping subsequence
CN115378589A (en) * 2022-10-26 2022-11-22 北京惠朗时代科技有限公司 Method, apparatus, device and medium for testing randomness of binary key

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337399A1 (en) * 2013-05-13 2014-11-13 Hiroshi Nakazawa Method of generating random numbers iii
CN104317719A (en) * 2014-11-11 2015-01-28 浪潮电子信息产业股份有限公司 Method for controlling software testing quality
CN107577452A (en) * 2016-07-04 2018-01-12 阿里巴巴集团控股有限公司 randomness detecting method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337399A1 (en) * 2013-05-13 2014-11-13 Hiroshi Nakazawa Method of generating random numbers iii
CN104317719A (en) * 2014-11-11 2015-01-28 浪潮电子信息产业股份有限公司 Method for controlling software testing quality
CN107577452A (en) * 2016-07-04 2018-01-12 阿里巴巴集团控股有限公司 randomness detecting method and device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
JIALIN HUANG等: "Measuring Random Tests by Conditional Entropy and Optimal Execution", 《TRUSTED SYSTEMS-SECOND INTERNATIONAL CONFERENCE》 *
刘骋昺: "随机性统计测试的评估", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
姜鑫维等: "《高光谱遥感数据降维与分类》", 31 December 2016, 中国地质大学出版社 *
张勇军等: "《热轧电气自动化与计算机控制技术》", 31 October 2016, 冶金工业出版社 *
陈敏: "《认知计算导论》", 30 April 2017, 华中科技大学出版社 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617653A (en) * 2018-12-06 2019-04-12 四川长虹电器股份有限公司 The optimization implementation method of sequential test
CN109905338A (en) * 2019-01-25 2019-06-18 晶晨半导体(上海)股份有限公司 A kind of control method of the multi-stage equalizing device gain of Gbps serial receiver
CN109905338B (en) * 2019-01-25 2021-10-19 晶晨半导体(上海)股份有限公司 Method for controlling gain of multistage equalizer of serial data receiver
CN110531957A (en) * 2019-09-11 2019-12-03 北京智芯微电子科技有限公司 The online test method of randomizer
CN110531957B (en) * 2019-09-11 2021-04-23 北京智芯微电子科技有限公司 On-line detection method of random number generator
CN111371547A (en) * 2020-03-03 2020-07-03 江苏芯盛智能科技有限公司 Method, system, equipment and computer storage medium for detecting overlapping subsequence
CN111371547B (en) * 2020-03-03 2023-01-13 江苏芯盛智能科技有限公司 Method, system, equipment and computer storage medium for detecting overlapping subsequence
CN115378589A (en) * 2022-10-26 2022-11-22 北京惠朗时代科技有限公司 Method, apparatus, device and medium for testing randomness of binary key
CN115378589B (en) * 2022-10-26 2023-01-13 北京惠朗时代科技有限公司 Method, apparatus, device and medium for testing randomness of binary key

Similar Documents

Publication Publication Date Title
CN108491318A (en) A kind of sequence detecting method, electronic equipment and storage medium
Kusano et al. Persistence weighted Gaussian kernel for topological data analysis
Manabat et al. Performance analysis of hyperdimensional computing for character recognition
CN100480990C (en) Monobit-run frequency on-line randomness test
Urbanowicz et al. Noise-level estimation of time series using coarse-grained entropy
Hussain et al. BIST-PUF: Online, hardware-based evaluation of physically unclonable circuit identifiers
Lin et al. Independent state and measurement characterization for quantum computers
CN112329895A (en) Method and device for identifying user with suspicion of electricity stealing
CN114528190B (en) Single index abnormality detection method and device, electronic equipment and readable storage medium
CN113936192A (en) Power distribution network synchronous measurement missing data repairing method, terminal and storage medium
Neugebauer et al. On the limits of stochastic computing
Ho et al. Posit arithmetic for the training and deployment of generative adversarial networks
US9703563B2 (en) Detecting cross-talk on processor links
El Amri et al. More powerful HSIC-based independence tests, extension to space-filling designs and functional data
CN113408804A (en) Electricity stealing behavior detection method, system, terminal equipment and storage medium
CN110472739B (en) Efficient post-processing method and device for quantum random number and quantum random number generator
Popereshnyak et al. The Testing of Pseudorandom Sequences using Multidimensional Statistics.
US10803179B2 (en) Method and system for detecting the vulnerability of an onboard device
Wang et al. Time series sequences classification with inception and LSTM module
CN112416709B (en) Chip dynamic power consumption estimation method and device, processor chip and server
Lazarevich et al. YOLOBench: Benchmarking Efficient Object Detectors on Embedded Systems
CN111858862B (en) Reply recommendation method, reply recommendation device and electronic equipment
Xiong et al. Study on energy theft detection based on customers’ consumption pattern
CN109977359B (en) Non-autocorrelation sampling method for large sample space complex probability distribution
Abdellatef et al. Characterization of correlation in stochastic computing functions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180904