Pseudo-random number generation method and device based on deep learning and medium

Through a deep learning-based method, a hybrid entropy pool is generated using hardware noise and server environment data and input it into the deep learning model, solving the problem of the existing pseudo-random number generator returning to the initial state after the generation step, and realizing more unpredictable and safe pseudo-random number generation.

CN120010814APending Publication Date: 2025-05-16SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510094615.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing pseudo-random number generator will return to the initial state after a certain number of generation steps, resulting in insufficient periodicity and randomness of the generated pseudo-random number, and is highly dependent on seed values ​​and is weak in security.

Method used

Using a deep learning-based method, a basic entropy source and auxiliary entropy source are generated by collecting hardware noise and server environment data, and normalized and mixed through a hash algorithm to obtain a mixed entropy pool. The mixed entropy seeds are extracted from the mixed entropy pool and input them into the trained deep learning model to generate a sequence of pseudo-random numbers.

Benefits of technology

The generated pseudo-random number sequence is even more unpredictable, close to true randomness, and can dynamically adjust the characteristics of the generated pseudo-random number sequence to adapt to environmental changes and improve security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010814A_ABST
    Figure CN120010814A_ABST
Patent Text Reader

Abstract

The invention discloses a pseudo-random number generation method and device based on deep learning and a medium, and relates to the field of random number generation, the method comprises the following steps: collecting built-in hardware noise of a target system, and setting the built-in hardware noise as a basic entropy source; acquiring server environment data of the target system in real time, and generating an auxiliary entropy source based on the environment data; performing normalized mixing on the basic entropy source and the auxiliary entropy source to obtain a mixed entropy pool; extracting a mixed entropy seed from the mixed entropy pool, inputting the mixed entropy seed into a trained deep learning model, and generating a pseudo-random number sequence through the deep learning model; and converting the pseudo-random number sequence into uniform distribution based on a preset distribution sequence, and carrying out randomness test on the pseudo-random number sequence through a test tool. The method can better adapt to environmental changes through the training model, and can dynamically adjust the characteristics of the generated pseudo-random number sequence according to the input data, thereby generating the pseudo-random number better meeting the current environment and application requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of random number generation, and in particular to a method, device and medium for generating pseudo-random numbers based on deep learning. Background Art

[0002] Pseudo-random numbers are random number sequences from a uniform distribution between [0,1] calculated using a deterministic algorithm. Although they are not truly random, they have statistical characteristics similar to random numbers, such as uniformity and independence. If the initial value (seed) used does not change, the sequence of pseudo-random numbers will also remain unchanged. In addition, pseudo-random number generation algorithms usually use fewer hardware resources and have higher generation efficiency than random number generation algorithms. With the widespread development of pseudo-random numbers in cryptography, scientific simulation, financial modeling, artificial intelligence, network security and other fields, pseudo-random number generation methods have also received increasing attention.

[0003] Existing pseudo-random number generation methods are usually implemented using a pseudo-random number generator. However, the pseudo-random number generator is based on an algorithm and will return to the initial state after a certain number of generation steps, repeatedly generating the same random number sequence, causing the generated pseudo-random numbers to have problems of periodicity and lack of randomness. In addition, the pseudo-random generator is highly dependent on the seed value, making the generated pseudo-random numbers weak in security. Once the seed is leaked or guessed, the attacker can completely reproduce the pseudo-random sequence. Summary of the invention

[0004] In order to solve the above problems, this application proposes a pseudo-random number generation method based on deep learning, including:

[0005] Collecting built-in hardware noise of a target system, and setting the built-in hardware noise as a basic entropy source;

[0006] Acquire server environment data of the target system in real time, and generate an auxiliary entropy source based on the environment data;

[0007] The basic entropy source and the auxiliary entropy source are normalized and mixed by a hash algorithm to obtain a mixed entropy pool;

[0008] Extracting a mixed entropy seed from the mixed entropy pool, inputting the mixed entropy seed into a trained deep learning model, and generating a pseudo-random number sequence through the deep learning model;

[0009] The pseudo-random number sequence is converted into a uniform distribution based on a preset distribution sequence, and a randomness test is performed on the pseudo-random sequence after the uniform distribution through a test tool.

[0010] On the other hand, the present application also proposes a pseudo-random number generation device based on deep learning, comprising:

[0011] at least one processor; and,

[0012] a memory communicatively connected to the at least one processor; wherein,

[0013] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a pseudo-random number generation method based on deep learning as described in the above example.

[0014] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: a pseudo-random number generation method based on deep learning as described in the above example.

[0015] This application proposes a pseudo-random number generation method based on deep learning, which can bring the following beneficial effects:

[0016] Deep neural networks are used to learn complex random patterns, thereby generating random number sequences that are more unpredictable and more difficult to analyze. Deep learning models can automatically learn the implicit rules in large amounts of data without the need for manually designed rules or formulas, which makes the generated pseudo-random number sequences closer to true randomness.

[0017] Moreover, by training the model to better adapt to environmental changes, the characteristics of the generated pseudo-random number sequence can be dynamically adjusted according to the input data, thereby generating pseudo-random numbers that are more in line with the current environment and application requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 A schematic diagram of a flow chart of a pseudo-random number generation method based on deep learning in an embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of a pseudo-random number generation device based on deep learning in an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0022] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0023] like Figure 1 As shown, the embodiment of the present application provides a pseudo-random number generation method based on deep learning, including:

[0024] S101: Collecting the built-in hardware noise of the target system, and setting the built-in hardware noise as a basic entropy source.

[0025] Specifically, data is collected from a variety of data sources as entropy sources, and the entropy sources include basic entropy sources and auxiliary entropy sources. The basic entropy source is built-in hardware noise, including clock jitter, voltage fluctuation, sensor noise, etc.

[0026] Furthermore, through the time acquisition function, the current timestamp of the target device is obtained multiple times to determine the time interval between the current timestamps. According to the fluctuation of the time interval, the clock jitter in the current timestamp is extracted. The voltage value of the power supply of the target device is read through a digital converter. According to the fluctuation between adjacent voltage values, the voltage fluctuation in the voltage value is randomly extracted. The sensor data is obtained through the sensor interface to extract the noise in the sensor data.

[0027] It should be noted that the time acquisition function provided by the operating system is called to read the system timestamp multiple times, and the time interval is calculated by comparing the difference between adjacent timestamps. By determining different time intervals, the fluctuation of the difference between adjacent timestamps is obtained, and these fluctuations (differences in time intervals) are used as seeds for pseudo-random number generators. Low-level random data is collected using the system's hardware noise (such as clock jitter, voltage fluctuations, CPU thermal noise, memory jitter, sensor noise, etc.), and these data are combined and processed to generate entropy seeds. The entropy seed can then be used to drive the pseudo-random number generator to produce high-quality random numbers. The combination of different hardware noise sources and post-processing (such as hashing and mixing) can help improve the quality and unpredictability of generated random numbers.

[0028] S102: Acquire server environment data of the target system in real time, and generate an auxiliary entropy source based on the environment data.

[0029] Specifically, server environment data includes network traffic and user interaction logs as auxiliary entropy sources.

[0030] Furthermore, network packet capture tools such as tcpdump or Wireshark are used to capture network data packets of the target system in real time, and the network time interval between each network data packet is determined based on the length and timestamp of the network data packet. The user interaction log of the target system is obtained, and the user interaction time interval of the target system is determined based on the timestamp of the user interaction log. Based on the network time interval, the length of the network data packet and the user interaction time interval, an auxiliary entropy source is generated.

[0031] It should be noted that the number of bytes of each transmitted data packet will fluctuate due to network conditions, so the length of each data packet has different values ​​at different time points (for example, the number of bytes is: 65 bytes, 128 bytes, 1024 bytes; the data packet arrival time is: 13:45:03.123, 13:45:03.567), and the time interval between data packets, that is, the time difference between the arrival of each data packet (for example: 0.444 seconds) is usually random and affected by multiple factors such as network delay, bandwidth, router load, etc.

[0032] S103: performing normalized mixing on the basic entropy source and the auxiliary entropy source through a hash algorithm to obtain a mixed entropy pool.

[0033] Specifically, a hash algorithm (SHA256 algorithm is used in the embodiment of the present application) is used to perform hash conversion on each entropy seed in the basic entropy source and the auxiliary entropy source to obtain a corresponding hash value, and the data is normalized. Auxiliary identifiers are added to the hash values ​​based on preset rules, and mixed to obtain a mixed entropy pool. The formula is as follows: S seed =Hash(E hardware ,E environment )in,

[0034] E hardware is the basic entropy source, E environment is the auxiliary entropy source, S seed It is the seed for mixed entropy calculation, and Hash is the hash algorithm.

[0035] The identifier includes a time identifier and a scene identifier. Through the current timestamp function, the time identifier is added to the hash value based on the current timestamp, and the scene identifier is added to the hash value based on the system type of the target system. By adding identifiers, the context of the entropy seed is enriched to facilitate the generation of high-complexity pseudo-random sequences.

[0036] S104: extracting a mixed entropy seed from the mixed entropy pool, inputting the mixed entropy seed into a trained deep learning model, and generating a pseudo-random number sequence through the deep learning model.

[0037] Specifically, a mixed entropy seed is extracted from the mixed entropy pool, and the mixed entropy seed and the added time identifier and scene identifier are input into the trained deep learning model together. The mixed entropy seed is parsed by the deep learning model to obtain the context of the mixed entropy seed. The context of the mixed entropy seed is weighted based on the time identifier and scene identifier of the mixed entropy seed, and a pseudo-random sequence is generated according to the weighted context.

[0038] In the embodiment of the present application, the Qwen2 large model is used to implement it. After the data is input into the Qwen2 large model, the Qwen2 large model recognizes the entropy_seed in the input, and uses it as the source of "randomness" to promote the process of generating a pseudo-random sequence, and adds a time mark and a scene mark to weight the context of the mixed entropy seed. The Qwen2 large model will use its pre-trained autoregressive structure to gradually generate a highly complex pseudo-random number sequence through the input context, and each time a random number is generated, the model will predict the next number based on the current state and the previously generated results (historical state). Finally, the Qwen2 large model will output a series of pseudo-random numbers.

[0039] It should be noted that the deep neural network model of the Qwen2 large model is highly nonlinear and complex, which enables it to generate complex and unpredictable pseudo-random number sequences. The model not only generates values ​​based on the initial value of the seed, but also introduces information such as timestamps and scene identifiers to adjust the distribution and generation method of random numbers. Due to the introduction of scene identifiers and time identifiers, the random number sequences generated by the model may be different in different contexts. For example, the random numbers generated when the network load is high may show more volatility, while the random numbers generated when the network load is low may be relatively stable.

[0040] At the same time, in the model generation process, in order to enhance the unpredictability of pseudo-random number generation, a noise mechanism is introduced to simulate the disturbance of the external environment. In the embodiment of the present application, only temperature is used as the noise in the noise disturbance mechanism.

[0041] Specifically, the device temperature of the target system is collected through a temperature sensor, and a temperature sequence is obtained based on the temperature value and the collection time. The temperature sequence is preprocessed to normalize the value of the temperature or system load to a specific range (such as [0, 1] or [-1, 1]), so as to ensure that they will not have an excessive impact on the generation process. Here we use the temperature parameter to control the range of the pseudo-random sequence: Where T is the current temperature, x is the output of each large model, and X is the set of all outputs of the large model. The preprocessed temperature sequence is set as noise data and input into the trained deep learning model to adjust the pseudo-random sequence output by the deep learning model.

[0042] S105: Convert the pseudo-random number sequence into a uniform distribution based on a preset distribution sequence, and perform a randomness test on the pseudo-random number sequence after uniform distribution through a test tool.

[0043] Specifically, the random number sequence output by the large model is converted into a uniform distribution: U(a,b)=a+(ba)·R, where a and b are the minimum and maximum values ​​of the target interval, respectively. Here we take a=0 and b=1 to adjust the target distribution to a 0-1 uniform distribution.

[0044] Furthermore, the generated random number sequence is subjected to a randomness test through a testing tool, the uniformly distributed pseudo-random sequence is converted into a preset format and input into the testing tool to obtain a test result, and the test result is analyzed based on a preset standard to determine whether the pseudo-random sequence passes the test.

[0045] In an embodiment of the present application, the NIST SP800-22 test suite tool is used. The NIST SP800-22 test will output a report to evaluate whether the generated pseudo-random number sequence meets the preset standards, where the preset standards include the p-value: the statistical significance of the test. Usually, the p-value needs to be greater than a certain threshold (for example, 0.01) to consider that the sequence has passed the test.

[0046] It should be noted that if the pseudo-random number sequence fails the NIST SP800-22 test, the entropy source or model generation process is adjusted according to the specific reason for the test failure. Specifically, if the test results show that the frequency test or other statistical distribution-related tests fail, introduce more diverse entropy sources. For example, more environmental noise (such as input from different sensors, or network traffic data, etc.) can be added to provide richer randomness. If the noise data is insufficient, adding more noise disturbance sources, such as electromagnetic noise, hardware sensor data, etc., can make the model generate more complex and unpredictable sequences. On the other hand, the generation strategy of the model can be changed by adjusting the model parameters. When the test fails, dynamically adjust the entropy source or model parameters to improve the output quality.

[0047] Deep neural networks are used to learn complex random patterns, thereby generating random number sequences that are more unpredictable and more difficult to analyze. Deep learning models can automatically learn the implicit rules in large amounts of data without the need for manually designed rules or formulas, which makes the generated pseudo-random number sequences closer to true randomness.

[0048] Moreover, by training the model to better adapt to environmental changes, the characteristics of the generated pseudo-random number sequence can be dynamically adjusted according to the input data, thereby generating pseudo-random numbers that are more in line with the current environment and application requirements.

[0049] like Figure 2 As shown, the embodiment of the present application also proposes a pseudo-random number generation device based on deep learning, including:

[0050] at least one processor; and,

[0051] a memory communicatively connected to the at least one processor; wherein,

[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a pseudo-random number generation method based on deep learning as described in any of the above embodiments.

[0053] An embodiment of the present application also provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to be: a pseudo-random number generation method based on deep learning as described in any of the above embodiments.

[0054] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0055] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0056] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0057] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0058] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0060] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0061] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0062] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0063] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0064] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A pseudo-random number generation method based on deep learning, characterized in that: include: Collecting built-in hardware noise of a target system, and setting the built-in hardware noise as a basic entropy source; Acquire server environment data of the target system in real time, and generate an auxiliary entropy source based on the environment data; The basic entropy source and the auxiliary entropy source are normalized and mixed by a hash algorithm to obtain a mixed entropy pool; Extracting a mixed entropy seed from the mixed entropy pool, inputting the mixed entropy seed into a trained deep learning model, and generating a pseudo-random number sequence through the deep learning model; The pseudo-random number sequence is converted into a uniform distribution based on a preset distribution sequence, and a randomness test is performed on the pseudo-random sequence after the uniform distribution through a test tool.

2. The method for generating pseudo-random numbers based on deep learning according to claim 1, characterized in that: The built-in hardware noise includes clock jitter, voltage fluctuation, and sensor noise; The built-in hardware noise of the acquisition target system specifically includes: Acquire the current timestamp of the target device multiple times through a time acquisition function, determine the time interval between the current timestamps, and extract the clock jitter in the current timestamp according to the change fluctuation of the time interval; Reading the voltage value of the power supply of the target device through a digital converter, and randomly extracting voltage fluctuations in the voltage value according to the variation fluctuations between adjacent voltage values; Sensor data is acquired through a sensor interface, and noise in the sensor data is extracted.

3. The method for generating pseudo-random numbers based on deep learning according to claim 1, characterized in that: The server environment data includes network traffic and user interaction logs; The real-time acquisition of the environmental data of the target system and the generation of the auxiliary entropy source based on the environmental data specifically include: Capturing the network data packets of the target system in real time by using a network packet capture tool, and determining the network time interval between each of the network data packets based on the length and timestamp of the network data packets; Acquire a user interaction log of the target system, and determine a user interaction time interval of the target system based on a timestamp of the user interaction log; An auxiliary entropy source is generated based on the network time interval, the length of the network data packet, and the user interaction time interval.

4. The method for generating pseudo-random numbers based on deep learning according to claim 1, characterized in that: The step of normalizing and mixing the basic entropy source and the auxiliary entropy source by a hash algorithm to obtain a mixed entropy pool specifically includes: Performing hash conversion on each entropy seed in the basic entropy source and the auxiliary entropy source through a hash algorithm to obtain a corresponding hash value; Based on preset rules, an auxiliary identifier is added to the hash value, and mixed to obtain a mixed entropy pool.

5. The method for generating pseudo-random numbers based on deep learning according to claim 4, characterized in that: The identifier includes a time identifier and a scene identifier. The adding an auxiliary identifier to the hash value based on a preset rule specifically includes: By using a current timestamp function, adding a time stamp to the hash value based on the current timestamp; And based on the system type of the target system, a scenario identifier is added to the hash value.

6. The method for generating pseudo-random numbers based on deep learning according to claim 5, characterized in that: The step of inputting the mixed entropy seed into a trained deep learning model and generating a pseudo-random number sequence through the deep learning model specifically includes: Inputting the mixed entropy seed into a trained deep learning model, parsing the mixed entropy seed through the deep learning model, and obtaining a context of the mixed entropy seed; and weighting the context of the mixed entropy seed based on the time identifier and the scene identifier of the mixed entropy seed; Generate a pseudo-random sequence based on the weighted context.

7. The method for generating pseudo-random numbers based on deep learning according to claim 6, characterized in that: The method further comprises: Collecting the device temperature of the target system through a temperature sensor, and obtaining a temperature sequence based on the temperature value and the collection time; The temperature sequence is preprocessed, the preprocessed temperature sequence is set as noise data, and is input into a trained deep learning model, and the pseudo-random sequence output by the deep learning model is adjusted.

8. The method for generating pseudo-random numbers based on deep learning according to claim 1, characterized in that: The randomness test of the pseudo-random sequence after uniform distribution is performed by the test tool, specifically including: Convert the uniformly distributed pseudo-random sequence into a preset format, input it into the test tool, and obtain the test result; The test result is analyzed based on a preset standard to determine whether the pseudo-random sequence passes the test.

9. A pseudo-random number generation device based on deep learning, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a pseudo-random number generation method based on deep learning as described in any one of claims 1 to 8.

10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are set to: a pseudo-random number generation method based on deep learning as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Encryption method and system for data collected by shared oxygen enrichment instrument

    CN120825338A

  • Internet of Things intelligent terminal security password verification method, system, medium and equipment

    CN121000395A

  • Random number testing method and device for quantum random source chip and terminal equipment

    CN121684090A