Number issuing method, device, number issuing system and computer program medium
Numbers are issued in parallel through multiple processes, with each process responsible for one number segment. This solves the problems of low efficiency and insufficient security in number allocation in the existing technology, and achieves efficient and secure number issuance.
Patent Information
- Application Number
- CN201810821292.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-24
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2040-02-06
AI Technical Summary
In the existing technology, the user number allocation mechanism has the problems of low efficiency and insufficient security. It is impossible for multiple processes to issue numbers at the same time, and it is easy to leak user information.
Multiple processes are used to issue numbers in parallel. Each process is responsible for issuing numbers within a number segment. Different processes are responsible for different number segments. This method improves the efficiency of parallel issuance and enhances security.
It achieves efficient number distribution, improves the concurrency and security of the system, and the number of users of the application cannot be known from the number.
Smart Images

Figure CN110750353B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of the Internet, and in particular to a number issuance method, device, number issuance system, and computer program medium. Background Art
[0002] Before using a new app, users must register with it, fill in their personal information, and then the app assigns them an app number. After registration, users can enter the app number when logging in.
[0003] Currently, there are two main mechanisms for allocating application numbers to users. The first mechanism assigns application numbers sequentially, for example, first assigning 00000001 and then incrementally assigning 00000002. The weakness of this mechanism is that it is easy to determine the number of registered users based on the application number. Furthermore, it relies on a single baseline number, making it impossible for multiple processes to issue numbers simultaneously, resulting in low issuance efficiency. The second mechanism generates the numbers to be issued in advance. When a user registers, the generated numbers are extracted and issued, for example, by randomly drawing from the generated numbers. This allocation method makes it difficult to determine the number of registered users of the application, and multiple processes can retrieve and issue numbers simultaneously. However, it requires a table to store all unused numbers, and each service process must lock the table when simultaneously accessing numbers, affecting the concurrency of number issuance and resulting in low issuance efficiency. Summary of the Invention
[0004] The disclosed embodiment proposes a number issuance solution that can improve the security of number issuance information and has high issuance efficiency.
[0005] According to a first aspect of an embodiment of the present disclosure, a number allocation method is disclosed, including:
[0006] Receive a request from a user for number issuance;
[0007] A process for allocating numbers to the request, wherein the process is responsible for issuing numbers within a number segment, different processes are responsible for issuing different number segments, and each process issues numbers in parallel;
[0008] The allocation process selects a number from the number segment responsible for issuance and issues it to the user.
[0009] According to a second aspect of an embodiment of the present disclosure, a number issuing device is disclosed, comprising:
[0010] A receiving unit, configured to receive a request from a user for number issuance;
[0011] an allocating unit, configured to allocate a number issuance process to the request, wherein the process is responsible for issuing numbers within a number segment, different processes are responsible for issuing different number segments, and each process issues numbers in parallel;
[0012] The selection unit is used for the allocation process to select a number from the number segment responsible for issuance and issue it to the user.
[0013] According to a third aspect of an embodiment of the present disclosure, a number issuance system is disclosed, including: a memory storing computer-readable instructions; and a processor reading the computer-readable instructions stored in the memory to execute the method described above.
[0014] According to a fourth aspect of an embodiment of the present disclosure, a computer program medium is disclosed, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described above.
[0015] In the disclosed embodiment, multiple processes issue numbers in parallel, with each process responsible for issuing numbers within a specific number segment. Different processes are responsible for issuing different number segments. When a user requests number issuance, a process is assigned to the request, which then issues numbers within the corresponding number segment. Externally, this process cannot reveal the number of users using the numbers, thereby improving the security of number issuance information. Furthermore, this method allows different processes to issue numbers in parallel. Since each process issues numbers within its own number segment, it does not need to access a public database and, therefore, does not require locking, thereby improving issuance efficiency.
[0016] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0017] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail example embodiments thereof with reference to the attached drawings.
[0019] Figure 1A FIG. 1-F shows an interface change diagram of the method for issuing a number according to an exemplary embodiment of the present disclosure being applied to a scenario of issuing an application ID during application registration.
[0020] Figure 2A FIG. 1-H shows an interface change diagram of a lottery number issuance scenario in which the number issuance method according to an exemplary embodiment of the present disclosure is applied.
[0021] Figure 3A -H shows the interface change diagram of the number issuance method according to the exemplary embodiment of the present disclosure applied in the scenario of vehicle lottery.
[0022] Figure 4AA schematic diagram showing a network architecture to which a number issuance method according to an example embodiment of the present disclosure is applied.
[0023] Figure 4B is Figure 4A A schematic diagram showing the internal structure of the process number configuration server in detail is shown on the basis of FIG.
[0024] Figure 5 A flow chart of a number issuing method according to an example embodiment of the present disclosure is shown.
[0025] Figure 6 An embodiment according to the present disclosure is shown Figure 5 Detailed flowchart of step 220 in FIG.
[0026] Figure 7 A flow chart of a number issuing method according to an example embodiment of the present disclosure is shown.
[0027] Figure 8 A flow chart illustrating the total number of numbers for a geographical area in an allocation process according to an example embodiment of the present disclosure.
[0028] Figure 9 An example embodiment according to the present disclosure is shown. Figure 5 Detailed flowchart of step 230 in FIG.
[0029] Figure 10 A flow chart of a number issuing method according to an example embodiment of the present disclosure is shown.
[0030] Figure 11 is a schematic diagram illustrating in detail a filtering rule matching part and an operation rule matching part according to an example embodiment of the present disclosure.
[0031] Figure 12 A block diagram of a number issuing device according to an example embodiment of the present disclosure is shown.
[0032] Figure 13 A structural diagram of a number issuing system according to an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be more comprehensive and complete, and will fully convey the concepts of the example embodiments to those skilled in the art. The accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures indicate identical or similar parts, and thus repeated descriptions thereof will be omitted.
[0034] In addition, the described features, structures or characteristics can be combined in any suitable manner in one or more example embodiments. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. can be adopted. In other cases, well-known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0035] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] Before using a new app, users must register with it, fill in their personal information, and then the app assigns them an app number. After registration, users can enter the app number when logging in.
[0037] Currently, there are two main mechanisms for allocating application numbers to users. The first mechanism assigns application numbers sequentially, for example, first assigning 00000001 and then incrementally assigning 00000002. The weakness of this mechanism is that it is easy to determine the number of registered users based on the application number. Furthermore, it relies on a single baseline number, making it impossible for multiple processes to issue numbers simultaneously, resulting in low issuance efficiency. The second mechanism generates the numbers to be issued in advance. When a user registers, the generated numbers are extracted and issued, for example, by randomly drawing from the generated numbers. This allocation method makes it difficult to determine the number of registered users of the application, and multiple processes can retrieve and issue numbers simultaneously. However, it requires a table to store all unused numbers, and each service process must lock the table when simultaneously accessing numbers, affecting the concurrency of number issuance and resulting in low issuance efficiency.
[0038] In the disclosed embodiment, multiple processes issue numbers in parallel, and each process is responsible for issuing numbers within a number segment. The number segments issued by different processes are different. For example, one process issues numbers in the number segment 00010001-00020000, and another process issues numbers in the number segment 00020001-00030000. When a user's request for number issuance is received, a process is assigned to the request. The process issues numbers in the corresponding number segment. For the outside world, the number of users cannot be known from the number. In addition, in this way, different processes can issue numbers in parallel, and since each process issues numbers in its own number segment, it does not need to access the public database and therefore does not need to be locked, thereby improving issuance efficiency.
[0039] The following combination Figure 1A -F, Figure 2A -H. Figure 3A -H, describe the use of the number allocation method according to the exemplary embodiments of the present disclosure in three application scenarios.
[0040] Figure 1A FIG. 1-F shows an interface change diagram of the method for issuing a number according to an exemplary embodiment of the present disclosure being applied to a scenario of issuing an application ID during application registration.
[0041] When registering an app, users typically fill in their basic information. After submitting their information, the app assigns them an application ID, which they use to log in to the app. In this scenario, the number issued is a user ID. It's undesirable for users to be unable to determine the number of registered users from the assigned application ID, and it's also desirable to ensure efficient issuance of application IDs.
[0042] Figure 1A The following figure shows the registration guide interface that appears when the user downloads the application and opens the application. Before using an application, the user must first download the application. After downloading the application, the user must register before logging in to use it. After downloading the application, open the application and the registration guide interface appears. Figure 1A The interface shown in the figure shows a button "Start Registration". The user touches the button "Start Registration" to enter Figure 1B interface.
[0043] Figure 1B Shows the interface where the user fills in the registration information. Figure 1B In the interface, users are required to fill in personal information such as name, nickname, date of birth, gender, hobbies, etc., and then the user touches the "Confirm Registration" button to start registration, and the application will issue an application ID to the user.
[0044] Figure 1C The waiting interface for the allocation of application ID is shown. Before the application ID is issued to the user, it will be displayed Figure 1C The waiting interface shown in the figure will continue until the application ID is successfully issued to the user.
[0045] Figure 1D The interface showing the application ID issued to the user is shown. Once the application ID is successfully issued to the user, Figure 1C The display interface will become as follows Figure 1D As shown, the assigned application ID is displayed. The user can directly log in with the application ID by touching the "Login" button on the interface. When logging in later, the user needs to enter the application ID to log in.
[0046] Figure 1E The interface for allowing users to receive red envelopes when the application ID meets the preset operating rules is shown. If the application ID issued to the user happens to meet the preset operating rules, the user is notified to receive the red envelope. Figure 1E The interface not only displays the application ID issued to the user, but also notifies the user to receive the red envelope. When the user touches the "Receive Red Envelope" button on the interface, the red envelope will be received.
[0047] Figure 1F The interface for sending gifts to users when the application ID meets the preset operating rules is shown. If the application ID issued to the user happens to meet the preset operating rules, the user is notified to receive the gift. Figure 1F The interface not only displays the application ID issued to the user, but also notifies the user to view the gift. When the user touches the "View Gift" button on the interface, the gift is viewed.
[0048] Figure 2A FIG. 1-H shows an interface change diagram of a lottery number issuance scenario in which the number issuance method according to an exemplary embodiment of the present disclosure is applied.
[0049] When lottery numbers are issued, they are lottery numbers. Generally speaking, when a user applies to purchase a lottery ticket on an app, the app assigns them a lottery number. At the draw, if the assigned lottery number matches the pre-set operating rules (winning rules) in the backend, the user wins and is notified to claim their prize. When requesting lottery tickets, they also want them to be issued quickly and efficiently, without excessive wait times. Furthermore, lottery issuing organizations don't want users to notice if too few people buy tickets.
[0050] Figure 2A The display interface of the third-party service module under WeChat is shown. Among these third-party service modules, there is a "Lottery" module. The user touches the module to enter the lottery application. In addition, the user can also download a separate lottery application to log in.
[0051] Whether the user Figure 2AThe interface shown above will appear whether you select the "Lottery" module or download the lottery application and log in. Figure 2B The lottery type selection interface shown. Users can Figure 2B Select one of the lottery types shown.
[0052] Figure 2C The waiting interface for lottery number allocation is shown. Figure 2B Select a lottery type in the interface, and the application will start issuing lottery numbers to the application. Before the lottery numbers are issued to the user, it will be displayed Figure 2C The waiting interface shown will continue until the lottery number is successfully issued to the user.
[0053] Figure 2D The interface showing the lottery numbers issued to the user in the case of an immediate lottery draw is shown. Once the lottery numbers are successfully issued to the user, Figure 2C The display interface will become as follows Figure 2D As shown, the lottery numbers assigned are displayed. There are two types of lotteries: immediate draw and regular draw. If it is an immediate draw lottery, as shown Figure 2D As shown, a "Check if you have won" button is displayed on the interface. When the user touches the button, he can check whether the assigned lottery number has won the prize.
[0054] Figure 2E The interface for notifying the user to claim the prize when the lottery number meets the preset operating rules is shown. Figure 2D Touch the "Check if you have won" button on the interface, and the application will match the assigned lottery numbers with the background operating rules (winning rules). If they match, the user will be notified on the interface to claim the prize.
[0055] Figure 2F This interface shows how lottery numbers are distributed to users and the draw time is notified for a regular lottery draw. The application calculates the time difference between the current time and the current draw time and displays it on the interface, such as "1 day, 12 hours, 38 minutes, and 45 seconds until the draw."
[0056] Figure 2G The following figure shows the lottery result interface when the user opens the app after the lottery result time. In the above example, if the lottery app is opened after 1 day, 12 hours, 38 minutes and 45 seconds, the lottery result interface will not be displayed to the user first. Figure 2B Instead of the interface shown in Figure 2G The interface shown in Figure 1 indicates that the lottery ticket purchased by the user has been drawn. The user can touch the "Check Winning Status" button on the interface to check whether they have won.
[0057] Figure 2HThe interface is shown when the user touches the button "check winning condition" and the lottery number matches the preset operation rule. When the user touches "check winning condition", the application will match the assigned lottery number with the operation rule (winning rule) in the background, and if they match, the user will be notified of the winning on the interface.
[0058] Figure 3A -H shows the interface change diagram of the number issuing method application according to the example embodiment of the present disclosure in the scene of vehicle lottery.
[0059] After the user buys a car, he carries the car purchase invoice to the traffic management department for verification, and the traffic management department stamps a seal. Under the guidance of the traffic management department, the user downloads the lottery application. The lottery application assigns a lottery ID to the user, which is used when the user participates in the lottery. When determining whether to issue a license plate number to the user, the application or the background will match the assigned lottery ID with the preset operation rule, and if they match, it is determined that the license plate number is issued to the user. In this application scenario, the issued number is the lottery ID (not the final license plate number).
[0060] When the user downloads the lottery application and opens the lottery application, the display interface shown in Figure 3A first appears, which requires the user to take a photo of the ID card. The user touches the "start shooting" button and uses the mobile phone to take a photo of the ID card. After the shooting is completed, the interface shown in Figure 3B appears.
[0061] Figure 3B The interface is shown after the ID card is photographed, prompting the user to view or upload. There are "view" and "upload" buttons on the interface. If the user touches the "view" button, the user will be shown the photographed ID card. If the user touches the "upload" button, the photographed ID card will be uploaded.
[0062] After the ID card is uploaded successfully, the interface shown in Figure 3C appears, which requires the user to take a photo of the vehicle purchase invoice verified and stamped by the traffic management department and upload it. The user touches the "shooting" button on the interface to start taking a photo of the vehicle purchase invoice verified and stamped by the traffic management department
[0063] Figure 3D The interface is shown after the vehicle purchase invoice is photographed, prompting the user to view or upload. The interface has two buttons, "view" and "upload". When the user touches the "view" button, the user will be shown the photographed vehicle purchase invoice. When the user touches the "upload" button, the photographed vehicle purchase invoice will be uploaded.
[0064] Figure 3E The interface is shown after the vehicle purchase invoice is photographed and uploaded, waiting for the traffic management department to verify, and notifying the user of the time to obtain the verification result. In Figure 3EInform the user to open the app 3 days later to obtain the verification result.
[0065] When the user opens the app 3 days later, the screen will show Figure 3F The interface shows that the traffic control department's verification and certification has been passed, requiring the user to collect the lottery ID. Figure 3F After clicking the “Receive” button on the interface, lottery IDs will be issued to users.
[0066] Figure 3G The interface shows the user receiving a lottery ID after the verification result is passed. The interface also notifies the user of the time to check whether the lottery ID will qualify for a license plate. The interface tells the user to open the app on June 30, 2018, to check the lottery results and whether they are eligible for a license plate.
[0067] When a user opens the app after June 30, 2018, the lottery result will first appear on the display screen, that is, whether the lottery ID assigned to the user is eligible to receive a license plate number. Figure 3H The interface shows that the lottery ID assigned to the user has obtained the qualification to receive the license plate number. The user can touch the "View" button on the interface to view the notification for collecting the ticket number and collect the license plate number according to the requirements of the notification.
[0068] Figure 4A A schematic diagram of a network architecture for a number issuance method according to an exemplary embodiment of the present disclosure is shown. The system architecture includes a user terminal 110 , a scheduling engine 120 , a number issuing machine 130 having one or more processes 1301 , and a process number configuration server 140 .
[0069] User terminal 110 is a terminal that requests number issuance. Figure 1A In the application scenario of application ID issuance during application registration of -F, the user terminal 110 is the terminal that requests registration and issuance of application ID. Figure 2A In the application scenario of lottery number distribution of -H, the user terminal 110 is a user terminal that purchases lottery tickets and requests the distribution of lottery numbers. Figure 3A In the vehicle lottery application scenario described in [H], user terminal 110 is the terminal of the user who participates in the vehicle lottery after purchasing a vehicle and requests a lottery ID. It can be a dedicated terminal or a general-purpose terminal with an installed application, such as a desktop computer, mobile phone, PDA, laptop, or vehicle-mounted device. In the application scenario where an application ID is issued during application registration, the installed application is the application being registered. In the application scenario where lottery numbers are issued, the installed application is the lottery application. In the application scenario where a vehicle lottery application is used, the installed application is the vehicle lottery application.
[0070] The scheduling engine 120 is a machine that responds to a request for number allocation from a user terminal 110 and allocates a process on a number allocation machine 130 to the request. The scheduling engine 120 can be implemented by a single computer, or a portion of a single computer (as a virtual machine), or by multiple networked computers, or by a combination of portions of multiple networked computers. For example, it can take the form of a virtual machine cluster, where portions of multiple physical machines are partitioned into virtual machines that collectively perform the functions of the scheduling engine 120. In a cloud environment, it can be implemented by a combination of multiple distributed computing devices within the cloud environment.
[0071] The number issuing machine 130 is a machine used to issue numbers to users. It can be a dedicated terminal or a general-purpose terminal with an installed application, such as a desktop computer or laptop. It can also be part of a terminal (as a virtual machine). The number issuing machine 130 runs several processes 1301 that issue numbers to users. A process is the basic unit of resource allocation (CPU, memory, etc.) and is an instance of program execution. A number issuing machine 130 can run one process 1301 or multiple processes 1301.
[0072] The process number configuration server 140 is a server that configures the number segments issued to each process. It can be a single computer, multiple networked computers, or even a combination of multiple networked computers. For example, it can take the form of a virtual machine cluster, where multiple physical machines are partitioned into virtual machines that collectively perform the functions of the process number configuration server 140. In a cloud environment, it can be implemented by multiple distributed computing devices within the cloud environment.
[0073] Figure 4B Shown Figure 4AThe following is an example of the components of the process number configuration server 140. The process number configuration server 140 includes a process ID table 1401, a number segment configuration table 1402, a sub-number segment allocation table 1403, and a number configuration engine 1404. When assigning a number segment for process 1301, process 1301 first obtains an unassigned process ID from process ID table 1401. Process ID table 1401 reports this process ID to number configuration engine 1404, which then assigns the process the number segment it is responsible for issuing. The specific method for assigning number segments will be described in detail later. Number configuration engine 1404 then stores the process ID and the assigned number segment in number segment configuration table 1402 in correspondence. Process 1301 can use the process ID to find the number segment it is responsible for issuing in number configuration table 1402. Simultaneously, number configuration engine 1404 writes the assigned number segment to the sub-number segment allocation table. After process 1301 knows the number segment it is responsible for issuing, it does not store the entire segment in its own cache for issuance (the cache of the number issuing machine where the process is located is limited). Instead, it extracts sub-segments from the segment one by one and issues them. Since the number configuration engine 1404 writes the number segment allocated to the process in the sub-segment allocation table, process 1301 extracts sub-segments from sub-segment allocation table 1403 one by one, places the extracted sub-segments in its own cache for issuance, and retains the unextracted sub-segments in sub-segment allocation table 1403. For example, the number segment allocated by process 1301 is 00010001-00020000. Process 1301 can first extract sub-segments 00010001-00011000 from sub-segment allocation table 1403 for issuance, leaving sub-segments 00011001-00020000 in sub-segment allocation table 1403 for later retrieval. When the process number configuration server 140 is implemented by multiple networked computers, the number configuration engine 1404 can be distributed on one or more of the computers. When the process number configuration server 140 is implemented by a single computer, the number configuration engine 1404 can be implemented as a part of the computer (such as a program code segment). Figure 4B In the example, process number configuration server 140 includes a process identification table 1401, a number segment configuration table 1402, a sub-number segment allocation table 1403, and a number configuration engine 1404. However, those skilled in the art will appreciate that process number configuration server 140 can be implemented as an integrated system without such structural distinctions. Process number configuration server 140 itself possesses all the functions of process identification table 1401, number segment configuration table 1402, sub-number segment allocation table 1403, and number configuration engine 1404.
[0074] like Figure 5 As shown, a number issuance method according to an embodiment of the present disclosure is proposed.
[0075] exist Figure 1A - In the application scenario where the application ID is issued when the application is registered, the number refers to the application ID when the application is registered. Figure 2A In the application scenario of lottery number distribution of -H, the number refers to the lottery number. Figure 3A - In the application scenario of vehicle lottery of H, the number refers to the lottery ID.
[0076] exist Figure 1A In the application scenario of application ID issuance during application registration of -F, the number issuance method is executed by the platform server of the application to be registered. Figure 2A In the application scenario of lottery number distribution of -H, the number distribution method is executed by the platform server of the lottery application. Figure 3A In the application scenario of vehicle lottery of -H, the number issuance method is executed by the server of the traffic management department responsible for vehicle lottery.
[0077] like Figure 5 As shown, the method includes:
[0078] Step 210: Receive a request from a user for number issuance.
[0079] Step 220: allocating a number to the requesting process, wherein the process is responsible for issuing numbers within a number range, different processes are responsible for issuing numbers in different number ranges, and each process issues numbers in parallel;
[0080] Step 230: The allocation process selects a number from the number segment responsible for issuance and issues it to the user.
[0081] These steps are described in detail below.
[0082] In step 210, a request for number issuance from a user is received.
[0083] exist Figure 1A - In the application scenario where the application ID is issued when the application is registered, the request is in response to the user's Figure 1B The registration is generated and sent by touching the "Confirm Registration" button on the interface. Figure 2A In the application scenario of lottery number distribution of -H, the request is made by the user in Figure 2B Select a lottery type on the interface to trigger the generation and sending of lottery tickets. Figure 3A In the application scenario of vehicle lottery of -H, the request is made by the user in Figure 3F It is generated and sent by touching the "Receive" button on the interface.
[0084] After the request generated by the user terminal is sent to the platform, the scheduling engine 120 allocates a service process 1301 for it.
[0085] In step 220, a process for assigning the request to assign a number is executed, the process is responsible for assigning numbers in a number segment, different processes are responsible for assigning different number segments, and the processes are executed in parallel.
[0086] A number segment refers to a set of numbers. Each process is responsible for assigning a number segment, which can be a continuous number segment or a discontinuous number segment.
[0087] A continuous number segment refers to a number segment in which the numbers are continuous. For example, process A is assigned the number segment 00010001-00020000, which contains 10000 continuous numbers; process B is assigned the number segment 00020001-00040000, which contains 20000 continuous numbers.
[0088] A discontinuous number segment refers to a number segment in which the numbers are discontinuous, for example, according to a predetermined rule. For example, all numbers conforming to 852X+1 (X is a positive integer) are assigned to process A, and all numbers conforming to 852X+2 and 852X+3 (X is a positive integer) are assigned to process B. This can bring a beneficial technical effect that it is difficult to infer from the value of the number which number segment it belongs to and which process should assign it, thereby improving the security of number assignment.
[0089] Therefore, in one embodiment, numbers conforming to the formula Y i = AX+i (i = 1, 2, 3, …, n) can be assigned to process i, where A is a positive integer not less than n, X is a positive integer, and Y i is the number assigned to process i. The advantage of this embodiment is that it is difficult to infer from the value of the number which number segment it belongs to, thereby improving the security of number assignment.
[0090] In one embodiment, from the perspective of balancing the processing load of each process, a process for assigning the request to assign a number can be assigned based on the number of requests that have been assigned to the process but not processed. Having been assigned but not processed means that the request has been assigned to the process, and the process has not assigned a number to the request. The number of requests that have been assigned but not processed by each process can be considered as the current processing load of the process. It should be ensured as much as possible that the request is assigned to the process with the smallest current processing load, that is, the process with the smallest number of requests that have been assigned but not processed, so as to facilitate load balancing, and the cooperative processing capacity of the system will be improved.
[0091] One method for assigning a process to a request based on the number of requests each process has allocated but not yet processed is to assign the request to the process with the smallest number of allocated but unprocessed requests. For example, if there are six processes with 17, 28, 57, 186, 9, and 87 allocated but unprocessed requests, the request would be assigned to the process with 9 allocated but unprocessed requests.
[0092] Another method for assigning a number-issuing process to a request based on the number of requests that have been assigned but not yet processed by each process includes:
[0093] From the processes whose number of allocated but unprocessed requests is lower than a predetermined request number threshold, one is randomly selected as the process to which the request is issued.
[0094] For example, there are 6 processes, and the numbers of allocated but unprocessed requests are 17, 28, 57, 186, 9, and 87 respectively. The predetermined request number threshold is 30, and 17, 28, and 9 are all below the threshold. The requests can be randomly assigned to any one of the 3 processes.
[0095] Compared to assigning the request to the process with the smallest number of allocated but unprocessed requests, this implementation has the following advantages: since the number of allocated but unprocessed requests for each process is collected regularly, for example, reported to the scheduling engine 120 by process 1301 every 5 minutes, if all requests received within each fixed period are concentrated and assigned to one process, assuming that the number of requests received within a fixed period is very large, it is possible that the number of requests assigned to the process after the fixed period will become excessive, which is not conducive to balanced load distribution. As long as the number of allocated but unprocessed requests is below the predetermined request number threshold, such processes can be considered to have a relatively light processing load. In this way, the load can be evenly distributed to these processes, avoiding the situation where the process with the lightest processing load becomes overloaded after a fixed period.
[0096] For example, in the example above where the numbers of allocated but unprocessed requests for the six processes are 17, 28, 57, 186, 9, and 87, respectively, the number of allocated but unprocessed requests for each process is determined every five minutes. 17, 28, 57, 186, 9, and 87 are the numbers of allocated but unprocessed requests for each process determined five minutes prior. However, if 200 number issuance requests are received within those five minutes, and the process with the smallest number of allocated but unprocessed requests is assigned to those requests, the process with 9, which originally had 9 allocated but unprocessed requests, will see an increase of 200 requests after five minutes, potentially jumping from the process with the smallest number of allocated but unprocessed requests to the process with the largest number of allocated but unprocessed requests. However, if these 200 requests are randomly distributed among the three processes with numbers of allocated but unprocessed requests (17, 28, and 9), none of these three processes will have an excessive number of allocated but unprocessed requests after five minutes.
[0097] As described above, the number of requests allocated but not processed by each process can be periodically obtained. One way to periodically obtain this number is for each process to report it to the scheduling engine 120 at the end of a fixed period. Another way to periodically obtain this number is for the scheduling engine 120 to poll each process at the end of each fixed period, and for each process to include the request count in its response to the poll.
[0098] In one embodiment, in addition to the number of requests that have been allocated but not processed by each process, the number-issuing process is also allocated based on the processing capacity of the machine where each process is located.
[0099] Compared to assigning processes to requests based solely on the number of requests each process has already assigned but not yet processed, this approach has the advantage of fully considering the load each process can still handle, which is related not only to the load it has already assumed but also to its capacity to handle it. Some processes have inherently higher processing capabilities and can handle more requests per unit time than others, so even if they have more assigned processes, their processing performance will not be affected.
[0100] The processing capacity of the machine where each process is located refers to the processing performance of the number-dispensing machine where the process is located, which includes multiple aspects such as CPU processing performance and storage capacity. In one embodiment, the processing capacity of the machine where each process is located can be characterized by CPU processing speed and / or memory capacity. The faster the processing speed of the CPU of the machine where the process is located, the larger the memory capacity, and the fewer the number of requests that have been allocated but not processed by the process, the more requests should be allocated to such a process. In one embodiment, the priority of process allocation is generated based on an increasing function of the processing speed and memory capacity of the CPU of the machine where the process is located, and a decreasing function of the number of requests that have been allocated but not processed by the process. The priority score P of the process can be determined by the following formula:
[0101] P=as / Q+bM / Q Formula 1
[0102] Where P is the process's priority score, reflecting the priority assigned to requests, s represents the CPU processing speed of the process's machine, M represents the memory capacity of the process's machine, Q represents the number of requests assigned to the process but not yet processed, and a and b are the constant coefficients for the s / Q and M / Q ratios, respectively. As shown in Formula 1, the faster the CPU processing speed and the larger the memory capacity of the process's machine, the higher its priority score P. The fewer requests a process has assigned but not yet processed, the higher its priority score P.
[0103] In order to prevent the P value from becoming infinite when Q is equal to 0, a constant term q can be added to the denominator of Formula 1, that is:
[0104] P=as / (q+Q)+bM / (q+Q) Formula 2
[0105] Formula 2 can prevent the value of P from being too large when the number of requests that have been allocated but not processed by the process is close to 0.
[0106] In this embodiment, the process to be assigned to the request is determined based on the priority score P.
[0107] A method for determining a process to be assigned to a request based on a priority score includes assigning the process with the highest priority score to the request.
[0108] Another method for determining a process to assign to the request based on the priority score includes:
[0109] A process is randomly selected from the processes whose priority scores are higher than a predetermined priority score threshold as the process to which the request is issued.
[0110] Compared to assigning the process with the highest priority score to the request, this implementation has the following advantages: since s and M in Formula 1 are fixed, and Q is collected periodically, for example, every 5 minutes, process 1301 reports to the scheduling engine 120, so the priority score P changes once every fixed period. If all requests received in each fixed period are concentrated and assigned to one process, assuming that the number of requests received in a fixed period is large, it is possible that the number of requests assigned to the process after the fixed period will become excessive, which is not conducive to the balanced distribution of the load. As long as the priority score is higher than the predetermined priority score threshold, it can be considered that such processes have basically the same priority. In this way, these processes can be evenly distributed to avoid the situation where a process that originally had a very light processing load becomes overloaded after a fixed period.
[0111] In another embodiment, Figure 6 As shown, step 220 is performed by a scheduling engine, which can be as follows Figure 4A - The scheduling engine 120 shown in B. In this embodiment, step 220 may include:
[0112] Step 2201: Determine a first score based on the processing capability of the machine where the process is located.
[0113] Step 2202: Determine a second score based on the number of requests that have been assigned but not processed by the process.
[0114] Step 2203: Determine the total score of the process based on the first score and the second score;
[0115] Step 2204: Determine a process to assign to the request based on the total score.
[0116] Step 2205: Assign a determined process to the request.
[0117] These steps are described below.
[0118] In step 2201, a first score is determined based on the processing capability of the machine where the process is located. The higher the processing capability of the machine where the process is located, the higher the first score should be. The lower the processing capability of the machine where the process is located, the lower the first score should be.
[0119] As described above, in one embodiment, the processing capability of the machine where the process resides includes the CPU processing speed and memory capacity of the machine where the process resides. In one embodiment, the first score can be determined by looking up a table. A comparison table is pre-set, comparing various numerical intervals of the CPU processing speed and memory capacity of the machine where the process resides with the first score. In determining the first score, the numerical intervals of the CPU processing speed and memory capacity of the machine where the process resides are first determined. Then, based on the two determined numerical intervals, the first score corresponding to the two determined numerical intervals is searched in the comparison table.
[0120] In another embodiment, the first score is generated based on an increasing function of the processing capability of the machine where the process is located. As described above, in one embodiment, the processing capability of the machine where the process is located includes the CPU processing speed and memory capacity of the machine where the process is located. Therefore, in one embodiment, the first score can be an increasing function of the CPU processing speed and memory capacity of the machine where the process is located, respectively, as follows:
[0121] S1= a1s+b1M Formula 3
[0122] Wherein, S1 represents the first score, s represents the CPU processing speed of the machine where the process is located, M represents the memory capacity of the machine where the process is located, and a1 and b1 are weights assigned to s and M respectively.
[0123] Compared with the above method of determining the first score by looking up a table, Formula 3 improves the accuracy of determining the first score, thereby making the allocation process more scientific and improving the efficiency of number issuance.
[0124] In step 2202, a second score is determined based on the number of requests that have been allocated but not processed by the process. The greater the number of requests that have been allocated but not processed by the process, the smaller the second score should be. The smaller the number of requests that have been allocated but not processed by the process, the larger the second score should be.
[0125] In one embodiment, the second score can be determined by looking up a table. A comparison table is pre-set, comparing various numerical ranges of the number of requests allocated but not processed by the process with the second score. In determining the second score, the numerical range of the number of requests allocated but not processed by the process is first determined. Then, based on the determined numerical range, the second score corresponding to the determined numerical range is searched in the comparison table.
[0126] In another embodiment, the second score is generated based on a decreasing function of the number of requests that the process has assigned but not processed. The formula for determining the second score based on the number of requests that the process has assigned but not processed is as follows:
[0127] S2= c1 / Q Formula 4
[0128] Among them, S2 represents the first score, Q represents the number of requests that the process has assigned but not processed, and c1 is a constant coefficient.
[0129] Compared with the above method of determining the second score by looking up a table, Formula 4 improves the accuracy of determining the second score, thereby making the allocation process more scientific and improving the efficiency of number issuance.
[0130] In order to prevent the S2 value from becoming infinite when Q is equal to 0, a constant term q can be added to the denominator of Formula 4, that is:
[0131] S2= c1 / (q+Q) Formula 5
[0132] The advantage of Formula 5 over Formula 4 is that it avoids the excessively large value of S2 when the number of requests that have been allocated but not processed by the process is close to 0.
[0133] In step 2203, the total score of the process is determined based on the first score and the second score.
[0134] One implementation method for determining the total score of the process based on the first score and the second score is to calculate the sum of the first score and the second score as the total score. This implementation method considers the processing power of the machine where the process resides and the number of requests allocated but not processed by the process as two equally important factors.
[0135] Another implementation method for determining the total score of the process based on the first score and the second score is to calculate the weighted sum of the first score and the second score as the total score. This implementation method takes into account the processing power of the machine where the process is located and the importance of the number of requests that the process has been assigned but not processed. That is:
[0136] S=p1S1+p2S2 Formula 6
[0137] Among them, S represents the total score, S1 represents the first score, S2 represents the second score, p1 and p2 represent the weights assigned to the first score and the second score respectively, which are set in advance based on experience.
[0138] Compared to calculating the total score by summing the first and second scores, Formula 6 has the advantage of fully considering the processing power of the machine where the process resides and the fact that the number of requests allocated but not processed by the process has unequal impact on the effectiveness of process allocation. This allows for more reasonable allocation of requests to processes and improves the efficiency of number issuance.
[0139] In step 2204, a process to be assigned to the request is determined based on the total score.
[0140] A method for determining a process to be assigned to the request based on a total score includes assigning the process with the largest total score to the request.
[0141] Another method of determining a process to assign to the request based on the total score includes:
[0142] From the processes whose total scores are higher than a predetermined total score threshold, one is randomly selected as the process to which the request is issued.
[0143] Compared to assigning the process with the largest total score to the request, this implementation has the following advantages: s and M are fixed, so the first score is relatively fixed. Q is collected periodically and will change in each fixed period, so the second score will change in each fixed period, resulting in the total score changing once in each fixed period. If all requests received in each fixed period are concentrated and assigned to one process, assuming that the number of requests received in a fixed period is large, it is possible that the number of requests assigned to the process after the fixed period will become excessive, which is not conducive to balanced load distribution. As long as the total score is higher than the predetermined priority score threshold, it can be considered that such processes have basically the same priority. In this way, they can be evenly distributed to these processes to avoid the situation where a process that originally had a very light processing load becomes overloaded after a fixed period.
[0144] In step 2205, the process is assigned to the request.
[0145] After determining the process to be assigned to the request in step 2204, in this step, the process can be assigned to the request.
[0146] Different processes are responsible for issuing different number segments. This means that no number can belong to multiple number segments and be issued by multiple processes at the same time. If a number can be issued by multiple processes, it will cause duplication of issued numbers.
[0147] Each process issues numbers in parallel, which greatly improves the efficiency of number issuance compared to when only one process can issue numbers at the same time.
[0148] After a process assigns a number to a request, there may be multiple requests currently assigned to that process but not yet executed. If numbers are assigned to multiple requests simultaneously, execution congestion will result. To avoid execution congestion, one embodiment of the present disclosure establishes a waiting queue for each process, queuing all requests assigned to that process in this queue. When a process finishes issuing numbers for the currently executing request, the request at the top of its queue receives the next execution right, and the process begins issuing numbers for it.
[0149] In this embodiment, when the user terminal generates a request for number issuance, the request carries a request timestamp, which identifies the time when the request is generated.
[0150] like Figure 7 As shown, in one embodiment, after step 220, the method further includes: step 225, placing the request in a queue of the assigned process based on the request timestamp.
[0151] In one embodiment, the requests are queued in a time sequence of request timestamps from earliest to latest.
[0152] For example, there are 6 requests in the queue, and their request timestamps are:
[0153] Request 1: 2018-06-05 11:27:34;
[0154] Request 2: June 5, 2018, 11:25:56 AM;
[0155] Request 3: June 5, 2018, 11:26:35 AM;
[0156] Request 4: 2018-06-05 11:26:55;
[0157] Request 5: 2018-06-05 11:27:10;
[0158] Request 6: 2018-06-05 11:26:11.
[0159] After sorting these 6 requests from earliest to latest according to the time sequence of the request timestamps, the following queue is formed:
[0160] Request 2: June 5, 2018, 11:25:56 AM;
[0161] Request 6: 2018-06-05 11:26:11;
[0162] Request 3: June 5, 2018, 11:26:35 AM;
[0163] Request 4: 2018-06-05 11:26:55;
[0164] Request 5: 2018-06-05 11:27:10;
[0165] Request 1: 2018-06-05 11:27:34.
[0166] The request timestamp indicates the time when the request was generated, not the time when the request arrived at the process. Due to factors such as network transmission speed, it is possible that a request generated earlier may arrive at the process later. Therefore, in one embodiment, step 225 includes:
[0167] placing the request in a queue of the allocated process;
[0168] Rearrange the requests in the queue in order of timestamp from earliest to latest.
[0169] That is to say, after the request is placed in the queue of the assigned process, the timestamp of the request is not necessarily the latest in the entire queue. This is because due to network reasons, some requests generated later than the request may arrive in the queue first. Therefore, the processes in the queue are reordered in order of timestamp from earliest to latest. One way to reorder is:
[0170] Assigning the request to the last position in the queue;
[0171] The timestamp of the request is compared with the timestamp of the previous request in its queue in sequence. If the timestamp of the request is earlier than the timestamp of the previous request, the positions are swapped until the timestamp of the request is later than the timestamp of the previous request.
[0172] Compared with the method of reordering by shuffling the timestamps of each request in the queue, this reordering method greatly reduces the number of comparisons and improves the efficiency of reordering.
[0173] For example, the process queue has six requests with timestamps as shown above. Request 7 is added to the queue. The timestamp of request 7 is 11:27:04, June 5, 2018.
[0174] First, place request 7 at the end of the queue. The queue becomes:
[0175] Request 2: June 5, 2018, 11:25:56 AM;
[0176] Request 6: 2018-06-05 11:26:11;
[0177] Request 3: June 5, 2018, 11:26:35 AM;
[0178] Request 4: 2018-06-05 11:26:55;
[0179] Request 5: 2018-06-05 11:27:10;
[0180] Request 1: 2018-06-05 11:27:34;
[0181] Request 7: 2018-06-05 11:27:04.
[0182] Compare request 7 with the timestamp of its previous request (request 1) in the queue. Since its timestamp is earlier than that of the previous request (request 1), swap the positions of request 7 and request 1. The queue now becomes:
[0183] Request 2: June 5, 2018, 11:25:56 AM;
[0184] Request 6: 2018-06-05 11:26:11;
[0185] Request 3: June 5, 2018, 11:26:35 AM;
[0186] Request 4: 2018-06-05 11:26:55;
[0187] Request 5: 2018-06-05 11:27:10;
[0188] Request 7: 2018-06-05 11:27:04;
[0189] Request 1: 2018-06-05 11:27:34.
[0190] Compare request 7 with the timestamp of its previous request (request 5) in the queue. Since its timestamp is earlier than the previous request (request 5), swap the positions of request 7 and request 5. The queue becomes:
[0191] Request 2: June 5, 2018, 11:25:56 AM;
[0192] Request 6: 2018-06-05 11:26:11;
[0193] Request 3: June 5, 2018, 11:26:35 AM;
[0194] Request 4: 2018-06-05 11:26:55;
[0195] Request 7: 2018-06-05 11:27:04;
[0196] Request 5: 2018-06-05 11:27:10;
[0197] Request 1: 2018-06-05 11:27:34.
[0198] Comparing request 7 with the timestamp of its previous request (request 4) in the queue, since request 7 is later than the timestamp of the previous request (request 4), their positions are no longer swapped.
[0199] The advantage of the request timestamp-based queuing method is that it eliminates the unfairness caused by late requests due to network reasons being placed at the front of the queue.
[0200] In another embodiment, the request further contains a priority. The priority refers to the degree of priority when the request is queued in the queue of the process. The priority can be determined according to various factors. In one embodiment, it is determined according to the issuer of the request. That is, if the request for number allocation comes from an entity (enterprise, organization, government agency, social group, etc.), rather than an individual, the request has a high priority and is allocated a number in priority.
[0201] In one embodiment, in addition to the request timestamp, the request is queued in the queue of the allocated process according to the priority. In one embodiment, it can specifically include:
[0202] Requests with high priority are queued in front of requests with low priority in the queue;
[0203] For requests of the same priority, requests are queued in the queue in the order of the request timestamp from early to late.
[0204] For example, there are 6 requests in the queue, and their request timestamps and priorities are as follows:
[0205] Request 1: June 5, 2018 11:27:34; Priority: High;
[0206] Request 2: June 5, 2018 11:25:56; Priority: Low;
[0207] Request 3: June 5, 2018 11:26:35; Priority: High;
[0208] Request 4: June 5, 2018 11:26:55; Priority: Low;
[0209] Request 5: June 5, 2018 11:27:10; Priority: Low;
[0210] Request 6: June 5, 2018 11:26:11; Priority: Low.
[0211] Since the priorities of requests 1 and 3 are high, they are queued in front of the remaining 4 requests. Since the request timestamp of request 3 is earlier than that of request 1, request 3 is queued in front of request 1. For the 4 requests with low priority, the order of the request timestamps from early to late is: request 2, request 6, request 4, request 5. The queue becomes:
[0212] Request 3: June 5, 2018 11:26:35; Priority: High;
[0213] Request 1: June 5, 2018 11:27:34; Priority: High;
[0214] Request 2: 2018-06-05 11:25:56; Priority: Low;
[0215] Request 6: 2018-06-05 11:26:11; Priority: Low;
[0216] Request 4: 2018-06-05 11:26:55; Priority: Low;
[0217] Request 5: 2018-06-05 11:27:10; Priority: Low.
[0218] Since this embodiment takes into account both the request timestamp and the priority, the urgency of the request for number allocation is distinguished, and for some situations where it is necessary to allocate the number first, it can be allocated first, increasing the flexibility of the allocation method.
[0219] In another embodiment, based on the request timestamp and the priority, queuing the request in the queue of the allocation process can include:
[0220] determining a request timestamp score based on the request timestamp;
[0221] determining a priority score based on the priority;
[0222] determining a total ranking score based on the request timestamp score and the priority score;
[0223] queuing the request in the queue of the allocation process based on the total ranking score.
[0224] Determining the request timestamp score based on the request timestamp can be performed by looking up a request timestamp score and time difference table. The determination of the request timestamp score can be performed at predetermined time intervals, or in response to a new request entering the queue. In the embodiment of determining the request timestamp score at predetermined time intervals (e.g., 1 minute), the time point at the end of the predetermined time interval is the current time. In the embodiment of determining the request timestamp score in response to a new request entering the queue, the time point of the new request entering the queue is the current time. For example, at 11:29:42 on June 5, 2018, a new request enters the queue, and the timestamp of a request in the queue is 2018-06-05 11:28:37, so the time difference is 1 minute and 5 seconds.
[0225] An example of the request timestamp score and time difference table is as follows:
[0226] The difference between the request timestamp and the current time Request timestamp score 0-30 seconds 0 30-50 seconds 1 50-60 seconds 2 60-70 seconds 3 70-80 seconds 4 80 and above 5
[0227] Table 1
[0228] When the time difference is 1 minute and 5 seconds, which falls in the interval of 60-70 seconds, look up the table to get the request timestamp score as 3.
[0229] The priority score based on the priority can also be determined by looking up a pre-set priority-priority score table. In the case where the priority has only two levels, high and low, a priority-priority score table can be as follows:
[0230] Priority Priority score Low 0 high 5
[0231] Table 2
[0232] In the case where the priority has five levels, the first level is the highest priority, the second level is the second highest priority, and the third, fourth and fifth levels are increasingly lower priorities, a corresponding priority-priority score table can be as follows:
[0233] Priority Priority score Level 1 5 Level 2 4 Level 3 3 Level 4 2 Level 5 1
[0234] Table 3
[0235] One embodiment of determining the total score for ordering based on the request timestamp score and the priority score is to add the request timestamp score and the priority score to get the total score for ordering. This embodiment is based on the assumption that the request timestamp and the priority should have the same impact on the ordering of the requests.
[0236] However, the request timestamp and the priority can not have the same impact on the ordering of the requests, depending on the specific application. Which factor has a greater impact depends on the value orientation of the system designer. Therefore, in another embodiment, the weighted sum of the request timestamp score and the priority score is used as the total score for ordering. For example, the request timestamp score is 3, the priority score is 5, the request timestamp is given a weight of 0.6, and the priority score is given a weight of 0.4, then the total score for ordering = 3 x 0.6 + 5 x 0.4 = 1.8 + 2 = 3.8.
[0237] Compared to the embodiment of adding the request timestamp score and the priority score to get the total score for ordering, this weighted sum embodiment takes into account that the request timestamp and the priority can not have the same impact on the ordering of the requests, making the ordering more flexible.
[0238] One embodiment of queuing the requests into the queue of the allocated process based on the total score for ordering is to queue the requests into the queue of the allocated process in the order of the total score for ordering from high to low.
[0239] In one embodiment, queuing the requests into the queue of the allocated process in the order of the total score for ordering from high to low comprises:
[0240] placing the request in a queue of the allocated process;
[0241] Rearrange the requests in the queue in order of timestamp from earliest to latest.
[0242] One way to rearrange is:
[0243] Assigning the request to the last position in the queue;
[0244] The total ranking score of the request is compared with the total ranking score of the previous request in its queue in turn. If the total ranking score of the request is higher than the total ranking score of the previous request, the positions will be swapped until the total ranking score of the request is lower than the total ranking score of the previous request.
[0245] Compared with the method of reordering by shuffling the total ranking score of each request in the queue, this reordering method greatly reduces the number of comparisons and improves the efficiency of reordering.
[0246] For example, the process queue has 6 requests, sorted from high to low by total score:
[0247] Request 3: 4.5 points;
[0248] Request 6: 3.7 points;
[0249] Request 5: 3.5 points;
[0250] Request 2: 3.1 points;
[0251] Request 4: 2.9 points;
[0252] Request 1: 2.5 points.
[0253] At this time, request 7 joins the queue. The total score of request 7 is 3.0 points.
[0254] First, place request 7 at the end of the queue. The queue becomes:
[0255] Request 3: 4.5 points;
[0256] Request 6: 3.7 points;
[0257] Request 5: 3.5 points;
[0258] Request 2: 3.1 points;
[0259] Request 4: 2.9 points;
[0260] Request 1: 2.5 points;
[0261] Request 7: 3.0 points.
[0262] Compare request 7 with the total score of its previous request (request 1) in the queue. Since its total score is higher than that of the previous request (request 1), the positions of request 7 and request 1 are swapped. The queue now becomes:
[0263] Request 3: 4.5 points;
[0264] Request 6: 3.7 points;
[0265] Request 5: 3.5 points;
[0266] Request 2: 3.1 points;
[0267] Request 4: 2.9 points;
[0268] Request 7: 3.0 points;
[0269] Request 1: 2.5 points.
[0270] Compare request 7 with the total score of its previous request (request 4) in the queue. Since request 7 is earlier than the previous request (request 4), swap the positions of request 7 and request 4. The queue becomes:
[0271] Request 3: 4.5 points;
[0272] Request 6: 3.7 points;
[0273] Request 5: 3.5 points;
[0274] Request 2: 3.1 points;
[0275] Request 7: 3.0 points;
[0276] Request 4: 2.9 points;
[0277] Request 1: 2.5 points.
[0278] Comparing the total score of request 7 with the previous request (request 2) in the queue, since request 7 has a lower total score than the previous request (request 2), they are no longer swapped.
[0279] As described above, each process is responsible for issuing numbers within a number segment, and the number of numbers each process is responsible for issuing can be different. In one embodiment, the number of numbers within a number segment that a process is responsible for issuing is determined based on the total number of numbers allocated to the geographic area where the process is located and the number of processes within that geographic area. The geographic area here can be an administrative area, for example, each province or municipality is an administrative area, or each county is an administrative area. It can also be a grid area with a predetermined length and width on a map, for example, dividing the geography into 10 km x 10 km squares, with each square being a geographic area. In one embodiment, when initially allocating number segments, the number of numbers within a number segment that a process is responsible for issuing is equal to the total number of numbers allocated to the geographic area where the process is located divided by the number of processes within that geographic area. In other words, the greater the total number of numbers allocated to the geographic area where the process is located, the greater the number of numbers within the number segment that each process is responsible for issuing; and the greater the number of processes within that geographic area, the smaller the number of numbers within the number segment that each process is responsible for issuing. Therefore, in order to control the balance of the number of numbers in the number segment that each process is responsible for issuing, in some prosperous areas, such as Beijing and Shanghai, if the request volume is relatively large, it is necessary to divide it into the total number of numbers in the area, so more processes need to be set up in the area to share the burden.
[0280] In the above embodiment, in a geographical area, the number of numbers in the number segment that each process is responsible for issuing is evenly distributed. However, in actual situations, the processing capabilities of each process are different, that is, the number of numbers issued for requests per unit time is different. Some processes issue more numbers per unit time (for example, one day, one hour), while some processes issue fewer numbers per unit time (for example, one day, one hour). In order to fully consider the ability of different processes to issue numbers, in one embodiment, the number of numbers in the number segment that a process is responsible for issuing is determined according to the following method, which is executed by the process number configuration server, such as Figure 4A The process number configuration server 140 in the process number configuration server 140. Specifically, the method is executed by the number configuration engine, such as Figure 4B The number configuration engine 1404 in the method includes:
[0281] Obtain the total number of numbers allocated to the geographical area where the process is located;
[0282] Obtain the number of numbers issued per unit time reported by each process in the geographical area where the process is located;
[0283] Determine the average number of issued numbers per unit time reported by each process per unit time;
[0284] The total number of numbers allocated to the geographical area where the process is located is distributed according to the ratio of the average number of each process.
[0285] The method of obtaining the total number of numbers allocated to the geographical area where the process is located will be described in detail later.
[0286] Obtaining the number of numbers issued per unit time reported by each process in the geographical area where the process is located can be achieved by the process 1301 reporting to the process number configuration server 140 every unit time (for example, one day, one hour), or by the process number configuration server 140 polling each process 1301 every unit time (for example, one day, one hour), and having each process 1301 respond.
[0287] The average number of issued numbers per unit time reported by each process per unit time may be determined by the process number configuration server 140 averaging the number of issued numbers per unit time reported per unit time in the history of the process.
[0288] The total number of numbers allocated to the geographical area where the process is located can be distributed according to the ratio of the average number of each process by the following formula:
[0289] M i =M×L i / (L1+L2+……+L n ) Formula 7
[0290] Where n is the total number of processes in the geographical area where the process is located, M is the total number of numbers allocated to the geographical area where the process is located, and M i is the total number of numbers in the number segment allocated by the i-th process (1≦i≦n), L i represents the above average calculated for the i-th process.
[0291] For example, there are five processes in a certain geographic area. The average number of numbers issued on each day reported by each process is 12,000, 8,000, 14,000, 6,000, and 10,000, respectively. The total number of processes in this geographic area is 100,000. Therefore, the total number of numbers in the number range allocated to the third process is:
[0292] 100000×14000 / (12000+8000+14000+6000+10000)=28000.
[0293] The advantage of this embodiment is that it fully considers the ability of different processes to issue numbers, and the total number of numbers in the geographical area is not distributed evenly, but is distributed according to the ability of different processes to issue numbers, which is conducive to improving the overall issuance efficiency.
[0294] The total number of numbers allocated to each geographic area is related to the number of number issuance requests in that geographic area. Generally speaking, the more prosperous the geographic area, the more likely it is to receive more number issuance requests, and in this case, a larger total number of numbers will be allocated.
[0295] like Figure 8 As shown, in one embodiment, the total number of numbers in the geographical area where the process is located is allocated according to the following method. The method is executed by the process number configuration server, such as Figure 4A The process number configuration server 140 in the process number configuration server 140. Specifically, the method is executed by the number configuration engine, such as Figure 4B The number configuration engine 1404 in the method includes:
[0296] Step 310: Obtain the total number of numbers to be issued;
[0297] Step 320: Obtain the historical average number of requests per unit time for each geographical area;
[0298] Step 330: Allocate the total number of numbers to be issued according to the historical proportion of the average number of requests per unit time in each geographical area.
[0299] These steps are described in detail below.
[0300] In step 310 , the total number of numbers to be issued may be obtained by the process number configuration server 140 reading the number issuance task from the number issuance task when receiving the number issuance task.
[0301] In step 320, the average number of requests per unit time in the history of each geographical area is obtained by obtaining the number of requests per unit time in the history of each geographical area and then averaging the number of requests per unit time in the history of the geographical area.
[0302] In one embodiment, obtaining the number of requests per unit time in the history of each geographical area can be achieved by each process reporting the number of number issuance requests received per unit time to the process number configuration server 140 at the end of each unit time, and then the process number configuration server 140 adding up the number of number issuance requests reported by the processes in the geographical area during the unit time.
[0303] In one embodiment, obtaining the number of requests per unit time in the history of each geographical area can be achieved by having the process number configuration server 140 inquire of each process in the geographical area at the end of each unit time about the number of number issuance requests received within the unit time, having each process respond, and then having the process number configuration server 140 add up the number of number issuance requests reported by the processes in the geographical area within the unit time.
[0304] In step 330, the total number of numbers to be issued is allocated according to the ratio of the average number of requests per unit time in history of each geographical area.
[0305] Step 330 can be implemented by the following formula:
[0306] F i =F×H i / (H1+H2+……+H l ) Formula 8
[0307] Where i is the number of geographical areas, F is the total number of numbers to be issued, and F i is the total number of numbers to be issued in the i-th geographical area (1≦i≦l), H i Represents the historical average number of requests per unit time in the i-th geographical area.
[0308] For example, there are five geographical regions. The historical average number of requests per unit time calculated for each geographical region is 110,000, 90,000, 100,000, 130,000, and 70,000. The total number of numbers to be issued is 1,000,000. For the third geographical region, the total number of numbers allocated is:
[0309] 1000000×100000 / (110000+90000+100000+130000+70000)=200000.
[0310] The advantage of this embodiment is that it fully considers the possible imbalance in the number of requests in different geographical areas and distributes the number of numbers allocated to each geographical area according to the actual number of requests in the geographical area, which is conducive to load balancing and improving the overall issuance efficiency.
[0311] In step 230, the allocation process selects a number from the number segment responsible for issuance and issues it to the user.
[0312] Since the cache of a process is often very small, if the assigned process takes all the numbers it is responsible for issuing and puts them into its cache, it may cause the cache to overflow or the process performance to decline. In order to avoid causing the process cache to overflow or the performance to decline, in one embodiment, Figure 9 As shown, step 230 includes:
[0313] Step 2301: The allocated process takes a sub-number segment from the number segment it is responsible for issuing and puts it into the cache of the process;
[0314] Step 2302: Take a number from the sub-number segment in the cache and issue it to the user.
[0315] The above process is performed by processes (such as Figure 4A- Process 1301 in B is executed.
[0316] like Figure 4B As shown, when assigning a number segment for process 1301 to issue, process 1301 first obtains an unassigned process ID from process ID table 1401. Process ID table 1401 reports this process ID to number configuration engine 1404, which then assigns the process the number segment it is responsible for issuing. The method for assigning number segments is described above. Number configuration engine 1404 then stores the process ID and the assigned number segment in number segment configuration table 1402. Process 1301 can use the process ID to find the number segment it is responsible for issuing in number configuration table 1402. Simultaneously, number configuration engine 1404 writes the assigned number segment to the sub-segment allocation table. Once process 1301 knows the number segment it is responsible for issuing, it does not store the entire number segment in its own cache for issuance (the cache of the number issuing machine where the process is located is limited). Instead, it extracts sub-segments from the number segment one by one for issuance. Since the number configuration engine 1404 writes the number segment allocated to the process in the sub-segment allocation table, the process 1301 takes out the sub-segments one by one from the sub-segment allocation table 1403, puts the taken out sub-segments in its own cache for distribution, and the untaken sub-segments remain in the sub-segment allocation table 1403.
[0317] In one embodiment, the sub-segments taken out from the sub-segment allocation table each time by a process are of equal size. In another embodiment, the sub-segments taken out from the sub-segment allocation table each time by a process are of unequal size, which can be determined based on the current processing speed of the process, etc. If the process has recently issued more numbers per unit time (for example, per hour) (possibly because the machine where it is located has not recently processed other tasks, and the remaining CPU power and memory storage capacity are large), a larger sub-segment can be used. If the process has recently issued fewer numbers per unit time (for example, per hour) (possibly because the machine where it is located has recently processed other tasks, and the remaining CPU power and memory storage capacity are small), a smaller sub-segment can be used.
[0318] In one embodiment, the number of numbers contained in the extracted sub-number segment is determined based on the average number of numbers issued per unit time in the history of the process. In one embodiment, this is specifically implemented as follows:
[0319] At the end of each unit time (for example, one hour), obtain the number of numbers issued by the process in that unit time;
[0320] Average the number of numbers issued per unit time in the history of the process;
[0321] The number of numbers contained in the extracted sub-number segment is determined based on the average number of numbers issued in each unit time.
[0322] The above is executed by the process number configuration server, such as Figure 4A The process number configuration server 140 in the process number configuration server 140. Specifically, the method is executed by the number configuration engine, such as Figure 4B The number configuration engine 1404 in.
[0323] At the end of each unit time (for example, one hour), the number of numbers issued by the process in that unit time is obtained. This can be done by each process reporting to the process number configuration server 140 at the end of each unit time, or by the process number configuration server 140 inquiring each process at the end of each unit time and having each process respond.
[0324] The number of numbers contained in the extracted sub-number segment can be determined based on the average number of numbers issued per unit time using the following formula:
[0325] D=αC Formula 9
[0326] Among them, C represents the average number of numbers issued per unit time in the process, α is the corresponding coefficient, and D is the number of numbers contained in the extracted sub-number segment.
[0327] In another embodiment, the number of numbers contained in the extracted sub-number segment can also be determined based on the number of numbers issued per unit time by the process. In one embodiment, this is specifically implemented as follows:
[0328] At the end of the current unit time (for example, one hour), obtain the number of numbers issued by the process in the current unit time;
[0329] The number of numbers contained in the retrieved sub-number segment is determined according to the number of numbers issued in the current unit time.
[0330] The above process is executed by the process number configuration server, such as Figure 4A The process number configuration server 140 in the process number configuration server 140. Specifically, the method is executed by the number configuration engine, such as Figure 4B The number configuration engine 1404 in.
[0331] At the end of the current unit time (for example, one hour), the number of numbers issued by the process in the current unit time is obtained. This can be done by each process reporting to the process number configuration server 140 at the end of the current unit time, or by the process number configuration server 140 inquiring each process at the end of the current unit time and having each process respond.
[0332] The number of numbers contained in the sub-number segment to be retrieved can be determined based on the number of numbers issued per unit time using the following formula:
[0333] D=βC1 Formula 10
[0334] Among them, C1 represents the number of numbers issued by the process per unit time, β is the corresponding coefficient, and D is the number of numbers contained in the extracted sub-number segment.
[0335] Since the number of numbers issued per unit time can better reflect the current processing capacity of the process, compared with the solution of determining the number of numbers contained in the sub-segment extracted according to the average number of numbers issued per unit time, the number of numbers contained in the sub-segment extracted is determined according to the number of numbers issued per unit time. The number of sub-segment numbers extracted is more suitable for the current actual situation of the process and is conducive to improving the issuance efficiency.
[0336] In one embodiment, the process may extract numbers from the cached sub-number segment and issue them in ascending order.
[0337] In another embodiment, the process can randomly select numbers from the cached sub-number segment and remove them from the cache after issuance. Compared to embodiments that select numbers from the smallest to the largest sub-number segment, this random issuance method makes it more difficult for attackers to infer the next number to be issued and makes it difficult for users to see the number of numbers currently issued, thus improving information security.
[0338] In addition, in one embodiment, step 230 includes: the allocation process selects a number from the number segment responsible for issuance, and if the selected number does not meet the preset filtering rules, the number is issued to the user.
[0339] like Figure 11 As shown, after step 220 (the process of allocating a number for the request), process 130 begins issuing a number for the request. First, process 130 selects a number from the corresponding sub-number segment. Instead of issuing the number immediately, it sends it to number filtering module 2307 for filtering. During filtering, number filtering module 2307 compares the number with filtering rules 2308. If the number meets the preset filtering rules 2308, the number is not issued. If the number does not meet the preset filtering rules 2308, the number is issued.
[0340] A typical application of this technical solution is the reservation of attractive numbers. This involves reserving numbers that contain a large number of numbers considered auspicious (such as 6 or 8) and not issuing them to regular users. Instead, they are sold at different prices. For example, numbers such as 88888888, 66666666, and 68686868, where all digits consist of 6 or 8, command the highest prices. Numbers such as 14156688 and 17356868, where the last digits consist of 6 or 8 but the first digits contain other digits, command lower prices than numbers where all digits consist of 6 or 8, but are still sold as attractive numbers. Therefore, rules for these attractive numbers are pre-set in the filtering rules 2308. These numbers cannot be issued normally. The filtering rules 2308 can be pre-configured as needed, for example, to ensure that at least the last four digits consist of 6 or 8.
[0341] like Figure 10 As shown, in one embodiment, after step 230, the method further includes:
[0342] Step 240: Notify the operating server of the issued number segment. If the issued number segment matches the preset operating rules of the operating server, the operating server sends an activity notification message to the user.
[0343] After the process issues a number to the user, it also notifies the operator server 2403 of the issued number segment. Operator services are services provided based on operator needs when an application user meets or triggers certain conditions. These services are often beneficial to users, often aiming to enhance the user experience and thus strengthen user retention.
[0344] The operation service module 2401 in the operation server 2403 compares the number issued to the user with the preset operation rules 2402. If there is a match, an operation activity is performed on the user, such as sending a gift, sending a red envelope, etc. For example, the preset operation rule is that the sum of the second and fourth digits of the number equals the sixth digit.
[0345] In such Figure 1A In the scenario where the application ID is issued during application registration as shown in -F, the operation activity is sending red envelopes or gifts. Figure 1E The interface shows that after the number is issued to the user during the application registration, if the number issued to the user matches the preset operation rules, the user can receive the red envelope. Figure 1E If the user clicks the “Receive Red Envelope” button, the user will receive the red envelope. Figure 1F This shows the interface where after the number is issued to the user during the application registration, if the number issued to the user matches the preset operation rules, a gift is given to the user and the user is allowed to view the gift. Figure 1FIf the user clicks the "View Gift" button, the user will view the gift details (including gift name, price), etc. After the user fills in the address, zip code and other information, the gift will be mailed to the user according to the address and zip code filled in by the user.
[0346] In such Figure 2A In the lottery number distribution scenario shown in -H, the operational activity is lottery winning. The operational rules are the winning rules. For example, there is one first prize winner, with the number 28709732; ten second prize winners, with the last seven digits being 7679972; one hundred third prize winners, with the last six digits being 070837; and ten thousand commemorative prize winners, with the last four digits being 0452.
[0347] In such Figure 3A In the vehicle lottery scenario shown in Figure 1, the operational activity is winning the lottery, meaning obtaining a license plate number. The operational rules might be a list of lottery IDs. For example, in this lottery, license plates were issued to 10,000 people. The operational rules might be a list of 10,000 lottery IDs. This list could be randomly drawn by a computer from all users who received lottery IDs.
[0348] In such Figure 1A In the scenario of issuing an application ID during application registration shown in -F, notifying the operator server of the issued number is performed after or simultaneously with issuing the selected number to the user, and is triggered by the action of issuing the selected number to the user.
[0349] In such Figure 2A In the lottery number distribution scenario shown in -H, the distribution number is notified to the operation server by Figure 2D The user touches "Check if you have won" on the interface shown (in the case of immediate prize drawing), or Figure 2G The interface shown is triggered by the user touching "check the winning situation" (in the case of regular prize draws), which is not carried out at the same time as the selected numbers are issued to the user.
[0350] In such Figure 3A In the vehicle lottery scenario shown in -H, the issued number is notified to the operation server by Figure 3H As shown, the action is triggered by the user opening the application at the specified time to check whether he is eligible to receive the license plate number, and it is not carried out at the same time as the selected number is issued to the user.
[0351] According to one embodiment of the present disclosure, Figure 12 As shown, a number issuing device is also provided, comprising:
[0352] Receiving unit 410, configured to receive a request from a user for number issuance;
[0353] an allocating unit 420, configured to allocate a number issuance process to the request, wherein the process is responsible for issuing numbers within a number segment, different processes are responsible for issuing different number segments, and each process issues numbers in parallel;
[0354] The selection unit 430 is used to select a number from the number segment responsible for issuance by the allocation process and issue it to the user.
[0355] In one embodiment, the allocating unit 420 is further configured to allocate a number-issuing process to the request based on the number of requests that have been allocated but not processed by each process.
[0356] In one embodiment, the allocating unit 420 is further configured to allocate the request to the process having the least number of allocated but unprocessed requests.
[0357] In one embodiment, the allocating unit 420 is further configured to randomly select one of the processes whose number of allocated but unprocessed requests is lower than a predetermined request number threshold as the process to which the request is issued.
[0358] In one embodiment, the allocating unit 420 is further configured to allocate a process for issuing a number to the request based on the processing capability of the machine where each process is located.
[0359] In one embodiment, the processing capability of the machine where the process is located includes the CPU processing speed and memory capacity of the machine. The allocation unit 420 is further configured to:
[0360] The priority score P of the process is determined by the following formula:
[0361] P=as / Q+bM / Q
[0362] Where P is the priority score of the process, which reflects the priority of assigning it to requests, s represents the CPU processing speed of the machine where the process is located, M represents the memory capacity of the machine where the process is located, Q represents the number of requests that the process has been assigned but not processed, and a and b are constant coefficients for s / Q and M / Q respectively.
[0363] Based on the priority score, a process to be assigned to the request is determined.
[0364] In one embodiment, the processing capability of the machine where the process is located includes the CPU processing speed and memory capacity of the machine. The allocation unit 420 is further configured to:
[0365] The priority score P of the process is determined by the following formula:
[0366] P=as / (q+Q)+bM / (q+Q)
[0367] Where P is the priority score of the process, which reflects the priority of assigning it to requests, s represents the CPU processing speed of the machine where the process is located, M represents the memory capacity of the machine where the process is located, Q represents the number of requests that the process has been assigned but not processed, a and b are the constant coefficients assigned to s / Q and M / Q respectively, and q is a constant term;
[0368] Based on the priority score, a process to be assigned to the request is determined.
[0369] In one embodiment, determining the process to be assigned to the request based on the priority scores includes: assigning the process with the highest priority score to the request.
[0370] In one embodiment, determining the process to be assigned to the request based on the priority score includes randomly selecting one of the processes having a priority score higher than a predetermined priority score threshold as the process to which the request is issued.
[0371] In one embodiment, the allocating unit 420 is further configured to:
[0372] Determine a first score based on the processing capability of the machine where the process is located;
[0373] Determine a second score based on the number of requests that have been assigned to the process but not processed;
[0374] determining a total score for the process based on the first score and the second score;
[0375] Based on the total score, a process to be assigned to the request is determined.
[0376] In one embodiment, the processing capability of the machine where the process is located includes the CPU processing speed and memory capacity of the machine where the process is located. The first score is determined according to the following formula:
[0377] S1=a1s+b1M
[0378] Wherein, S1 represents the first score, s represents the CPU processing speed of the machine where the process is located, M represents the memory capacity of the machine where the process is located, and a1 and b1 are weights assigned to s and M respectively.
[0379] In one embodiment, the second score is determined according to the following formula:
[0380] S2=c1 / Q
[0381] Among them, S2 represents the first score, Q represents the number of requests that the process has assigned but not processed, and c1 is a constant coefficient.
[0382] In one embodiment, the second score is determined according to the following formula:
[0383] S2=c1 / (q+Q)
[0384] Where S2 represents the first score, Q represents the number of requests that have been assigned but not processed by the process, c1 is a constant coefficient, and q is a constant term.
[0385] In one embodiment, determining the total score of the process based on the first score and the second score includes:
[0386] The weighted sum of the first score and the second score is taken as the total score.
[0387] In one embodiment, based on the total score, determining the process to assign to the request includes: randomly selecting one of the processes whose total scores are higher than a predetermined total score threshold as the process to which the request is issued.
[0388] In one embodiment, a waiting queue is set for each process, and the request includes a request timestamp. The apparatus further includes:
[0389] A queuing unit (not shown) is used for placing the request into a queue of the allocated process based on the request timestamp after allocating the process of issuing the number to the request.
[0390] In one embodiment, queuing the request in a queue of an assigned process based on the request timestamp includes:
[0391] placing the request in a queue of the allocated process;
[0392] Rearrange the requests in the queue in order of timestamp from earliest to latest.
[0393] In one embodiment, the rearrangement comprises:
[0394] Assigning the request to the last position in the queue;
[0395] The timestamp of the request is compared with the timestamp of the previous request in its queue in sequence. If the timestamp of the request is earlier than the timestamp of the previous request, the positions are swapped until the timestamp of the request is later than the timestamp of the previous request.
[0396] In one embodiment, the request further includes a priority, and queuing the request in the queue of the assigned process is also based on the priority.
[0397] In one embodiment, queuing the request in a queue of an assigned process based on the request timestamp and priority includes:
[0398] Put high-priority requests ahead of low-priority requests in the queue;
[0399] For requests of the same priority, the requests are queued in the order of the request timestamps from earliest to latest.
[0400] In one embodiment, queuing the request in a queue of an assigned process based on the request timestamp and priority includes:
[0401] Based on the request timestamp, determining a request timestamp score;
[0402] Based on the priority, determine the priority score;
[0403] Determine the total ranking score based on the request timestamp score and priority score;
[0404] Based on the total ranking score, the request is queued in the queue of the assigned process.
[0405] In one embodiment, placing the request in a queue of the assigned process based on the total ranking score comprises:
[0406] placing the request in a queue of the allocated process;
[0407] Rearrange the requests in the queue in order of timestamp from earliest to latest.
[0408] In one embodiment, the rearrangement comprises:
[0409] Assigning the request to the last position in the queue;
[0410] The total ranking score of the request is compared with the total ranking score of the previous request in its queue in turn. If the total ranking score of the request is higher than the total ranking score of the previous request, the positions will be swapped until the total ranking score of the request is lower than the total ranking score of the previous request.
[0411] In one embodiment, the process is assigned a number segment as follows: i =AX+i as a number segment and assign it to process i (i=1, 2, 3...n), where A is a positive integer not less than n, X is a positive integer, and Y is a positive integer. i is the number assigned to thread i.
[0412] In one embodiment, the number of numbers in the number segment that a process is responsible for issuing is determined according to the total number of numbers allocated in the geographical area where the process is located and the number of processes in the geographical area.
[0413] In one embodiment, the total number of numbers for the geographical area where the process is located is allocated as follows:
[0414] Get the total number of numbers to be issued;
[0415] Get the historical average number of requests per unit time for each geographic region;
[0416] The total number of numbers to be issued is allocated according to the ratio of the average number of requests per unit time in history of each geographical area.
[0417] In one embodiment, the selection unit 430 is further configured to:
[0418] The allocating process takes a sub-segment from the number segment it is responsible for issuing and puts it into the cache of the process;
[0419] The number is taken from the sub-number segment in the cache and issued.
[0420] In one embodiment, the number of numbers contained in the extracted sub-number segment is determined based on the average number of numbers issued per unit time in the history of the process.
[0421] In one embodiment, the selecting, by the allocation process, a number from the number segment responsible for issuance and issuing it to the user includes:
[0422] If the selected number does not meet the preset filtering rules, the number will be issued to the user.
[0423] In one embodiment, after the allocation process selects a number from the number segment responsible for issuance and issues it to the user, the apparatus further comprises:
[0424] The notification unit (not shown) is used to notify the operating server of the issued number, wherein if the issued number matches the preset operating rule of the operating server, the operating server sends an activity notification message to the user.
[0425] The number issuing method according to the embodiment of the present disclosure can be Figure 13 The number issuing system 500 is implemented. Figure 13 The number issuing system 500 according to an embodiment of the present disclosure is described. Figure 13 The number issuing system 500 shown is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0426] like Figure 13 As shown, the number issuance system 500 is implemented as a general-purpose computing device. Components of the number issuance system 500 may include, but are not limited to, the at least one processing unit 810, the at least one storage unit 820, and a bus 830 connecting various system components (including the storage unit 820 and the processing unit 810).
[0427] The storage unit stores program codes that can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary method above. For example, the processing unit 810 can perform the following steps: Figure 5 The steps shown in .
[0428] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0429] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0430] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0431] The number issuance system 500 can also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the number issuance system 500, and / or any device that enables the number issuance system 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can occur via an input / output (I / O) interface 650. Furthermore, the number issuance system 500 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the number issuance system 500 via a bus 830. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the number issuance system 500, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0432] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0433] In an exemplary embodiment of the present disclosure, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described in the above method embodiment.
[0434] According to one embodiment of the present disclosure, a program product for implementing the method in the above method embodiment is also provided. The program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0435] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0436] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0437] The program code embodied on the computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0438] The program code, when executed by the processor, can cause the processing circuit to perform any of the features and / or operations described herein. The program code can be stored on a non-transitory computer-readable storage medium as an algorithm executable by the processor. In one example, components of the system can be configured to perform a method provided herein. Alternatively, or additionally, components can be configured to receive a computer- program product storing machine- readable instructions that, when executed by a processor, can cause the processor to perform a method provided herein.
[0439] It should be noted that, although several modules or units of devices for performing actions are mentioned in the foregoing detailed description, such division into modules or units is not mandatory. In fact, according to embodiments of the present disclosure, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further split into plural modules or units.
[0440] Moreover, although various steps of the methods in the present disclosure are described in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order, or that all of the steps must be performed to achieve the desired results. Additionally or alternatively, certain steps can be omitted, combined, performed in a different order, etc.
[0441] From the above description of the embodiments, those skilled in the art will readily perceive that the example embodiments described herein can be practiced by various other methods than those specifically described. Thus, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash disk, mobile hard disk, etc.) or network, and includes a number of instructions to make a computing device (such as a personal computer, a server, a mobile terminal, or a network device, etc.) execute the methods according to the embodiments of the present disclosure.
[0442] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the appended claims.
Claims
1. A number distribution method, characterized in that: include: Receive a request from a user for number issuance; Allocating a process for issuing numbers to the request from multiple processes, each process is responsible for issuing numbers within a number segment, different processes are responsible for issuing different number segments, and each process issues numbers in parallel; the machines to which the multiple processes belong are not completely the same; The allocation process selects a number from the number segment it is responsible for issuing and issues it to the user, the number including an identification number. During the number issuance process, the allocation process extracts a sub-segment from the number segment it is responsible for issuing and stores it in the process's cache, and then extracts a number from the sub-segment in the cache and issues it to the user. The number of numbers included in the sub-segment is positively correlated with the number of numbers issued by the process in the most recent unit time. Each process has a waiting queue, the request includes a request timestamp and a priority, and after allocating a process for issuing a number to the request, the method further includes: Based on the request timestamp and the priority, the request is placed in a waiting queue of the assigned process; wherein, based on the request timestamp score corresponding to the request timestamp and the priority score corresponding to the priority, the total number of ranked shares is determined, the request is assigned to the last position in the queue, and the total ranked score of the request is sequentially compared with the total ranked score of the previous request in the queue; if the total ranked score of the request is higher than the total ranked score of the previous request, the positions are swapped until the total ranked score of the request is lower than the total ranked score of the previous request; The number of numbers in the number segment that the process is responsible for issuing is determined based on the total number of numbers allocated in the geographical area where the process is located and the number of processes in the geographical area; The total number of numbers for the geographical area where the process is located is allocated as follows: Get the total number of numbers to be issued; Get the historical average number of requests per unit time for each geographic region; The total number of numbers to be issued is allocated according to the proportional relationship between the average number of requests per unit time in the history of each geographical area; wherein, the total number of numbers to be issued is allocated in the following manner: the average number of requests per unit time in the history of each geographical area is summed to obtain the total number of requests, the ratio between the average number of requests per unit time in the history of each geographical area and the total number of requests is calculated, and the product of the ratio corresponding to each geographical area and the total number of numbers to be issued is calculated to obtain the total number of numbers corresponding to each geographical area.
2. The method according to claim 1, characterized in that The process of allocating a number for the request includes: Based on the number of requests that have been assigned to each process but not yet processed, the request is assigned to a process that issues a number.
3. The method according to claim 1, characterized in that The process of allocating a number for the request includes: Based on the number of requests that have been allocated but not processed by each process and the processing capacity of the machine where each process is located, the process of issuing numbers is assigned to the request.
4. The method according to claim 3, characterized in that The process of allocating a number for the request includes: Determine a first score based on the processing capability of the machine where the process is located; Determine a second score based on the number of requests that have been assigned to the process but not processed; determining a total score for the process based on the first score and the second score; determining a process to assign to the request based on the total score; A determined process is assigned to the request.
5. The method according to claim 1, wherein The number of numbers included in the sub-number segment is determined according to the average number of numbers issued per unit time in the history of the process.
6. The method according to claim 1, characterized in that The allocation process selects a number from the number segment responsible for issuance and issues it to the user, including: The allocation process selects a number from the number segment responsible for issuance. If the selected number does not meet the preset filtering rules, the number will be issued to the user.
7. The method according to claim 1, characterized in that After the allocation process selects a number from the number segment responsible for issuance and issues it to the user, the method further includes: The issued number is notified to the operation server, wherein if the issued number matches the preset operation rule of the operation server, the operation server sends an activity notification message to the user.
8. A number issuing device, characterized in that: include: A receiving unit, configured to receive a request from a user for number issuance; an allocating unit, configured to allocate a process for issuing numbers to the request from a plurality of processes, each process being responsible for issuing numbers within a number segment, the number segments issued by different processes being different from each other, and each process issuing numbers in parallel; and the machines to which the plurality of processes belong are not all the same; A selection unit is configured to select a number from the number segment for issuance by the allocated process and issue it to the user, the number including an identification number; during the number issuance process, the allocated process extracts a sub-segment from the number segment for issuance and stores it in the cache of the process, and then extracts a number from the sub-segment in the cache and issues it to the user; wherein the number of numbers included in the sub-segment is positively correlated with the number of numbers issued by the process in the most recent unit time; a queuing unit, configured to place the request in a waiting queue of the assigned process based on a request timestamp and a priority contained in the request; wherein, based on a request timestamp score corresponding to the request timestamp and a priority score corresponding to the priority, a total number of ranked shares is determined, the request is assigned to the last position in the queue, the total ranked score of the request is sequentially compared with the total ranked score of the previous request in the queue, and if the total ranked score of the request is higher than the total ranked score of the previous request, the positions are swapped until the total ranked score of the request is lower than the total ranked score of the previous request; The number of numbers in the number segment that the process is responsible for issuing is determined based on the total number of numbers allocated in the geographical area where the process is located and the number of processes in the geographical area; The total number of numbers for the geographical area where the process is located is allocated as follows: Get the total number of numbers to be issued; Get the historical average number of requests per unit time for each geographic region; The total number of numbers to be issued is allocated according to the proportional relationship between the average number of requests per unit time in the history of each geographical area; wherein, the total number of numbers to be issued is allocated in the following manner: the average number of requests per unit time in the history of each geographical area is summed to obtain the total number of requests, the ratio between the average number of requests per unit time in the history of each geographical area and the total number of requests is calculated, and the product of the ratio corresponding to each geographical area and the total number of numbers to be issued is calculated to obtain the total number of numbers corresponding to each geographical area.
9. A number issuing system, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer-readable instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer program medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, causes the computer to execute the method according to any one of claims 1 to 7.
11. A program product, characterized in that The method comprises a program code, which, when executed by a processor, causes a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
User registration method, server and computer readable storage medium
CN107733891A
Method and system for assigning express delivery codes based on express cabinet
CN107832357A