Method and apparatus for generating random numbers in computer system

A computer system and random number technology, applied in the computer field, can solve problems such as effective control, poor user experience, uneven distribution of random numbers, etc.
CN106919365APending Publication Date: 2017-07-04ALIBABA GRP HLDG LTD

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
ALIBABA GRP HLDG LTD
Publication Date
2017-07-04

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a method and an apparatus for generating random numbers in a computer system. The method for generating the random numbers in the computer system comprises the steps of firstly dividing to-be-generated random numbers into a plurality of subsets when a first request is received, and when each subset comprises two random numbers, defining a sum of the two random numbers to be double an average number, and defining a quotient of the two random numbers to be a preset threshold; and then determining one or two random numbers comprised in each subset in sequence, thereby obtaining a specified number of random numbers. Therefore, the purpose of controlling the generated random numbers is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present application relates to the field of computer technology, in particular to a method and device for generating random numbers in a computer system. Background technique

[0002] In the traditional technology, when generating a specified number of random numbers, the random number of the specified number is often generated randomly by calling a random function. However, because the above random numbers are randomly generated, it cannot be effectively controlled (such as , controlled within a certain range), which will lead to the problem of uneven distribution of the specified number of random numbers generated. For example, in the scenario of realizing the sending of "red envelopes", the "red envelope amount" randomly generated by the payment server may be very large or very small (for example, 0.01), which will bring poor user experience. Contents of the invention

[0003] This application describes a method and device for generating rand...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More