[go: up one dir, main page]

CN111399804B - Random number generation method and device, intelligent mobile terminal and storage medium - Google Patents

Random number generation method and device, intelligent mobile terminal and storage medium Download PDF

Info

Publication number
CN111399804B
CN111399804B CN202010143913.4A CN202010143913A CN111399804B CN 111399804 B CN111399804 B CN 111399804B CN 202010143913 A CN202010143913 A CN 202010143913A CN 111399804 B CN111399804 B CN 111399804B
Authority
CN
China
Prior art keywords
random number
noise signal
original
intensity value
processing
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.)
Active
Application number
CN202010143913.4A
Other languages
Chinese (zh)
Other versions
CN111399804A (en
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.)
Chengdu Westone Information Industry Inc
Original Assignee
Chengdu Westone Information Industry Inc
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 Chengdu Westone Information Industry Inc filed Critical Chengdu Westone Information Industry Inc
Priority to CN202010143913.4A priority Critical patent/CN111399804B/en
Publication of CN111399804A publication Critical patent/CN111399804A/en
Application granted granted Critical
Publication of CN111399804B publication Critical patent/CN111399804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/588Random number generators, i.e. based on natural stochastic processes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The present disclosure relates to a random number generation method: acquiring the intensity value of a pilot channel signal in the current environment; a target noise signal is obtained according to the intensity value; and processing the target noise signal by utilizing a hash algorithm to obtain a random number. The basis for generating the random number is the intensity value of the pilot channel signal in the current environment, and the intensity value of the pilot channel signal is influenced by a plurality of factors existing in the actual scene, and the pilot channel signal has real randomness, so that the random number with real randomness, namely the real random number, can be generated on the basis. Compared with the prior art which can only generate pseudo random numbers, the scheme provided by the invention can enable the intelligent mobile terminal to provide true random numbers for applications with higher security requirements, and eliminates potential safety hazards caused by the use of pseudo random numbers. The disclosure also relates to a random number generation device, an intelligent mobile terminal and a readable storage medium, which have the same beneficial effects.

Description

Random number generation method and device, intelligent mobile terminal and storage medium
Technical Field
The disclosure relates to the technical field of random numbers, and in particular relates to a random number generation method, a random number generation device, an intelligent mobile terminal and a computer readable storage medium.
Background
With the development of modern computer technology and electronic information technology, a great number of ways for guaranteeing data security are emerging and developed. The most commonly used encryption algorithm and authentication algorithm and protocol are used for encrypting and authenticating data, in various encryption algorithms and authentication algorithms and protocols, the generation process of secret key, the operation process of encryption, the use of authentication algorithm and the execution of authentication protocol all need the participation of random number, and whether the parameter generated based on random number has truly security or not depends on whether random number has truly randomness or not.
In the use process of the intelligent mobile terminal, in order to ensure the security of various applications, the prior art generally generates random numbers in the following two ways: one is to add a special random number generation chip in the intelligent mobile terminal, namely, the random number is generated by the noise generated randomly by a noise generation circuit in the chip; the other is to generate the random number by means of a software algorithm. In the method of generating a random number using a random number generation chip, since it is based on physical circuit noise having true randomness, it can generate a random number having true randomness. However, the additional chips tend to occupy a small space of the intelligent mobile terminal and increase power consumption, and the motherboard needs to be redesigned, which is difficult and low in cost.
The method for generating the random number by using the software algorithm does not need to additionally add a random number generation chip, but the generated random number does not have real randomness. Because they are actually generated by a fixed, repeatable calculation method, while their longer repetition period makes the numbers they generate appear to have the statistical characteristics of true random numbers, they are not truly random in nature. In a very obvious example, random play options are seen in many music playing software, and after clicking, the next song should be a random one in the song list, and should not have any relation with the previous one and the next one. However, the actual experience is often that several songs are often randomized, while some songs seem never to be randomized, because the random numbers used are not true random numbers, but pseudo random numbers calculated by an algorithm.
While pseudo-random numbers are adequate for use in most scenarios, security concerns are buried for sensitive security applications. Therefore, how to provide a method for generating true random numbers by using a software algorithm is a problem to be solved by those skilled in the art for eliminating the potential safety hazard.
Disclosure of Invention
The main purpose of the present disclosure is to provide a method, an apparatus, an intelligent mobile terminal and a computer readable storage medium for generating a random number, which aims to provide a method for generating a true random number by using a software algorithm without adding a special random number generation chip, so as to eliminate the potential safety hazard caused by that the prior art can only generate a pseudo random number.
To achieve the above object, the present disclosure provides a random number generation method, including:
acquiring the intensity value of a pilot channel signal in the current environment;
a target noise signal is obtained according to the intensity value;
and processing the target noise signal by utilizing a hash algorithm to obtain a random number.
Optionally, obtaining the digital noise signal according to the intensity value includes:
performing digital quantization coding on the intensity value to obtain an original noise signal;
and performing entropy increase processing on the original noise signal to obtain the target noise signal.
Optionally, performing entropy processing on the original noise signal, including:
and performing exclusive OR operation on the two original noise signals with the obtained time intervals of a preset time length.
Optionally, performing entropy processing on the original noise signal, including:
and performing exclusive or operation on the two original noise signals with the preset quantity in the middle.
Optionally, performing entropy processing on the original noise signal, including:
and inserting the current time into the queue in which the original noise signals are arranged according to a preset inserting rule.
Optionally, the random number generation method further includes:
mixing the processed noise signal with each of the original noise signals; the processed noise is a noise signal obtained after exclusive OR operation or current time is inserted.
Optionally, processing the target noise signal using a hashing algorithm includes:
grouping each target noise signal which is continuously arranged according to the grouping length of the actually used hash algorithm to obtain a noise signal after grouping;
and inputting the noise signals after grouping as input signals into a hash algorithm which is actually used, and taking the output processing result as the random number.
To achieve the above object, the present disclosure also provides a random number generation apparatus, including:
the RSCP parameter acquisition unit is used for acquiring the intensity value of the pilot channel signal in the current environment;
a target noise signal generating unit for generating a target noise signal according to the intensity value;
and the random number generation unit is used for processing the target noise signal by utilizing a hash algorithm to obtain a random number.
Optionally, the target noise signal generating unit includes:
the digital quantization coding subunit is used for carrying out digital quantization coding on the intensity value to obtain an original noise signal;
and the entropy increase processing subunit is used for performing entropy increase processing on the original noise signal to obtain the target noise signal.
Optionally, the entropy adding unit includes:
and the time length exclusive OR operation module is used for carrying out exclusive OR operation on the two original noise signals with the obtained time intervals of a preset time length.
Optionally, the entropy adding unit includes:
and the quantity exclusive OR operation module is used for carrying out exclusive OR operation on the two original noise signals which are separated by a preset quantity.
Optionally, the entropy adding unit includes:
and the time inserting module is used for inserting the current time into the queue in which the original noise signals are arranged according to a preset inserting rule.
Optionally, the random number generating device further includes:
a noise signal mixing unit for mixing the processed noise signal with each of the original noise signals; the processed noise is a noise signal obtained after exclusive OR operation or current time is inserted.
Optionally, the random number generation unit includes:
a grouping subunit, configured to group each of the target noise signals that are continuously arranged according to a grouping length of the hash algorithm that is actually used, so as to obtain a noise signal after grouping;
and the hash algorithm operation subunit is used for inputting the noise signals after grouping as input signals into a hash algorithm which is actually used, and taking the output processing result as the random number.
To achieve the above object, the present disclosure further provides an intelligent mobile terminal, including:
a memory having a computer program stored thereon;
a processor for executing the computer program to implement the random number generation method as described in the foregoing.
To achieve the above object, the present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a random number generation method as described in the above.
The present disclosure provides a random number generation method: acquiring the intensity value of a pilot channel signal in the current environment; a target noise signal is obtained according to the intensity value; and processing the target noise signal by utilizing a hash algorithm to obtain a random number.
According to the technical scheme, the basis for generating the random number is the intensity value of the pilot channel signal in the current environment, and the intensity value of the pilot channel signal is influenced by a plurality of factors existing in the actual scene, so that the real randomness is realized, and the noise signal obtained on the basis of the intensity value with the real randomness can be used for generating the random number with the real randomness, namely the real random number with the help of a hash algorithm. Compared with the prior art which can only generate pseudo random numbers, the scheme provided by the present disclosure can enable the intelligent mobile terminal to provide true random numbers for various applications with higher security requirements. The disclosure also provides a random number generating device, an intelligent mobile terminal and a computer readable storage medium, which have the same beneficial effects and are not described herein.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present disclosure, and other drawings may be obtained according to the provided drawings without inventive effort to those of ordinary skill in the art.
Fig. 1 is a flowchart of a method for generating a random number according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method for generating random numbers according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of yet another method for generating random numbers provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of a random number generating device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an intelligent mobile terminal according to an embodiment of the present disclosure.
Detailed Description
The main purpose of the present disclosure is to provide a method, an apparatus, an intelligent mobile terminal and a computer readable storage medium for generating a random number, which aims to provide a method for generating a true random number by using a software algorithm without adding a special random number generation chip, so as to eliminate the potential safety hazard caused by that the prior art can only generate a pseudo random number.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of a method for generating a random number according to an embodiment of the present disclosure, which includes the following steps, and it should be noted that an execution subject of the following steps is a software algorithm in an intelligent mobile terminal:
s101: acquiring the intensity value of a pilot channel signal in the current environment;
the method aims at acquiring the intensity value of a pilot channel signal in the current environment of the intelligent mobile terminal. This intensity value is also commonly referred to as RSCP, which is fully spelled in english: received Signal Code Power, which is specifically a pilot channel, is nowadays commonly used as the strength of pilot channel signals received by smart mobile terminals (e.g. smartphones).
Wherein the pilot channel is used as a communication term, specifically to an unmodulated direct sequence spread spectrum signal continuously transmitted by each code division multiple access (CMDA, code Division Multiple Access) base station, the pilot channel enables the subscriber station to obtain a time limit for the forward code division multiple access channel and provides a coherent demodulation phase reference, and provides a signal strength comparison means for each base station to determine when to switch to another base station. The pilot channel is a signal that the intelligent mobile terminal will receive during the existing use process, and is mainly used today to switch the current intelligent mobile terminal to a suitable base station according to the difference of its intensity values, so as to provide better communication service for the intelligent mobile terminal through a more suitable base station.
The handover of the base station is performed because the intelligent mobile terminal tends to change its location along with the movement of the user to which it belongs. At present, coverage of mobile phone signals is in a unit of cells, so as to trigger the action of the smart phone to switch the base station to which the smart phone belongs from the base station of the cell A to the base station of the cell B along with the position from the vicinity of the cell A to the vicinity of the cell B. The closer the station is to the base station of the B cell, the larger the intensity value of the pilot channel from the base station of the B cell, and the smaller the intensity value of the pilot channel from the base station of the a cell.
The present embodiment obtains the intensity value of the pilot channel in order to generate a true random number by using the characteristics of the intensity value. Since the pilot channel, which is a special electromagnetic wave emitted from the base station, also has many characteristics of electromagnetic waves, is interfered by complex buildings and shields in actual scenes, the pilot channel may have complex direct, diffraction and reflection phenomena during the propagation process. Although the base station can be basically guaranteed to provide relatively stable communication service for users within a certain range from the base station, the intensity values of the pilot channels received by different smartphones at different positions are basically unpredictable, and even if the intensity values of the pilot channels received by the same smartphone at different times at the same position are also often greatly different (due to complex electromagnetic environment interference in a practical application scene). Based on the above, RSCP can be considered a time-varying random variable, i.e., the intensity value can be considered truly random.
S102: a target noise signal according to the intensity value;
on the basis of S101, this step aims at obtaining a target noise signal from the intensity value obtained as an acquisition, so that the subsequent step obtains a true random number based on the target noise signal. In particular, in order to facilitate subsequent processing of the intensity values, it is often necessary to process the intensity values into digital quantities using quantization coding techniques in this step, i.e. the resulting target noise signal is digital. There are many quantization coding techniques for digital quantities, and there are various standards, for example, RSCP with intensity values ranging from-120 to-90 can be equally divided into 256 according to the national standard, and coded into 0 to 255 correspondingly. But may also be performed according to other digital quantization standards adopted in practical application scenarios, and is not limited herein.
Furthermore, in order to avoid the situation that the intensity value does not have a real random number under the extreme condition (the external environment is not changed or very weak, and the position of the intelligent mobile terminal is not changed, and the probability of occurrence of the situation is very low in consideration of the external complex electromagnetic environment), so that the situation that the obtained target noise signal and the random number do not have the characteristic can occur, and the entropy increasing processing can be supplemented so that the finally obtained target noise signal can have the capability of generating the real random number.
Entropy, which itself is used as one of the parameters characterizing the state of a substance in thermodynamics, has its physical meaning as a measure of the degree of confusion of a system. Here, too, the degree of confusion in the context of the present disclosure will be expressed, and when a system is sufficiently chaotic, two values of a parameter that change with time will also satisfy the definition of a true random number (the latter number it generates has no relation to the former number), so the entropy increasing process then means a process of increasing the degree of confusion of the system, so that the final target noise signal is expected to satisfy the requirement of generating a true random number by the process of this way.
Specifically, the entropy increasing processing may be performed in various manners, for example, some operations are performed on any two or more intensity values, and for any two examples, the entropy increasing processing may be selected according to a time interval in which each intensity value is obtained, or may be selected according to the number of intervals between intensity values that are sequentially obtained, and further, the time interval or the number of intervals may be set to be variable. The operations may include, but are not limited to, exclusive-or operations, interpolation operations, sampling operations, and the like. Any way of increasing the degree of confusion of the system and providing the target noise signal with the capability of generating true random numbers can be used, and is not limited to the above-listed parts, i.e. some slightly modified schemes given under the guidance of the above ideas, all fall within the protection scope of the present disclosure.
S103: and processing the target noise signal by using a hash algorithm to obtain a random number.
On the basis of S102, this step aims to process the digital quantity target noise signal with a hashing algorithm so that it can output a truly random number, i.e. a true random number.
The Hash algorithm is also called Hash function (chinese called Hash function or Hash algorithm), and the algorithm/function can change an input message string with any length into an output string with a fixed length. I.e. the present application exploits this property of the hashing algorithm to generate random numbers of fixed length. Specifically, the Hash function can be subdivided into a plurality of specific functions according to different characteristics, for example, a Hash algorithm SM3 of the national standard can be directly adopted. Meanwhile, other hash algorithms can be selected on the basis of not affecting the aim to be achieved by the present disclosure, and are not listed here.
After the random number with true randomness is obtained, the intelligent mobile terminal can store the random number for operation of applications including but not limited to encryption algorithm key generation, key negotiation, random operation, communication two-party handshake protocol, various identity authentication, authority control and the like, and the potential safety hazard caused by reverse cracking of pseudo random numbers used by malicious personnel in the prior art can be effectively eliminated due to the true random number.
Based on the above technical solution, the basis for generating the random number in this embodiment is the intensity value of the pilot channel signal in the current environment, and the intensity value of the pilot channel signal is affected by many factors existing in the actual scene, which has true randomness, so that the noise signal obtained on the basis of the intensity value with true randomness can generate the random number with true randomness, that is, the true random number with the help of the hash algorithm. Compared with the prior art which can only generate pseudo random numbers, the scheme provided by the invention can enable the intelligent mobile terminal to provide true random numbers for various applications with higher security requirements, and eliminates potential safety hazards caused by using pseudo random numbers.
Example two
Referring to fig. 2, fig. 2 is a flowchart of another method for generating a random number according to an embodiment of the present disclosure, and compared with the first embodiment, the present embodiment mainly aims at providing a lower implementation manner of obtaining a target noise signal including an entropy increasing operation for S102, so as to prevent as far as possible that a problem that a true random number cannot be obtained based on the target noise signal in an extreme case, and includes the following steps:
s201: acquiring the intensity value of a pilot channel signal in the current environment;
s202: performing digital quantization coding on the intensity value to obtain an original noise signal;
s203: performing entropy increase processing on the original noise signal to obtain a target noise signal;
for S203, the present embodiment further provides several specific processing manners to achieve the effect of entropy increase:
mode 1: performing exclusive OR operation on the two original noise signals with the obtained time intervals of a preset time length;
mode 2: performing exclusive OR operation on the two original noise signals with the preset quantity of the two original noise signals at intervals;
mode 3: and inserting the current time into the queue in which the original noise signals are arranged according to a preset inserting rule.
The entropy increase is performed by selecting two original noise signals to perform an exclusive-or operation in both modes 1 and 2, and the increase of the degree of confusion is specifically performed in two aspects, namely, selecting two original noise signals which have no relation as far as possible to perform an operation, and using the characteristics of the exclusive-or operation to make the relation between the operation result and the original noise signals more complex. The difference between the mode 1 and the mode 2 is that which two original noises are selected, and the mode 1 is to avoid the two original noises with certain relevance obtained in the similar time period by separating the two original noise signals with preset time length; mode 2 is the same as mode 1 except that the mode is changed to be a mode in which the intervals are set to be a predetermined number. According to the specific application scene, the preset duration and the specific number of the preset number can be set to proper values by themselves.
Mode 3 is another processing mode different from mode 1/2, that is, the degree of confusion of the original noise signal is increased by inserting the current time which varies with time and does not have two identical values, specifically, the inserting mode and the selected inserting position can be set by themselves, and the present invention is not limited specifically.
It should be noted that the above-mentioned several modes are only three modes which are relatively simple and easy to implement, and the above-mentioned three modes can be independently existed to implement entropy increase, and also can be flexibly combined, and because the above-mentioned three modes do not involve causal relationship, in the course of combination, either one mode can be implemented first or later, and after several modes are implemented, the processed result can be undergone the operation of exclusive OR operation or operation of inserting current time, etc.
S204: and processing the target noise signal by using a hash algorithm to obtain a random number.
On the basis of the beneficial effects of the embodiment, the embodiment provides a lower implementation mode for obtaining the target noise signal, including entropy increase operation, through S202 and S203, so that with the help of the entropy increase processing mode, the problem that the true random number cannot be obtained based on the target noise signal under extreme conditions can be prevented as much as possible, and the generated random number is guaranteed to be the true random number.
Example III
Referring to fig. 3, fig. 3 is a flowchart of another random number generation method according to an embodiment of the present disclosure, and based on the second embodiment, the present embodiment is directed to providing a random number generation method including S304, so as to further increase the implementation manner of the confusion degree through the newly added S304, including the following steps:
s301: acquiring the intensity value of a pilot channel signal in the current environment;
s302: performing digital quantization coding on the intensity value to obtain an original noise signal;
s303: performing entropy increase processing on the original noise signal to obtain a processed noise signal;
s304: mixing the processed noise signals with each original noise signal to obtain target noise signals;
the processed noise signal is the noise signal obtained after the entropy processing in S303, and the specific entropy processing method can be seen from the explanation and description of the second pair of embodiments S203. The step further increases the degree of confusion of the storage pool storing each original noise signal by mixing the processed noise signal and the original noise signal, and can be regarded as another entropy increasing processing mode.
Specifically, the mixing manner may also be a plurality of manners, such as overall mixing, scattering mixing, adding specific values after mixing, or subtracting part of data, which is not limited herein.
S305: and processing the target noise signal by using a hash algorithm to obtain a random number.
On the basis of the beneficial effects of the second embodiment, the present embodiment further ensures that the target noise signal has true randomness through the added S304, so as to prevent the problem that the true random number cannot be obtained based on the target noise signal in extreme cases as far as possible from occurring, and ensure that the generated random number is the true random number.
In order to deepen understanding the invention point of the application, the disclosure further provides a specific implementation scheme in combination with a specific application scene:
firstly, under the starting-up state of the smart phone, RSCP is collected at regular time (for example, 100 times per second), and quantitative digital coding is carried out (256 equal divisions are carried out on the RSCP between-120 and-90, and corresponding RSCP value coding is between 0 and 255), so that an original noise signal is obtained. The raw noise signal is then stored into a raw noise memory of appropriate size (e.g., 64 KB);
then, after the original noise signal memory is full, carrying out exclusive OR operation on the noise signal overflowed in the queuing and the newly acquired original noise signal, and storing the result of the exclusive OR operation into the original noise memory;
then, each noise signal in the original noise memory is grouped according to the grouping length of the adopted hash algorithm, and the current time (1 byte)/minute (1 byte)/second (1 byte)/millisecond (2 bytes)) of the smart phone is inserted after the grouping is completed, so that the target noise is obtained.
Finally, the generated target noise is input into the hash function to carry out hash operation, and the value output by the hash function is stored as a random number into a random number memory with proper size (for example 64 KB) for standby. When the smart phone has any operation requiring random numbers, the smart phone can require the random numbers to be output and used in the random number memory.
Furthermore, when the random number memory is full, the execution of the steps can be stopped to save the consumption of electric quantity; when the random number memory is not full due to output, the execution is continued until the random number memory is full.
Because of the complexity of the case and the inability to set forth a list, those skilled in the art will recognize that many examples of the basic method principles provided in accordance with the present disclosure may exist without significant inventive effort, and should be within the scope of the present disclosure.
Referring to fig. 4, fig. 4 is a block diagram illustrating a structure of a random number generating device according to an embodiment of the disclosure, where the device may include:
an RSCP parameter obtaining unit 100, configured to obtain an intensity value of a pilot channel signal in a current environment;
a target noise signal generation unit 200 for generating a target noise signal according to the intensity value;
the random number generation unit 300 is configured to process the target noise signal by using a hash algorithm to obtain a random number.
Wherein, the target noise signal generation unit 200 may include:
the digital quantization coding subunit is used for carrying out digital quantization coding on the intensity value to obtain an original noise signal;
and the entropy increase processing subunit is used for performing entropy increase processing on the original noise signal to obtain a target noise signal.
Wherein the entropy processing subunit may include:
the time length exclusive OR operation module is used for carrying out exclusive OR operation on the two original noise signals with the obtained time intervals of a preset time length.
Wherein the entropy processing subunit may include:
the quantity exclusive-OR operation module is used for carrying out exclusive-OR operation on the two original noise signals which are separated by a preset quantity.
Wherein the entropy processing subunit may include:
and the time inserting module is used for inserting the current time into the queue in which the original noise signals are arranged according to a preset inserting rule.
Further, the random number generation device may further include:
the noise signal mixing unit is used for mixing the processed noise signals with the original noise signals; the processed noise is noise signal obtained after exclusive OR operation or current time insertion.
Wherein, the random number generation unit 300 may include:
a grouping subunit, configured to group each of the target noise signals that are continuously arranged according to a grouping length of the hash algorithm that is actually used, so as to obtain a noise signal after grouping;
the hash algorithm operation subunit is used for inputting the noise signals after grouping as input signals into a hash algorithm which is actually used, and taking the output processing result as a random number.
The present embodiment exists as an apparatus embodiment corresponding to the above method embodiment, and has all the advantages of the method embodiment, which are not described herein in detail.
Fig. 5 is a block diagram of an electronic device 700, according to an example embodiment. As shown in fig. 5, the electronic device 700 may include a processor 701 and a memory 702, and may further include one or more of a multimedia component 703, an information input/information output (I/O) interface 704, and a communication component 705.
Wherein the processor 701 is configured to control the overall operation of the electronic device 700 to perform all the steps in the random number generation method described above; the memory 702 is used to store various types of data to support operation on the electronic device 700, which may include, for example, instructions for any application or method operating on the electronic device 700, as well as application-related data. The Memory 702 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as one or more of static random access Memory (Static Random Access Memory, SRAM), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The multimedia component 703 can include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 702 or transmitted through the communication component 705. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near Field Communication, NFC for short), 2G, 3G or 4G, or a combination of one or more thereof, the corresponding communication component 705 may thus comprise: wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), digital signal processor (Digital Signal Processor, abbreviated as DSP), digital signal processing device (Digital Signal Processing Device, abbreviated as DSPD), programmable logic device (Programmable Logic Device, abbreviated as PLD), field programmable gate array (Field Programmable Gate Array, abbreviated as FPGA), controller, microcontroller, microprocessor, or other electronic component for performing the random number generation method as set forth in the above embodiments.
Specifically, the intelligent mobile terminal comprises, but is not limited to, a smart phone, a smart tablet computer, a smart watch and other terminal devices capable of acquiring RSCP.
In another exemplary embodiment, a computer readable storage medium storing program instructions that, when executed by a processor, will perform operations corresponding to the program instructions is also provided. For example, the computer readable storage medium may be the memory 702 including program instructions as described above, which are specifically executable by the processor 701 of the electronic device 700 to perform the random number generation method as given in the above embodiments.

Claims (5)

1. A method for generating a random number, comprising:
acquiring the intensity value of a pilot channel signal in the current environment;
performing digital quantization coding on the intensity value to obtain an original noise signal;
performing entropy increase processing on the original noise signal to obtain a target noise signal;
processing the target noise signal by utilizing a hash algorithm to obtain a random number;
the entropy increasing process is performed on the original noise signal, and the entropy increasing process comprises the following steps:
performing exclusive OR operation on the two original noise signals with the obtained time intervals of a preset time length;
performing exclusive or operation on the two original noise signals with the preset quantity of the two original noise signals;
inserting the current time into the queue in which the original noise signals are arranged according to a preset insertion rule;
the random number generation method further comprises the following steps:
mixing the processed noise signals with the original noise signals to obtain target noise signals; the processed noise is a noise signal obtained after exclusive OR operation or current time is inserted.
2. The random number generation method of claim 1, wherein processing the target noise signal using a hashing algorithm comprises:
grouping each target noise signal which is continuously arranged according to the grouping length of the actually used hash algorithm to obtain a noise signal after grouping;
and inputting the noise signals after grouping as input signals into a hash algorithm which is actually used, and taking the output processing result as the random number.
3. A random number generation apparatus, comprising:
the RSCP parameter acquisition unit is used for acquiring the intensity value of the pilot channel signal in the current environment;
the target noise signal generation unit comprises a digital quantization coding subunit and an entropy increasing processing subunit, wherein the digital quantization coding subunit is used for carrying out digital quantization coding on the intensity value to obtain an original noise signal; the entropy processing subunit is used for performing entropy processing on the original noise signal to obtain the target noise signal;
the entropy adding processing subunit is specifically configured to perform exclusive-or operation on two original noise signals obtained in a time interval of a preset duration; performing exclusive OR operation on the two original noise signals with the preset quantity of the two original noise signals at intervals; inserting the current time into the queue in which the original noise signals are arranged according to a preset insertion rule;
the noise signal mixing unit is used for mixing the processed noise signals with the original noise signals to obtain target noise signals; the noise after processing is a noise signal obtained after exclusive OR operation or current time is inserted;
and the random number generation unit is used for processing the target noise signal by utilizing a hash algorithm to obtain a random number.
4. An intelligent mobile terminal, characterized by comprising:
a memory for storing a computer program;
processor for implementing the random number generation method according to any one of claims 1 to 2 when executing the computer program.
5. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the random number generation method according to any of claims 1 to 2.
CN202010143913.4A 2020-03-04 2020-03-04 Random number generation method and device, intelligent mobile terminal and storage medium Active CN111399804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010143913.4A CN111399804B (en) 2020-03-04 2020-03-04 Random number generation method and device, intelligent mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010143913.4A CN111399804B (en) 2020-03-04 2020-03-04 Random number generation method and device, intelligent mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111399804A CN111399804A (en) 2020-07-10
CN111399804B true CN111399804B (en) 2023-07-25

Family

ID=71432187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010143913.4A Active CN111399804B (en) 2020-03-04 2020-03-04 Random number generation method and device, intelligent mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111399804B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112203327A (en) * 2020-09-22 2021-01-08 普联国际有限公司 BSS Color value generation method, device, medium and equipment based on communication equipment
CN112395561B (en) * 2020-11-25 2023-12-26 航天信息股份有限公司 Database fingerprint generation and verification method, device, storage medium and equipment
CN114281303B (en) * 2021-11-30 2024-05-17 宁波普瑞均胜汽车电子有限公司 Method and device for generating true random number
CN114201143B (en) * 2021-12-07 2025-03-04 北京京东方技术开发有限公司 Random number generation method, node and network system
CN114244397B (en) * 2022-02-25 2022-05-10 北京智芯微电子科技有限公司 Frequency hopping communication device, method, chip, transmitter and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1130451A (en) * 1994-07-13 1996-09-04 夸尔柯姆股份有限公司 Method and apparatus for simulating interference received by subscribers in spread spectrum communications system
CN1996974A (en) * 2006-12-15 2007-07-11 北京工业大学 Self-adapted channel estimate device and its method based on CDMA frequency expansion sequence
CN101884202A (en) * 2007-11-02 2010-11-10 诺基亚公司 OFDM synchronization using two pilot symbols with a predetermined frequency shift between each other
CN102484629A (en) * 2009-08-20 2012-05-30 高通股份有限公司 Apparatus and method of searching multi-carrier active set pilots
CN109683851A (en) * 2018-11-16 2019-04-26 深圳市先河系统技术有限公司 The generation method of random number, generating random number device, computer storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6661833B1 (en) * 2000-01-31 2003-12-09 Qualcomm Incorporated PN generators for spread spectrum communications systems
US8831658B2 (en) * 2010-11-05 2014-09-09 Qualcomm Incorporated Controlling application access to a network
US9490867B2 (en) * 2011-08-16 2016-11-08 Harris Corporation CDMA communications device and related methods
CN108345446B (en) * 2018-03-08 2021-08-10 太原理工大学 High-speed random number generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1130451A (en) * 1994-07-13 1996-09-04 夸尔柯姆股份有限公司 Method and apparatus for simulating interference received by subscribers in spread spectrum communications system
CN1996974A (en) * 2006-12-15 2007-07-11 北京工业大学 Self-adapted channel estimate device and its method based on CDMA frequency expansion sequence
CN101884202A (en) * 2007-11-02 2010-11-10 诺基亚公司 OFDM synchronization using two pilot symbols with a predetermined frequency shift between each other
CN102484629A (en) * 2009-08-20 2012-05-30 高通股份有限公司 Apparatus and method of searching multi-carrier active set pilots
CN109683851A (en) * 2018-11-16 2019-04-26 深圳市先河系统技术有限公司 The generation method of random number, generating random number device, computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An Investigation of Using Loop-Back Mechanism for Channel Reciprocity Enhancement in Secret Key Generation;Linning PENG等;《IEEE》;507-519 *
基于导频的同频噪声干扰对消技术;何方敏 等;《系统工程与电子技术》;992-998 *

