Block chain random number generation method and device, equipment, medium and program product
By using a target neural network model to generate random numbers in the blockchain and updating the model parameters after each generation, the problem of insecurity in blockchain random number generation is solved, the randomness and security of random numbers are improved, and the security risks of the blockchain are reduced.
Patent Information
- Application Number
- CN202511119811.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-25
AI Technical Summary
The randomness and security of blockchain random number generation in existing technologies are not high, which leads to security risks in blockchain.
Random numbers are generated using a target neural network model, and the model's internal parameters are updated after each generation operation to improve the randomness and security of the random numbers.
By dynamically updating the internal parameters of the target neural network model, the security and randomness of the generated random numbers are improved, thereby reducing the security risks of the blockchain.
Smart Images

Figure CN121008774A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a blockchain random number generation method, apparatus, device, medium, and program product. Background Technology
[0002] With the continuous development of technologies such as the internet and computers, the application of blockchain technology is becoming increasingly widespread. In blockchain technology, random numbers can be applied in multiple scenarios, bringing unpredictable characteristics to the blockchain system and improving information security.
[0003] In related technologies, the generation of random numbers in blockchain is usually based on traditional random number generation mechanisms, such as Verifiable Random Function (VRF) and Threshold Signature Scheme.
[0004] However, the randomness and security of random numbers generated in existing technologies are not high, which leads to certain security risks in blockchain. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and program product for generating random numbers for blockchain, which can improve the security and randomness of the generated random numbers for blockchain and reduce the security risks of blockchain.
[0006] In a first aspect, embodiments of this application provide a blockchain random number generation method, including:
[0007] Obtain the data to be processed, which is random data;
[0008] The data to be processed is input into the target neural network model, which then performs a random number generation operation to obtain a target random number for blockchain.
[0009] The internal parameters of the target neural network model are updated so that the next random number generation operation is based on the updated target neural network model to obtain the target random number, thereby enhancing the randomness of the target random number obtained based on the target neural network model.
[0010] Secondly, embodiments of this application provide a blockchain random number generation device, comprising:
[0011] The acquisition module is used to acquire data to be processed, wherein the data to be processed is random data;
[0012] An execution module is used to input the data to be processed into the target neural network model, so that the target neural network model performs a random number generation operation to obtain a target random number for blockchain;
[0013] An update module is used to update the internal parameters of the target neural network model so that the next random number generation operation is based on the updated target neural network model to obtain the target random number, thereby enhancing the randomness of the target random number obtained based on the target neural network model.
[0014] Thirdly, embodiments of this application provide a blockchain random number generation device, including: a memory and a processor;
[0015] The memory stores computer-executed instructions;
[0016] The processor executes computer execution instructions stored in the memory, causing the processor to perform the blockchain random number generation method as described in any of the first aspects above.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the blockchain random number generation method described in any of the first aspects above.
[0018] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the blockchain random number generation method as described in any of the first aspects above.
[0019] The blockchain random number generation method, apparatus, device, medium, and program products provided in this application embodiment involve acquiring data to be processed, inputting the data into a target neural network model, causing the target neural network model to perform a random number generation operation to obtain a target random number; and after the random number generation operation is completed, updating the internal parameters of the target neural network model so that the next random number generation operation is based on the updated target neural network model to obtain the target random number. In this application, the electronic device updates the internal parameters of the target neural network model after each random number generation operation, ensuring that each random number generation operation is based on the previously updated target neural network model. This dynamic updating of the internal parameters of the target neural network model improves its randomness, thereby enhancing the security and randomness of the random numbers generated based on the target neural network model. Therefore, when the generated random numbers with higher randomness are applied to the blockchain, it can effectively reduce the security risks of the blockchain. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 A flowchart illustrating a blockchain random number generation method provided in this application;
[0022] Figure 2 A flowchart illustrating another blockchain random number generation method provided in this application;
[0023] Figure 3 A schematic diagram of a blockchain random number generation device provided in this application;
[0024] Figure 4 This is a schematic diagram of the structure of a blockchain random number generation device provided in this application.
[0025] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions of this application, the application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments and drawings described herein are merely for explaining this application and are not intended to limit this application.
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0028] Furthermore, the technical solution involved in this application, which performs blockchain analysis on user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and uses artificial intelligence technology to make automated decisions, and makes decisions that have a significant impact on personal rights based on the results of the automated decisions, provides users with corresponding operation entry points for users to choose to agree to or reject the results of the automated decisions; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0029] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0030] It should be noted that the blockchain random number generation method, apparatus, device, medium and program products of this application can be used in the field of blockchain technology, or in any field other than blockchain technology. This application does not limit the specific application field of the blockchain random number generation method, apparatus, device, medium and program products.
[0031] With the continuous development of computer and internet technologies, the application of blockchain technology is becoming increasingly widespread. Blockchain is a distributed ledger technology that connects data blocks in an orderly manner and uses cryptography to ensure its immutability and unforgeability. Transaction confirmation on the blockchain is completed jointly by all nodes on the blockchain, and its consistency is guaranteed by a consensus algorithm. Blockchain random numbers refer to the real-time random data used in the blockchain system.
[0032] In blockchain technology, random numbers can be used in various scenarios, such as the selection of voting nodes, consensus nodes, and the scheduling of computing power networks, as well as for random rewards, private key generation, and quiz applications. They bring unpredictability to the system, enhance information security, and ensure the fairness and impartiality of various voting processes, making the entire blockchain system more secure and reliable. A random number is a special type of data defined mathematically; it is a value or data sequence in which each data point is unpredictable, and its value or sequence cannot be precisely predicted by any deterministic process.
[0033] In related technologies, random number generation in blockchains is typically based on traditional random number generation mechanisms, such as Verifiable Random Functions (VRFs), Threshold Signature Schemes, or block producers using the hash values of one or more blocks in the blockchain as their random number seeds. This method of random number generation is relatively simple and direct, resulting in low randomness and security of the generated random numbers. When applied to blockchains, this leads to certain security vulnerabilities.
[0034] To address the aforementioned issues, this application provides a blockchain random number generation method, apparatus, device, medium, and program product. After acquiring data to be processed, the data is input into a target neural network model, causing the model to perform a random number generation operation to obtain a target random number. After the random number generation operation is completed, the internal parameters of the target neural network model are updated, ensuring that the next random number generation operation is based on the updated model. In this application, the electronic device updates the internal parameters of the target neural network model after each random number generation operation, ensuring that each operation is based on the previously updated model. This dynamic updating of the model's internal parameters improves its randomness, thereby enhancing the security and randomness of the generated random numbers. Therefore, when these more random numbers are applied to a blockchain, it effectively reduces the blockchain's security risks.
[0035] The following detailed description of the solution presented in this application is provided through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; identical or similar content will not be repeated in different embodiments.
[0036] Figure 1 This is a flowchart illustrating a blockchain random number generation method provided in this application. Please refer to [link / reference]. Figure 1 The blockchain random number generation method may include:
[0037] S101. Obtain the data to be processed, wherein the data to be processed is random number data.
[0038] The execution subject of this application embodiment can be an electronic device, such as a mobile phone, computer, or wearable device, or a blockchain random number generation device installed in the electronic device. The blockchain random number generation device can be implemented through software or a combination of software and hardware. For ease of understanding, the following description uses an electronic device as the execution subject.
[0039] In this embodiment, the data to be processed can refer to the input data used to generate blockchain random numbers. Specifically, it can include at least one type of random data, such as the current time, device temperature, device voltage, device fan speed, and basic pseudo-random numbers. Of course, the data to be processed can also include other random data.
[0040] S102. Input the data to be processed obtained in S101 into the target neural network model, so that the target neural network model performs a random number generation operation to obtain the target random number.
[0041] Specifically, after initializing the target neural network, the electronic device can input the data to be processed into the target neural network model. The target neural network model then calculates the data and outputs a target random number, which can improve the randomness and security of blockchain random number generation.
[0042] In this embodiment, the target neural network model can refer to a pre-configured neural network model, specifically a shallow convolutional neural network algorithm (LeNet), a large-scale deep convolutional neural network algorithm (AlexNet), a deep convolutional network (VGGNet), or a residual network (ResNet), etc. This embodiment does not limit the specific type of the target neural network model.
[0043] In this embodiment, the first target random number generated by the target neural network can refer to the random number generated by the target neural network model. In this embodiment, the lengths of the first and second target random numbers can be preset lengths, which can be determined based on actual needs; this embodiment does not limit this.
[0044] In one embodiment, before inputting the data to be processed into the target neural network model, the electronic device can first initialize the target neural network model. Specifically, it can initialize the network structure of the target neural network model, such as initializing the network layers such as convolutional layers and fully connected layers in the target neural network model. At the same time, it can determine the initial parameters such as the weights of each network layer. Subsequently, it can generate blockchain random numbers based on the initialized target neural network model.
[0045] S103. After the random number generation operation in S102 is completed, the electronic device can update the internal parameters of the target neural network model. Once the internal parameters of the target neural network model are updated, the electronic device can obtain the target random number based on the updated target neural network model when it receives the data to be processed next time.
[0046] In this embodiment of the application, internal parameters may refer to parameters such as the weight coefficients of each network layer in the target neural network.
[0047] It is understandable that the electronic device executes steps S101-S103 each time it generates a random number. Furthermore, after each random number generation operation in S102, it updates the internal parameters of the target neural network model via S103, such as updating the convolution matrix, to obtain an updated target neural network model. Therefore, each time the electronic device performs the random number generation operation in S102, the target neural network model it is based on is the one that was previously updated. This ensures that the data input to the target neural network model during each random number generation operation is random, and the target neural network model is dynamically updated. This application improves the security and randomness of the generated blockchain random numbers through these two layers of randomness. When the generated random numbers with higher randomness are applied to the blockchain, the security risks of the blockchain can be effectively reduced.
[0048] In summary, the blockchain random number generation method provided in this application obtains the data to be processed, inputs the data into a target neural network model, and enables the target neural network model to perform a random number generation operation to obtain a target random number. After the random number generation operation is completed, the internal parameters of the target neural network model are updated so that the next random number generation operation is based on the updated target neural network model to obtain the target random number. This improves the randomness of the target neural network model, thereby improving the security and randomness of the random numbers generated based on the target neural network model. Therefore, when the generated random numbers with higher randomness are applied to the blockchain, the security risks of the blockchain can be effectively reduced.
[0049] Based on the above embodiments, Figure 2 A flowchart illustrating another blockchain random number generation method provided in this application. Please refer to [link / reference]. Figure 2 The blockchain random number generation method may include:
[0050] S201. Initialize the network structure of the target neural network model; the network structure includes multiple network layers; determine the initial parameters of each network layer.
[0051] In this embodiment, the network structure can refer to the internal network structure of the target neural network model, which includes multiple network layers, such as convolutional layers and fully connected layers. The initial parameters can refer to internal parameters such as the initial weight coefficients in the network layers.
[0052] Specifically, the electronic device can initialize the network structure of the target neural network model, determining the network's hierarchical structure (e.g., input layer, hidden layers, and output layer), the number of neurons in each layer, and the activation function. Then, the electronic device can determine the initial parameters of each network layer, either randomly or based on a Gaussian or uniform distribution. In this way, by initializing the network structure of the target neural network model and determining the initial parameters of each network layer, the electronic device can ensure the reliability of the target neural network model and guarantee the normal and rapid generation of blockchain random numbers.
[0053] In one possible implementation, the target neural network model is a convolutional neural network model.
[0054] In this embodiment, the target neural network model in the electronic device can specifically refer to a Convolutional Neural Network (CNN) model. As a deep learning algorithm, the CNN is a feedforward neural network that includes convolutional computation and has a deep structure. Thus, in this embodiment, the electronic device uses the convolutional algorithm within the CNN model to generate blockchain random numbers, thereby improving the security and randomness of blockchain random number generation.
[0055] S202. Obtain the data to be processed and input it into the target neural network model. Then, perform a random number generation operation through the target neural network model to obtain the target random number.
[0056] In one possible implementation, the data to be processed includes at least one of the following: current time, device temperature, device voltage, fan speed, and basic pseudo-random number.
[0057] In this embodiment, the data to be processed may include at least one type of random data. For example, the data to be processed may include at least one of the following: current time, device temperature, device voltage, fan speed, and basic pseudo-random number. The current time may refer to the moment when a trigger command to perform a random number generation operation is received. The device temperature, device voltage, and fan speed may refer to the real-time temperature, real-time voltage, and real-time fan speed of the electronic device corresponding to the current time. The basic pseudo-random number may refer to a random number generated based on a pseudo-random number generation algorithm. Of course, the data to be processed may also include other types of random data, and this embodiment does not limit this.
[0058] In this application, the electronic device can obtain at least one of the following as data to be processed: current time, device temperature, device voltage, fan speed, and basic pseudo-random number, which can improve the randomness and security of blockchain random number generation.
[0059] S203. After each random number generation operation is completed, the internal parameters of the target neural network model are updated. First, the quantization method corresponding to the target neural network model is determined.
[0060] In this embodiment, quantization refers to the process of processing model data in a quantization device during actual model application to reduce model size, reduce computational and storage requirements, and improve model computation speed and efficiency. The quantization method refers to the specific model quantization method used by the target neural network in the quantization device. For example, the quantization method may include uniform quantization, logarithmic quantization, non-uniform quantization, or floating-point quantization. Specifically, the electronic device can determine the quantization method of the target neural network model in the quantization device based on user interaction, or it can determine the quantization method based on the comparison of model data.
[0061] S204. Obtain the internal parameters corresponding to the target neural network, and preprocess the internal parameters according to the quantization method to obtain intermediate parameters.
[0062] In this embodiment, preprocessing can refer to the initial processing of internal parameters, such as format conversion and standardization. Intermediate parameters can refer to the parameters obtained after preprocessing the internal parameters.
[0063] Specifically, since different quantization devices may use different formats for their internal parameters, when updating the target neural network model, the electronic device can first obtain the internal parameters corresponding to the target neural network, and determine the target format of the target neural network model in the quantization device based on the quantization method corresponding to the target neural network. Then, it can perform preprocessing such as format conversion on the obtained internal parameters according to the target format to obtain intermediate parameters. This can ensure the subsequent update processing of internal parameters.
[0064] S205. Update the intermediate parameters to obtain the target internal parameters, and generate the updated target neural network model based on the target internal parameters.
[0065] In this embodiment, the target intrinsic parameters can refer to the updated intrinsic parameters of the target neural network model. Specifically, after preprocessing the obtained intrinsic parameters to obtain intermediate parameters, the electronic device can update the intermediate parameters to obtain the target intrinsic parameters, and generate the updated target neural network model based on the target intrinsic parameters.
[0066] In this embodiment, the electronic device determines the quantization method corresponding to the target neural network, then obtains the corresponding internal parameters of the target neural network, and preprocesses these internal parameters according to the quantization method to obtain intermediate parameters. The electronic device then updates these intermediate parameters to obtain the target internal parameters, and generates an updated target neural network model based on these internal parameters. In this way, the electronic device obtains intermediate parameters by acquiring and preprocessing internal parameters, then updates these intermediate parameters to obtain updated internal parameters as the target internal parameters, and further generates an updated target neural network model. This allows the electronic device to combine the quantization method with the updating of internal parameters, achieving dynamic updating of the target neural network model's internal parameters, which can improve the randomness and security of blockchain random number generation.
[0067] In one possible implementation, updating the internal parameters of the target neural network model can be achieved in the following way:
[0068] Randomize the positions of the elements in the parameter matrix corresponding to the intrinsic parameters to obtain the target intrinsic parameters; and / or modify the element values in the parameter matrix corresponding to the intrinsic parameters to obtain the target intrinsic parameters.
[0069] In this embodiment, the parameter matrix can refer to a matrix composed of the internal parameters corresponding to the target neural network. The element position can refer to the row and column values of an element within the parameter matrix. The element value can refer to the specific numerical value of an element within the parameter matrix.
[0070] In this step, the electronic device can perform diffusion and / or scrambling operations when updating the internal parameters of the target neural network model. Diffusion involves the electronic device shuffling the element positions of the parameter matrix to obtain the target internal parameters, thus randomizing the element positions and achieving diffusion of the internal parameters. Scrambling involves the electronic device modifying the element values of the parameter matrix to obtain the target internal parameters, thus scrambling the parameter matrix. Specifically, this can involve modifying the element values of the parameter matrix based on chaotic algorithms, enabling flexible and random updates of the internal parameters.
[0071] It should be noted that when updating the internal parameters of the target neural network model, the electronic device can employ at least one of the diffusion operation and scrambling operation, or other update methods, which are not limited in this application embodiment. In this application embodiment, the electronic device achieves dynamic updating of the internal parameters by modifying the element values and / or element positions of the parameter matrix corresponding to the internal parameters. This improves the randomness of the internal parameter update, thereby enhancing the randomness and security of subsequent random number generation.
[0072] S206. Perform the next random number generation operation based on the updated target neural network model.
[0073] In this embodiment, after obtaining the updated target neural network model, the electronic device can input the data to be processed into the second target random number in the updated target neural network model when performing the next random number generation operation. Then, the electronic device can execute steps S203 to S206 again. After each random number generation operation is completed, the internal parameters of the target neural network model are updated again, and the next random number generation operation is performed based on the updated target neural network model to obtain the target random number, until the random number generation is complete. The random numbers generated in this embodiment can be applied to various scenarios that use random numbers, such as blockchain transaction node selection. Specific applications can be flexibly selected based on actual needs, and this embodiment does not limit this application.
[0074] In this embodiment, the electronic device generates blockchain random numbers based on a target neural network model. After each random number generation operation is completed, the internal parameters in the target neural network model can be dynamically adjusted, and the next random number generation operation can be performed based on the updated target neural network model. This ensures the security and reliability of random number generation, ensures the randomness of random numbers, and also reduces the security risks of the blockchain.
[0075] Figure 3 This is a schematic diagram of a blockchain random number generation device provided in this application. Please refer to [link / reference]. Figure 3 The blockchain random number generation device 30 may include:
[0076] Acquisition module 31 is used to acquire data to be processed, wherein the data to be processed is random data;
[0077] Execution module 32 is used to input the data to be processed into the target neural network model, so that the target neural network model performs a random number generation operation to obtain a target random number for blockchain;
[0078] The update module 33 is used to update the internal parameters of the target neural network model so that the next random number generation operation is based on the updated target neural network model to obtain the target random number, thereby enhancing the randomness of the target random number obtained based on the target neural network model.
[0079] In one possible implementation, execution module 32 is specifically used for:
[0080] Initialize the network structure of the target neural network model; the network structure includes multiple network layers.
[0081] Determine the initial parameters for each network layer.
[0082] In one possible implementation, the update module 33 is specifically used for:
[0083] Determine the quantization method corresponding to the target neural network model;
[0084] Obtain the intrinsic parameters corresponding to the target neural network, and preprocess the intrinsic parameters according to the quantization method to obtain intermediate parameters;
[0085] The intermediate parameters are updated to obtain the target intrinsic parameters, and the updated target neural network model is generated based on the target intrinsic parameters.
[0086] In one possible implementation, the update module 33 is specifically used for:
[0087] The element positions of the parameter matrix corresponding to the intrinsic parameters are randomized to obtain the target intrinsic parameters; and / or,
[0088] The target intrinsic parameters are obtained by modifying the element values of the parameter matrix corresponding to the intrinsic parameters.
[0089] In one possible implementation, the data to be processed includes at least one of the following: current time, device temperature, device voltage, fan speed, and basic pseudo-random number.
[0090] In one possible implementation, the target neural network model is a convolutional neural network model.
[0091] The blockchain random number generation device 30 provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0092] Figure 4 A schematic diagram of a blockchain random number generation device provided in this application. Please refer to [link / reference]. Figure 4 The blockchain random number generation device 40 may include a memory 41 and a processor 42. For example, the memory 41 and the processor 42 are interconnected via a bus 43.
[0093] Memory 41 is used to store program instructions;
[0094] The processor 42 is used to execute the program instructions stored in the memory to implement the blockchain random number generation method shown in the above embodiment.
[0095] Figure 4 The blockchain random number generation device 40 shown can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0096] This application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above-described blockchain random number generation method when executed by a processor.
[0097] This application embodiment may also provide a computer program product, including a computer program that, when executed by a processor, can implement the above-described blockchain random number generation method.
[0098] It should be noted that the processor mentioned in the embodiments of this application can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0099] It should be understood that the memory mentioned in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct RAM Bus RAM (DR RAM). It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) is integrated into the processor. It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0100] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0101] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0102] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0103] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0104] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. Each device and product can be applied to or integrated into a chip, chip module, or terminal device. For example, for devices and products applied to or integrated into a chip, each included module / chip can be implemented entirely using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining modules / units can be implemented using hardware methods such as circuits.
[0105] In this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". The terms "first", "second", etc., in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0106] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating random numbers in a blockchain, characterized in that, include: Obtain the data to be processed, which is random data; The data to be processed is input into the target neural network model, which then performs a random number generation operation to obtain a target random number for blockchain. The internal parameters of the target neural network model are updated so that the next random number generation operation is based on the updated target neural network model to obtain the target random number, thereby enhancing the randomness of the target random number obtained based on the target neural network model.
2. The method according to claim 1, characterized in that, The updating of the internal parameters of the target neural network model includes: Determine the quantization method corresponding to the target neural network model; Obtain the internal parameters corresponding to the target neural network, and preprocess the internal parameters according to the quantization method to obtain intermediate parameters; The intermediate parameters are updated to obtain the target intrinsic parameters, and the updated target neural network model is generated based on the target intrinsic parameters.
3. The method according to claim 1, characterized in that, The updating of the intrinsic parameters of the target neural network includes: The element positions of the parameter matrix corresponding to the intrinsic parameters are randomized to obtain the target intrinsic parameters; and / or, The target intrinsic parameters are obtained by modifying the element values of the parameter matrix corresponding to the intrinsic parameters.
4. The method according to claim 1, characterized in that, Before inputting the data to be processed into the target neural network model, the method further includes: Initialize the network structure of the target neural network model; the network structure includes multiple network layers; Determine the initial parameters for each of the network layers.
5. The method according to any one of claims 1 to 4, characterized in that, The data to be processed includes at least one of the following: current time, device temperature, device voltage, fan speed, and basic pseudo-random number.
6. The method according to any one of claims 1 to 4, characterized in that, The target neural network model is a convolutional neural network model.
7. A blockchain random number generation device, characterized in that, include: The acquisition module is used to acquire data to be processed, wherein the data to be processed is random data; An execution module is used to input the data to be processed into the target neural network model, so that the target neural network model performs a random number generation operation to obtain a target random number for blockchain; An update module is used to update the internal parameters of the target neural network model so that the next random number generation operation is based on the updated target neural network model to obtain the target random number, thereby enhancing the randomness of the target random number obtained based on the target neural network model.
8. A blockchain random number generation device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the blockchain random number generation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the blockchain random number generation method as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the blockchain random number generation method according to any one of claims 1 to 6.