CN109241053B - Identification code allocation method, device and server - Google Patents

Identification code allocation method, device and server Download PDF

Info

Publication number
CN109241053B
CN109241053B CN201810841740.6A CN201810841740A CN109241053B CN 109241053 B CN109241053 B CN 109241053B CN 201810841740 A CN201810841740 A CN 201810841740A CN 109241053 B CN109241053 B CN 109241053B
Authority
CN
China
Prior art keywords
inventory
area
level
layer
protective layer
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.)
Active
Application number
CN201810841740.6A
Other languages
Chinese (zh)
Other versions
CN109241053A (en
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.)
Advanced New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810841740.6A priority Critical patent/CN109241053B/en
Publication of CN109241053A publication Critical patent/CN109241053A/en
Application granted granted Critical
Publication of CN109241053B publication Critical patent/CN109241053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The specification discloses an identification code allocation method, an identification code allocation device and a server, wherein identification codes are allocated from a top-level stock area aiming at received service requests; and if the allocation fails, allocating an identification code for the service request from the protection layer inventory area configured for the top-level inventory area.

Description

Identification code allocation method, device and server
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method, an apparatus, and a server for allocating an identifier.
Background
When a service occurs, an identification code needs to be assigned for the service to use. For example, when a service occurs, the inventory area management system may assign a card number and a code number to the occurring service. The card number and the code number are distributed in a single-inventory mode and a multi-inventory mode. The single stock mode is to store all identification codes in one stock area, and the serial execution method is to allocate the identification codes to the services. The multi-inventory-zone mode is to divide the total inventory into a plurality of parallel sub-inventory zones, and identification codes can be parallelly allocated to the occurring services from the plurality of parallel sub-inventory zones so as to be applied to high-concurrency scenes.
Disclosure of Invention
The embodiment of the specification provides an identification code allocation method, an identification code allocation device and a server.
In a first aspect, an embodiment of the present specification provides an identification code allocation method, including: receiving a service request; determining a target top-level stock area from M top-level stock areas, and allocating an identification code to the service request from the target top-level stock area, wherein M is an integer greater than 1; and if the distribution fails, distributing an identification code for the service request from a protection layer stock area configured for the target top-layer stock area.
In a second aspect, an embodiment of the present specification provides an identification code allocation apparatus, including: a request receiving unit, configured to receive a service request; the first allocation unit is used for determining a target top-level stock area from M top-level stock areas and allocating an identification code to the service request from the target top-level stock area, wherein M is an integer greater than 1; and the second allocation unit is used for allocating an identification code for the service request from the protection layer stock area configured for the target top-layer stock area if the allocation fails.
In a third aspect, the present specification provides a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method according to any one of the first aspect when executing the program.
In a fourth aspect, the present specification provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to any one of the first aspect.
One or more technical solutions provided in the embodiments of the present specification have at least the following technical effects or advantages:
supporting a high concurrency scenario through multiple top-level inventory zones; firstly, determining an identification code in a target top-layer stock area from a plurality of top-layer stock areas according to a received service request; and if the allocation fails, allocating an identification code for the service request from a protection layer inventory area configured for the top layer inventory area. Therefore, the identification code can still be allocated to the service request when the inventory identification of the target top-level inventory area is insufficient, and the success of allocating the identification code is ensured. Therefore, the aim of successfully distributing the identification code under the high concurrent service scene is fulfilled.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic view of a scenario in which an identification code assignment method is implemented in this specification;
fig. 2 is a flowchart of an identifier assignment method provided in the first aspect in an embodiment of the present specification;
FIG. 3 is a schematic diagram of a stock cluster and a stock relationship in the first aspect according to an embodiment of the present disclosure;
figure 4 is a schematic structural view of an identification code dispensing apparatus provided in a second aspect of an embodiment of the present description;
fig. 5 is a schematic structural diagram of a server provided in the third aspect in the embodiment of the present specification.
Detailed Description
In order to better understand the technical solutions of the embodiments of the present specification, the technical solutions of the embodiments of the present specification are described in detail below with reference to the accompanying drawings and specific embodiments, and it should be understood that the specific features of the embodiments and examples of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and are not limitations of the technical solutions of the embodiments and examples of the present specification, and the technical features of the embodiments and examples of the present specification may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic view of a scenario for implementing an identification code assignment method in this specification. The terminal 100 is located on the user side and communicates with the server 200 on the network side. Types of terminals 100 include, but are not limited to, hand-held computers, tablet computers, mobile phones, personal digital assistants, smart watches, and the like. The client 101 in the terminal 100 may be an APP or a website for implementing a service based on the internet, the client 101 provides an interface for initiating a service request for a user, and provides the service request to the server 200 on the network side, and the server 200 responds to the service request. The inventory management system 201 in the server 200 is used for allocating identification codes for the service requests. Specifically, the identification code assigned to the service request may be one of a card number and a code number. The identification code is not limited to a numeric card number or an alphabetic code number, and may be another form of identification code to be assigned.
In a first aspect, an embodiment of the present specification provides an identification code allocation method, which is applied to a server on a network side. Referring to fig. 2, the identifier allocation method provided in the embodiment of the present specification includes the following steps S201 to S203:
step S201: a service request is received.
In this embodiment, when a service occurs at a client, the client initiates a service request to a server. The initiated service request is as follows: any scenario requiring the assignment of an identification code for a service request.
Specifically, there are multiple types of generated services, and corresponding to different types of services, the embodiments of the present specification provide the following scenario examples of multiple service requests, but are not used to limit the types of service requests received in the present specification: if the service request is an account registration request initiated by the client, an account needs to be allocated to the user according to the account registration request. If the service request is a lottery drawing request initiated by the client, a lottery drawing number needs to be allocated to the user aiming at the lottery drawing request. If the service request is a seat number allocation request initiated by the client, a corresponding seat number needs to be allocated to the user according to the seat number allocation request. The assigned seat numbers may specifically be: flight seat number, sight shadow seat number and the like.
For example, in a "killing by seconds" scene in the internet, a plurality of users perform a robbery purchase simultaneously, and a combined scene of "killing by seconds + identification code allocation" is "after a user initiates a killing by seconds request, an XX member vip card number is allocated".
Step S202: and determining a target top-level stock area from the M top-level stock areas, and allocating an identification code for the service request from the target top-level stock area, wherein M is an integer greater than 1.
In the embodiment of the present specification, a tree inventory structure is created. The tree inventory structure includes: inventory clusters and inventory relationships.
The stock area group comprises a plurality of stock areas. Specifically, the inventory cluster includes: m top layer inventory areas and N protective layer inventory areas, wherein M is an integer larger than 1, and N is a positive integer. The N protective layer inventory areas are correspondingly configured to the M top layer inventory areas, and the protective layer inventory area configured for the target top layer inventory area belongs to the N protective layer inventory areas.
The inventory relationship records: the association relationship between the M top layer inventory areas and the N protective layer inventory areas further records: consumption status of M top layer inventory zones and N protective layer inventory zones.
In an optional embodiment, the association relationship between the M top layer inventory zones and the N protective layer inventory zones is specifically: and (4) tree association between the M top layer inventory areas and the N protective layer inventory areas. In the tree association relationship: the M top-level inventory zones are leaf nodes. The N protective layer inventory regions are correspondingly configured as single-level protective layer inventory regions of the M top-level inventory regions, or the N protective layer inventory regions are correspondingly configured as multi-level protective layer inventory regions of the M top-level inventory regions. The same protective layer inventory area is allocated to one or more top layer inventory areas as a protective layer for the one or more top layer inventory areas. For example, the same protection layer inventory area is allocated to two top layer inventory areas as protection layer inventory areas of the two top layer inventory areas.
For a single level protective layer inventory zone: the same one of the first level protective layer inventory zones is configured to one or more of the M top level inventory zones. For example, the same passivation layer inventory region is configured for two top layer inventory regions, and the same top layer inventory region is not repeatedly configured with different passivation layer inventory regions in the first level passivation layer inventory region. The first-level protective layer stock area is the protective layer stock area at the nearest level relative to the top-level stock area.
As for the multi-stage protective layer stock area, at least a second-stage protective layer stock area is also present in addition to the first-stage protective layer stock area. The same protective layer inventory area of the second level protective layer inventory area is configured to one or more protective layer inventory areas in the first level protective layer inventory area, and the same protective layer inventory area of the first level protective layer inventory area is not repeatedly configured with different protective layer inventory areas in the second level protective layer inventory area. For the sake of brevity of the description, the other level of protective layer inventory regions following the second level of protective layer inventory region will not be described in detail.
In the implementation process, the consumption state of the inventory zone is one of consumed state and unconsumed state. And the protective layer stock area is configured for the top layer stock area and used for distributing the identification code for the service request from the protective layer stock area configured for the top layer stock area after the stock identification code in the top layer stock area is consumed.
An example of a tree inventory structure is given below with reference to FIG. 3:
the M top-level inventory zones include: top level inventory area 01, top level inventory area 02, top level inventory area 03, top level inventory area 04, … … through to top level inventory area M-1, top level inventory area M. The N protective layer inventory areas comprise a first-level protective layer inventory area, and the first-level protective layer inventory area specifically comprises: protective layer inventory area 11, protective layer inventory area 12, … …, until protective layer inventory area 1X, still include second level protective layer inventory area in N protective layer inventory areas, second level protective layer inventory area specifically includes: protective layer stock area 21, … … up to protective layer stock area 2Y. Wherein N ═ X + Y.
The protective layer inventory area 11 is configured for the top layer inventory area 01 and the top layer inventory area 02 and serves as a protective layer of the top layer inventory area 01 and the top layer inventory area 02; protective layer inventory area 12 is allocated to top layer inventory area 03 and top layer inventory area 04 as a protective layer for top layer inventory area 03 and top layer inventory area 04, … …; according to the rule, the protection layer stock area 1X is configured to the top layer stock area M-1 and the top layer stock area M and serves as a protection layer of the top layer stock area M-1 and the top layer stock area M. The protective layer stock area 21 is configured to the protective layer stock area 11 and the protective layer stock area 12 as the protective layers of the protective layer stock area 11 and the protective layer stock area 12; the protective layer stock area 2Y is allocated to the protective layer stock area 1(X-1) and the protective layer stock area 1X as the protective layer of the protective layer stock area 1(X-1) and the protective layer stock area 1X. Based on the above rules, more levels of protective layer inventory zones can be set.
In an optional embodiment, the stock cluster and the stock relation are generated in advance by:
generating an inventory zone group according to the identification code set, wherein the inventory zone group comprises N protective layer inventory zones and M top layer inventory zones, the N protective layer inventory zones are correspondingly configured to the M top layer inventory zones, the protective layer inventory zone configured for the target top layer inventory zone belongs to the N protective layer inventory zones, and N is a positive integer; and generating an inventory relationship between the N protective layer inventory areas and the M top layer inventory areas, wherein the inventory relationship comprises an association relationship between the N protective layer inventory areas and the M top layer inventory areas.
The association relationship between the N protection layer inventory areas and the M top layer inventory areas may be one of the following two association relationships:
the first and the N protective layer inventory areas are configured to be single-stage protective layer inventory areas of the M top layer inventory areas, and the same protective layer inventory area is configured to be one or more top layer inventory areas.
And the N protective layer inventory areas are configured into multi-level protective layer inventory areas of the M top layer inventory areas, and the same protective layer inventory area is configured into one or more top layer inventory areas.
It should be noted that the high concurrency means that the number of service requests for requesting assignment of the identification code, which are initiated at the same time, is greater than the first threshold. The concurrency prediction information includes: and the concurrency amount predicted value and the duration predicted value of the high concurrency amount time period. The concurrency prediction value is used for predicting the number of service requests for requesting to allocate the identification code at the same time point.
In a specific implementation, the initial inventory amounts in the N protective layer inventory zones and the initial inventory amounts in the M top layer inventory zones may be the same or different.
To the extent that the initial inventory amounts in the inventory zones are the same, the inventory zone group may be generated by:
presetting the initial stock of a single stock area; and determining the number of the stock areas of the stock area group based on the identification quantity of the identification code set and the preset stock amount of the single stock area, and equally dividing the identification code set into each stock area of the stock area group, so that the initial stock amounts in each stock area are the same.
For example, the number of the stock areas to be configured is obtained by dividing the identification amount of the identification code set by the initial stock of a single stock area, that is, the number of the stock areas in the stock area group is obtained. In this embodiment, the larger the identification amount of the identification code set, the larger the number of the obtained stock areas. For example, if the identification amount of the identification code set is 1000w and the preset initial stock amount is 100w, a stock area group having 10 stock areas is obtained.
On the basis, the tree-shaped incidence relation between the M top-layer inventory areas and the N protective layer inventory areas is generated based on the concurrency prediction information, and the implementation process is as follows:
if the high concurrency time interval is in the early stage, determining the number (M value) of top-level stock areas to be configured according to the predicted concurrency value of the high concurrency time interval, and configuring the M stock areas of the stock area group as the top-level stock areas; configuring the remaining inventory zones in the inventory zone group as a single-level protection layer inventory zone or a multi-level protection layer inventory zone for the M top-level inventory zones. The concurrency quantity predicted value of the high concurrency quantity period is positively correlated with the number of the top layer inventory areas: the larger the concurrency prediction value of the high concurrency time interval is, the more the top layer stock areas are, and therefore the high concurrency requirement of the business in the previous period is supported.
The same protection layer inventory area is configured for one or more top layer inventory areas, specifically: if the later concurrency is less, such as: and if the sum of the first threshold and the second threshold is less than the second threshold, the same protective layer inventory area is configured to a plurality of top-layer inventory areas, so that more waste of the inventory areas in the later period is avoided. If the high concurrency time interval exists in the later period, the same protective layer inventory area is configured to a top layer inventory area, and meanwhile, high concurrency of the business in the front period and the business in the later period is supported. It should be noted that the high concurrency of the service is caused by the concurrent operation initiated by the external service.
As for the manner in which the initial stock amount is different, the stock area group may be generated by the following embodiments:
if the high concurrency time interval is in the early stage, determining the number (M value) of top inventory zones to be configured according to the predicted concurrency value of the high concurrency time interval, and configuring M top inventory zones; the concurrency quantity predicted value is positively correlated with the number of the configured top-level stock areas: the larger the predicted value of the concurrency amount is, the larger the number of the configured top-level stock areas is. Determining the initial inventory of the top inventory zone according to the duration prediction value of the high concurrency period, wherein the duration prediction value of the high concurrency period is positively correlated with the initial inventory of the top inventory zone: the longer the duration prediction value of the high concurrency period is, the more the initial inventory amount in the top inventory zone is, and the less the initial inventory amount is otherwise.
Similarly, the initial inventory of the protection layer inventory zone is determined according to the duration prediction value of the later concurrency time period, and the number of the protection layer inventory zones is configured according to the concurrency prediction value of the later concurrency time period. If the later concurrency is less, such as: if the number of the protection layer inventory areas is smaller than the second threshold value, the same protection layer inventory area is configured to a plurality of top layer inventory areas, so that waste caused by configuration of more protection layer inventory areas is avoided. If the high concurrency time interval exists in the later stage, the same protection layer inventory area is configured to a top layer inventory area so as to support the high concurrency requirements of the business in the front stage and the business in the later stage.
The early stage and the late stage are divided by a time midpoint or a preset time point in terms of the total time period from the start of allocating the identification codes in the inventory zone to the completion of allocating the identification codes in the inventory zone group.
Through the tree-shaped incidence relation, the high concurrency scenes of different businesses can be adapted by adjusting the stock of the protective layer stock area, the number of the protective layer stock areas and the number of the top layer stock areas and the number of the levels.
In the embodiment of the present specification, the inventory relationship is updated according to the consumption state of the inventory region. Specifically, as the stock identifiers in the top level stock area are assigned, the stock identifiers in the top level stock area may become less and less until consumed. When the stock identification code in the top-level stock area is consumed, the consumption state of the top-level stock area is changed from the non-consumption state to the consumption state. Likewise, as the stock identification codes in the protective layer stock area are assigned, the stock identification codes in the protective layer stock area will be less and less until consumed. When the stock identification code in the protective layer stock area is consumed, the consumption state of the protective layer stock area is changed from the non-consumed state to the consumed state.
In an optional implementation manner, step S202 specifically includes: determining M top-layer stock areas from the stock area group based on the association relationship between the M top-layer stock areas and the N protective layer stock areas; and based on a preset selection rule, selecting a target top-level inventory area from the M top-level inventory areas, and routing to the target top-level inventory area.
Specifically, the preset selection rule may be a random selection rule, a modulo selection rule, or another customized selection rule. Taking a random selection rule as an example, a top-level inventory area is randomly selected from the M top-level inventory areas as a target top-level inventory area. Taking a modulus selection rule as an example, performing modulus calculation based on the current distribution times and the number of the top-level inventory areas to obtain a top-level inventory area corresponding to a calculation result, and taking the top-level inventory area as a target top-level inventory area. Such as: the number of the top-level stock areas is 10, if the current distribution times is the 1 st time, the calculation result of the modulo calculation is 1, and the 1 st top-level stock area is correspondingly selected as a target top-level stock area; and if the current distribution times is 12 th, the calculation result of the modulo calculation is 2, and the 2 nd top-level inventory area is correspondingly selected as the target top-level inventory area. For the sake of brevity of description, no one example is illustrated.
And step S203, if the identification code is failed to be distributed to the service request from the target top-level stock area, distributing the identification code to the service request from a protection layer stock area configured for the target top-level stock area.
Specifically, there may be various embodiments for determining the assignment failure of the identification code from the target top-level inventory zone:
in an alternative embodiment, the following may be implemented: routing to a target top-level inventory area, executing an allocation action of allocating an identification code for the service request from the target top-level inventory area, and if the allocation result is null, determining that the allocation of the identification code for the service request from the target top-level inventory area fails; and if the distribution result is not empty, directly distributing the identification code from the target top-level stock area.
In another optional embodiment, after determining the target top-level inventory region from the M top-level inventory regions, determining whether the inventory identifier in the target top-level inventory region is consumed; if so, determining that the identification code is failed to be allocated from the target top-level stock area; otherwise, an allocation action of allocating the identification code for the service request from the target top-level stock area is executed.
In step S203, an identification code is allocated to the service request from the protection layer inventory area configured for the target top-level inventory area, specifically: and determining a protection layer inventory area configured to the target top layer inventory area from the N protection layer inventory areas based on the association relationship between the M top layer inventory areas and the N protection layer inventory areas. In a specific implementation process, for a case that the N protection layer inventory areas are configured as a single-stage protection layer inventory area of the M top layer inventory areas, the step of determining the protection layer inventory area configured to the target top layer inventory area from the N protection layer inventory areas specifically includes: and acquiring a protective layer stock area configured for the target top layer stock area from the single-stage protective layer stock area.
For the case that the N protection layer inventory areas are configured as multi-level protection layer inventory areas for the M top layer inventory areas, the step of determining the protection layer inventory area configured for the target top layer inventory area from the N protection layer inventory areas specifically includes: and determining a nearest protective layer stock area of the target top layer stock area from the multi-stage protective layer stock areas, and acquiring a protective layer stock area configured for the target top layer stock area from the nearest protective layer stock area.
It should be noted that, if the assignment of the identification code to the service request from the target top-level inventory area fails and the inventory identification code in the target top-level inventory area is consumed, the identification code is assigned to the service request from the protection layer inventory area configured to the target top-level inventory area. Specifically, a new routing strategy is calculated through the routing module, and a protection layer inventory area configured to the target top layer inventory area is obtained based on the new routing strategy. In a specific implementation process, after the inventory identification in the target top-level inventory area is consumed, the routing module is notified to calculate a new routing strategy.
In an alternative embodiment, the protection level inventory area allocated to the target top level inventory area is derived based on the new routing policy during the gap period in which the top level inventory area is updated.
It should be noted that, updating the gap time period of the top layer inventory area specifically means: all top-level inventory zones configured with the same protective-layer inventory: the inventory identification in the target top-level inventory zone has been depleted, but there is also at least one top-level inventory zone in which the inventory identification has not been depleted.
For example, referring to fig. 3, the two top layer inventory zones configured with the protective layer inventory zone 11 are: top level inventory area 01 and top level inventory area 02. The inventory identification in the top-level inventory area 01 is not consumed, the inventory identification in the top-level inventory area 02 is consumed, and at this time, the interval time period for updating the top-level inventory area is set, and then the routing module is informed to calculate a new routing policy as follows: if routing to the top level inventory area 02, routing directly to the protection level inventory area 11 allocated to the top level inventory area 01 and the top level inventory area 02, and assigning an identification code for the service request in the protection level inventory area 11.
Through the technical scheme, after the stock identification code in the top-layer stock area is consumed, a new routing strategy can be calculated, and the identification code can be distributed from the corresponding protective layer stock based on the new routing strategy. Therefore, the successful allocation of the identification codes is ensured on the premise of supporting high concurrent allocation, and the problem of fragment introduced by splitting the inventory area is avoided.
Further, the method further comprises the following steps 2-4:
step 2: and detecting whether the inventory identification codes in K top-layer inventory areas configured with the same protection layer inventory area are all consumed, wherein K is the number of the top-layer inventory areas protected by the same protection layer inventory area and is an integer larger than 1.
Specifically, whether the inventory identification codes in all the top-layer inventory areas corresponding to the same protective layer inventory area are all consumed is determined by detecting identification information representing the consumption state in the inventory relationship of the top-layer inventory areas. For example, if the same protection layer inventory area is configured for two top layer inventory areas, it is detected whether the identification information representing the consumption states of the two top layer inventory areas corresponding to the same protection layer inventory area is "consumed" or not.
And 4, step 4: and if the detection result in the step 2 is positive, replacing the K top layer inventory areas with the same protection layer inventory area configured to the K top layer inventory areas to form a new top layer inventory area.
It should be noted that, when all the stock identifiers in the K top-level stock areas configured with the same protection layer stock area are consumed, the routing module calculates and obtains the protection layer stock areas configured with the K top-level stock areas.
For example, referring to fig. 3, two top-level inventory zones configured with the same protective-layer inventory zone 12 are: top level inventory area 03 and top level inventory area 04. The inventory identifiers in the top-level inventory area 03 and the top-level inventory area 04 are all consumed. The routing module is notified that the calculation results in the protective layer inventory area 12 being allocated to the top level inventory area 03 and the top level inventory area 04. The protective layer inventory area 12 replaces the top layer inventory area 03 and the top layer inventory area 04 to become a new top layer inventory area, namely, the new top layer inventory area becomes a directly routed inventory area, and the inventory area is not required to be routed to the top layer inventory area 03 or the top layer inventory area 04, the shortage of inventory identification is found, and then the inventory area is routed to the protective layer inventory area 12, so that the distribution efficiency is improved.
And if the service request is received and the new top-level stock area is determined to be the target top-level stock area, directly routing to the new top-level stock area, and distributing the service identifier for the new service request from the new top-level stock area. And the method does not need to route to the original top-layer stock area which is consumed, finds that the stock identification is insufficient, and then routes to the protective layer stock area, thereby improving the distribution efficiency. And because the protective layer inventory area is introduced to replace the consumed top layer inventory area, the effect of smoothly replacing the consumed top layer inventory area is achieved.
In a second aspect, based on the same inventive concept, an embodiment of the present specification provides an identification code allocation apparatus, shown with reference to fig. 4, including:
a request receiving unit 401, configured to receive a service request;
a first allocating unit 402, configured to determine a target top-level inventory area from M top-level inventory areas, and allocate an identification code for the service request from the target top-level inventory area, where M is an integer greater than 1;
a second allocating unit 403, configured to allocate an identification code for the service request from the protection layer inventory area configured for the target top-level inventory area if allocation fails.
In an alternative embodiment, M top layer inventory zones and protective layer inventory zones are pre-established by:
the group generating unit is used for generating an inventory zone group according to the identification code set, wherein the inventory zone group comprises N protective layer inventory zones and M top layer inventory zones, the N protective layer inventory zones are correspondingly configured to the M top layer inventory zones, the protective layer inventory zone configured for the target top layer inventory zone belongs to the N protective layer inventory zones, and N is a positive integer;
and the relation generating unit is used for generating an inventory relation between the N protective layer inventory areas and the M top layer inventory areas, wherein the inventory relation comprises an association relation between the N protective layer inventory areas and the M top layer inventory areas.
In an optional embodiment, in the association relationship, the N protection layer inventory regions are configured to: a single level protective layer inventory zone for the M top level inventory zones, or a multi-level protective layer inventory zone for the M top level inventory zones.
In an optional implementation manner, an apparatus provided in an embodiment of this specification further includes:
a first protection bank area determination unit configured to: and acquiring a protective layer stock area configured for the target top layer stock area from the single-stage protective layer stock area, or determining a nearest protective layer stock area of the target top layer stock area from the multi-stage protective layer stock area, and acquiring a protective layer stock area configured for the target top layer stock area from the nearest protective layer stock area.
In an alternative embodiment, the first distributing unit 402 includes:
the determining subunit is used for determining M top-level stock areas from the stock area group based on the association relationship;
and the selecting subunit is used for selecting the target top-level inventory area from the M top-level inventory areas based on a preset selecting rule and routing the target top-level inventory area to the target top-level inventory area.
In an optional implementation manner, an apparatus provided in an embodiment of this specification further includes:
and the second protection library area determining unit is used for determining a protection layer inventory area configured to the target top layer inventory area from the N protection layer inventory areas based on the incidence relation.
In an optional embodiment, the apparatus further comprises:
the detection unit is used for detecting whether inventory identification codes in K top-layer inventory areas configured with the same protection layer inventory area are all consumed, wherein K is the number of the top-layer inventory areas protected by the same protection layer inventory area and is an integer larger than 1;
and the replacing unit is used for replacing the K top layer inventory areas with the same protective layer inventory area configured to the K top layer inventory areas to form a new top layer inventory area if the detection result of the detecting unit is positive.
In an optional implementation manner, an apparatus provided in an embodiment of this specification further includes:
the judging unit is used for judging whether the stock identification codes in the target top-level stock area are consumed or not;
a failure determination unit, configured to determine that the allocation fails if the determination result of the determination unit is yes; otherwise, the step of allocating the identification code for the service request from the target top-level stock area is executed.
In a third aspect, based on the same inventive concept as the identifier code allocation method in the foregoing embodiment, the present specification further provides a server, as shown in fig. 5, including a memory 504, a processor 502, and a computer program stored in the memory 504 and capable of running on the processor 502, where the processor 502 executes the program to implement the steps in any possible implementation manner of the identifier code allocation method described above.
Where in fig. 5 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 506 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
In a fourth aspect, based on the same inventive concept as the identification code allocation method in the foregoing embodiments, the present specification further provides a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps described in any of the foregoing possible implementations of the identification code allocation method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present specification have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all changes and modifications that fall within the scope of the specification.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present specification without departing from the spirit and scope of the specification. Thus, if such modifications and variations of the present specification fall within the scope of the claims of the present specification and their equivalents, the specification is intended to include such modifications and variations.

Claims (16)

1. An identification code assignment method, comprising:
receiving a service request;
determining a target top-level stock area from M top-level stock areas, and allocating an identification code to the service request from the target top-level stock area, wherein M is an integer greater than 1;
if the distribution fails, distributing an identification code aiming at the service request from a protective layer stock area configured for the target top-layer stock area;
the M top layer inventory zones and the protective layer inventory zone are pre-established by: generating an inventory zone group according to an identification code set, wherein the inventory zone group comprises N protective layer inventory zones and M top layer inventory zones, the N protective layer inventory zones are correspondingly configured to the M top layer inventory zones, the protective layer inventory zones configured for the target top layer inventory zone belong to the N protective layer inventory zones, and N is a positive integer; generating an inventory relationship between the N protective layer inventory areas and the M top layer inventory areas, wherein the inventory relationship includes an association relationship between the N protective layer inventory areas and the M top layer inventory areas, and specifically includes: tree association relations between M top layer inventory areas and N protective layer inventory areas;
generating tree incidence relations between M top-layer inventory areas and N protective layer inventory areas based on the concurrency prediction information; the concurrency prediction information includes: predicting the quantity of service requests requesting to distribute identification codes at the same time point by using the concurrency predicted value and the duration predicted value of the high concurrency time period; and adjusting the stock of the stock area of the protective layer, the quantity of the stock area and the top stock area and the number of the series by the tree-shaped incidence relation.
2. The identification code assignment method according to claim 1, wherein in the association relationship, the N protection layer inventory sections are configured to: a single level protective layer inventory zone for the M top level inventory zones, or a multi-level protective layer inventory zone for the M top level inventory zones.
3. The identification code allocation method according to claim 2, wherein, in the protection layer inventory area configured from the target top-level inventory area, before allocating an identification code for the service request, further comprising:
obtaining a protection layer inventory zone configured for the target top layer inventory zone from the single-stage protection layer inventory zone, or
And determining a nearest protective layer stock area of the target top layer stock area from the multi-stage protective layer stock areas, and acquiring a protective layer stock area configured for the target top layer stock area from the nearest protective layer stock area.
4. The identification code assignment method of claim 1, wherein said determining a target top-level inventory zone from among the M top-level inventory zones comprises:
determining the M top-level stock areas from the stock area group based on the association relation;
and based on a preset selection rule, selecting the target top-level inventory area from the M top-level inventory areas and routing to the target top-level inventory area.
5. The method for assigning identification codes according to claim 1, wherein before assigning identification codes for the service requests from the protection layer inventory zone configured for the target top-level inventory zone, the method further comprises:
and determining a protection layer inventory area configured to the target top layer inventory area from the N protection layer inventory areas based on the incidence relation.
6. The identification code assignment method according to any one of claims 1 to 5, further comprising:
detecting whether inventory identification codes in K top-layer inventory areas configured with the same protection layer inventory area are all consumed, wherein K is the number of the top-layer inventory areas protected by the same protection layer inventory area and is an integer larger than 1;
and if so, replacing the K top layer inventory areas with the same protection layer inventory area configured to the K top layer inventory areas to form a new top layer inventory area.
7. The method of assigning identification codes according to claim 1, wherein prior to said assigning identification codes for said service requests from said target top-level inventory area, further comprising:
judging whether the stock identification codes in the target top-level stock area are consumed or not;
if so, determining that the distribution fails; otherwise, the step of allocating the identification code to the service request from the target top-level stock area is executed.
8. An identification code assigning apparatus, comprising:
a request receiving unit, configured to receive a service request;
the first allocation unit is used for determining a target top-level stock area from M top-level stock areas and allocating an identification code to the service request from the target top-level stock area, wherein M is an integer greater than 1;
the second distribution unit is used for distributing an identification code aiming at the service request from a protective layer stock area configured for the target top-layer stock area if the distribution fails;
the M top layer inventory zones and the protective layer inventory zone are pre-established by:
the group generating unit is used for generating an inventory zone group according to the identification code set, wherein the inventory zone group comprises N protective layer inventory zones and M top layer inventory zones, the N protective layer inventory zones are correspondingly configured to the M top layer inventory zones, the protective layer inventory zone configured for the target top layer inventory zone belongs to the N protective layer inventory zones, and N is a positive integer;
a relationship generating unit, configured to generate an inventory relationship between the N protective layer inventory regions and the M top layer inventory regions, where the inventory relationship includes an association relationship between the N protective layer inventory regions and the M top layer inventory regions, and specifically includes: tree-shaped association relations between the M top layer inventory areas and the N protective layer inventory areas;
generating tree incidence relations between M top-layer inventory areas and N protective layer inventory areas based on the concurrency prediction information; the concurrency prediction information includes: the concurrency prediction value and the duration prediction value of the high concurrency time period are used for predicting the number of service requests requesting to allocate identification codes at the same time point; and adjusting the stock of the stock area of the protective layer, the quantity of the stock area and the top stock area and the number of the series by the tree-shaped incidence relation.
9. The identification code assigning apparatus according to claim 8, wherein in the association relationship, the N protective layer inventory zones are configured to: a single level protective layer inventory zone for the M top level inventory zones, or a multi-level protective layer inventory zone for the M top level inventory zones.
10. The identification code assigning apparatus of claim 9, wherein the apparatus further comprises:
a first protection bank determination unit configured to: and acquiring a protection layer stock area configured for the target top layer stock area from the single-stage protection layer stock area, or determining a closest protection layer stock area of the target top layer stock area from the multi-stage protection layer stock areas, and acquiring a protection layer stock area configured for the target top layer stock area from the closest protection layer stock area.
11. The identification code dispensing apparatus of claim 8, wherein the first dispensing unit comprises:
a determining subunit, configured to determine, based on the association relationship, the M top-level inventory zones from the inventory zone group;
and the selecting subunit is used for selecting the target top-level inventory area from the M top-level inventory areas based on a preset selecting rule and routing the target top-level inventory area.
12. The identification code assigning apparatus of claim 8, wherein the apparatus further comprises:
and the second protection library area determining unit is used for determining a protection layer inventory area configured to the target top layer inventory area from the N protection layer inventory areas based on the incidence relation.
13. The identification code assigning apparatus of any one of claims 8-12, wherein the apparatus further comprises:
the detection unit is used for detecting whether inventory identification codes in K top-layer inventory areas configured with the same protection layer inventory area are all consumed, wherein K is the number of the top-layer inventory areas protected by the same protection layer inventory area and is an integer larger than 1;
and the replacing unit is used for replacing the K top layer inventory areas with the same protective layer inventory area configured to the K top layer inventory areas to form a new top layer inventory area if the detection result of the detecting unit is positive.
14. The identification code assigning apparatus of claim 8, wherein the apparatus further comprises:
the judging unit is used for judging whether the inventory identification code in the target top-layer inventory area is consumed or not;
a failure determination unit, configured to determine that allocation fails if a determination result of the determination unit is yes; otherwise, executing the step of allocating the identification code for the service request from the target top-level stock area.
15. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1-7 when the program is executed.
16. 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 7.
CN201810841740.6A 2018-07-27 2018-07-27 Identification code allocation method, device and server Active CN109241053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810841740.6A CN109241053B (en) 2018-07-27 2018-07-27 Identification code allocation method, device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810841740.6A CN109241053B (en) 2018-07-27 2018-07-27 Identification code allocation method, device and server

Publications (2)

Publication Number Publication Date
CN109241053A CN109241053A (en) 2019-01-18
CN109241053B true CN109241053B (en) 2022-08-23

Family

ID=65073131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810841740.6A Active CN109241053B (en) 2018-07-27 2018-07-27 Identification code allocation method, device and server

Country Status (1)

Country Link
CN (1) CN109241053B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102024209A (en) * 2010-12-30 2011-04-20 浪潮集团山东通用软件有限公司 Method for automatically replacing materials by replacement tree technology
CN102761469A (en) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 Allocation method and device for resource pool
CN103426072A (en) * 2013-07-16 2013-12-04 无限极(中国)有限公司 Order processing system of high concurrency competitive inventory and processing method thereof
CN103559558A (en) * 2013-11-07 2014-02-05 金蝶软件(中国)有限公司 Material reserved supply and demand matching method and device
CN104486452A (en) * 2014-09-23 2015-04-01 华为技术有限公司 Address processing method and related equipment and system
CN105656924A (en) * 2016-02-19 2016-06-08 腾讯科技(深圳)有限公司 Data processing method, device and system
CN105827563A (en) * 2015-01-04 2016-08-03 中国移动通信集团江西有限公司 Information verification method, intermediate platform and business support system
CN107092686A (en) * 2017-04-24 2017-08-25 浙江宇视科技有限公司 A kind of file management method and device based on cloud storage platform
CN107645468A (en) * 2016-07-20 2018-01-30 平安科技(深圳)有限公司 Extension set resource allocation methods and device
CN107679718A (en) * 2017-09-19 2018-02-09 平安科技(深圳)有限公司 List distribution method, equipment and computer-readable recording medium
CN107807787A (en) * 2016-09-08 2018-03-16 北京京东尚科信息技术有限公司 A kind of distributed data storage method and system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102024209A (en) * 2010-12-30 2011-04-20 浪潮集团山东通用软件有限公司 Method for automatically replacing materials by replacement tree technology
CN102761469A (en) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 Allocation method and device for resource pool
CN103426072A (en) * 2013-07-16 2013-12-04 无限极(中国)有限公司 Order processing system of high concurrency competitive inventory and processing method thereof
CN103559558A (en) * 2013-11-07 2014-02-05 金蝶软件(中国)有限公司 Material reserved supply and demand matching method and device
CN104486452A (en) * 2014-09-23 2015-04-01 华为技术有限公司 Address processing method and related equipment and system
CN105827563A (en) * 2015-01-04 2016-08-03 中国移动通信集团江西有限公司 Information verification method, intermediate platform and business support system
CN105656924A (en) * 2016-02-19 2016-06-08 腾讯科技(深圳)有限公司 Data processing method, device and system
CN107645468A (en) * 2016-07-20 2018-01-30 平安科技(深圳)有限公司 Extension set resource allocation methods and device
CN107807787A (en) * 2016-09-08 2018-03-16 北京京东尚科信息技术有限公司 A kind of distributed data storage method and system
CN107092686A (en) * 2017-04-24 2017-08-25 浙江宇视科技有限公司 A kind of file management method and device based on cloud storage platform
CN107679718A (en) * 2017-09-19 2018-02-09 平安科技(深圳)有限公司 List distribution method, equipment and computer-readable recording medium

Also Published As

Publication number Publication date
CN109241053A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN107360206B (en) Block chain consensus method, equipment and system
CN110858161B (en) Resource allocation method, device, system, equipment and medium
CN109783237B (en) Resource allocation method and device
CN112269641B (en) Scheduling method, scheduling device, electronic equipment and storage medium
CN108399101B (en) Method, device and system for scheduling resources
JP6881575B2 (en) Resource allocation systems, management equipment, methods and programs
CN109614209B (en) Task processing method, application server and system
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
CN111460504B (en) Service processing method, device, node equipment and storage medium
CN107861811B (en) Task information transmission method and device in workflow system and computer equipment
CN108154298B (en) Distribution task allocation method and device, electronic equipment and computer storage medium
US10379834B2 (en) Tenant allocation in multi-tenant software applications
US11102284B2 (en) Service processing methods and systems based on a consortium blockchain network
CN113206877A (en) Session keeping method and device
CN106952085B (en) Method and device for data storage and service processing
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CN109241053B (en) Identification code allocation method, device and server
CN111905362A (en) Game guild loading method and server
CN116263715A (en) Automatic scaling system and method for cloud native intelligent typesetting service
JP2005309868A (en) Processing allocation management apparatus, control method for the same, and program
CN114866547A (en) Virtual resource allocation method, device, equipment and storage medium
CN115689763A (en) Data processing method and device, electronic equipment and storage medium
CN111736953A (en) Virtual resource delivery method and device, computer equipment and storage medium
CN111143386A (en) Method and device for processing bond line data
KR20150002270A (en) Method and its apparatus for task load balancing for multicore system

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40003297

Country of ref document: HK

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant