Embodiment
Be described below in detail the embodiment of the application, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Be exemplary below by the embodiment be described with reference to the drawings, be intended to for explaining the application, and the restriction to the application can not be interpreted as.
Below with reference to the accompanying drawings generation method and the device thereof of the card number of the embodiment of the present application are described.
Fig. 1 a is the process flow diagram of the generation method of card number according to the application's embodiment.As shown in Figure 1a, the generation method of this card number comprises:
S101, obtains the card number application request of user.
In this embodiment, when user needs application member card, promotional card, can click corresponding card application field in client, now, client can obtain corresponding card number application request.This embodiment is especially applicable to the situation that process user applies for card number in a large number.
S102, by card number application Requests routing to one or more node, wherein, each node has unduplicated segment information.
In this embodiment, by arranging multiple nodes with unduplicated segment information that can call, the follow-up operation generating a large amount of card number is efficiently realized.
It should be noted that, above-mentioned S102 both can have been come by client, also can have been come by server.When S102 has been come by client, above-mentioned node refers to the multiple nodes being positioned at client, and when S102 has been come by server, above-mentioned node refers to the multiple nodes being positioned at server.Card number application Requests routing to multiple node can be improved treatment effeciency.
Particularly, card number application Requests routing to one or more node can be realized in the following manner: obtain card number Back ground Information according to card number application request, according to the local information list preserved of card number Back ground Information inquiry obtained, thus determine the information of multiple nodes that can call, then by one or several node in card number application Requests routing to multiple node, particularly, Issue Number application request can be divided according to the idle condition can calling node.
Wherein, the information of the multiple nodes called of card number Back ground Information and correspondence thereof and number segment information corresponding with each node can be comprised in information list, certainly can also comprise first data corresponding with card number Back ground Information and bin value.Card number Back ground Information can comprise card sending mechanism information, card type information etc.Such as: card sending mechanism can comprise Mei Tesibangwei, Carrefour etc., card type information can comprise regular member's card, VIP (honored guest) member card, promotional card etc.For example, as shown in table 1: the bin value that the member card of Mei Tesibangwei is corresponding is 000001, can be distributed to four nodes.Wherein, number segment information of node 1 correspondence is 0/1000, and number segment information of node 2 correspondence is 1001/2000, and number segment information of node 3 correspondence is 2001/3000, and number segment information of node 4 correspondence is 3001/4000.The bin value that Carrefour's member card is corresponding is 000005, can be distributed to node 10, and number segment information of node 10 correspondence is 0/1000.Bin value corresponding to Carrefour's VIP card is 000006, and can be distributed to node 11, number segment information of node 11 correspondence is 0/1000.
Table 1 information list
S103, obtains corresponding card number Back ground Information and number segment value by the node receiving card number application request, and according to the card number Back ground Information of correspondence and number segment value generation card number, wherein, number segment value difference of the same card number Back ground Information of correspondence of acquisition.
A number segment information corresponding due to each node does not repeat, therefore above-mentioned multiple node can obtain based on number segment information of oneself the different number segment value being positioned at correspondence section concurrently, thus generates multiple unduplicated card number efficiently while of can ensureing.
It should be noted that, aforesaid operations can complete execution by client, namely client first can obtain information list from server, then multiple nodes that can call are determined according to information list, then by the card number application Requests routing of acquisition extremely one or more node called, card number is generated according to the card number Back ground Information of the correspondence obtained and number segment value, as shown in Figure 1 b finally by the node receiving card number application request; Aforesaid operations also can be completed by server, namely server side determines multiple nodes that can call according to the information list that server side is preserved, then by the card number application Requests routing of acquisition to one or several node that can call, card number is generated according to the card number Back ground Information of the correspondence obtained and number segment value finally by the node receiving card number application request, then the card number of generation is returned to client, as illustrated in figure 1 c, finally operated by client executing hair fastener.
The generation method of the card number of the embodiment of the present application, obtain be positioned at oneself number number segment value that section is different by multiple nodal parallel, and generate card number according to the not jack per line segment value obtained and corresponding card number Back ground Information, not only ensure that the card number of generation does not repeat, also solve the problem of performance bottleneck during a large amount of hair fastener, improve the efficiency of hair fastener.
Fig. 2 is the process flow diagram of the generation method of card number according to the application's specific embodiment.This embodiment is described from the node side receiving card number application request, and wherein, the node receiving card number application request both can be positioned at server side, also can be positioned at client-side; For the node that each receives card number application request, it performs the process of generation card number as shown in Figure 2, comprising:
S201, Query Information list obtains first data corresponding with current card number Back ground Information, and obtains current segment value according to the first data and a number segment information corresponding with present node.
Particularly, present node judges whether there are the first data in local information list, if exist, then using the number of distribution segment value as current segment value, then add one operation is carried out to the number of distribution segment value.For example, suppose that number segment information that present node is corresponding is 0-1000, current card number Back ground Information comprises Mei Tesibangwei and regular member's card, if there is the first data and the bin value of regular member's card of corresponding Mei Tesibangwei in the information list of this locality, be assumed to be 000001, then using the segment value of distribution in number segment information corresponding for the first data as current segment value, suppose that the number of distribution segment value is 3, then using 3 as current segment value, then the number of distribution segment value is set to 4, like this, present node is when the regular member receiving next Mei Tesibangwei blocks application request, just can using 4 as number segment value of corresponding requests, similarly, the number of distribution segment value is needed again to be set to 5, thus number segment value difference of the same card number Back ground Information of correspondence obtained can be ensured.
In addition, in order to ensure to preserve the bin value corresponding with the card number Back ground Information comprised in card number application request in information list, in this embodiment, after the card number application request that server receives client sends, obtain the card number Back ground Information comprised in card number application request, if there is not the first data and the bin value of corresponding card number Back ground Information in the information list of this locality, such as there is not the bin value of regular member's card of corresponding Mei Tesibangwei, then distribute the first corresponding data, and by the first data of distribution and corresponding card number Back ground Information written information list, in addition, after user end to server sends information inquiring request, server can return the information list of the first data and the corresponding card number Back ground Information comprising distribution to client, thus all include the bin value corresponding with the card number Back ground Information comprised in current card number application request in ensure that the information list that server side or client-side are preserved.
In this embodiment, present node can judge whether the number of distribution segment value is less than predetermined threshold, if be less than, then using the number of distribution segment value as current segment value.When determining that the number of distribution segment value is more than or equal to predetermined threshold, available section whether is there is in Query Information list, if there is available section, then obtain available section, if there is not available section, then generate the first new data, and the segment value of the number of distribution corresponding for the first new data is set to the initial value of correspondence section.For example, suppose that number segment information that present node is corresponding is 0-1000, predetermined threshold is 900, if the number of distribution segment value is 800, is less than predetermined threshold value, then current segment value is 800.If the number of distribution segment value is 950, be greater than predetermined threshold value, then Query Information list, due to the segment information of distribution of each node, maximum available segment information etc. can also be comprised in information list, can judge whether present node also has available section according to these information, if still have available section, then obtain available section, and using number segment information of this available section as present node.If there is no available section, then generate the first new data as: 000002, and the initial value 0 segment value of the number of distribution corresponding for the first new data being set to present node correspondence section 0-1000.The object done like this is: be greater than predetermined threshold at the segment value of distribution of present node, namely when the available segment value of present node is little, obtains more available segment value in advance, improves the efficiency of node acquisition segment value.
S202, obtains check bit information.
After obtaining current segment value according to the first data and a corresponding number segment information, present node can obtain check bit information, to ensure the legitimacy of card number.
S203, generates card number according to the first data obtained, current segment value and check bit information.
After acquisition check bit information, present node can generate card number according to the first data obtained, current segment value and check bit information.Particularly, generate the schematic diagram of card number as shown in Figure 3, wherein, card number Back ground Information can comprise card sending mechanism information and card type information.By card sending mechanism information and card type information, the first data can be obtained.Hair fastener key element can comprise: the first data (bin value), immediately number section (number segment value) and check bit.By above-mentioned three hair fastener key elements, card number can be generated.
The generation method of the card number of the embodiment of the present application, obtain be positioned at oneself number number segment value that section is different by multiple nodal parallel, and generate card number according to the not jack per line segment value obtained and corresponding card number Back ground Information, not only ensure that the card number of generation does not repeat, also solve the problem of performance bottleneck during a large amount of hair fastener, improve the efficiency of hair fastener.
In order to realize above-described embodiment, the application also proposes a kind of generating apparatus of card number.
Fig. 4 is the structural drawing of the generating apparatus of card number according to the application's embodiment.The generating apparatus of this card number can as shown in Figure 4, comprise: obtain module 110, distribution module 120 and generation module 130.Wherein, generation module 130 comprises: first obtains unit 131, second obtains unit 132 and generation unit 133.
Obtain module 110 for obtaining the card number application request of user.
Distribution module 120 for by card number application Requests routing to one or more node, wherein, each node has unduplicated segment information.
Generation module 130 obtains corresponding card number Back ground Information and number segment value for the node by receiving card number application request, and generate card number according to the card number Back ground Information of correspondence and number segment value, wherein, number segment value difference of the same card number Back ground Information of the correspondence of acquisition.
The generating apparatus of the card number of the embodiment of the present application, obtain be positioned at oneself number number segment value that section is different by multiple nodal parallel, and generate card number according to the not jack per line segment value obtained and corresponding card number Back ground Information, not only ensure that the card number of generation does not repeat, also solve the problem of performance bottleneck during a large amount of hair fastener, improve the efficiency of hair fastener.
It should be noted that, above-mentioned module both can be arranged in client, also can be arranged in server.Therefore, be described in detail respectively from server and client side below, be not repeated herein.
Fig. 5 is the structural drawing of the generating apparatus of card number according to another embodiment of the application.When performing by server the operation generating card number, the generating apparatus of this card number can as shown in Figure 5, comprise: obtain module 110, distribution module 120, generation module 130 and return module 140.Wherein, generation module 130 comprises: first obtains unit 131, second obtains unit 132 and generation unit 133.
Obtain module 110 for obtaining the card number application request of user.
In this embodiment, the hair fastener request that module 110 can receive client transmission is obtained.Wherein, when hair fastener request is for needing as user to apply for member card, promotional card, the corresponding card of click client produces.Then, module 110 can obtain user card number application request according to hair fastener request is obtained.
Distribution module 120 for by card number application Requests routing to one or more node, wherein, each node has unduplicated segment information.
Particularly, card number application Requests routing to one or more node can realize by distribution module 120 in the following manner: distribution module 120 can obtain card number Back ground Information according to card number application request, according to the local information list preserved of card number Back ground Information inquiry obtained, thus determine the information of multiple nodes that can call, then by one or several node in card number application Requests routing to multiple node, particularly, Issue Number application request can be divided according to the idle condition can calling node.
Wherein, the information of the multiple nodes called of card number Back ground Information and correspondence thereof and number segment information corresponding with each node can be comprised in information list, certainly first data corresponding with card number Back ground Information and bin value can also be comprised, particularly, as shown in table 1: the bin value that the member card of Mei Tesibangwei is corresponding is 000001, can be distributed to four nodes.Wherein, number segment information of node 1 correspondence is 0/1000, and number segment information of node 2 correspondence is 1001/2000, and number segment information of node 3 correspondence is 2001/3000, and number segment information of node 4 correspondence is 3001/4000.The bin value that Carrefour's member card is corresponding is 000005, can be distributed to node 10, and number segment information of node 10 correspondence is 0/1000.Bin value corresponding to Carrefour's VIP card is 000006, and can be distributed to node 11, number segment information of node 11 correspondence is 0/1000.Generation module 130 obtains corresponding card number Back ground Information and number segment value for the node by receiving card number application request according to the card number application request received and corresponding number segment information, and generate card number according to the card number Back ground Information of correspondence and number segment value, wherein, number segment value difference of the same card number Back ground Information of the correspondence of acquisition.
Particularly, generation module 130 comprises: first obtains unit 131, second obtains unit 132 and generation unit 133.
Wherein, first obtains unit 131 for obtaining first data corresponding with current card number Back ground Information by the list of present node Query Information, and obtains current segment value according to the first data and a number segment information corresponding with present node.
Particularly, first obtains unit 131 judges whether there are the first data in local information list, if exist, then using the number of distribution segment value as current segment value, then add one operation is carried out to the number of distribution segment value.For example, suppose that number segment information that present node is corresponding is 0-1000, current card number Back ground Information comprises Mei Tesibangwei and regular member's card, if there is the first data and the bin value of regular member's card of corresponding Mei Tesibangwei in the information list of this locality, be assumed to be 000001, then using the segment value of distribution in number segment information corresponding for the first data as current segment value, suppose that the number of distribution segment value is 3, then using 3 as current segment value, then the number of distribution segment value is set to 4, like this, present node is when the regular member receiving next Mei Tesibangwei blocks application request, using 4 as number segment value of corresponding requests, similarly, the number of distribution segment value is needed again to be set to 5, thus number segment value difference of the same card number Back ground Information of correspondence obtained can be ensured.
In this embodiment, first obtains unit 131 can judge whether the number of distribution segment value is less than predetermined threshold, if be less than, then using the number of distribution segment value as current segment value.When determining that the number of distribution segment value is more than or equal to predetermined threshold, available section whether is there is in Query Information list, if there is available section, then obtain available section, if there is not available section, then generate the first new data, and the segment value of the number of distribution corresponding for the first new data is set to the initial value of correspondence section.For example, suppose that number segment information that present node is corresponding is 0-1000, predetermined threshold is 900, if the number of distribution segment value is 800, is less than predetermined threshold value, then current segment value is 800.If the number of distribution segment value is 950, be greater than predetermined threshold value, then Query Information list, due to the segment information of distribution of each node, maximum available segment information etc. can also be comprised in information list, can judge whether present node also has available section according to these information, if still have available section, then obtain available section, and using number segment information of this available section as present node.If there is no available section, then generate the first new data as: 000002, and the initial value 0 segment value of the number of distribution corresponding for the first new data being set to present node correspondence section 0-1000.The object done like this is: be greater than predetermined threshold at the segment value of distribution of present node, namely when the available segment value of present node is little, obtains more available segment value in advance, improves the efficiency of node acquisition segment value.
Second obtains unit 132 for obtaining check bit information by present node.
After obtaining current segment value according to the first data and a corresponding number segment information, second obtains unit 132 can obtain check bit information, to ensure the legitimacy of card number.
Generation unit 133 is for generating card number by present node according to the first data obtained, current segment value and check bit information.
After acquisition check bit information, generation unit 133 can generate card number according to the first data obtained, current segment value and check bit information.
Return module 140 for after generation module 130 is according to the card number Back ground Information of correspondence and number segment value generation card number, return card number to client.
The generating apparatus of the card number of the embodiment of the present application, obtain be positioned at oneself number number segment value that section is different by multiple nodal parallel, and generate card number according to the not jack per line segment value obtained and corresponding card number Back ground Information, not only ensure that the card number of generation does not repeat, also solve the problem of performance bottleneck during a large amount of hair fastener, improve the efficiency of hair fastener.
Fig. 6 is the structural drawing of the generating apparatus of card number according to another embodiment of the application.When generating the operation of card number by client executing, the generating apparatus of this card number can as shown in Figure 6, comprise: obtain module 110, distribution module 120, generation module 130 and data obtaining module 150.Wherein, generation module 130 comprises: first obtains unit 131, second obtains unit 132 and generation unit 133.
Obtain module 110 for obtaining the card number application request of user.
In this embodiment, when user needs application member card, promotional card, corresponding card can be clicked in client, now, obtain module 110 and can obtain corresponding card number application request.This embodiment is especially applicable to the situation that process user applies for card number in a large number.
Distribution module 120 for by card number application Requests routing to one or more node, wherein, each node has unduplicated segment information.
Particularly, distribution module 120 first can obtain information list from server, then determines multiple nodes that can call according to information list, then by the card number application Requests routing of acquisition extremely one or more node called.
The function and structure of generation module 130 with embodiment illustrated in fig. 4 in description consistent, be not repeated herein.
Data obtaining module 150 is for before distribution module 120 is according to the local information list preserved of card number Back ground Information inquiry obtained, card number Back ground Information according to obtaining sends information inquiring request to server, and the information list that reception server returns according to information inquiring request.
In the embodiment of the application, data obtaining module 150 can send information inquiring request according to the card number Back ground Information obtained to server in advance, and the information list that reception server returns according to information inquiring request, and the information list returned is preserved in this locality, to make client after receiving application request, from the information list returned, obtain card number Back ground Information and corresponding number segment information.Wherein, number segment information of card number Back ground Information and correspondence thereof is comprised in information list.
The generating apparatus of the card number of the embodiment of the present application, the information list that reception server returns according to information inquiring request, not only ensure that the card number of generation does not repeat, also solves the problem of performance bottleneck during a large amount of hair fastener, improve the efficiency of hair fastener.
In the description of this instructions, at least one embodiment that specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained in the application or example.In this manual, to the schematic representation of above-mentioned term not must for be identical embodiment or example.And the specific features of description, structure, material or feature can combine in one or more embodiment in office or example in an appropriate manner.In addition, when not conflicting, the feature of the different embodiment described in this instructions or example and different embodiment or example can carry out combining and combining by those skilled in the art.
In addition, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance or imply the quantity indicating indicated technical characteristic.Thus, be limited with " first ", the feature of " second " can express or impliedly comprise at least one this feature.In the description of the application, the implication of " multiple " is at least two, such as two, three etc., unless otherwise expressly limited specifically.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred implementation of the application comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by the embodiment person of ordinary skill in the field of the application.
In flow charts represent or in this logic otherwise described and/or step, such as, the sequencing list of the executable instruction for realizing logic function can be considered to, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise the system of processor or other can from instruction execution system, device or equipment instruction fetch and perform the system of instruction) use, or to use in conjunction with these instruction execution systems, device or equipment.With regard to this instructions, " computer-readable medium " can be anyly can to comprise, store, communicate, propagate or transmission procedure for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), ROM (read-only memory) (ROM), erasablely edit ROM (read-only memory) (EPROM or flash memory), fiber device, and portable optic disk ROM (read-only memory) (CDROM).In addition, computer-readable medium can be even paper or other suitable media that can print described program thereon, because can such as by carrying out optical scanning to paper or other media, then carry out editing, decipher or carry out process with other suitable methods if desired and electronically obtain described program, be then stored in computer memory.
Should be appreciated that each several part of the application can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the application can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.Although illustrate and described the embodiment of the application above, be understandable that, above-described embodiment is exemplary, can not be interpreted as the restriction to the application, and those of ordinary skill in the art can change above-described embodiment, revises, replace and modification in the scope of the application.