Also Published As

Publication number Publication date
CN111399804A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111399804B (en) Random number generation method and device, intelligent mobile terminal and storage medium
CN110266480B (en) Data transmission method, device and storage medium
US20160044001A1 (en) Network-enabled device provisioning
CN108040355B (en) Network access method and system
KR20140030616A (en) Apparatus and method for remotely deleting important information
CN110611568B (en) Dynamic encryption and decryption method, device and equipment based on multiple encryption and decryption algorithms
CN108111464B (en) Data verification method and device
CN111193588B (en) Information processing method and device based on process and storage medium
CN113422679A (en) Key generation method, device and system, encryption method, electronic device and computer-readable storage medium
CN112003696A (en) SM9 key generation method, system, electronic equipment, device and storage medium
CN104700003A (en) File shell adding and shell removing method, device and system
CN105024807A (en) Data processing method and system
CN114553590A (en) Data transmission method and related equipment
CN105391468B (en) Method and device for controlling carrier aggregation function
Damasevicius et al. Energy consumption of hash functions
CN105554557A (en) Method for sharing of multimedia content, and user terminal
CN113037487A (en) File encryption data processing method and device
CN117278156B (en) Channel simulation method and device, storage medium and electronic equipment
CN111934933A (en) Method, device and equipment for intelligent door lock network distribution and storage medium
CN117768881A (en) Ranging positioning method, positioning system, chip and storage medium
CN109560918B (en) Method for generating NTRU key and terminal equipment
CN110880974A (en) Data communication method and device based on block chain network
CN111625278B (en) Source code file generation method and related equipment
KR20140116725A (en) Method and apparatus for block encryption algorithm
CN111026800B (en) Data export method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant