CN111949406A - Numbering resource allocation processing method and device, computer and storage medium - Google Patents

Numbering resource allocation processing method and device, computer and storage medium Download PDF

Info

Publication number
CN111949406A
CN111949406A CN202010814630.8A CN202010814630A CN111949406A CN 111949406 A CN111949406 A CN 111949406A CN 202010814630 A CN202010814630 A CN 202010814630A CN 111949406 A CN111949406 A CN 111949406A
Authority
CN
China
Prior art keywords
resource
client
resource number
server
allocated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010814630.8A
Other languages
Chinese (zh)
Inventor
卢修学
黎雪峰
陈来武
黄旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruicezhe Technology Co ltd
Original Assignee
Shenzhen Ruicezhe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruicezhe Technology Co ltd filed Critical Shenzhen Ruicezhe Technology Co ltd
Priority to CN202010814630.8A priority Critical patent/CN111949406A/en
Publication of CN111949406A publication Critical patent/CN111949406A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications

Abstract

The application relates to a numbering resource allocation processing method, a numbering resource allocation processing system, a computer and a storage medium. The method comprises the steps of receiving a number application request sent by a client; responding to the numbering application request, and reading a first numbering resource library; determining the allocated resource number in the first numbered resource library, and acquiring the resource number to be allocated which is closest to the allocated resource number in sequence based on the allocated resource number; and sending the acquired resource number to be allocated to the client. The numbers on the clients are uniformly distributed by the server, the clients send the number application requests to the server, and the server responds to the number application requests to send the unallocated resource numbers closest to the distributed resource numbers to the clients, so that the resource numbers of the clients can be uniformly recorded and distributed, the resource numbers are prevented from being multiplexed, the resource numbers used on the clients are unique, and the utilization rate of the resource numbers is effectively improved.

Description

