Entropy data pooling method and device, equipment and medium

By judging the occupied state of the entropy pool lock when the entropy source generates entropy data and generating processing strategies, the system load problem caused by the entropy source to generate a large amount of entropy data in a short time is solved, and the effect of reducing system load and improving operating efficiency is achieved.

CN119987716APending Publication Date: 2025-05-13ZEBRED NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411812496.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When a large amount of entropy data is generated in a short time by the entropy source, the entropy data will be frequently added to the entropy pool in the prior art, resulting in excessive load on the computer system.

Method used

When the entropy data is generated by the entropy source, the entropy pool lock is judged, the current time, period mark time and the accumulated number of additions are obtained, and the entropy data processing strategy is generated. If the policy is added, the entropy data is added to the entropy pool; if the policy is discarded, the entropy data is discarded.

Benefits of technology

It reduces the load of the computer system, improves the system operation efficiency and reliability, and avoids system overload problems caused by frequent addition of entropy data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987716A_ABST
    Figure CN119987716A_ABST
Patent Text Reader

Abstract

The invention provides an entropy data pooling method and device, equipment and a medium, and can be applied to the field of computers. In the method, when an entropy source generates entropy data for one time, if a random number generator determines that a lock applied to an entropy pool is not occupied, a current moment and a period marking moment are obtained, and an accumulated number of times is added, so that an entropy data processing strategy can be generated. And if the entropy data processing strategy is to add the entropy data to the entropy pool, adding the entropy data to the entropy pool. According to the scheme, when the generated entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool, and all the entropy data are not added to the entropy pool, so that the load of a computer system is reduced, and the operation efficiency and reliability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, equipment and medium for entering entropy data into a pool. Background Art

[0002] Random numbers can be used in a variety of computing scenarios, such as encryption and decryption scenarios, Hypertext Transfer Protocol Secure (HTTPS) access scenarios, task scheduling scenarios, etc. Therefore, since the birth of computers, how to use computers to generate high-quality random numbers has always been a concern for people.

[0003] In the prior art, entropy data in an entropy pool is usually used as a random number, and the entropy data in the entropy pool comes from an entropy source, such as a driver of an external device. The entropy source can generate entropy data, which can be the time interval between two keyboard key presses, the time interval between the mouse position and two consecutive mouse interrupts, the time interval between two consecutive disk operations, etc., and then the entropy source adds the entropy data to the entropy pool.

[0004] However, when the entropy source generates a large amount of entropy data in a short period of time, the operation of adding the entropy data to the entropy pool will be continuously performed, resulting in excessive load on the computer system. Summary of the invention

[0005] The embodiments of the present application provide a method, device, equipment and medium for entering an entropy data into a pool, which are used to solve the problem of excessive load caused by the existing entropy pool adding method continuously adding entropy data to the entropy pool when a large amount of entropy data is generated by an entropy source in a short period of time.

[0006] In a first aspect, an embodiment of the present application provides a method for pooling entropy data, the method comprising:

[0007] When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied;

[0008] If the lock is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, wherein the period mark time is used to indicate the end time of the addition period of the entropy pool;

[0009] Generate an entropy data processing strategy according to the current time, the period mark time, and the cumulative number of filling times; wherein the entropy data processing strategy is to add the entropy data to the entropy pool, or to discard the entropy data;

[0010] If the entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool.

[0011] In a specific implementation, generating an entropy data processing strategy according to the current moment, the periodic marking moment, and the cumulative number of additions includes:

[0012] Determine whether the current time is earlier than the periodic mark time;

[0013] If the current time is earlier than the period mark time, generating the entropy data processing strategy according to the cumulative number of additions and a preset number of additions threshold;

[0014] If the current time is later than or equal to the period mark time, an entropy data processing strategy is generated to add the entropy data to the entropy pool.

[0015] In a specific implementation, generating the entropy data processing strategy according to the cumulative number of additions and a preset number of additions threshold includes:

[0016] Determine whether the cumulative number of additions is less than the preset number of additions threshold;

[0017] If the cumulative number of additions is less than the preset number of additions threshold, generating an entropy data processing strategy for adding the entropy data to the entropy pool;

[0018] If the cumulative number of additions is greater than or equal to the preset number of additions threshold, an entropy data processing strategy for discarding the entropy data is generated.

[0019] In a specific implementation, after generating the entropy data processing strategy for adding the entropy data to the entropy pool, the method further includes:

[0020] Update the cumulative number of additions to 1;

[0021] The period marking time is added to the duration of the period to obtain an updated period marking time.

[0022] In a specific implementation, if the cumulative number of additions is less than the preset number of additions threshold, after generating an entropy data processing strategy for adding the entropy data to the entropy pool, the method further includes:

[0023] The cumulative number of additions is increased by 1 to obtain an updated cumulative number of additions.

[0024] In a specific embodiment, the method further comprises:

[0025] If the entropy data processing strategy is to discard the entropy data, then the entropy data is discarded.

[0026] In a specific embodiment, the method further comprises:

[0027] If the lock is occupied, the entropy data is discarded.

[0028] In a second aspect, an embodiment of the present application provides an entropy data pooling device, including:

[0029] Processing modules for:

[0030] When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied;

[0031] If the lock is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, wherein the period mark time is used to indicate the end time of the addition period of the entropy pool;

[0032] Generate an entropy data processing strategy according to the current time, the period mark time, and the cumulative number of additions; wherein the entropy data processing strategy is to add the entropy data to the entropy pool, or to discard the entropy data;

[0033] An adding module is used to add the entropy data to the entropy pool if the entropy data processing strategy is to add the entropy data to the entropy pool.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0035] Processor, memory, communication interface;

[0036] The memory is used to store executable instructions of the processor;

[0037] Wherein, the processor is configured to execute the entropy data pooling method described in any one of the first aspects by executing the executable instructions.

[0038] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the entropy data pooling method described in any one of the first aspects is implemented.

[0039] The entropy data pooling method, device, equipment and medium provided in the embodiments of the present application can generate an entropy data processing strategy by obtaining the current time, the period mark time, and the cumulative number of additions when the random number generator determines that the lock applied to the entropy pool is not occupied when the entropy source generates entropy data once. If the entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool. This solution adds the entropy data to the entropy pool when the generated entropy data processing strategy is to add the entropy data to the entropy pool, and does not add all the entropy data to the entropy pool, thereby reducing the load on the computer system and improving the system operation efficiency and reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] Figure 1 A schematic diagram of the process of the entropy data pooling method in the prior art provided by this application;

[0042] Figure 2a A schematic diagram of the process of the first embodiment of the entropy data pooling method provided by the present application;

[0043] Figure 2b Schematic diagram of the process of entropy data entering the pool provided for this application;

[0044] Figure 3 A schematic diagram of the flow chart of Embodiment 2 of the entropy data pooling method provided in this application;

[0045] Figure 4 A schematic diagram of the structure of an embodiment of an entropy data pooling device provided by the present application;

[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in this application.

[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0049] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0050] Random numbers play an important role in many different computing scenarios, such as encryption and decryption scenarios, Hypertext Transfer Protocol Secure (HTTPS) access scenarios, task scheduling scenarios, etc. Therefore, since the birth of computers, how to use computers to generate high-quality random numbers has always been a concern for people.

[0051] In the prior art, entropy data is usually generated by an entropy source and added to an entropy pool, and then the entropy data in the entropy pool is used as a random number. The entropy source can be a driver of an external device, and the entropy data generated includes the time interval between two keyboard key presses, the mouse position and the time interval between two consecutive mouse interrupts, the time interval between two consecutive disk operations, etc. These entropy data are all random, so they can be used as random numbers.

[0052] However, when the entropy source generates a large amount of entropy data in a short period of time, the entropy data will be continuously added to the entropy pool, which will cause the computer system to be overloaded and the computer system to operate in a low efficiency.

[0053] For example, Figure 1 The process diagram of the entropy data pooling method in the prior art provided by this application is as follows: Figure 1 As shown, multiple entropy sources can generate entropy data. After generating the entropy data, the entropy source adds all the generated entropy data to the entropy pool.

[0054] In view of the problems existing in the prior art, the inventors found in the process of studying the entropy data pooling method that in order to reduce the load of the computer system, a cycle for adding to the entropy pool, that is, an adding cycle, can be set, and the number of times entropy data is added in each cycle cannot exceed the preset adding number threshold, which can not only ensure that the amount of entropy data in the entropy pool can meet the demand as a random number, but also when a large amount of entropy data is generated in a short time by the entropy source, the computer system load is low, thereby improving the operating efficiency and reliability of the computer system. Based on the above inventive concept, the entropy data pooling scheme in this application is designed.

[0055] It should be noted that the present application can be applied in operating systems such as AliOS, Linux, FreeBSD, etc. The executor of the entropy data pooling method in the present application is the random number generator in the operating system, and the random number generator is a software or program in the operating system.

[0056] The following is an example of an application scenario of the entropy data pooling method provided in this application.

[0057] Exemplarily, in this application scenario, there are multiple entropy sources that can generate entropy data, and the entropy pool has a lock, so that the random number generator can only add entropy data of one entropy source to the entropy pool at the same time.

[0058] When the entropy source generates entropy data once, the random number generator first determines whether the lock applied to the entropy pool is occupied. If it is not occupied, the current time, the period mark time, the cumulative number of times are added, and the lock is occupied to prevent the entropy data of other entropy sources from being added to the entropy pool.

[0059] Then the random number generator determines whether the current moment is in a new cycle according to the current moment and the cycle marking moment, and directly adds the entropy data to the entropy pool when the current moment is in a new cycle. The preset adding times threshold and cycle marking moment are updated.

[0060] When the current time is not in a new cycle, it is determined whether the cumulative number of additions reaches a preset number of additions threshold.

[0061] When the preset adding times threshold is not reached, the entropy data is added to the entropy pool, and the preset adding times threshold and the period marking time are updated. When the preset adding times threshold is reached, the entropy data is discarded.

[0062] The lock is then released so that entropy data from other entropy sources can be added to the entropy pool.

[0063] It should be noted that the above scenario is only an example of an application scenario provided by an embodiment of the present application. The embodiment of the present application does not limit the actual form of the device corresponding to the entropy source in the scenario. In the specific application of the solution, it can be set according to actual needs.

[0064] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0065] Figure 2a The flowchart of the first embodiment of the entropy data pooling method provided by the present application is as follows. The present application embodiment generates an entropy data processing strategy according to whether the lock of the entropy pool is occupied, the current time, the cycle marking time, and the cumulative number of additions by the random number generator, and then describes the situation where the entropy data is added to the entropy pool when the entropy data processing strategy is to add the entropy data to the entropy pool. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. Figure 2a As shown, the entropy data pooling method specifically includes the following steps:

[0066] S201: When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied.

[0067] In this step, when the entropy source generates entropy data once, the random number generator first determines whether the lock applied to the entropy pool is occupied to determine whether the entropy pool can be filled.

[0068] It should be noted that the number of entropy data generated by the entropy source at one time can be one or more. The embodiment of the present application does not limit the number of entropy data generated by the generated entropy source at one time, which can be determined according to actual conditions.

[0069] S202: If the lock is not occupied, obtain the current time, the period mark time, and add the cumulative number of times.

[0070] In this step, if the random number generator determines that the lock is not occupied, it means that the entropy data can be added to the entropy pool. It is necessary to obtain the current time, the period mark time, the cumulative number of additions, and occupy the lock to prevent entropy data from other entropy sources from being added to the entropy pool.

[0071] In this solution, there is a cycle of adding the entropy pool, that is, an adding cycle, wherein the cycle marking moment is used to indicate the end moment of the adding cycle of the entropy pool, and can be used to determine whether the current moment is in a new cycle.

[0072] If the random number generator determines that the lock is occupied, it means that entropy data from other entropy sources is being added to the entropy pool, and the generated entropy data is discarded.

[0073] S203: Generate an entropy data processing strategy based on the current time, the period mark time, and the cumulative number of fillings.

[0074] In this step, after the random number generator obtains the current time, the cycle marking time, and the cumulative number of additions, it can determine whether the current time is in a new cycle based on the current time and the cycle marking time. If it is in a new cycle, it generates an entropy data processing strategy to add the entropy data to the entropy pool.

[0075] When it is not in a new cycle, it is determined whether it is necessary to continue adding entropy data in the current cycle according to the cumulative number of additions, and the entropy data processing strategy is determined. Among them, the entropy data processing strategy is to add the entropy data to the entropy pool or discard the entropy data.

[0076] S204: If the entropy data processing strategy is to add the entropy data to the entropy pool, then the entropy data is added to the entropy pool.

[0077] In this step, after the random number generator obtains the entropy data processing strategy, if the entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool.

[0078] It should be noted that when adding entropy data to the entropy pool, the entropy data can be added to the entropy pool directly, or the entropy data can be processed using encryption algorithms such as hash algorithms, Advanced Encryption Standard (AES) algorithms, and Data Encryption Standard (DES) algorithms, and the processed entropy data is added to the entropy pool to ensure the randomness of the entropy data.

[0079] If the entropy data processing strategy is to discard the entropy data, it means that the number of times the entropy data is added in the current cycle has reached the upper limit and entropy data cannot be added any more, so the entropy data is discarded.

[0080] After adding entropy data to the entropy pool or discarding entropy data, the lock must be released so that entropy data from other entropy sources can be added to the entropy pool.

[0081] For example, Figure 2b The schematic diagram of the process of entropy data entering the pool provided for this application is as follows: Figure 2b As shown, after the entropy source generates entropy data, the random number generator determines whether the entropy data can be added to the entropy pool based on whether the lock applied to the entropy pool is occupied, the current time, the cycle mark time, and the cumulative number of additions, and then adds the entropy data that can be added to the entropy pool to the entropy pool.

[0082] The entropy data pooling method provided in this embodiment is that when the entropy source generates entropy data once, if the random number generator determines that the lock applied to the entropy pool is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, and then an entropy data processing strategy can be generated. If the entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool. Compared with the prior art in which all the entropy data generated by the entropy source in a short period of time is added to the entropy pool, this solution adds the entropy data to the entropy pool when the generated entropy data processing strategy is to add the entropy data to the entropy pool, and does not add all the entropy data to the entropy pool, thereby reducing the load of the computer system and improving the system operation efficiency and reliability.

[0083] Figure 3 This is a flow chart of the second embodiment of the entropy data pooling method provided by this application. Based on the above embodiment, this embodiment of the application describes the situation in which the random number generator generates an entropy data processing strategy based on the current time, the periodic marking time, and the cumulative number of additions. Figure 3 As shown, the entropy data pooling method specifically includes the following steps:

[0084] S301: Determine whether the current time is earlier than the period mark time; if the current time is earlier than the period mark time, execute step S305; if the current time is later than or equal to the period mark time, execute steps S302-S304.

[0085] In this step, after the random number generator obtains the current time, the cycle mark time, and the cumulative number of additions, in order to determine whether the generated entropy data can be added to the entropy pool, it first determines whether the current time is earlier than the cycle mark time to determine whether the current time is in a new cycle.

[0086] S302: Generate an entropy data processing strategy for adding entropy data to an entropy pool.

[0087] In this step, if the random number generator determines that the current time is later than or equal to the cycle mark time, it means that it is in a new cycle and no entropy data has been added to the entropy pool during this cycle. It is necessary to generate an entropy data processing strategy to add entropy data to the entropy pool.

[0088] S303: Update the cumulative number of additions to 1.

[0089] S304: Add the period marking time to the duration of the period to obtain an updated period marking time.

[0090] In the above steps, when the current time is later than or equal to the cycle marking time, the random number generator generates an entropy data processing strategy to add the entropy data to the entropy pool. In order for the subsequent random number generator to add the entropy data to the entropy pool, the cumulative number of additions needs to be updated to 1, and the cycle marking time is added to the duration of the cycle to obtain the updated cycle marking time. The next time the entropy data is generated, it can be determined whether it is in a new cycle.

[0091] It should be noted that the length of the cycle can be 1 second, 5 seconds, 10 seconds, etc. The embodiment of the present application does not limit the length of the cycle and can be set according to actual conditions.

[0092] S305: Determine whether the cumulative number of additions is less than the preset addition number threshold; if the cumulative number of additions is less than the preset addition number threshold, execute steps S306-S308; if the cumulative number of additions is greater than or equal to the preset addition number threshold, execute step S308.

[0093] In this step, if the random number generator determines that the current time is earlier than the cycle mark time, it means that the current time is not in a new cycle. The entropy data processing strategy can be determined based on the cumulative number of additions and the preset number of additions threshold.

