CN112579045A - Method and device for generating pseudorandom sequence and storage medium - Google Patents

Method and device for generating pseudorandom sequence and storage medium Download PDF

Info

Publication number
CN112579045A
CN112579045A CN202011531712.8A CN202011531712A CN112579045A CN 112579045 A CN112579045 A CN 112579045A CN 202011531712 A CN202011531712 A CN 202011531712A CN 112579045 A CN112579045 A CN 112579045A
Authority
CN
China
Prior art keywords
sequence
pseudorandom sequence
phase shift
mask
state transition
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
CN202011531712.8A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011531712.8A priority Critical patent/CN112579045A/en
Publication of CN112579045A publication Critical patent/CN112579045A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F7/582Pseudo-random number generators

Abstract

The embodiment of the application discloses a method and a device for generating a pseudorandom sequence and a storage medium, and belongs to the technical field of computers. The method for generating the pseudo-random sequence can achieve the effect of automatically generating the target pseudo-random sequence corresponding to different first phase shift values. In the generation process, K is carried out on the initial mask1And obtaining a mask corresponding to the first phase shift value after iteration, and obtaining a target pseudorandom sequence through logical operation between the mask and a state column vector of the source pseudorandom sequence. The phase shift value can be obtained through parameter configuration, so that pseudo-random sequence generation of any phase shift can be supported. In the generation process, a useful pseudo-random sequence value after any phase shift can be directly calculated without generating a useless sequence value, the delay of the generation of a target pseudo-random sequence is reduced, the efficiency of generating the target pseudo-random sequence in real time under different phase shifts is improved, and the communication efficiency of the communication device is further improved.

Description

