Random number generation method, device, computer equipment and storage medium

By encoding and multiple calculations of the data related to the to-process project and the encryptor response data, random numbers with randomness and unpredictability are generated, which solves the predictability problem of traditional random number generation algorithms, improves security and guarantees High availability of services.

CN117667016BActive Publication Date: 2024-12-13CHINA LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311747193.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2024-12-13
Estimated Expiration
2043-12-19

AI Technical Summary

Technical Problem

Traditional random number generation algorithms are based on deterministic mathematical calculations or fixed seeds, resulting in the output being predictable to a certain extent, increasing security risks.

Method used

By determining the target encoded data based on the relevant data of the pending project and the encryptor response data, using the preset password hash algorithm for data conversion, combining the preset extraction indicators and character data for multiple operations to generate random, uninferiorable and Multi-bit random number that is not repeatable.

Benefits of technology

It improves the randomness and security of random numbers, avoids the front-end application thread pool occupation caused by slow response of hardware encryption machines, and ensures high service availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667016B_ABST
    Figure CN117667016B_ABST
Patent Text Reader

Abstract

The present application relates to a random number generation method, device, computer equipment and storage medium. The method comprises: determining target coded data according to the relevant data of the project to be processed and the response data of the encryption machine; performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence; performing multiple operations and processing according to preset extraction indicators, coded feature sequences and preset character data to obtain a target multi-digit random number. The method can generate random numbers with randomness, unpredictability and non-repeatability according to different project requirements, and can select a more efficient random number generation method based on the response data of the encryption machine, avoiding special situations such as slow response of the hardware encryption machine causing the front-end application thread pool to be occupied, thereby ensuring high availability of the service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a random number generation method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of the Internet, dynamic password authentication systems have emerged to meet the growing needs of operators, financial institutions and other enterprises in identity security authentication. These needs are concentrated in the fields of online banking identity authentication, online game identity authentication, mobile payment identity authentication, enterprise internal login authentication, and telecommunications self-operated business identity authentication. The emergence of dynamic password authentication systems has improved the protection of user identity security, helped enterprises effectively prevent the risk of identity theft and information leakage, and also promoted the security and reliability of Internet applications.

[0003] In conventional technologies, random number generation algorithms are mostly used to generate data sequences that appear to be random, and then the generated data sequences are used to generate encryption keys or authentication passwords to protect data security.

[0004] However, in traditional technologies, pseudo-random number generation algorithms are usually based on deterministic mathematical calculations or fixed seeds, which makes the output of the algorithm predictable to a certain extent. When an attacker obtains information about a part of the random number sequence, it is possible to infer the next random number, thereby exacerbating security risks. Summary of the invention

[0005] Based on this, it is necessary to provide a random number generation method, device, computer equipment, computer-readable storage medium and computer program product that can improve data randomness and data security in response to the above technical problems.

[0006] In a first aspect, the present application provides a random number generation method, comprising:

[0007] Determine the target encoding data according to the relevant data of the item to be processed and the response data of the encryption machine;

[0008] Performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence;

[0009] Multiple operations are performed based on preset extraction indicators, coding feature sequences and preset character data to obtain the target multi-digit random number.

[0010] In one embodiment, determining target encoding data according to the data related to the item to be processed and the response data of the encryption machine includes:

[0011] When receiving a project response request, send an encryption machine response request and record the encryption machine response time; wherein the project response request includes data related to the project to be processed;

[0012] Compare the response time of the encryption machine with the preset response threshold of the encryption machine to obtain a response comparison result;

[0013] The target coding data is determined based on the response comparison results and the data related to the items to be processed.

[0014] In one embodiment, determining target coding data based on the response comparison result and data related to the item to be processed includes:

[0015] When the response comparison result is that the response feedback data is obtained within the preset encryption machine response threshold, the recording of the encryption machine response time is ended;

[0016] Performing data preprocessing on the project-to-be-processed related data and the response feedback data to obtain first target coded data; wherein the project-to-be-processed related data includes the project-to-be-processed data and its corresponding timestamp data, and the response feedback data includes random data;

[0017] When the response comparison result is that the encryption machine response time exceeds the preset encryption machine response threshold, data preprocessing is performed on the data related to the project to be processed to obtain second target encoded data.

[0018] In one embodiment, data conversion is performed on target coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence, including:

[0019] Performing data preprocessing on the target coded data according to the preset cryptographic hash algorithm to obtain preprocessed coded data;

[0020] Data extraction is performed on the preprocessed coded data based on a preset random function to obtain a coding feature sequence.

[0021] In one embodiment, multiple operations are performed according to the preset extraction index, the coding feature sequence and the preset character data to obtain a target multi-digit random number, including:

[0022] Performing an operation execution judgment based on the number of operations completed and a preset operation processing threshold to obtain an execution judgment result;

[0023] When the execution judgment result is that the number of operations has not exceeded the preset operation processing threshold, the sequence extraction position of the current operation is determined based on the preset random number generation function;

[0024] Perform multiple operations according to the sequence extraction position of the current operation, the preset extraction index, the coding feature sequence and the preset character data to obtain the target random character of the current operation and update the number of operations;

[0025] Until the updated number of operations is equal to the preset operation processing threshold, the multiple target random characters are sorted based on the acquisition order to obtain the target multi-digit random number.

[0026] In one embodiment, multiple operations are performed according to the sequence extraction position, the encoding feature sequence and the preset character data of the current operation to obtain the target random character of the current operation and update the number of operations, including:

[0027] Extract data from the encoding feature sequence according to the sequence extraction position of the current operation and the preset extraction length to obtain the target partial sequence of the current operation;

[0028] Performing operation processing on the target partial sequence of the current operation based on a preset data processing algorithm to obtain target index data;

[0029] The target random character is determined according to the target index data, the preset mapping relationship and the preset dictionary table, and the current number of operations is updated.

[0030] In a second aspect, the present application also provides a random number generating device, comprising:

[0031] The coding selection module is used to determine the target coding data according to the relevant data of the project to be processed and the response data of the encryption machine;

[0032] A data processing module is used to perform data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence;

[0033] The character generation module is used to perform multiple operations based on preset extraction indicators, coding feature sequences and preset character data to obtain a target multi-digit random number.

[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0035] Determine the target encoding data according to the relevant data of the item to be processed and the response data of the encryption machine;

[0036] Performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence;

[0037] Multiple operations are performed according to the preset extraction index, coding feature sequence and preset dictionary table to obtain the target multi-digit random number.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0039] Determine the target encoding data according to the relevant data of the item to be processed and the response data of the encryption machine;

[0040] Performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence;

[0041] Multiple operations are performed based on preset extraction indicators, coding feature sequences and preset character data to obtain the target multi-digit random number.

[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0043] Determine the target encoding data according to the relevant data of the item to be processed and the response data of the encryption machine;

[0044] Performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence;

[0045] Multiple operations are performed based on preset extraction indicators, coding feature sequences and preset character data to obtain the target multi-digit random number.

[0046] The above-mentioned random number generation method, device, computer equipment, storage medium and computer program product, when receiving a project response request, extract the relevant data of the project to be processed from the project response request, and then perform data processing in combination with the encryption machine response data to obtain a coding feature sequence for generating a random number corresponding to the project to be processed, randomly obtain a partial sequence of a certain length from the coding feature sequence, convert the obtained partial sequence into an integer, perform arithmetic processing on the converted integer to obtain a query index, and search for the corresponding character in a preset dictionary table. After multiple cycles of operation, a random number of a certain length is obtained, and random numbers with randomness, unpredictability and non-repeatability can be generated according to different project requirements. A more efficient random number generation method can be selected based on the encryption machine response data to avoid special situations such as slow response of the hardware encryption machine causing the front-end application thread pool to be occupied, thereby ensuring high availability of the service. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A schematic diagram of a random number generation method according to an embodiment of the present invention;

[0049] Figure 2A schematic diagram of a process for obtaining random number generation in one embodiment;

[0050] Figure 3 is a structural block diagram of a random number generating device in one embodiment;

[0051] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] In one embodiment, Figure 1 As shown, a random number generation method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0054] Step 102, determining target encoding data based on the relevant data of the item to be processed and the encryption machine response data.

[0055] Among them, the encryption machine response data includes response feedback data.

[0056] Exemplarily, after obtaining the project response request, extract the project-related data to be processed from the project response request, wherein the project-related data to be processed includes the project data to be processed and its corresponding timestamp data. Send a response request to the encryption machine, and determine whether the encryption machine responds.

[0057] When the encryption machine responds, the encryption machine response data including the response feedback data is received, and then combined with the relevant data of the item to be processed to obtain the target encoded data.

[0058] Or when the encryption machine does not respond, the data related to the item to be processed is processed to obtain the target encoded data.

[0059] Step 104, performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coding feature sequence.

[0060] Exemplarily, after the target coding data is obtained, the feature value corresponding to the coding data is converted into a feature sequence, that is, a coding feature sequence.

[0061] Step 106, performing multiple operations based on the preset extraction index, the coding feature sequence and the preset character data to obtain a target multi-digit random number.

[0062] The preset extraction index includes a preset extraction length, and the preset character data includes a preset mapping relationship and a preset dictionary table.

[0063] Exemplarily, it is necessary to perform multiple operations on the coding feature sequence.

[0064] During each operation, a partial sequence is intercepted from the coding feature sequence based on a preset extraction index, and then the intercepted partial sequence is operated once to obtain a character index, and then the character data corresponding to the character index is searched in the preset character data.

[0065] After completing multiple operations, the obtained multiple character data are combined in sequence into a target multi-digit random number.

[0066] The above-mentioned random number generation method, when receiving a project response request, extracts the relevant data of the project to be processed from the project response request, and then performs data processing in combination with the encryption machine response data to obtain a coding feature sequence for generating a random number corresponding to the project to be processed, randomly obtains a partial sequence of a certain length from the coding feature sequence, converts the obtained partial sequence into an integer, performs arithmetic processing on the converted integer to obtain a query index, and searches for the corresponding character in a preset dictionary table. After multiple cycles, a random number of a certain length is obtained, and random numbers with randomness, unpredictability and non-repeatability can be generated according to different project requirements. A more efficient random number generation method can be selected based on the encryption machine response data to avoid special situations such as slow response of the hardware encryption machine causing the front-end application thread pool to be occupied, thereby ensuring high availability of the service.

[0067] In an exemplary embodiment, determining target encoding data according to the data related to the item to be processed and the encryption machine response data includes:

[0068] When receiving a project response request, an encryption machine response request is sent and the encryption machine response time is recorded; wherein the project response request includes data related to the project to be processed; the encryption machine response time is compared with a preset encryption machine response threshold to obtain a response comparison result; and the target coding data is determined based on the response comparison result and the data related to the project to be processed.

[0069] Exemplarily, after receiving the project response request, the project-related data to be processed is extracted from the project response request, and the response request is sent to the encryption machine and the response time is recorded. While recording the response time, it is determined whether the response time exceeds a preset encryption machine response threshold.

[0070] If the encryption machine response data sent by the encryption machine is received within the preset encryption response threshold, the encryption machine response data is combined with the relevant data of the project to be processed to obtain the target encoded data.

[0071] If no response feedback is received from the encryption machine within the preset encryption response threshold, data processing is performed on the data related to the project to be processed to obtain target encoded data.

[0072] In this embodiment, a more efficient random number generation method is selected based on the encryption machine response data, thereby avoiding the front-end application thread pool being occupied.

[0073] In an exemplary embodiment, determining target coding data based on the response comparison result and the data related to the item to be processed includes:

[0074] When the response comparison result is that the response feedback data is obtained within the preset encryption machine response threshold, the recording of the encryption machine response time is ended; data preprocessing is performed on the data related to the project to be processed and the response feedback data to obtain the first target encoded data; when the response comparison result is that the encryption machine response time exceeds the preset encryption machine response threshold, data preprocessing is performed on the data related to the project to be processed to obtain the second target encoded data.

[0075] The data related to the project to be processed includes the project data to be processed and its corresponding timestamp data, and the response feedback data includes random data.

[0076] Exemplarily, when the response feedback data is obtained within the preset encryption machine response threshold, the response feedback data is random data generated by the encryption machine, that is, a true random number. The to-be-processed related data, timestamp data and random data are concatenated to obtain the to-be-processed data for generating a multi-bit random number, that is, the first target encoded data.

[0077] When the encryption machine response time exceeds a preset encryption machine response threshold, the related data to be processed and the timestamp data are concatenated to obtain the data to be processed for generating a multi-bit random number, namely, the second target encoded data.

[0078] In this embodiment, a comparison is made between the preset encryption machine response threshold and the recorded response time to determine whether to receive the encryption machine response data, and then a more efficient random number generation method is selected, thereby avoiding the front-end application thread pool being occupied.

[0079] In an exemplary embodiment, data conversion is performed on target coded data according to a preset cryptographic hash algorithm to obtain a coding feature sequence, including:

[0080] The target coded data is preprocessed according to the preset cryptographic hash algorithm to obtain preprocessed coded data; and data extraction is performed on the preprocessed coded data based on a preset random function to obtain a coding feature sequence.

[0081] Exemplarily, after obtaining the target coded data, a preset cryptographic hashing algorithm is used to perform a hash calculation on it to obtain the characteristics of the target coded data and convert it into a feature sequence, i.e., preprocessing the coded data. Then, a preset random function is used to generate a random number, and a sequence of a certain length is extracted at the position corresponding to the random number in the feature sequence, i.e., the coded feature sequence. For example, if a 32-bit sequence needs to be extracted, the ThreadLocalRandom function is used to calculate the random number pos (pos<=256-32), and a 32-bit coded sequence is extracted from the random number pos.

[0082] In this embodiment, the integrity of the data can be verified quickly and accurately to ensure that the data has not been tampered with or damaged during transmission or storage.

[0083] In an exemplary embodiment, Figure 2 As shown, multiple operations are performed according to the preset extraction index, the coding feature sequence and the preset character data to obtain the target multi-digit random number, including the following steps 202 to 208. Among them:

[0084] Step 202, performing an operation execution judgment according to the number of operations completed and a preset operation processing threshold, and obtaining an execution judgment result.

[0085] Exemplarily, after obtaining the coding feature sequence, the number of operation processing times is determined based on the number of bits of the random number that needs to be sent.

[0086] Before each operation, the number of operations is compared with a preset operation threshold, that is, the preset number of operations. If it does not exceed the preset operation threshold, the coding feature sequence is operated once; if it exceeds the preset operation threshold, the operation is stopped.

[0087] Step 204 , when the execution judgment result is that the number of operations has not exceeded the preset operation processing threshold, the sequence extraction position of the current operation is determined based on the preset random number generation function.

[0088] Exemplarily, when the preset operation processing threshold is not exceeded, a random number generation function is used to obtain an extractable position of the current operation, that is, a sequence extraction position.

[0089] Step 206, performing multiple operations according to the sequence extraction position of the current operation, the preset extraction index, the coding feature sequence and the preset character data, obtaining the target random character of the current operation and updating the number of operations.

[0090] Among them, the preset extraction index includes a preset extraction length.

[0091] Exemplarily, after determining the extractable position of the coding feature sequence, a partial sequence is extracted from the extractable position of the current operation of the coding feature sequence based on a preset extraction index, for example, a 32-bit partial sequence is obtained from the extractable position of the 256-bit coding feature sequence. Then, the partial sequence is processed and the target random character of the current operation is obtained. After that, the number of operations is increased by one.

[0092] Step 208 , until the updated number of operations is equal to the preset operation processing threshold, the multiple target random characters are sorted based on the acquisition order to obtain a target multi-digit random number.

[0093] Exemplarily, after completing multiple calculations, multiple target random characters obtained by the multiple calculations are concatenated in the order of acquisition to obtain a target multi-digit random number.

[0094] In this embodiment, a partial sequence of a certain length is randomly obtained from the coding feature sequence, the obtained partial sequence is converted into an integer, the converted integer is processed to obtain a query index, and the corresponding character is looked up in a preset dictionary table. After multiple cycles, a random number of a certain length is obtained, which can generate random numbers that are random, unpredictable and non-repeatable according to different project requirements.

[0095] In an exemplary embodiment, multiple operations are performed according to the sequence extraction position, the coding feature sequence and the preset character data of the current operation to obtain the target random character of the current operation and update the number of operations, including:

[0096] Data is extracted from the coding feature sequence according to the sequence extraction position of the current operation and the preset extraction length to obtain the target partial sequence of the current operation; the target partial sequence of the current operation is processed based on the preset data processing algorithm to obtain the target index data; the target random character is determined according to the target index data, the preset mapping relationship and the preset dictionary table, and the current number of operations is updated.

[0097] The preset extraction index includes a preset extraction length, and the preset character data includes a preset mapping relationship and a preset dictionary table.

[0098] Exemplarily, a partial sequence of a certain length is extracted from the coding feature sequence based on the sequence extraction position, and then the partial sequence is converted into an integer. After that, the converted integer can be operated by, for example, modulo operation, remainder operation, etc. to obtain the target index data, and then the target random character corresponding to the target index data is searched in the preset dictionary table through the preset mapping relationship, and the number of operations is increased by one after the search is completed.

[0099] In this embodiment, a partial sequence of a certain length is randomly obtained from the coding feature sequence, the obtained partial sequence is converted into an integer, the converted integer is processed to obtain a query index, and the corresponding character is looked up in a preset dictionary table. Different combinations of random numbers can be obtained according to actual needs, thereby improving the randomness of the generated data.

[0100] In an exemplary embodiment, a random number generation method is provided, the method comprising the following steps:

[0101] When receiving a project response request, an encryption machine response request is sent and the encryption machine response time is recorded; wherein the project response request includes data related to the project to be processed.

[0102] The encryption machine response time is compared with a preset encryption machine response threshold to obtain a response comparison result.

[0103] When the response comparison result is that the response feedback data is obtained within the preset encryption machine response threshold, the recording of the encryption machine response duration ends.

[0104] Data preprocessing is performed on the project-related data to be processed and the response feedback data to obtain the first target coded data, wherein the project-related data to be processed includes the project data to be processed and its corresponding timestamp data, and the response feedback data includes random data.

[0105] When the response comparison result is that the encryption machine response time exceeds the preset encryption machine response threshold, data preprocessing is performed on the data related to the project to be processed to obtain second target encoded data.

[0106] Data preprocessing is performed on the target coded data to obtain preprocessed coded data.

[0107] The pre-processed coded data is divided into data blocks to obtain multiple coded data blocks.

[0108] A compression function is applied to each coded data block to obtain a function processing result.

[0109] A coding feature sequence is determined based on multiple function processing results.

[0110] After obtaining each target random character, an operation execution judgment is performed according to the number of operations performed and a preset operation processing threshold to obtain an execution judgment result.

[0111] When the execution judgment result is that the number of operations has not exceeded the preset operation processing threshold, the sequence extraction position of the current operation is determined based on the preset random number generation function.

[0112] Data is extracted from the coding feature sequence according to the sequence extraction position of the current operation and the preset extraction length to obtain the target partial sequence of the current operation.

[0113] Based on the preset data processing algorithm, the target partial sequence of the current operation is processed to obtain the target index data.

[0114] The target random character is determined according to the target index data, the preset mapping relationship and the preset dictionary table, and the current number of operations is updated.

[0115] Until the updated number of operations is equal to the preset operation processing threshold, the multiple target random characters are sorted based on the acquisition order to obtain the target multi-digit random number.

[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0117] Based on the same inventive concept, the embodiment of the present application also provides a random number generating device for implementing the random number generating method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more random number generating device embodiments provided below can refer to the limitations of the random number generating method above, and will not be repeated here.

[0118] In an exemplary embodiment, Figure 3 As shown, a random number generating device is provided, comprising: a code selection module 302, a data processing module 304 and a character generation module 306, wherein:

[0119] The code selection module 302 is used to determine the target code data according to the relevant data of the project to be processed and the encryption machine response data.

[0120] The data processing module 304 is used to perform data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence.

[0121] The character generation module 306 is used to perform multiple operations according to the preset extraction index, the coding feature sequence and the preset dictionary table to obtain a target multi-digit random number.

[0122] In an exemplary embodiment, the coding selection module 302 is also used to send an encryption machine response request and record the encryption machine response time when receiving a project response request; compare the encryption machine response time with a preset encryption machine response threshold to obtain a response comparison result; and determine the target coding data based on the response comparison result and the data related to the project to be processed.

[0123] In an exemplary embodiment, the code selection module 302 is further configured to end recording of the encryption machine response duration when the response comparison result is that the response feedback data is obtained within a preset encryption machine response threshold;

[0124] Data preprocessing is performed on the data related to the project to be processed and the response feedback data to obtain the first target coded data; when the response comparison result is that the encryption machine response time exceeds the preset encryption machine response threshold, data preprocessing is performed on the data related to the project to be processed to obtain the second target coded data.

[0125] In an exemplary embodiment, the data processing module 304 is further used to perform data preprocessing on the target coded data to obtain preprocessed coded data; divide the preprocessed coded data into data to obtain a plurality of coded data blocks; perform compression function processing on each coded data block to obtain a function processing result;

[0126] A coding feature sequence is determined based on multiple function processing results.

[0127] In an exemplary embodiment, the character generation module 306 is also used to perform an operation execution judgment based on the number of operations completed and a preset operation processing threshold after obtaining each target random character, and obtain an execution judgment result; when the execution judgment result is that the number of operations completed does not exceed the preset operation processing threshold, determine the sequence extraction position of the current operation based on the preset random number generation function; perform multiple operations based on the sequence extraction position of the current operation, preset extraction indicators, coding feature sequences and preset character data to obtain the target random character of the current operation and update the number of operations completed; until the updated number of operations completed is equal to the preset operation processing threshold, sort the multiple target random characters based on the acquisition order to obtain the target multi-digit random number.

[0128] In an exemplary embodiment, the character generation module 306 is also used to extract data from the coding feature sequence according to the sequence extraction position of the current operation and the preset extraction length to obtain the target partial sequence of the current operation; perform operation processing on the target partial sequence of the current operation based on the preset data processing algorithm to obtain target index data; determine the target random character according to the target index data, the preset mapping relationship and the preset dictionary table, and update the current number of operations.

[0129] Each module in the random number generating device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0130] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store project data to be processed and encryption machine response data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a random number generation method is implemented.

[0131] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0132] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0133] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0134] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0135] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0136] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0137] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0138] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A random number generation method, characterized in that: The method comprises: Determine the target encoding data according to the relevant data of the item to be processed and the response data of the encryption machine; Performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coded feature sequence; Perform multiple operations according to the preset extraction index, the coding feature sequence and the preset character data to obtain a target multi-digit random number; wherein the preset extraction index includes a preset extraction length, and the preset character data includes a preset mapping relationship and a preset dictionary table; The step of determining target encoding data according to the data related to the item to be processed and the response data of the encryption machine includes: When receiving a project response request, sending an encryption machine response request and recording the encryption machine response time; wherein the project response request includes data related to the project to be processed; Compare the response time of the encryption machine with a preset encryption machine response threshold to obtain a response comparison result; Determine target coding data based on the response comparison result and the data related to the item to be processed; The encryption machine response data includes response feedback data; the target encoding data is determined based on the response comparison result and the data related to the item to be processed, including: When the response comparison result is that the response feedback data is obtained within the preset encryption machine response threshold, the recording of the encryption machine response time is ended; Performing data preprocessing on the data related to the item to be processed and the response feedback data to obtain first target coded data; wherein the data related to the item to be processed includes the item to be processed data and its corresponding timestamp data, and the response feedback data includes random data; When the response comparison result is that the response time of the encryption machine exceeds the preset encryption machine response threshold, data preprocessing is performed on the data related to the item to be processed to obtain second target encoded data.

2. The method according to claim 1, characterized in that The step of performing data conversion on the target coded data according to a preset cryptographic hash algorithm to obtain a coding feature sequence includes: Performing data preprocessing on the target coded data according to the preset cryptographic hash algorithm to obtain preprocessed coded data; Data extraction is performed on the preprocessed coded data based on a preset random function to obtain a coding feature sequence.

3. The method according to claim 1, characterized in that The method of performing multiple operations based on the preset extraction index, the coding feature sequence and the preset character data to obtain a target multi-digit random number includes: Performing an operation execution judgment based on the number of operations completed and a preset operation processing threshold to obtain an execution judgment result; When the execution judgment result is that the number of operations has not exceeded the preset operation processing threshold, determining the sequence extraction position of the current operation based on the preset random number generation function; Perform multiple operations according to the sequence extraction position of the current operation, the preset extraction index, the coding feature sequence and the preset character data to obtain the target random character of the current operation and update the number of operations; Until the updated number of operations is equal to the preset operation processing threshold, the plurality of target random characters are sorted based on the acquisition order to obtain a target multi-digit random number.

4. The method according to claim 3, characterized in that The preset extraction index includes a preset extraction length; the preset character data includes a preset mapping relationship and a preset dictionary table; Perform multiple operations according to the sequence extraction position of the current operation, the coding feature sequence and the preset character data to obtain the target random character of the current operation and update the number of operations, including: Extract data from the coding feature sequence according to the sequence extraction position and the preset extraction length of the current operation to obtain the target partial sequence of the current operation; Performing operation processing on the target partial sequence of the current operation based on a preset data processing algorithm to obtain target index data; The target random character is determined according to the target index data, the preset mapping relationship and the preset dictionary table, and the current number of operations is updated.

5. A random number generating device, characterized in that: The device comprises: A coding selection module, used to determine target coding data according to the data related to the project to be processed and the encryptor response data; wherein the encryptor response data includes response feedback data; used to send an encryptor response request and record the encryptor response time when receiving a project response request; wherein the project response request includes the data related to the project to be processed; compare the encryptor response time with a preset encryptor response threshold to obtain a response comparison result; determine the target coding data based on the response comparison result and the data related to the project to be processed; used to end the recording of the encryptor response time when the response comparison result is that the response feedback data is obtained within the preset encryptor response threshold; perform data preprocessing on the data related to the project to be processed and the response feedback data to obtain first target coding data; wherein the data related to the project to be processed includes the project data to be processed and its corresponding timestamp data, and the response feedback data includes random data; when the response comparison result is that the encryptor response time exceeds the preset encryptor response threshold, perform data preprocessing on the data related to the project to be processed to obtain second target coding data; A data processing module, used for performing data conversion on the coded data according to a preset cryptographic hash algorithm to obtain a coding feature sequence; The character generation module is used to perform multiple operations according to the preset extraction index, the coding feature sequence and the preset character data to obtain a target multi-digit random number; wherein the preset extraction index includes a preset extraction length, and the preset character data includes a preset mapping relationship and a preset dictionary table.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.