[0094] First, it is necessary to determine whether the cumulative number of additions is less than the preset number of additions threshold to determine whether the number of times the entropy data is added has reached the upper limit in the current cycle.

[0095] It should be noted that the preset addition times threshold may be 5, 10, 15, etc. The embodiment of the present application does not limit the preset addition times threshold and may be set according to actual conditions.

[0096] S306: Generate an entropy data processing strategy for adding the entropy data to the entropy pool.

[0097] In this step, if the random number generator determines that the cumulative number of additions is less than the preset addition number threshold, it means that the number of entropy data added in the current cycle has not reached the upper limit, and entropy data can continue to be added to generate an entropy data processing strategy for adding entropy data to the entropy pool.

[0098] S307: Add 1 to the cumulative number of additions to obtain an updated cumulative number of additions.

[0099] In this step, after the random number generator generates an entropy data processing strategy to add entropy data to the entropy pool when the cumulative number of additions is less than the preset addition number threshold, it is also necessary to add 1 to the cumulative number of additions to obtain an updated cumulative number of additions, so as to determine whether the number of entropy data added within the cycle has reached the upper limit during the subsequent entropy data entering the pool.

[0100] S308: Generate an entropy data processing strategy for discarding the entropy data.

[0101] In this step, if the random number generator determines that the cumulative number of additions is greater than or equal to the preset addition number threshold, it means that the number of entropy data added in the current cycle has reached the upper limit, and entropy data cannot be added, and an entropy data processing strategy is generated to discard the entropy data.

[0102] The entropy data pooling method provided in this embodiment determines the entropy data processing strategy by determining whether the current moment is in a new cycle, and when not in a new cycle, determining whether the number of times the entropy data is added in the current cycle reaches an upper limit, so that the number of times the entropy data is added in each cycle does not exceed the preset addition number threshold, thereby reducing the load of the computer system and improving the system operation efficiency and reliability. At the same time, by setting the preset addition number threshold, it is also ensured that the amount of entropy data in the entropy pool can meet the demand as a random number.

[0103] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0104] Figure 4 This is a schematic diagram of the structure of an embodiment of the entropy data pooling device provided by this application. Figure 4 As shown, the entropy data pooling device 40 includes:

[0105] The processing module 41 is used for:

[0106] When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied;

[0107] If the lock is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, wherein the period mark time is used to indicate the end time of the addition period of the entropy pool;

[0108] Generate an entropy data processing strategy according to the current time, the period mark time, and the cumulative number of additions; wherein the entropy data processing strategy is to add the entropy data to the entropy pool, or to discard the entropy data;

[0109] The adding module 42 is configured to add the entropy data to the entropy pool if the entropy data processing strategy is to add the entropy data to the entropy pool.

[0110] Furthermore, the processing module 41 is specifically used for:

[0111] Determine whether the current time is earlier than the periodic mark time;

[0112] If the current time is earlier than the period mark time, generating the entropy data processing strategy according to the cumulative number of additions and a preset number of additions threshold;

[0113] If the current time is later than or equal to the period mark time, an entropy data processing strategy is generated to add the entropy data to the entropy pool.

[0114] Furthermore, the processing module 41 is specifically used for:

[0115] Determine whether the cumulative number of additions is less than the preset number of additions threshold;

[0116] If the cumulative number of additions is less than the preset number of additions threshold, generating an entropy data processing strategy for adding the entropy data to the entropy pool;

[0117] If the cumulative number of additions is greater than or equal to the preset number of additions threshold, an entropy data processing strategy for discarding the entropy data is generated.

[0118] Further, after generating the entropy data processing strategy for adding the entropy data to the entropy pool, the processing module 41 is further used to:

[0119] Update the cumulative number of additions to 1;

[0120] The period marking time is added to the duration of the period to obtain an updated period marking time.

[0121] Further, if the cumulative number of additions is less than the preset number of additions threshold, after generating an entropy data processing strategy for adding the entropy data to the entropy pool, the processing module 41 is further used to:

[0122] The cumulative number of additions is increased by 1 to obtain an updated cumulative number of additions.

[0123] Furthermore, the processing module 41 is also used for:

[0124] If the entropy data processing strategy is to discard the entropy data, then the entropy data is discarded.

[0125] Furthermore, the processing module 41 is also used for:

[0126] If the lock is occupied, the entropy data is discarded.

[0127] The entropy data pooling device provided in this embodiment is used to execute the technical solution in any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0128] Figure 5This is a schematic diagram of the structure of an electronic device provided in this application. Figure 5 As shown, the electronic device 50 includes:

[0129] Processor 51, memory 52, and communication interface 53;

[0130] The memory 52 is used to store executable instructions of the processor 51;

[0131] The processor 51 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.

[0132] Optionally, the memory 52 may be independent or integrated with the processor 51 .

[0133] Optionally, when the memory 52 is a device independent of the processor 51, the electronic device 50 may further include:

[0134] The bus 54 , the memory 52 and the communication interface 53 are connected to the processor 51 via the bus 54 and communicate with each other. The communication interface 53 is used to communicate with other devices.

[0135] Optionally, the communication interface 53 may be implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0136] The bus 54 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0137] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0138] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.

[0139] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the technical solution provided by any of the aforementioned method embodiments is implemented.

[0140] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the aforementioned method embodiments when executed by a processor.

[0141] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for pooling entropy data, characterized in that: include: When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied; If the lock is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, wherein the period mark time is used to indicate the end time of the addition period of the entropy pool; Generate an entropy data processing strategy according to the current time, the period mark time, and the cumulative number of additions; wherein the entropy data processing strategy is to add the entropy data to the entropy pool, or to discard the entropy data; If the entropy data processing strategy is to add the entropy data to the entropy pool, the entropy data is added to the entropy pool.

2. The method according to claim 1, characterized in that The step of generating an entropy data processing strategy according to the current time, the periodic marking time, and the cumulative number of additions includes: Determine whether the current time is earlier than the periodic mark time; If the current time is earlier than the period mark time, generating the entropy data processing strategy according to the cumulative number of additions and a preset number of additions threshold; If the current time is later than or equal to the period mark time, an entropy data processing strategy is generated to add the entropy data to the entropy pool.

3. The method according to claim 2, characterized in that The step of generating the entropy data processing strategy according to the cumulative number of additions and a preset number of additions threshold comprises: Determine whether the cumulative number of additions is less than the preset number of additions threshold; If the cumulative number of additions is less than the preset number of additions threshold, generating an entropy data processing strategy for adding the entropy data to the entropy pool; If the cumulative number of additions is greater than or equal to the preset number of additions threshold, an entropy data processing strategy for discarding the entropy data is generated.

4. The method according to claim 2, characterized in that: After generating the entropy data processing strategy for adding the entropy data to the entropy pool, the method further includes: Update the cumulative number of additions to 1; The period marking time is added to the duration of the period to obtain an updated period marking time.

5. The method according to claim 3, characterized in that: If the cumulative number of additions is less than the preset number of additions threshold, after generating an entropy data processing strategy for adding the entropy data to the entropy pool, the method further includes: The cumulative number of additions is increased by 1 to obtain an updated cumulative number of additions.

6. The method according to claim 1, characterized in that The method further comprises: If the entropy data processing strategy is to discard the entropy data, then the entropy data is discarded.

7. The method according to claim 1, characterized in that The method further comprises: If the lock is occupied, the entropy data is discarded.

8. An entropy data pooling device, characterized in that: include: Processing modules for: When the entropy source generates entropy data once, it is determined whether the lock applied to the entropy pool is occupied; If the lock is not occupied, the current time, the period mark time, and the cumulative number of additions are obtained, wherein the period mark time is used to indicate the end time of the addition period of the entropy pool; Generate an entropy data processing strategy according to the current time, the period mark time, and the cumulative number of additions; wherein the entropy data processing strategy is to add the entropy data to the entropy pool, or to discard the entropy data; An adding module is used to add the entropy data to the entropy pool if the entropy data processing strategy is to add the entropy data to the entropy pool.

9. An electronic device, characterized in that: include: Processor, memory, communication interface; The memory is used to store executable instructions of the processor; Wherein, the processor is configured to execute the entropy data pooling method described in any one of claims 1 to 7 by executing the executable instructions.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the entropy data pooling method described in any one of claims 1 to 7 is implemented.