Method and device for generating pseudorandom sequence and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating a pseudorandom sequence and a storage medium.
Background
In the field of communications, pseudo-random codes can be used for communication performance testing or secure communications. Among them, Gold sequences having good auto-correlation and cross-correlation are most widely used.
In the related art, a communication device calculates two m sequences, and the two m sequences are subjected to modulo-2 sum operation to obtain corresponding Gold sequences. Because the actually required Gold sequence has a phase shift and the m-sequence also has a phase shift, according to the method for normally obtaining the Gold sequence, the equipment needs to wait for the time length after the total phase shift to obtain the actually required Gold sequence. To reduce the latency of this portion, the device typically pre-stores several masks, with the masks corresponding to the total phase. When the known total phase corresponds to a pre-stored mask, the device will process the m-sequence according to the mask, thereby obtaining the required Gold sequence.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a pseudo-random sequence and a storage medium. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method for generating a pseudo-random sequence, the method including:
obtaining a first phase shift value Q configured for a source pseudorandom sequence1,Q1Is a positive integer;
shifting the first phase by a value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer;
k is carried out on the initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain the first phase shift value Q1Corresponding masks are obtained in the iteration mode, and the masks corresponding to the next round are obtained according to the masks corresponding to the current round and the state transition matrix;
by said first phase shift value Q1And generating a target pseudorandom sequence through logic operation between the corresponding mask and the state column vector of the source pseudorandom sequence.
According to another aspect of the present application, there is provided an apparatus for generating a pseudo-random sequence, the apparatus comprising:
a parameter obtaining module for obtaining a first phase shift value Q1, Q configured for the source pseudorandom sequence1Is a positive integer;
a digital system conversion module for converting the first phase shift value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer;
a mask iteration module for performing K on the initial mask corresponding to the source pseudorandom sequence1The iteration is carried out in a round way,obtaining the first phase shift value Q1Corresponding masks are obtained, and the iteration is to obtain the masks corresponding to the next round by the masks corresponding to the current round and the state transition matrix;
a sequence generation module for passing the first phase shift value Q1And generating a target pseudorandom sequence through logic operation between the corresponding mask and the state column vector of the source pseudorandom sequence.
According to another aspect of the present application, there is provided a communication apparatus comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the method of generating a pseudo-random sequence as provided in the various aspects of the present application.
According to another aspect of the present application, there is provided a computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to implement the method for generating a pseudo-random sequence as provided in the various aspects of the present application.
According to one aspect of the present application, a computer program product is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the method for generating a pseudorandom sequence described above.
According to the embodiment of the application, under the condition that the current software architecture and hardware structure are not changed, when the communication device needs target pseudo-random sequences corresponding to different phase shift values, the effect of automatically generating the target pseudo-random sequences corresponding to different first phase shift values can be achieved. In the generation process, K is carried out on the initial mask1Obtaining a mask corresponding to the first phase shift value after iteration, wherein K1The number of bits of the binary number value equal to the first phase shift value is obtained, and finally the target pseudorandom sequence is obtained through the logical operation between the mask and the state column vector of the source pseudorandom sequence. Generation method of pseudo-random sequence of the applicationIn the method, the phase shift value can be obtained through parameter configuration, so that the generation of a pseudo-random sequence of any phase shift can be supported. In the generation process, a useful pseudo-random sequence value after any phase shift can be directly calculated without generating a useless sequence value, the delay of the generation of a target pseudo-random sequence is reduced, the efficiency of generating the target pseudo-random sequence in real time under different phase shifts is improved, and the communication efficiency of the communication device is further improved.
Drawings
In order to more clearly describe the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a communication system provided in an embodiment of the present application;
fig. 2 is a block diagram of a transmitter provided based on the embodiment shown in fig. 1;
fig. 3 is a block diagram of a receiver provided based on the embodiment shown in fig. 1;
FIG. 4 is a diagram of a logic circuit for generating a Gold sequence;
fig. 5 is a schematic diagram of a frequency domain resource occupied by a PDSCH (Physical Downlink Shared Channel) and a pseudo random sequence corresponding to a DMRS (Demodulation Reference Signal) of the PDSCH;
FIG. 6 is a flow chart of a method for generating a pseudorandom sequence provided by an exemplary embodiment of the present application;
FIG. 7 is a flowchart of a method for generating a pseudo-random sequence according to another exemplary embodiment of the present application;
fig. 8 is a schematic diagram of a generation flow of a pseudo-random sequence according to an embodiment of the present application;
fig. 9 is a block diagram of a pseudo-random sequence generation apparatus according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "connected" and "connected" are to be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1, fig. 1 is a schematic diagram of a communication system according to an embodiment of the present disclosure. In fig. 1, a transmitter 1A and a receiver 1B are included. Wherein the transmitter 1A is used to transmit the target signal to the receiver 1B. Accordingly, the receiver 1B is used to receive the target signal transmitted by the transmitter 1A.
For the transmitter 1A, the transmitter 1A needs to encode the original signal before generating the target signal. In the encoding process, a target pseudo-random sequence with good autocorrelation and cross-correlation is required to participate, so that the target signal obtained after encoding has good anti-interference performance and high safety. The target pseudo-random sequence needs to be generated at the transmitter 1A local end.
For the receiver 1B, the receiver 1B needs to decode the target signal after receiving the target signal. In the decoding process, it is necessary to use a target pseudo-random sequence corresponding to that used by the transmitter 1A in the encoding process. The target pseudo-random sequence needs to be generated at the receiver 1B local side.
Based on the communication system shown in fig. 1, the method for generating the target pseudorandom sequence provided by the present application can be applied to a communication device. The communication device may be a transmitter or a receiver in a communication system. It should be noted that, in a practical scenario, a device is a transmitter when transmitting a signal and a receiver when receiving a signal.
Alternatively, the communication device may be one of a base station, a terminal, or a chip according to the setting of the size and the shape of the apparatus.
The procedure of processing the target signal by the transmitter 1A and the receiver 1B will be described below, respectively.
Referring to fig. 2, fig. 2 is a block diagram of a transmitter provided based on the embodiment shown in fig. 1. In fig. 2, the Transmitter 1A includes a reference signal generating module 211, an encoding module 212, a modulating module 213, a resource mapping module 214, an OFDM baseband signal generating module 215, and a Transmitter Radio Frequency module 216 (Tx-RF).
In fig. 2, an original signal to be transmitted in a transmitter is input to an encoding module 212, and a reference signal generating module 211 is used to generate a reference signal based on a target pseudo-random sequence. In one aspect, the original signal is encoded by the encoding module 212 and then input to the modulation module 213, and the modulation module 213 is configured to modulate the original signal encoded by the encoding module. The modulation module 213 transmits the signal to the resource mapping module 214 after the signal processing is completed. On the other hand, the reference signal is generated and transmitted from the reference signal generating module 211 to the resource mapping module 214. After the signal is processed by the resource mapping module 214, the baseband signal is generated in the OFDM baseband signal generating module 215. Finally, the processed signal will be transmitted through the antenna under the arrangement of the transmitter rf module 216.
Referring to fig. 3, fig. 3 is a block diagram of a receiver according to the embodiment shown in fig. 1. In fig. 3, the Receiver includes a reference signal generating module 311, a Receiver Radio Frequency module 312 (Rx-RF), a timing and Frequency synchronizing module 313, a channel estimating and equalizing module 314, a demodulating module 315, and a decoding module 316.
In fig. 3, the receiver processes the target signal transmitted from the transmitter through the receiver rf module 312. Subsequently, the received signal is processed by the timing and frequency synchronization module 313 and then input to the channel estimation and equalization module 314. Meanwhile, the channel estimation and equalization module 314 obtains a reference signal from the reference signal generation module 311, and the reference signal is generated by the reference signal generation module 311 based on the target pseudo-random sequence. The demodulation module 315 demodulates the signal that has passed through the channel estimation and equalization module 314. The demodulated signal is transmitted to the decoding module 316. After the decoding module 316 decodes the signal, the receiver will obtain the information contained in the target signal.
In the field of communications, pseudo-random sequences are generally used for testing communication performance or encrypting communication contents, because the pseudo-random sequences have good randomness and correlation functions close to white noise. Since the pseudo-random sequence requires the generation of a pseudo-random sequence generator in real time. Therefore, the speed and efficiency of generating the pseudo-random sequence by the pseudo-random sequence generator directly affect the speed and efficiency of the communication performance test, and the efficiency of the communication can be kept secret.
In practical applications, the part of the pseudo-random sequence that is usually used is a phase-shifted part that is specified. In an application mode, a pseudo-random sequence with good autocorrelation and cross-correlation is used for generating communication functions such as scrambling codes and DMRS.
Specifically, m-sequences have the best autocorrelation properties as the most studied pseudo-random sequences, but the number of family sequences having good cross-correlation properties is small, which limits the application of m-sequences. Based on this, researchers found that Gold sequences have good auto-correlation and cross-correlation properties, and the number of family sequences is large. Therefore, the Gold sequence is generally widely used as a pseudo random sequence for practical applications in LTE (Long Term Evolution) and NR (New Radio) systems.
Wherein, the Gold sequence is a pseudo random sequence generated by modulo-2 addition of two m sequences with equal code length.
Next, a method of generating a Gold sequence is described.
c(n)=(x1(n+Nc)+x2(n+Nc))mod2 (1)
x1(n+31)=(x1(n+3)+x1(n))mod2 (2)
x2(n+31)=(x2(n+3)+x2(n+2)+x2(n+1)+x2(n))mod2 (3)
In the above equations (1), (2) and (3), Nc=1600,x1(n) and x2(n) are two m-sequences. First m-sequence x1(n) initial state, i.e. the first 31 values are x1(0)=1。x1(n) 0, 1, 2, 3, 30 the second m-sequence x2The initial state of (n) may be according to the expression
Figure BDA0002852276250000051
Is obtained byinitDifferent values can be configured through the parameters to achieve the effect of obtaining different Gold sequences.
Accordingly, referring to fig. 4, fig. 4 is a logic circuit diagram of Gold sequence generation. In the logic circuit diagram shown in FIG. 4, the first m-sequence x1(n) and a second m-sequence x2(n) the operation procedure shown in the above equations (1), (2) and (3) is completed by the processing of the logic circuit.
In FIG. 4, the first m-sequence of multiplication coefficients is
f=[f0,f1,...,f30]
=[1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
The second m-sequence of multiplication coefficients is
g=[g0,g1,...,g30]
=[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
By the multiplication coefficients of the m-sequence and the logic circuit diagram shown in FIG. 4, the Gold sequence c (N) shown in this example is phase-shifted by N with respect to the initial statecOf two m-sequences of modulo-2 sums. That is, in order to calculate the value c (0) of bit 1 of the pseudo-random sequence, two m-sequence state registers need to be shifted by N from the initial statecNext, the process is carried out. Based on this scenario, if the gold sequence c (N) is obtained in the conventional manner, the system is required to wait for NcAfter one cycle, the first bit of the gold sequence c (n) can be obtained. If the length of the gold sequence c (N) includes L bits, the device needs to pass through NcThe actual gold sequence c (n) can only be obtained after + L cycles.
An application scenario for actually generating the gold sequence is described below. Taking a demodulation reference signal (DMRS) of a Physical Downlink Shared Channel (PDSCH) as an example, a generated gold sequence is modulated into a DMRS symbol and then mapped to time-frequency resources. Wherein, the reference point of the frequency domain resource sequence number k may be the first resource block CRB0 in the common resource block. While, depending on the location of BWP (Bandwidth Part) and the resource allocation of PDSCH, DMRS is not necessarily located on the frequency domain resources from CRB0, so the corresponding sequence does not necessarily start from the first value c (0) of the pseudo-random sequence, but there may be a different phase shift. The pseudo-random sequences corresponding to the frequency domain resources and their DMRSs are shown in fig. 5. Fig. 5 is a schematic diagram of frequency domain resources occupied by a PDSCH and a pseudo-random sequence corresponding to a DMRS of the PDSCH.
In fig. 5, DMRS symbols for PDSCH and PDSCH may be locatedThe initial position is
Figure BDA0002852276250000061
Has a length of
Figure BDA0002852276250000062
Arbitrary position of the frequency domain resource grid.
Figure BDA0002852276250000063
Is provided by the higher level parameter offsetToCarrier,
Figure BDA0002852276250000064
the value range of (2) is 0-2199, and correspondingly, the starting RB (resource Block) range of the PDSCH and the DMRS thereof is CRB 0-2199.
Illustratively, the number of DMRS symbols corresponding to each RB is K. The corresponding pseudo-random sequence length is 2K. In DMRS configuration type 1 and type 2, the value of K is 6 and 4, respectively. Accordingly, the maximum range of possible phase shifts of the useful pseudo-random sequence required to generate the DMRS symbols is
Figure BDA0002852276250000065
The value range is 0-26399. That is, when the device calculates the pseudo-random sequence by using the method, since the m-sequence itself needs to be phase-shifted by 1600, the phase-shift range corresponding to the m-sequence is 1600-27999.
The pseudo-random sequence may be output by the shift register from an initial state, with a new sequence value being output each clock cycle. As can be seen from the foregoing, the previous part of the pseudo-random sequence generated is a sequence that is not used, i.e., a useless sequence. The corresponding useful sequence may start with the nth value, i.e. corresponding to the phase shift N. When the value of the phase shift N is large, it takes a long period for the terminal to obtain the first value of the useful sequence, which causes a waste of computing resources and a large delay, and it is difficult to meet the requirement of processing time. On this basis, a method for calculating a pseudo-random sequence which can support any phase shift based on a mask is introduced.
According to the generation formula of the pseudo-random sequence, two m sequences x1(n) and x2The phase shift relationship of (n) is expressed in the form of matrix multiplication under the following galois field GF (2). In the present application, unless otherwise specified, all operations are performed in the galois field GF (2).
X1(n)=[x1(n),x1(n+1),...,x1(n+30)]T
X2(n)=[x2(n),x2(n+1),...,x2(n+30)]T
Figure BDA0002852276250000071
Figure BDA0002852276250000072
Wherein the content of the first and second substances,
Figure BDA0002852276250000073
Figure BDA0002852276250000074
in the case of this embodiment, the process is,
Figure BDA0002852276250000075
first row of
Figure BDA0002852276250000076
I.e. phase shifting the first m-sequence by NcA mask of time by which the first m-sequence phase shift N can be directly calculatedcThe latter sequence value. Please see the following formula:
Figure BDA0002852276250000077
in this equation, the parameter x to the left of the equation1(n+Nc) Represents the first m-sequence shift NcThe latter sequence. First term on right side of equation
Figure BDA0002852276250000078
Represents the first m-sequence shift NcMask corresponding to time, second term [ x ]1(n),x1(n+1),…,x1(n+30)]TIs the state column vector of the first m-sequence.
Note that 31 elements included in the state column vector are the number of linear shift registers used to generate the first m-sequence. In the embodiment of the present application, after reading the respective elements in the 31 linear shift registers, the communication device transposes the row vector formed by the 31 elements to obtain the state column vector corresponding to the first m-sequence. In other embodiments, when the number of the linear shift registers used to generate the first m-sequence is other values, for example, the number of the linear shift registers is b, and b is a positive integer, the communication device reads respective elements in the b linear shift registers, and then transposes a row vector formed by the b elements to obtain a state column vector corresponding to the first m-sequence, that is, the number of the state column vectors at this time is b.
Similarly, the second m-sequence is shifted by NcThe latter sequence value can also be obtained by the same method. Wherein the second m-sequence is represented by x2And (n) represents.
Figure BDA0002852276250000081
First row of
Figure BDA0002852276250000082
I.e. the second m-sequence x2(N) phase shifting NcMask of time, pass
Figure BDA0002852276250000083
Corresponding sum of state column vectors
Figure BDA0002852276250000084
Can directly calculate the phase shift N of the second m-sequencecThe latter sequence value.
Figure BDA0002852276250000085
Thus, the first m-sequence x1(n) and a second m-order x2(n) after modulo 2 sum, the scheme will directly get the Gold sequence.
c(n)=(x1(n+Nc)+x2(n+Nc))mod 2
Therefore, the useful Gold sequence can be directly obtained through the scheme based on the mask, and the linear shift register for generating the m sequence does not need to output a plurality of useless numerical values bit by bit and then output the useful Gold sequence. Thereby saving clock cycles for generating the garbage sequence values.
However, in a communication performance test or a secret communication using a pseudo random sequence, a phase shift of a useful pseudo random sequence is not fixed in different application scenarios. The phase shift may have different values according to different frequency domain resource positions occupied by BWP and PDSCH. Meanwhile, the value range of the phase shift is large, and masks corresponding to different phase shifts are different. Therefore, the above scheme can only calculate the corresponding mask for a certain fixed phase shift in advance, and cannot dynamically support any phase shift through parameter configuration when generating the sequence. In other words, if the mask corresponding to each phase shift is pre-calculated and stored by using the above scheme, since the value range of the phase shift is large, pre-storing all possible masks consumes huge memory resources, and the cost for rapidly acquiring the pseudorandom sequence is too large under the condition that the storage space of the communication device is limited.
Based on this, the present application provides a method for generating a pseudo-random sequence, which can calculate a mask corresponding to a useful pseudo-random sequence in real time, thereby obtaining the useful pseudo-random sequence quickly and efficiently.
Referring to fig. 6, fig. 6 is a flowchart of a method for generating a pseudo-random sequence according to an exemplary embodiment of the present application. The method for generating the pseudo-random sequence can be applied to the communication device shown above. In fig. 6, the method for generating the pseudo random sequence includes:
step 610, obtaining a first phase shift value Q configured for a source pseudorandom sequence1,Q1Is a positive integer.
In the embodiment of the present application, when the communication device needs to use the target pseudo-random sequence, it usually obtains a corresponding phase shift value from the higher layer parameters. The communication device then needs the phase shift value of the offset in conjunction with the source pseudorandom sequence itself. The communication device determines the total phase shift value as a first phase shift value Q1
In this example, the source pseudorandom sequence may be a sequence actively generated by a pseudorandom sequence auto-generator. In one possible approach, the number of source pseudorandom sequences may be one or more than one.
If the number of the source pseudorandom sequences is more than one, the source pseudorandom sequences can be a group, and the terminal generates a group of source pseudorandom sequences according to a preset generation mode.
For example, if the number of source pseudorandom sequences is two, and the number of bits of the two source pseudorandom sequences is required to be equal. In this case, the terminal will control the auto-generator to generate two source pseudo-random sequences of equal number of bits.
It should be noted that, the number of source pseudorandom sequences generated in the embodiment of the present application, the number of bits per se, and the like are performed according to preset conditions, and the present application does not limit a specific source pseudorandom sequence generation manner, and the manner of generating 2 source pseudorandom sequences is only schematically described above.
In one possible approach, the first phase shift value may be a given value. In another possible manner, the first phase shift value can be calculated by simple numerical accumulation or the like, which is not limited in this embodiment of the application.
Step 620, the first phase shift value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer.
In the present application, the communication device is able to adjust the first phase shift value Q1And adjusting the numerical value. In one case, the first phase shift value Q1Before the adjustment, a non-binary number such as a decimal number, an octal number, or a hexadecimal number may be used. In another case, if the first phase shift value Q1Is itself a binary number, this step is essentially Q1And Q2Are identical. At Q1And Q2Under the same condition, directly carrying out the treatment of the subsequent steps.
This step uses the first phase shift value Q1Is illustrated as an example decimal number 2100. Wherein, 2100 ═ 1 × 211+0*210+0*29+0*28+0*27+0*26+1*25+1*24+0*23+1*22+0*21+0*20Then the decimal 2100 conversion to binary is 100000110100. Thus, this step results in 100000110100 being a binary number from the decimal number 2100, and the number of digits of the binary number is 12.
Step 630, K is performed on the initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain a first phase shift value Q1And corresponding masks, wherein iteration is to obtain the masks corresponding to the next round according to the masks corresponding to the current round and the state transition matrix.
In the embodiment of the present application, the source pseudorandom sequence corresponds to an initial mask. The number of bits of the initial mask is equal to the number of bits of the source pseudorandom sequence, and the first bit of the initial mask is 1 and the remaining bits are 0.
The method can start iteration from the initial mask, and the result of each iteration is the input of the next iteration. Through K1Performing iteration to obtain a first phase shift value Q1A corresponding mask.
Step 640, passing the first phase shift value Q1Logical operation between corresponding mask and state column vector of source pseudorandom sequenceAnd (4) generating a target pseudo-random sequence.
In this example, the communication device may cause the first phase shift value Q1And multiplying the corresponding mask with the state column vector of the source pseudorandom sequence to obtain a corresponding target pseudorandom sequence. The algorithm represented by step 640 may be a generic algorithm. The communication device can calculate each bit of the target pseudorandom sequence according to the method provided in this step. For example, the communication device shifts the first phase by a value Q1The corresponding mask is multiplied by the state column vector to generate the target bits of the target pseudorandom sequence.
After the target pseudorandom sequence is obtained, the embodiment of the application may use the target pseudorandom sequence as a communication performance test. The embodiments of the present application may also use the target pseudorandom sequence as a secure communication.
In summary, the embodiments of the present application can achieve an effect of automatically generating target pseudorandom sequences corresponding to different first phase shift values when a communication device needs target pseudorandom sequences corresponding to different phase shift values without changing a current software architecture and a current hardware structure. In the generation process, K is carried out on the initial mask1Obtaining a mask corresponding to the first phase shift value after iteration, wherein K1The number of bits of the binary number value equal to the first phase shift value is obtained, and finally the target pseudorandom sequence is obtained through the logical operation between the mask and the state column vector of the source pseudorandom sequence. According to the method for generating the pseudorandom sequence, the phase shift value can be obtained through parameter configuration, and therefore the method can support generation of the pseudorandom sequence with any phase shift. In the generation process, a useful pseudo-random sequence value after any phase shift can be directly calculated without generating a useless sequence value, the delay of the generation of a target pseudo-random sequence is reduced, the efficiency of generating the target pseudo-random sequence in real time under different phase shifts is improved, and the communication efficiency of the communication device is further improved.
Optionally, in the present application, the phase shift value may be obtained through parameter configuration, and it is not necessary to calculate and store a mask corresponding to each phase shift in advance, and it is not necessary to increase and consume huge memory resources, so that it is not necessary to change the current software architecture and hardware structure.
Based on the scheme disclosed in the previous embodiment, the terminal can further improve the efficiency of calculating the obtained mask through setting a specific iteration mode and introducing a parallel processing means. Therefore, the efficiency of calculating the target pseudorandom sequence in the present application is comprehensively improved, please refer to the following embodiments.
Referring to fig. 7, fig. 7 is a flowchart of a method for generating a pseudo-random sequence according to another exemplary embodiment of the present application. The method for generating the pseudo-random sequence can be applied to the terminal shown above. In fig. 7, the method for generating the pseudo random sequence includes:
step 710, obtaining a first phase shift value Q configured for a source pseudorandom sequence1
In the embodiment of the present application, the execution process of step 710 is the same as the execution process of step 410, and is not described herein again.
In addition, in the embodiment of the application, the terminal can acquire a first numerical value input by a user through the input component, and determine the first numerical value as the first phase shift value. For example, the input component may be a hardware device such as a touch screen, a mouse, a keyboard, or a microphone. The user can input the first numerical value into the terminal through the hardware equipment, and the terminal determines the first numerical value as a first phase shift value.
Step 720, the first phase shift value Q1Conversion to binary value Q2
In the embodiment of the present application, the execution process of step 720 is the same as the execution process of step 420, and is not described herein again.
Step 731, when the ith round corresponds to the binary value Q2When the numerical value of the digit of (b) is 1, in the ith round of iteration, multiplying the mask corresponding to the ith round by the state transition matrix corresponding to the ith round to obtain the mask corresponding to the (i + 1) th round, wherein i is a natural number, and is less than or equal to K1-1。
In the embodiment of the present application, the communication device will be based on the binary value Q in each round2The number of bits of (c) to perform different processes. When binary value Q2The number of digits of (1) isThen, the present application performs step 731; when binary value Q2If the value of the number of bits is 0, the present application performs step 732.
Step 732, when the i-th round corresponds to the binary value Q2When the number of bits of (b) is 0, in the ith iteration, the mask corresponding to the ith round is determined as the mask corresponding to the (i + 1) th round.
In the iterative process provided by the application, K is executed in total1And (6) performing iteration in turn. In this application, in the first iteration, i is 0; k th1When the iteration is repeated, i is equal to K1-1。
When i is equal to 0, the mask corresponding to the ith wheel is an initial mask, the state transition matrix corresponding to the ith wheel is an initial state transition matrix, the initial state transition matrix is a square matrix with the order of D, and D is a positive integer.
The source pseudo-random sequence is a sequence generated by D linear feedback shift registers, and the element value of the D-th row of the initial state transition matrix is a multiplication coefficient corresponding to the linear feedback shift register.
When i is equal to K1At 1, K1The mask for 1 round is the first phase shift value Q1A corresponding mask.
741, according to the initial state transition matrix and the first phase shift value Q1And obtaining a first state transition matrix according to the corresponding mask, wherein the row number of the first state transition matrix is the parallelism P of the target pseudorandom sequence.
In this example, the first state transition matrix is described with Fp as an example.
Wherein the communication device is capable of phase shifting the value Q1And j is a natural number and is less than or equal to P-1. Since the number of rows of the first state transition matrix Fp is P, the first state transition matrix Fp can be derived by this method in a row-by-row manner.
Step 742, a second state transition matrix is obtained according to the parallelism P and the initial state transition matrix, wherein the second state transition matrix is the power of P of the initial state transition matrix.
In this example, the second state transition matrix is described with Fs as an example.
Step 743, processing the source pseudorandom sequence to obtain a target pseudorandom sequence according to the first state transition matrix and the second state transition matrix.
In actual processing, the first state transition matrix and the second state transition matrix can participate in multiple iterations, and designated data processing is performed in the iteration process, so that the source pseudo-random sequence is processed, and the target pseudo-random sequence is obtained.
In the embodiment of the present application, step 743 can be alternatively implemented by step (1) and step (2).
Step (1), according to a second state transition matrix, carrying out X-1 times of iterative processing on a source pseudorandom sequence to generate an intermediate state sequence; wherein if L/P is an integer, then X is equal to L/P; if L/P is a non-integer, then X is equal to A, 0< A-L/P <1, and A is a positive integer.
And (2) multiplying the first state transition matrix by the intermediate state sequence to generate a target pseudorandom sequence.
In this application, if the source pseudorandom sequence includes at least a first source pseudorandom sequence and a second source pseudorandom sequence, the communication apparatus may achieve the effect of generating the target pseudorandom sequence through steps (3), (4), and (5).
And (3) taking the first source pseudo-random sequence which is subjected to mask processing corresponding to the first phase shift value of the first source pseudo-random sequence as a first target pseudo-random sequence.
And (4) taking the second source pseudo-random sequence which is subjected to mask processing corresponding to the first phase shift value of the second source pseudo-random sequence as a second target pseudo-random sequence.
And (5) performing modulo-2 sum operation on the first target pseudorandom sequence and the second target pseudorandom sequence to generate a target pseudorandom sequence.
In this application, as a possible implementation manner, the first source pseudorandom sequence and the second source pseudorandom sequence are m sequences respectively, and the target pseudorandom sequence is a Gold sequence. Further, the target pseudo-random sequence is a useful sequence in the Gold sequence. The embodiment of the application can enable the terminal to directly obtain the part of the sequence required by the terminal in the Gold sequence. For example, the part of the Gold sequence required by the terminal is the sequence starting at the 1700 th bit, and the target pseudo-random sequence shown in this application refers to the part of the sequence.
In another possible calculation mode, in the process of iteratively obtaining the mask corresponding to the source pseudorandom sequence, the state transition matrix corresponding to the ith round has two acquisition modes. The first mode is data which is calculated in advance and stored in local, the second mode is that a state transition matrix corresponding to the ith wheel is data obtained by real-time calculation, and the state transition matrix corresponding to the ith wheel is a result of multiplication of state transition matrices corresponding to 2 (i-1) th wheels.
In summary, in this embodiment, a mask code corresponding to a first phase shift value required by the present application can be obtained step by step from an initial mask code according to an iterative manner, and then a target pseudorandom sequence is generated under the processing of logical operation of the mask code and a source pseudorandom sequence, so that it is avoided that a terminal acquires excessive useless values in advance for acquiring the target pseudorandom sequence, the occupied amount of resources during operation of the terminal is reduced, the capability of the terminal in dealing with different phase shift values is improved, and a useful pseudorandom sequence is obtained quickly.
The method for generating the pseudorandom sequence provided by the embodiment can also acquire the numerical values of a plurality of bits in the target pseudorandom sequence in parallel, and the speed of finally acquiring the pseudorandom sequence is improved.
Based on the methods shown in the above embodiments, the embodiments of the present application further provide a method for generating a pseudorandom sequence, please refer to the following embodiments.
Referring to fig. 8, fig. 8 is a schematic diagram illustrating a generation flow of a pseudo-random sequence according to an embodiment of the present disclosure.
In the generation process of the pseudo-random sequence of practical application, the method for generating the pseudo-random sequence in parallel supporting any phase shift can configure the phase shift value through parameters in different application scenes without changing a software or hardware implementation framework.
Illustratively, the phase shift range of the pseudo-random sequence is assumed to be 0 to NmaxThen the corresponding m-sequence phase shift range is Nc~Nc+NmaxShifting the phase of the m-sequence by a certain phase shift value NtExpressed as K ═ log2(Nc+Nmax+1)]Binary form of bit (n)0,n1,...,nK-1) Satisfy the following requirements
Figure BDA0002852276250000131
First, phase shifts N are calculated separatelytMask corresponding to time two m-sequences
Figure BDA0002852276250000132
And
Figure BDA0002852276250000133
wherein
Figure BDA0002852276250000134
Can be calculated by
Figure BDA0002852276250000135
And obtaining a first line of the image;
Figure BDA0002852276250000136
can be calculated by
Figure BDA0002852276250000137
And get its first row. Thus, two m-sequence phase shifts 0 correspond to masks of:
f(0)=g(0)=[1,0,...,0]
taking the first m-sequence as an example, the calculation formula of the state transition matrix can be obtained as follows:
Figure BDA0002852276250000138
the above formula can be calculated in an iterative manner, and the initial mask is f(0)Each iteration preceded byPhase shifting, i.e. multiplying, on a primary masked basis
Figure BDA0002852276250000139
Obtaining the phase shift N after the maximum K iterationstIs covered with
Figure BDA00028522762500001310
Specifically, an initial mask is set to
Figure BDA00028522762500001311
The mask after the ith iteration is
Figure BDA00028522762500001312
Then
Figure BDA00028522762500001313
When n isiWhen the number is equal to 1, the alloy is put into a container,
Figure BDA00028522762500001314
is provided with
Figure BDA00028522762500001315
At which point the mask needs to be updated by computation.
When n isiWhen the content is equal to 0, the content,
Figure BDA00028522762500001316
is provided with
Figure BDA00028522762500001317
The mask does not need to be updated at this point.
niCan be calculated by the following method:
setting initial value of phase shift
Figure BDA0002852276250000141
Taken directly at the i-th iteration
Figure BDA0002852276250000142
The lowest bit can be used to obtain ni, which is then shifted right by one bit to obtain a new value
Figure BDA0002852276250000143
Since n isiThe mask does not need to be updated when 0, so the phase shift is given for the ith iteration
Figure BDA0002852276250000144
I.e. iterating all n thereafteriAll are 0, the mask is not updated any more, at this time, iteration can be stopped in advance, and the final result is directly obtained
Figure BDA0002852276250000145
In another method, the embodiment of the present application may also continue the iterative process without performing any calculation, so as to ensure a fixed output delay. After the processing described herein, the mask obtained in the embodiments of the present application after a maximum of K iterations
Figure BDA0002852276250000146
I.e. phase shift NtIs covered with
Figure BDA0002852276250000147
State transition matrix
Figure BDA0002852276250000148
The initial value of the state transition matrix can be set by iterative calculation
Figure BDA0002852276250000149
Updated to after the ith iteration
Figure BDA00028522762500001410
Another method, the state transition matrix
Figure BDA00028522762500001411
Or the data can be calculated in advance and stored, and can be directly read and used in an iterative process.
Assuming that the phase shift of the pseudo-random sequence to be calculated is N, the length is L, and the calculation parallelism is P, the phase shift corresponding to the m sequence is N + Nc
First, let N be according to the above methodt=N+NcTo obtain a phase shift of N + NcIs covered with
Figure BDA00028522762500001412
Then, the mask is obtained by iteration
Figure BDA00028522762500001413
Forming P flax into state transition matrix F for parallel generation of m sequencePIs composed of
Figure BDA00028522762500001414
In addition, the state transition matrix F for m-sequence state updatesSIs composed of
Figure BDA00028522762500001415
FSThe parallelism can be calculated and stored in advance, and the iteration can be directly read and used.
Based on the above FPAnd FSThe two state matrices can respectively calculate the output m-sequence vector and update the m-sequence state in an iterative way.
Setting m sequence initial state
Figure BDA00028522762500001416
The state after the jth iteration is
Figure BDA00028522762500001417
The j iteration outputs an m-sequence vector:
Figure BDA00028522762500001418
then
Figure BDA00028522762500001419
Figure BDA00028522762500001420
It can be seen that the calculation of the output sequence vector and the update sequence state are both performed by multiplying the current sequence state value by the respective corresponding state transition matrix.
For the second m sequence, the same method can be used for calculation in the present application, and details are not described herein.
The j iteration obtains the first m sequence vector
Figure BDA0002852276250000151
And a second m-sequence vector
Figure BDA0002852276250000152
And finally, adding the two vectors modulo 2 to obtain the pseudorandom sequence vector which is output in parallel.
Figure BDA0002852276250000153
Through
Figure BDA00028522762500001519
After the iteration, all the pseudo-random sequence values can be obtained. It should be noted that if L/P is not an integer, there are some useless values in the pseudo-random sequence values generated in the last iteration, which need to be discarded or ignored in subsequent processing.
In summary, the steps of generating the pseudo-random sequence of phase shifts N can be summarized as follows:
(1) mask for initializing two m-sequences as
Figure BDA0002852276250000154
Initializing an initial value of a phase shift
Figure BDA0002852276250000155
Initializing state transition matrices
Figure BDA0002852276250000156
The initialization iteration count value i is 0.
(2) If i is not less than K or
Figure BDA0002852276250000157
Jumping to the step (5); otherwise, obtaining
Figure BDA0002852276250000158
Is the lowest bit of
Figure BDA0002852276250000159
And update
Figure BDA00028522762500001510
If n isiJumping to the step (4) when the value is 0; if n isiAnd (5) executing the step (3) as 1.
(3) Updating the corresponding masks of two m-sequences
Figure BDA00028522762500001511
And
Figure BDA00028522762500001512
(4) updating state transition matrices
Figure BDA00028522762500001513
Figure BDA00028522762500001514
Updating iteration count value i ═ i +1
Jumping to the step (2).
(5) Obtaining two m-sequence phase shifts N + NcAre respectively a mask of
Figure BDA00028522762500001515
Figure BDA00028522762500001516
The initialization iteration count value k is 0.
(6) Iteratively calculating a mask
Figure BDA00028522762500001517
Figure BDA00028522762500001518
The iteration count value k is updated to k + 1.
(7) If k is more than or equal to P-1, jumping to the step (8); otherwise, repeating the step (6).
(8) Respectively composing P masks into a state transition matrix F for parallel generation of m sequencesPAnd GP
Reading a prestored state transition matrix F for updating m-sequence statesSAnd GS
Initializing m-sequence states
Figure BDA0002852276250000161
And
Figure BDA0002852276250000162
the initialization iteration count value j is 0.
(9) Updating two m-sequence states separately
Figure BDA0002852276250000163
And
Figure BDA0002852276250000164
separately calculating two m-sequence output vectors
Figure BDA0002852276250000165
And
Figure BDA0002852276250000166
modulo-2 addition of two m-sequence output vectors to obtain a pseudorandom sequence vector
Figure BDA0002852276250000167
The iteration count value j is updated to j + 1.
(10) If it is
Figure BDA0002852276250000168
Finishing the calculation; otherwise, repeating the step (9).
It should be noted that if the phase shift value N of the pseudo-random sequence remains unchanged in a certain application scenario, only the initial state value c of the second m-sequence is usedinitWhen a change occurs, only the mask matrix F needs to be calculated and stored once during the initial configuration of the application scenarioPAnd GPThat is, the steps (1) to (7) are performed only once. When the pseudo-random sequence of different initial state values is generated subsequently, the mask calculation step can be skipped, and the process is directly executed from the step (8).
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 9, fig. 9 is a block diagram of a pseudo-random sequence generating apparatus according to an exemplary embodiment of the present application. The pseudo-random sequence generating means may be implemented as all or part of the terminal by software, hardware or a combination of both. The device includes:
a parameter obtaining module 910, configured to obtain a first phase shift value Q configured for a source pseudorandom sequence1,Q1Is a positive integer;
a digital system conversion module 920 for converting the first phase shift value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer;
a mask iteration module 930 configured to perform K on an initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain the first phase shift value Q1Corresponding masks are obtained, and the iteration is to obtain the masks corresponding to the next round by the masks corresponding to the current round and the state transition matrix;
a sequence generation module 940 for passing the first phase shift value Q1And generating a target pseudorandom sequence through logic operation between the corresponding mask and the state column vector of the source pseudorandom sequence.
In an alternative embodiment, the mask iteration module 930 is configured to iterate the binary value Q corresponding to the ith round2When the numerical value of the digit of (b) is 1, in the ith round of iteration, multiplying the mask corresponding to the ith round by the state transition matrix corresponding to the ith round to obtain the mask corresponding to the (i + 1) th round, wherein i is a natural number, and is less than or equal to K1-1; when the binary value Q corresponding to the ith round is2When the value of the digit of (b) is 0, in the ith round of iteration, determining the mask corresponding to the ith round as the mask corresponding to the (i + 1) th round; when i is equal to 0, the mask corresponding to the ith wheel is the initial mask, the state transition matrix corresponding to the ith wheel is an initial state transition matrix, the initial state transition matrix is a square matrix with the order of D, and D is a positive integer; when i is equal to K1At 1, K1-1 round of corresponding masks is the first phase shift value Q1A corresponding mask.
In an alternative embodiment, the apparatus involves: the source pseudorandom sequence is a sequence generated by D linear feedback shift registers, and the element values of the D-th row of the initial state transition matrix are multiplication coefficients corresponding to the linear feedback shift registers.
In an alternative embodiment, the sequence generating module 940 is configured to shift the first phase shift value Q1And multiplying the corresponding mask by the state column vector to generate a target bit of the target pseudorandom sequence.
In an optional embodiment, the first matrix obtaining module is configured to obtain a first state transition matrix according to the initial state transition matrix and a mask corresponding to the first phase shift value Q1, where a row number of the first state transition matrix is a parallelism P of the target pseudorandom sequence; a second matrix obtaining module, configured to obtain a second state transition matrix according to the parallelism P and the initial state transition matrix, where the second state transition matrix is a power P of the initial state transition matrix; and the processing module is used for processing the source pseudo-random sequence according to the first state transition matrix and the second state transition matrix to obtain the target pseudo-random sequence.
In an optional embodiment, the first matrix obtaining module is configured to obtain the phase shift value Q1And the mask corresponding to the + j is used as the jth row of the first state transition matrix, j is a natural number and j is less than or equal to P-1.
In an optional embodiment, the processing module is configured to perform iteration processing on the source pseudorandom sequence for X-1 times according to the second state transition matrix to generate an intermediate state sequence; wherein if L/P is an integer, then X is equal to L/P; if L/P is a non-integer, then X is equal to A, 0< A-L/P <1, A is a positive integer; and multiplying the first state transition matrix by the intermediate state sequence to generate the target pseudorandom sequence.
In an optional embodiment, the sequence generating module 940 is configured to use the first source pseudorandom sequence subjected to the masking process corresponding to the first phase shift value of the first source pseudorandom sequence as a first target pseudorandom sequence; using the second source pseudorandom sequence subjected to mask processing corresponding to the first phase shift value of the second source pseudorandom sequence as a second target pseudorandom sequence; and performing modulo-2 sum operation on the first target pseudorandom sequence and the second target pseudorandom sequence to generate the target pseudorandom sequence.
In an alternative embodiment, the first source pseudo-random sequence and the second source pseudo-random sequence in the apparatus are m-sequences and the target pseudo-random sequence is a Gold sequence.
In an optional embodiment, the state transition matrix corresponding to the ith round in the apparatus is data that is calculated in advance and stored locally, or the state transition matrix corresponding to the ith round is data that is calculated in real time.
In summary, the embodiments of the present application can achieve an effect of automatically generating target pseudorandom sequences corresponding to different first phase shift values when a communication device needs target pseudorandom sequences corresponding to different phase shift values without changing a current software architecture and a current hardware structure. In the generating process, K1 iterations are performed on the initial mask to obtain a mask corresponding to the first phase shift value, where K1 is the number of bits of a binary number value equal to the first phase shift value, and finally, a target pseudorandom sequence is obtained through logical operation between the mask and a state column vector of the source pseudorandom sequence. According to the method for generating the pseudorandom sequence, the phase shift value can be obtained through parameter configuration, and therefore the method can support generation of the pseudorandom sequence with any phase shift. In the generation process, a useful pseudo-random sequence value after any phase shift can be directly calculated without generating a useless sequence value, the delay of the generation of a target pseudo-random sequence is reduced, the efficiency of generating the target pseudo-random sequence in real time under different phase shifts is improved, and the communication efficiency of the communication device is further improved.
Optionally, in the present application, the phase shift value may be obtained through parameter configuration, and it is not necessary to calculate and store a mask corresponding to each phase shift in advance, and it is not necessary to increase and consume huge memory resources, so that it is not necessary to change the current software architecture and hardware structure.
The present application further provides a computer-readable medium, which stores at least one instruction, where the at least one instruction is loaded and executed by a processor to implement the method for generating a pseudo-random sequence according to the above embodiments.
It should be noted that: in the above embodiment, when the apparatus for generating a pseudorandom sequence executes the method for generating a pseudorandom sequence, only the division of the above functional modules is used as an example, in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the pseudo-random sequence generation apparatus provided in the above embodiments and the pseudo-random sequence generation method embodiment belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiment and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the implementation of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (13)

1. A method for generating a pseudorandom sequence, the method comprising:
obtaining a first phase shift value Q configured for a source pseudorandom sequence1,Q1Is a positive integer;
shifting the first phase by a value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer;
k is carried out on the initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain the first phase shift value Q1Corresponding masks are obtained in the iteration mode, and the masks corresponding to the next round are obtained according to the masks corresponding to the current round and the state transition matrix;
by said first phase shift value Q1And generating a target pseudorandom sequence through logic operation between the corresponding mask and the state column vector of the source pseudorandom sequence.
2. The method of claim 1, wherein K is performed on an initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain the first phase shift value Q1A corresponding mask comprising:
when the ith round corresponds to the binary value Q2When the numerical value of the digit of (b) is 1, in the ith round of iteration, multiplying the mask corresponding to the ith round by the state transition matrix corresponding to the ith round to obtain the mask corresponding to the (i + 1) th round, wherein i is a natural number, and is less than or equal to K1-1;
When the binary value Q corresponding to the ith round is2When the value of the digit of (b) is 0, in the ith round of iteration, determining the mask corresponding to the ith round as the mask corresponding to the (i + 1) th round;
when i is equal to 0, the mask corresponding to the ith wheel is the initial mask, the state transition matrix corresponding to the ith wheel is an initial state transition matrix, the initial state transition matrix is a square matrix with the order of D, and D is a positive integer;
when i is equal to K1At 1, K1-1 round of corresponding masks is the first phase shift value Q1A corresponding mask.
3. The method of claim 2, further comprising: the source pseudorandom sequence is a sequence generated by D linear feedback shift registers, and the element values of the D-th row of the initial state transition matrix are multiplication coefficients corresponding to the linear feedback shift registers.
4. The method of claim 2, wherein said passing said first phase shift value Q1Generating a target pseudorandom sequence by logical operation between the corresponding mask and the state column vector of the source pseudorandom sequence, including:
shifting the first phase by a value Q1And multiplying the corresponding mask by the state column vector to generate a target bit of the target pseudorandom sequence.
5. The method of claim 2, further comprising:
according to the initial state transition matrix and the first phase shift value Q1Obtaining a first state transition matrix according to the corresponding mask, wherein the row number of the first state transition matrix is the parallelism P of the target pseudorandom sequence;
obtaining a second state transition matrix according to the parallelism P and the initial state transition matrix, wherein the second state transition matrix is the power P of the initial state transition matrix;
and processing the source pseudo-random sequence according to the first state transition matrix and the second state transition matrix to obtain the target pseudo-random sequence.
6. The method of claim 5, wherein said first phase shift value Q is based on said initial state transition matrix and said first phase shift value1Obtaining a first state transition matrix according to the corresponding mask, including:
phase shift value Q1And the mask corresponding to the + j is used as the jth row of the first state transition matrix, j is a natural number and j is less than or equal to P-1.
7. The method of claim 5, wherein processing the source pseudorandom sequence to obtain the target pseudorandom sequence according to the first state transition matrix and the second state transition matrix comprises:
carrying out X-1 times of iterative processing on the source pseudorandom sequence according to the second state transition matrix to generate an intermediate state sequence; wherein if L/P is an integer, then X is equal to L/P; if L/P is a non-integer, then X is equal to A, 0< A-L/P <1, A is a positive integer;
and multiplying the first state transition matrix by the intermediate state sequence to generate the target pseudorandom sequence.
8. The method according to any of claims 1 to 7, wherein said source pseudorandom sequence comprises at least a first source pseudorandom sequence and a second source pseudorandom sequence, said passing of said first phase shift value Q1Generating a target pseudorandom sequence by logical operation between the corresponding mask and the state column vector of the source pseudorandom sequence, including:
using the first source pseudorandom sequence subjected to mask processing corresponding to the first phase shift value of the first source pseudorandom sequence as a first target pseudorandom sequence;
using the second source pseudorandom sequence subjected to mask processing corresponding to the first phase shift value of the second source pseudorandom sequence as a second target pseudorandom sequence;
and performing modulo-2 sum operation on the first target pseudorandom sequence and the second target pseudorandom sequence to generate the target pseudorandom sequence.
9. The method of claim 8, wherein the first source pseudorandom sequence and the second source pseudorandom sequence are m-sequences and the target pseudorandom sequence is a Gold sequence.
10. The method according to any one of claims 2 to 7, wherein the state transition matrix corresponding to the ith round is data which is calculated in advance and stored locally, or the state transition matrix corresponding to the ith round is data which is calculated in real time.
11. An apparatus for generating a pseudo-random sequence, the apparatus comprising:
a parameter obtaining module for obtaining a first phase shift value Q configured for the source pseudorandom sequence1,Q1Is a positive integer;
a digital system conversion module for converting the first phase shift value Q1Conversion to binary value Q2,Q2Is the number of bits of K1,K1Is a positive integer;
a mask iteration module for performing K on the initial mask corresponding to the source pseudorandom sequence1Performing iteration to obtain the first phase shift value Q1Corresponding masks are obtained, and the iteration is to obtain the masks corresponding to the next round by the masks corresponding to the current round and the state transition matrix;
a sequence generation module for passing the first phase shift value Q1And generating a target pseudorandom sequence through logic operation between the corresponding mask and the state column vector of the source pseudorandom sequence.
12. A communications device comprising a processor, a memory coupled to the processor, and program instructions stored on the memory, the processor, when executing the program instructions, implementing a method of generating pseudorandom sequences as claimed in any one of claims 1 to 10.
13. A computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement the method of generating a pseudorandom sequence as claimed in any one of claims 1 to 10.
CN202011531712.8A 2020-12-22 2020-12-22 Method and device for generating pseudorandom sequence and storage medium Pending CN112579045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011531712.8A CN112579045A (en) 2020-12-22 2020-12-22 Method and device for generating pseudorandom sequence and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011531712.8A CN112579045A (en) 2020-12-22 2020-12-22 Method and device for generating pseudorandom sequence and storage medium

Publications (1)

Publication Number Publication Date
CN112579045A true CN112579045A (en) 2021-03-30

Family

ID=75139432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011531712.8A Pending CN112579045A (en) 2020-12-22 2020-12-22 Method and device for generating pseudorandom sequence and storage medium

Country Status (1)

Country Link
CN (1) CN112579045A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553386A (en) * 2022-04-24 2022-05-27 哲库科技(北京)有限公司 Sequence generation method and device and computer readable storage medium
CN115567183A (en) * 2022-09-29 2023-01-03 上海星思半导体有限责任公司 M sequence generation method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5532695A (en) * 1994-04-13 1996-07-02 Electronics And Telecommunications Research Institute Power of two length pseudorandom noise sequence generator
WO1999045670A2 (en) * 1998-03-05 1999-09-10 Koninklijke Philips Electronics N.V. Mask generating polynomials for pseudo-random noise generators
CN1328389A (en) * 2001-03-29 2001-12-26 深圳市中兴集成电路设计有限责任公司 Method for quickly generating pseudo-random code sequence synchronous with phase of base station
US20040220985A1 (en) * 2003-05-02 2004-11-04 Morris John R. System and method for producing functions for generating pseudo-random bit sequences
CN1914804A (en) * 2004-01-30 2007-02-14 国家科学研究中心 High-rate random bitstream generation
CN104113497A (en) * 2014-07-16 2014-10-22 西安交通大学 DAB (digital audio broadcasting) signal generating method and device
CN105262557A (en) * 2015-09-07 2016-01-20 东南大学 Method for generating pseudo-random sequences in LTE (Long Term Evolution) system
CN105391545A (en) * 2015-11-27 2016-03-09 东南大学 Method of generating pseudo-random sequence in LTE system
CN111694546A (en) * 2020-06-12 2020-09-22 成都海光集成电路设计有限公司 Method and device for generating pseudo-random binary sequence code
CN112019473A (en) * 2019-05-31 2020-12-01 华为技术有限公司 Method and device for generating sequence

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5532695A (en) * 1994-04-13 1996-07-02 Electronics And Telecommunications Research Institute Power of two length pseudorandom noise sequence generator
WO1999045670A2 (en) * 1998-03-05 1999-09-10 Koninklijke Philips Electronics N.V. Mask generating polynomials for pseudo-random noise generators
CN1328389A (en) * 2001-03-29 2001-12-26 深圳市中兴集成电路设计有限责任公司 Method for quickly generating pseudo-random code sequence synchronous with phase of base station
US20040220985A1 (en) * 2003-05-02 2004-11-04 Morris John R. System and method for producing functions for generating pseudo-random bit sequences
CN1914804A (en) * 2004-01-30 2007-02-14 国家科学研究中心 High-rate random bitstream generation
CN104113497A (en) * 2014-07-16 2014-10-22 西安交通大学 DAB (digital audio broadcasting) signal generating method and device
CN105262557A (en) * 2015-09-07 2016-01-20 东南大学 Method for generating pseudo-random sequences in LTE (Long Term Evolution) system
CN105391545A (en) * 2015-11-27 2016-03-09 东南大学 Method of generating pseudo-random sequence in LTE system
CN112019473A (en) * 2019-05-31 2020-12-01 华为技术有限公司 Method and device for generating sequence
CN111694546A (en) * 2020-06-12 2020-09-22 成都海光集成电路设计有限公司 Method and device for generating pseudo-random binary sequence code

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
张桂华等: "长伪随机序列实时相位快速计算算法研究", 信号与信息处理, vol. 36, no. 11, 31 December 2006 (2006-12-31) *
汪侃, 傅剑虹, 施惠昌: "一种二维混沌及其同步保密通信", 通信技术, no. 03, 30 April 2003 (2003-04-30) *
齐国元;胡玉庆;万彰凯;: "基于超混沌的伪随机数发生器的FPGA设计", 天津工业大学学报, no. 01, 2 March 2018 (2018-03-02) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553386A (en) * 2022-04-24 2022-05-27 哲库科技(北京)有限公司 Sequence generation method and device and computer readable storage medium
CN114553386B (en) * 2022-04-24 2023-03-10 哲库科技(北京)有限公司 Sequence generation method and device and computer readable storage medium
CN115567183A (en) * 2022-09-29 2023-01-03 上海星思半导体有限责任公司 M sequence generation method and device

Similar Documents

Publication Publication Date Title
CA2632857C (en) Closed galois field combination
CA2633858C (en) Mixed radix conversion with a priori defined statistical artifacts
US8139764B2 (en) Closed galois field cryptographic system
Güneysu et al. Towards lightweight identity-based encryption for the post-quantum-secure Internet of Things
CN102007717B (en) For the generation of the pseudo random sequence of OFDM cellular system
JP5564053B2 (en) Method for generating encryption key, network and computer program
WO2004112271A1 (en) Communication device and communication method
JP2012510754A (en) Method and apparatus for generating a pseudo-random sequence in a broadband wireless communication system
CN112579045A (en) Method and device for generating pseudorandom sequence and storage medium
CN109375897B (en) Method for generating pseudo-random sequence
CN112262544B (en) Device, system and method for generating and processing cryptographic parameters
CN111813374A (en) Method and device for generating pseudo-random sequence based on DSP (digital Signal processor), and storage medium
RU2577588C1 (en) Method and device for generating scrambling code
WO2019149180A1 (en) Interleaving method and interleaving device
US11539463B2 (en) Methods and computing device for facilitating multiple access in a wireless communication network
CN106664267B (en) Method and apparatus for decoding
CN108809323B (en) Method and device for generating cyclic redundancy check code
CN114553386B (en) Sequence generation method and device and computer readable storage medium
CN110661591A (en) Data processing method, apparatus and computer readable storage medium
EP1111785A1 (en) Method and device for self-clock controlled pseudo random noise (PN) sequence generation
CN113595672A (en) Modular implementation method based on 5G pseudo-random sequence
Khan et al. Secret key encryption model for Wireless Sensor Networks
Chen et al. Grant-Free Sparse Code Multiple Access for Uplink Massive Machine-Type Communications and Its Real-Time Receiver Design
CN114553505B (en) Method, device, storage medium and computing equipment for generating random numbers cooperatively by multiple parties
CN107846272B (en) Device and method for rapidly generating Golden sequence

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