Numbering resource allocation processing method and device, computer and storage medium
Technical Field
The present application relates to the field of computer resource allocation technologies, and in particular, to a method and an apparatus for allocating and processing serial number resources, a computer, and a storage medium.
Background
With the continuous development of the internet and the mobile internet, online learning, online teaching and online training become common education and training modes at present.
However, most of the online learning videos are not recorded in real time at present, and students do not directly interact with teachers and interpreters in the videos, so that the videos watched by learners cannot be well monitored, and the learners can freely switch pages on terminals, so that the learning effect is poor. At present, although there is a means for monitoring the screen switching of the terminal, the learner still cannot be guaranteed to continuously pay attention to the video, so that the learning effect is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a numbering-enabled resource allocation processing method, apparatus, computer, and storage medium.
A method for processing allocation of numbering resources, the method comprising:
receiving a number application request sent by a client;
responding to the numbering application request, and reading the first numbering resource library;
determining the allocated resource number in the first numbered resource library, and acquiring the resource number to be allocated which is closest to the allocated resource number in sequence based on the allocated resource number;
and sending the acquired resource number to be allocated to the client.
In one embodiment, after the step of sending the acquired resource number to be allocated to the client, the method further includes:
acquiring the time of sending the resource number to the client, and recording the time of sending the resource number to the client;
receiving the use state information of the client, wherein the use state information records the used resource number and the unused resource number of the client;
detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time when the resource number is sent to the client;
and when the storage time of the unused resource number at the client is greater than a first preset time, sending recovery information to the client.
In one embodiment, the step of sending the acquired resource number to be allocated to the client includes:
acquiring expiration time information associated with the resource number to be allocated, wherein the expiration time information records the first preset time;
and sending the resource number and the associated expiration time information to the client.
A method for processing allocation of numbering resources, the method comprising:
a numbering application request sent to a server, wherein the numbering application request is used for requesting allocation of at least one resource number to the server;
receiving at least one resource number sent by the server in response to the number application request;
and recording the received resource numbers in a second number resource library of the client.
In one embodiment, the step of receiving at least one resource number sent by the server in response to the number application request further includes:
acquiring a use instruction;
and generating a use identifier for the resource number in response to the use instruction, and associating the use identifier with the resource number.
In one embodiment, the step of receiving at least one resource number sent by the server in response to the number application request further includes:
acquiring the time for receiving the resource number sent by the server, and recording the time for receiving the resource number sent by the server;
based on the time for receiving the resource number sent by the server, scanning each resource number of the second number resource library at intervals of second preset time, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time;
and when detecting that the resource number which does not have the associated use identifier in the corresponding first preset time exists in the second numbered resource library, returning the resource number to the server, and deleting the resource number returned to the server from the second numbered resource library.
An allocation processing apparatus of numbering resources, the apparatus comprising:
the number application request receiving module is used for receiving a number application request sent by a client;
the first numbering resource library reading module is used for responding to the numbering application request and reading the first numbering resource library;
a resource number to be allocated obtaining module, configured to determine a resource number already allocated in the first numbered resource pool, and obtain, based on the allocated resource number, a resource number to be allocated that is closest in order to the allocated resource number;
and the resource number sending module is used for sending the acquired resource number to be distributed to the client.
An allocation processing apparatus of numbering resources, the apparatus comprising:
a number application request sending module, configured to send a number application request to a server, where the number application request is used to request allocation of at least one resource number to the server;
a resource number receiving module, configured to receive at least one resource number sent by the server in response to the number application request;
and the numbering resource library recording module is used for recording the received resource numbers in a second numbering resource library of the client.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any of the above embodiments.
According to the method, the device, the computer and the storage medium for allocating the numbered resources, the numbers on the clients are uniformly allocated by the server, the clients send the number application requests to the server, and the server responds to the number application requests to send the unallocated resource numbers closest to the allocated resource numbers to the clients, so that the resource numbers of the clients can be uniformly recorded and allocated, the resource numbers are prevented from being multiplexed, the resource numbers used by the clients are unique, and the utilization rate of the resource numbers is effectively improved.
Drawings
FIG. 1 is a diagram of an exemplary environment in which a numbering resource allocation process may be implemented;
FIG. 2 is a flowchart illustrating a numbering resource allocation processing method according to an embodiment;
FIG. 3 is a flowchart illustrating a numbering resource allocation processing method according to another embodiment;
FIG. 4A is a block diagram of an apparatus for numbering resource allocation processing according to an embodiment;
FIG. 4B is a block diagram of an apparatus for numbering resource allocation according to another embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The numbering resource allocation processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers. The server 104 stores a first numbered resource pool, the first numbered resource pool records a plurality of resource numbers, responds to a number application request of the terminal, reads the first numbered resource pool, determines the allocated resource numbers in the first numbered resource pool, acquires the resource numbers to be allocated, which are closest to the allocated resource numbers in sequence, based on the allocated resource numbers, and sends the acquired resource numbers to be allocated to the terminal 102. A number application request sent by the terminal 102 to the server 104, wherein the number application request is used for requesting allocation of at least one resource number to the server; receiving at least one resource number sent by the server in response to the number application request; and recording the received resource numbers in a second number resource library of the client.
In one embodiment, as shown in fig. 2, a numbering resource allocation processing method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
step 210, receiving a number application request sent by a client.
Specifically, the client is the terminal in the embodiment in fig. 1, and the number application request is used for the client to request a resource number from the server. The resource number is used as a unique identification code for the business system on the client.
The resource number can be applied to a data acquisition service system, unique numbers are distributed for acquired data, the data are used as unique identification of the data in the service system, the data are conveniently managed in the system, and if the resource number is a multi-platform system (android, apple and small program), fixed number ranges can be distributed for all platforms to be distinguished. For example, the resource number is used for an application number, for example, the resource number is used for a module number of the application, for example, the resource number is used for a number of a service class in the application.
Step 220, responding to the numbering application request, reading the first numbering resource library.
In this embodiment, the first numbering resource pool is a pool used for recording resource numbers on the server, and the first numbering resource pool may also be referred to as a first numbering resource table. All resource numbers on the server are recorded in the first number resource library.
Specifically, resource numbers are recorded in the first numbered resource pool, and the allocation status of each resource number is recorded, for example, the allocated resource numbers and the unallocated resource numbers are recorded, and the resource numbers of the first numbered resource pool are ordered in a preset order.
In this step, the server responds to the number application request and reads the first number repository stored in the server. And all resource numbers are uniformly recorded by the server and distributed to all clients.
Step 230, determining the allocated resource number in the first numbered resource pool, and obtaining the resource number to be allocated closest to the allocated resource number in the sequence based on the allocated resource number.
Specifically, the unallocated resource number closest to the allocated resource number in the sequence is the resource number allocated this time. The resource numbers on the server can be distributed in sequence, when the distributed resource numbers exist in the first numbered resource library, the resource numbers to be distributed closest to the distributed resource numbers are obtained so as to be sent to the client, and when the distributed resource numbers do not exist in the first numbered resource library, the resource numbers arranged in the first numbered resource library in sequence are obtained. For example, whether the allocated resource number exists in the first numbered resource library is detected, and when the allocated resource number exists in the first numbered resource library, the resource number to be allocated, which is closest to the allocated resource number in sequence, is obtained; and when the first numbered resource library does not have the allocated resource number, acquiring the resource number ranked at the front in the first numbered resource library. In this embodiment, the server sequentially allocates the resource numbers according to the sequence of the first number resource pool, so as to improve the utilization rate of the resource numbers and improve the acquisition efficiency of the resource numbers.
In this embodiment, the allocated resource number in the first numbered resource pool is determined, based on the allocated resource number, the resource number to be allocated that is closest in sequence to the allocated resource number is obtained according to the number application request, and the number of resource numbers corresponding to the number application request is obtained. For example, a plurality of resource numbers are obtained according to the number application request. For the client, the requirement for the resource number may be one or multiple, and therefore, the number application request carries the requirement for the number of the resource number, so that the server can obtain the resource number of the corresponding number from the first number resource library according to the requirement.
And 240, sending the acquired resource number to be allocated to the client.
In this step, the resource number to be allocated acquired in the previous step is sent to the client, so that the client receives the resource number. In this embodiment, the acquired resource numbers to be allocated are packaged to generate allocation number information, and the allocation number information is sent to the client.
In order to distinguish the allocated resource numbers, in an embodiment, after the acquired resource numbers to be allocated are sent to the client, the resource numbers are recorded as allocated in a first numbered resource library. In one embodiment, the acquired resource number to be allocated is sent to the client, an allocated identifier is generated for the resource number, and the resource number and the allocated identifier sent to the client are associated. In this embodiment, the resource number that has been sent to the client can be recorded as allocated by recording the resource number as allocated or associating it with the allocated identifier, so as to distinguish the unallocated resource numbers in the first numbered resource pool.
In the embodiment, the numbers on the clients are uniformly distributed by the server, the clients send the number application requests to the server, and the server responds to the number application requests to send the unallocated resource numbers closest to the distributed resource numbers to the clients, so that the resource numbers of the clients can be uniformly recorded and distributed, the resource numbers are prevented from being multiplexed, the resource numbers used by the clients are unique, and the utilization rate of the resource numbers is effectively improved.
In one embodiment, before the step of receiving the number application request sent by the client, the method further includes: and generating a resource number according to a preset coding rule, and establishing a first number resource library. In this way, the server generates a plurality of resource codes of the first numbered resource library in advance according to the coding rule, so that each client can acquire the resource numbers from the server.
In one embodiment, after the step of sending the acquired resource number to be allocated to the client, the method further includes: acquiring the time of sending the resource number to the client, and recording the time of sending the resource number to the client; receiving the use state information of the client, wherein the use state information records the used resource number and the unused resource number of the client; detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time when the resource number is sent to the client; and when the storage time of the unused resource number at the client is greater than a first preset time, sending recovery information to the client.
Specifically, the first preset time is a storage period after the resource number is allocated, and when the resource number is still not used after the first preset time is exceeded, the resource number needs to be recovered to the server by the client. The server receives the use state information of the client to obtain the use condition of the resource number on the client, further obtain the unused resource number, and further detect whether the unused resource number exceeds the use period.
In this embodiment, the time when the resource number is sent to the client is the allocation time of the resource number, the server records the allocation time of each resource number, and detects whether the time when the resource number is allocated to the client is greater than a first preset time based on the allocation time of the allocated resource number, and when the time when the resource number is allocated to the client is greater than the first preset time, it indicates that the allocation of the resource number is overtime, the server sends recovery information to the client, and the client is notified to recover the resource number to the server.
In this embodiment, whether the allocation of the resource number is expired is detected by the server, and when the allocated resource number on the client expires, the server notifies the client to recover, so that the server can uniformly recover the resource number for each client, thereby avoiding the waste of the resource number and reusing the unused resource number.
In one embodiment, after the step of sending the recycling information to the client, the method further includes: and receiving return information fed back by the client in response to the recovery information, and recording the resource number in the first number resource library corresponding to the return information as unallocated. In one embodiment, return information fed back by a client in response to recovery information is received, an unallocated identifier is generated from a resource number in a first number resource library corresponding to the return information, and the unallocated identifier is associated with the resource number corresponding to the return information. In the above embodiment, the recovery information is sent to the client, so that the client learns that the resource number is recovered, and then responds to the feedback recovery information, and after the server receives the recovery information, the resource number is recorded as unallocated or associated with an unallocated identifier, so that the resource number can be reallocated.
In one embodiment, the step of sending the acquired resource number to be allocated to the client includes: acquiring expiration time information associated with the resource number to be allocated, wherein the expiration time information records the first preset time; and sending the resource number and the associated expiration time information to the client.
In this embodiment, the resource numbers have different allocation deadlines, or the expiration times of the different resource numbers are different, and the server sends each resource number and its associated expiration time information to the client, so that each client receives the resource number and the expiration time information corresponding to each resource number, and each client performs an overdue detection on the received resource number, thereby reducing the load of the server.
In one embodiment, a number application request sent by a client is received; responding to the numbering application request, reading the first numbering resource library, detecting whether the occupation ratio of the rest unallocated resource numbers in the first numbering resource library is smaller than a preset occupation ratio or not, and generating the resource numbers of a first preset quantity according to a preset coding rule when the occupation ratio of the rest unallocated resource numbers in the first numbering resource library is smaller than the preset occupation ratio, wherein the ratio of the first preset quantity to the total quantity of the resource numbers of the current first numbering resource library is a newly increased occupation ratio, and the ratio of the newly increased occupation ratio to the preset occupation ratio is 1: 2.
In this embodiment, whether the number of the remaining unallocated resource numbers in the current first numbered resource pool is small is determined by detecting whether the occupancy of the unallocated resource numbers is greater than the preset occupancy, and when the occupancy of the unallocated resource numbers is less than the preset occupancy, it indicates that the allocated resource numbers are large and the remaining unallocated resource numbers are small, so that the resource numbers are regenerated, and the resource numbers are prevented from being insufficient. Since the number of the regenerated unallocated resource numbers is set according to the total number of the resource numbers of the current first-numbered resource pool, and the number of the resource numbers regenerated every time is not fixed, but increases as the total number of resource numbers of the current first-numbered resource increases, for example, the preset percentage is 30%, the new share is 15%, that is, when the server receives the number application request sent by the client, detecting that the proportion of the remaining unallocated resource numbers in the first numbered resource pool is 30%, indicating that the proportion of the allocated resource numbers is 70%, the first numbered resource pool is allocated completely, therefore, the ratio of the resource number of the newly generated unallocated resource pool to the total resource number of the current first numbered resource pool is 15%, which corresponds to the total resource number of the newly added resource pool of the first numbered resource pool being 115% of the total resource number of the original first numbered resource pool.
The number of the unallocated resource numbers generated again at each time is increased along with the increase of the total number of the resource numbers of the current first-numbered resources, so that the requirement of a client in a subsequent long time can be met, and the situation that the large storage space of the server is occupied due to the fact that the number of the unallocated resource numbers generated again is too large can be avoided.
In order to avoid the confusion of the allocation of the newly added resource numbers, in an embodiment, the step of generating the resource numbers of the first preset number according to the preset encoding rule includes: calculating to obtain a newly increased proportion according to the preset proportion, and calculating to obtain a first preset quantity according to the total quantity of the resource numbers of the current first number resource base and the newly increased proportion; calculating to obtain a newly added batch according to the first preset quantity and the total quantity of the resource numbers of the current first number resource library; and generating a resource number according to a preset coding rule based on the newly added batch and the first preset quantity.
Specifically, the ratio of the new proportion to the preset proportion is 1:2, so that the new proportion can be obtained by calculation according to the preset proportion, and the first preset quantity can be obtained by calculation according to the product of the total quantity of the resource numbers of the current first number resource base and the new proportion. And because the new increase ratio of each time is fixed, the total quantity of the resource numbers of the first numbered resource library after each new increase is in an equal ratio series, and the number of new increases, namely the new increase batch, can be calculated and obtained based on the equal ratio series. In this embodiment, in the encoding rule, the newly added batch and the first preset number are used for encoding, so that the generated resource number carries the newly added batch and the first preset number, and thus, by analyzing the resource code, the batch newly added by the newly added unallocated resource number can be identified, and the number of the newly added resource number of the batch can be obtained, thereby facilitating management of the resource number.
In one embodiment, the step of receiving a numbered application request sent by a client further includes: responding to the number application request sent by the client, sending a use state inquiry request to other clients, receiving use state information of other clients, detecting whether the storage time of unused resource numbers of other clients is greater than second preset time, and sending overtime prompt information to the corresponding client when the storage time of the unused resource numbers in other clients is greater than the second preset time, wherein the second preset time is less than the first preset time.
In this embodiment, after one of the clients sends a number application request, the server detects storage time of unused resource numbers on other clients, and when the storage time of the unused resource numbers is longer than a second preset time, sends an overtime reminder to the client to remind the client to use the resource numbers in time. The second preset time is less than the first preset time, so that the client is prompted in advance. It should be understood that, compared to the conventional detection of the time of the unused resource of each client every other time, in this embodiment, the detection of the unused time of the resource number is triggered only when the number application request of one of the clients is received, and then the prompt of the other clients is triggered. Therefore, the consumption of computing resources of the server can be effectively reduced, the detection of the idle time of the resource number is more timely, the resource number is timely recovered, and the resource number is prevented from being idle.
In one embodiment, the step of sending a request for querying a usage status to each of the other clients in response to the number application request sent by the client includes: responding to the number application request sent by the client, analyzing the number application request, obtaining the number application quantity, detecting whether the number application quantity is larger than a second preset quantity, sending a use state inquiry request to other clients when the number application quantity is larger than the second preset quantity, and executing the step of reading the first number resource library in response to the number application request when the number application quantity is smaller than or equal to the second preset quantity, wherein the second preset quantity is the product of the quantity of the residual unallocated resource numbers in the current first number resource library and a preset proportion.
Specifically, the number of the number application is the number of the resource numbers applied by the client. In this embodiment, when a number application request of a client is responded, the number of resource numbers required by the client is first acquired, and then whether the number of resource numbers required by the client is greater than a second preset number is determined, when the number of resource numbers required by the client is greater than the second preset number, which indicates that the number required by the client is greater, a server is triggered to send a use state inquiry request to each client, and otherwise, a first number resource library is directly read to acquire and allocate resource numbers.
It should be understood that the second predetermined number is dynamically adjusted according to the number of the unallocated resource numbers remaining in the current first numbered resource pool. As long as the ratio of the number applied by the client to the number of the remaining unallocated resource numbers in the first numbered resource pool is greater than the corresponding preset ratio, the usage state inquiry request is triggered to be sent to each client by each client, so that when the number of the remaining unallocated resource numbers in the first numbered resource pool is small, the number applied by the client is small, the usage state inquiry request is also triggered to be sent to each client by each client, and when the number of the remaining unallocated resource numbers in the first numbered resource pool is large, the number applied by the client is large, and the usage state inquiry request is also triggered to be sent to each client by each client. By dynamically adjusting the second preset quantity, the server can accurately and timely inquire the state of other clients, further avoid the consumption of computing resources of the server, timely recycle resource numbers and avoid the idle of the resource numbers.
In an embodiment, as shown in fig. 3, a numbering resource allocation processing method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step 310, sending a number application request to a server, where the number application request is used to request allocation of at least one resource number to the server.
In this step, the client sends a number application request to the server.
Step 320, receiving at least one resource number sent by the server in response to the number application request.
Specifically, after responding to the number application request, the server sends the unallocated resource number on the server to the client. And the client receives the resource number sent by the server.
Step 330, recording the received resource numbers in a second number resource library of the client.
Specifically, the second number resource library is used for recording the resource number issued by the server for the client. Each client stores a second numbering resource pool. In this embodiment, after receiving the resource number allocated by the server, the client records the resource number in the second number resource library for use by an application and an application system on the client.
In the embodiment, the numbers on the clients are uniformly distributed by the server, the clients send the number application requests to the server, and the server responds to the number application requests to send the unallocated resource numbers closest to the distributed resource numbers to the clients, so that the resource numbers of the clients can be uniformly recorded and distributed, the resource numbers are prevented from being multiplexed, the resource numbers used by the clients are unique, and the utilization rate of the resource numbers is effectively improved.
In one embodiment, the step of receiving at least one resource number sent by the server in response to the number application request further includes: acquiring a use instruction; and generating a use identifier for the resource number in response to the use instruction, and associating the use identifier with the resource number.
In this embodiment, the use instruction is input by the user on the client, and is used to put the resource number into the application or the application system for use. The client responds to the use instruction, generates a use identifier, and associates the use identifier with the used resource number, so that the client can distinguish the used resource number from the unused resource number.
In one embodiment, the step of receiving at least one resource number sent by the server in response to the number application request further includes: acquiring the time for receiving the resource number sent by the server, and recording the time for receiving the resource number sent by the server; based on the time for receiving the resource number sent by the server, scanning each resource number of the second number resource library at intervals of second preset time, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time; and when detecting that the resource number which does not have the associated use identifier in the corresponding first preset time exists in the second numbered resource library, returning the resource number to the server, and deleting the resource number returned to the server from the second numbered resource library.
In this embodiment, the client scans the resource number in the second number resource pool of the client every second preset time, and detects whether the allocation time of the unused resource number exceeds the allocation deadline, that is, whether the allocation time of the unused resource number is greater than the first preset time, and when it is detected that the allocation time of the unused resource number in the second number resource pool is greater than the first preset time, the resource number is returned, and the server is notified that the resource number exceeds the deadline and is unused, and at this time, the returned resource number is recovered by the server. In this embodiment, the client returns the resource number to the server, and the process is that the client sends return information to the server to notify the server that the returned resource number has been deleted in the second numbered repository, and because the first repository records the returned resource number, the client does not need to actually send the resource number to the server. By recycling the resource numbers, the waste of the resource numbers is avoided, and unused resource numbers can be reused.
In one embodiment, the step of recording each received resource number in the second numbered resource pool of the client further comprises: and responding to recovery information sent by the server, returning the resource number corresponding to the recovery information to the server, and deleting the resource number returned to the server from the second numbered resource library.
In this embodiment, the server detects whether the allocation of the resource number is expired, and when the allocated resource number on the client expires, the server notifies the client to recover the resource number, and sends recovery information to the client, and the client responds to the recovery information to delete the resource number to be recovered in the second numbered resource library, so that the server can uniformly recover the resource number for each client, thereby avoiding the waste of the resource number and reusing the unused resource number.
It should be understood that, although the steps in the flowcharts of fig. 2 to 3 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4A, there is provided a numbering resource allocation processing apparatus, including:
a number application request receiving module 411, configured to receive a number application request sent by a client;
a first numbering resource library reading module 412, configured to read the first numbering resource library in response to the numbering application request;
a to-be-allocated resource number obtaining module 413, configured to determine a resource number already allocated in the first numbered resource pool, and obtain, based on the allocated resource number, a resource number to be allocated that is closest in sequence to the allocated resource number;
a resource number sending module 414, configured to send the obtained resource number to be allocated to the client.
In one embodiment, the numbering resource allocation processing device further includes:
the sending time recording module is used for acquiring the time of sending the resource number to the client and recording the time of sending the resource number to the client;
a use state information receiving module, configured to receive use state information of the client, where the use state information records a used resource number and an unused resource number of the client;
the time detection module is used for detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time of sending the resource number to the client;
and the recovery information sending module is used for sending recovery information to the client when the storage time of the unused resource number at the client is greater than a first preset time.
In one embodiment, the resource number sending module includes:
an expiration time information obtaining unit, configured to obtain expiration time information associated with the resource number to be allocated, where the expiration time information records the first preset time;
and the resource number sending unit is used for sending the resource number and the associated expiration time information to the client.
An allocation processing apparatus of numbering resources, as shown in fig. 4B, the apparatus comprising:
a number application request sending module 421, configured to send a number application request to a server, where the number application request is used to request allocation of at least one resource number to the server;
a resource number receiving module 422, configured to receive at least one resource number sent by the server in response to the number application request;
a numbering resource pool recording module 423, configured to record each received resource number in a second numbering resource pool of the client.
In one embodiment, the numbering resource allocation processing device further includes:
the using instruction acquisition module is used for acquiring a using instruction;
and the use identifier association module is used for responding to the use instruction, generating a use identifier for the resource number and associating the use identifier with the resource number.
In one embodiment, the numbering resource allocation processing device further includes:
the receiving time recording module is used for acquiring the time for receiving the resource number sent by the server and recording the time for receiving the resource number sent by the server;
the scanning detection module is used for scanning each resource number of the second numbered resource library at intervals of second preset time based on the time for receiving the resource number sent by the server, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time;
the number returning module is used for returning the resource number to the server and deleting the resource number returned to the server from the second number resource library when detecting that the resource number which does not have the associated use identifier exists in the second number resource library within the corresponding first preset time.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is for storing a numbering resource pool of numbering resources. The network interface of the computer device is used for communicating with the client through a network connection. The computer program is executed by a processor to implement a numbering resource allocation processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
receiving a number application request sent by a client;
responding to the numbering application request, and reading the first numbering resource library;
determining the allocated resource number in the first numbered resource library, and acquiring the resource number to be allocated which is closest to the allocated resource number in sequence based on the allocated resource number;
and sending the acquired resource number to be allocated to the client.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the time of sending the resource number to the client, and recording the time of sending the resource number to the client;
receiving the use state information of the client, wherein the use state information records the used resource number and the unused resource number of the client;
detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time when the resource number is sent to the client;
and when the storage time of the unused resource number at the client is greater than a first preset time, sending recovery information to the client.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring expiration time information associated with the resource number to be allocated, wherein the expiration time information records the first preset time;
and sending the resource number and the associated expiration time information to the client.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
a numbering application request sent to a server, wherein the numbering application request is used for requesting allocation of at least one resource number to the server;
receiving at least one resource number sent by the server in response to the number application request;
and recording the received resource numbers in a second number resource library of the client.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a use instruction;
and generating a use identifier for the resource number in response to the use instruction, and associating the use identifier with the resource number.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the time for receiving the resource number sent by the server, and recording the time for receiving the resource number sent by the server;
based on the time for receiving the resource number sent by the server, scanning each resource number of the second number resource library at intervals of second preset time, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time;
and when detecting that the resource number which does not have the associated use identifier in the corresponding first preset time exists in the second numbered resource library, returning the resource number to the server, and deleting the resource number returned to the server from the second numbered resource library.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a number application request sent by a client;
responding to the numbering application request, and reading the first numbering resource library;
determining the allocated resource number in the first numbered resource library, and acquiring the resource number to be allocated which is closest to the allocated resource number in sequence based on the allocated resource number;
and sending the acquired resource number to be allocated to the client.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the time of sending the resource number to the client, and recording the time of sending the resource number to the client;
receiving the use state information of the client, wherein the use state information records the used resource number and the unused resource number of the client;
detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time when the resource number is sent to the client;
and when the storage time of the unused resource number at the client is greater than a first preset time, sending recovery information to the client.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring expiration time information associated with the resource number to be allocated, wherein the expiration time information records the first preset time;
and sending the resource number and the associated expiration time information to the client.
In one embodiment, the computer program when executed by the processor further performs the steps of:
a numbering application request sent to a server, wherein the numbering application request is used for requesting allocation of at least one resource number to the server;
receiving at least one resource number sent by the server in response to the number application request;
and recording the received resource numbers in a second number resource library of the client.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a use instruction;
and generating a use identifier for the resource number in response to the use instruction, and associating the use identifier with the resource number.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the time for receiving the resource number sent by the server, and recording the time for receiving the resource number sent by the server;
based on the time for receiving the resource number sent by the server, scanning each resource number of the second number resource library at intervals of second preset time, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time;
and when detecting that the resource number which does not have the associated use identifier in the corresponding first preset time exists in the second numbered resource library, returning the resource number to the server, and deleting the resource number returned to the server from the second numbered resource library.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A numbering resource allocation processing method is characterized by comprising the following steps:
receiving a number application request sent by a client;
responding to the numbering application request, and reading the first numbering resource library;
determining the allocated resource number in the first numbered resource library, and acquiring the resource number to be allocated which is closest to the allocated resource number in sequence based on the allocated resource number;
and sending the acquired resource number to be allocated to the client.
2. The method according to claim 1, wherein the step of sending the acquired resource number to be allocated to the client further comprises:
acquiring the time of sending the resource number to the client, and recording the time of sending the resource number to the client;
receiving the use state information of the client, wherein the use state information records the used resource number and the unused resource number of the client;
detecting whether the storage time of the unused resource number at the client is greater than first preset time or not based on the time when the resource number is sent to the client;
and when the storage time of the unused resource number at the client is greater than a first preset time, sending recovery information to the client.
3. The method according to claim 2, wherein the step of sending the acquired resource number to be allocated to the client comprises:
acquiring expiration time information associated with the resource number to be allocated, wherein the expiration time information records the first preset time;
and sending the resource number and the associated expiration time information to the client.
4. A numbering resource allocation processing method is characterized by comprising the following steps:
a numbering application request sent to a server, wherein the numbering application request is used for requesting allocation of at least one resource number to the server;
receiving at least one resource number sent by the server in response to the number application request;
and recording the received resource numbers in a second number resource library of the client.
5. The method of claim 1, wherein the step of receiving at least one resource number sent by the server in response to the number application request is further followed by:
acquiring a use instruction;
and generating a use identifier for the resource number in response to the use instruction, and associating the use identifier with the resource number.
6. The method of claim 1, wherein the step of receiving at least one resource number sent by the server in response to the number application request is further followed by:
acquiring the time for receiving the resource number sent by the server, and recording the time for receiving the resource number sent by the server;
based on the time for receiving the resource number sent by the server, scanning each resource number of the second number resource library at intervals of second preset time, and detecting whether each resource number does not have the associated use identifier within the corresponding first preset time;
and when detecting that the resource number which does not have the associated use identifier in the corresponding first preset time exists in the second numbered resource library, returning the resource number to the server, and deleting the resource number returned to the server from the second numbered resource library.
7. An apparatus for processing allocation of numbering resources, the apparatus comprising:
the number application request receiving module is used for receiving a number application request sent by a client;
the first numbering resource library reading module is used for responding to the numbering application request and reading the first numbering resource library;
a resource number to be allocated obtaining module, configured to determine a resource number already allocated in the first numbered resource pool, and obtain, based on the allocated resource number, a resource number to be allocated that is closest in order to the allocated resource number;
and the resource number sending module is used for sending the acquired resource number to be distributed to the client.
8. An apparatus for processing allocation of numbering resources, the apparatus comprising:
a number application request sending module, configured to send a number application request to a server, where the number application request is used to request allocation of at least one resource number to the server;
a resource number receiving module, configured to receive at least one resource number sent by the server in response to the number application request;
and the numbering resource library recording module is used for recording the received resource numbers in a second numbering resource library of the client.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 6 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202010814630.8A 2020-08-13 2020-08-13 Numbering resource allocation processing method and device, computer and storage medium Pending CN111949406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010814630.8A CN111949406A (en) 2020-08-13 2020-08-13 Numbering resource allocation processing method and device, computer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010814630.8A CN111949406A (en) 2020-08-13 2020-08-13 Numbering resource allocation processing method and device, computer and storage medium

Publications (1)

Publication Number Publication Date
CN111949406A true CN111949406A (en) 2020-11-17

Family

ID=73343305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010814630.8A Pending CN111949406A (en) 2020-08-13 2020-08-13 Numbering resource allocation processing method and device, computer and storage medium

Country Status (1)

Country Link
CN (1) CN111949406A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112351110A (en) * 2020-11-27 2021-02-09 杭州安恒信息技术股份有限公司 ID distribution method and device based on zookeeper
CN112416592A (en) * 2020-11-26 2021-02-26 张新利 Method for providing computing power of cloud server
CN112632117A (en) * 2020-12-30 2021-04-09 广州华多网络科技有限公司 Method and device for processing serial number data, electronic equipment and storage medium
CN113065034A (en) * 2021-03-29 2021-07-02 上海安畅网络科技股份有限公司 Distributed system number generation method and system
WO2023155513A1 (en) * 2022-02-18 2023-08-24 腾讯科技(深圳)有限公司 Virtual scene data processing method and apparatus, electronic device, computer readable storage medium and computer program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045323A (en) * 2009-10-09 2011-05-04 华为终端有限公司 Method and device for processing information of uniform resource identifier (URI) indexes
WO2017219848A1 (en) * 2016-06-22 2017-12-28 中兴通讯股份有限公司 Id processing method in distributed database, management system, and server
CN109144979A (en) * 2018-08-15 2019-01-04 中国建设银行股份有限公司 A kind of data processing method and device based on distribution application system
CN110175491A (en) * 2018-11-13 2019-08-27 广东小天才科技有限公司 A kind of queue number generation method and wearable device
CN110515956A (en) * 2019-09-02 2019-11-29 中国工商银行股份有限公司 Sequence number acquisition methods, device, system, electronic equipment and storage medium
CN111325511A (en) * 2020-03-11 2020-06-23 上海东普信息科技有限公司 Express item bar code management method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045323A (en) * 2009-10-09 2011-05-04 华为终端有限公司 Method and device for processing information of uniform resource identifier (URI) indexes
WO2017219848A1 (en) * 2016-06-22 2017-12-28 中兴通讯股份有限公司 Id processing method in distributed database, management system, and server
CN107528816A (en) * 2016-06-22 2017-12-29 中兴通讯股份有限公司 ID processing method, management system and server in distributed data base
CN109144979A (en) * 2018-08-15 2019-01-04 中国建设银行股份有限公司 A kind of data processing method and device based on distribution application system
CN110175491A (en) * 2018-11-13 2019-08-27 广东小天才科技有限公司 A kind of queue number generation method and wearable device
CN110515956A (en) * 2019-09-02 2019-11-29 中国工商银行股份有限公司 Sequence number acquisition methods, device, system, electronic equipment and storage medium
CN111325511A (en) * 2020-03-11 2020-06-23 上海东普信息科技有限公司 Express item bar code management method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416592A (en) * 2020-11-26 2021-02-26 张新利 Method for providing computing power of cloud server
CN112351110A (en) * 2020-11-27 2021-02-09 杭州安恒信息技术股份有限公司 ID distribution method and device based on zookeeper
CN112632117A (en) * 2020-12-30 2021-04-09 广州华多网络科技有限公司 Method and device for processing serial number data, electronic equipment and storage medium
CN113065034A (en) * 2021-03-29 2021-07-02 上海安畅网络科技股份有限公司 Distributed system number generation method and system
WO2023155513A1 (en) * 2022-02-18 2023-08-24 腾讯科技(深圳)有限公司 Virtual scene data processing method and apparatus, electronic device, computer readable storage medium and computer program product

Similar Documents

Publication Publication Date Title
CN111949406A (en) Numbering resource allocation processing method and device, computer and storage medium
US11068964B2 (en) Method and device for processing service request
CN110620812B (en) Interactive information pushing method and device, computer equipment and storage medium
CN108322363B (en) Pushed data abnormity monitoring method and device, computer equipment and storage medium
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN111130925B (en) Resource monitoring method and device, computer equipment and storage medium
CN110321480B (en) Recommendation information pushing method and device, computer equipment and storage medium
CN114237852A (en) Task scheduling method, device, server and storage medium
CN110390424B (en) Method, device, equipment and medium for estimating service life of test object
CN111078984B (en) Network model issuing method, device, computer equipment and storage medium
CN112685157B (en) Task processing method, device, computer equipment and storage medium
CN112818204A (en) Service processing method, device, equipment and storage medium
CN113672497A (en) Method, device and equipment for generating non-buried point event and storage medium
CN113111078A (en) Resource data processing method and device, computer equipment and storage medium
CN114513686A (en) Method and device for determining video information and storage medium
CN111158654A (en) Algorithm calling method, device, server and storage medium
CN110673931A (en) Distributed calculation method for document synthesis, document synthesis system and control device thereof
CN111882373B (en) Data operation method and device, computer equipment and storage medium
CN111008131B (en) Automated testing method, apparatus, computer device and storage medium
CN110968817A (en) Page content detection method, device and system
CN112084827B (en) Data processing method and device
CN115860422A (en) Test case distribution method and device
CN113132428A (en) Information pushing method, system, device, computer device and storage medium
CN114418646A (en) Questionnaire investigation method and device, electronic equipment and storage medium
CN116991828A (en) Data complement method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination