CN104113435A - Method and device for generating identifier - Google Patents

Method and device for generating identifier Download PDF

Info

Publication number
CN104113435A
CN104113435A CN201410317647.7A CN201410317647A CN104113435A CN 104113435 A CN104113435 A CN 104113435A CN 201410317647 A CN201410317647 A CN 201410317647A CN 104113435 A CN104113435 A CN 104113435A
Authority
CN
China
Prior art keywords
type
mark
resource type
value corresponding
suffix
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.)
Granted
Application number
CN201410317647.7A
Other languages
Chinese (zh)
Other versions
CN104113435B (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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201410317647.7A priority Critical patent/CN104113435B/en
Publication of CN104113435A publication Critical patent/CN104113435A/en
Application granted granted Critical
Publication of CN104113435B publication Critical patent/CN104113435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a device for generating an identifier, and belongs to the technical field of network. The method comprises the following steps: an identifier generating request is sent to a server when a service process is started, wherein the identifier generating request carries the resource type of the service process so that the server can generate a unique identifier seed value corresponding to the resource type according to the resource type; the identifier seed value sent by the server and corresponding to the resource type is received; a prefix value corresponding to the resource type is generated according to the identifier seed value corresponding to the resource type; when any identifier in a service scene where the service process is in currently is generated, a suffix value corresponding to the scene type is generated according to the scene type of the service scene; and an identifier is generated according to the prefix value corresponding to the resource type and the suffix value corresponding to the scene type. By adopting the method and the device of the invention, the efficiency of identifier generation is improved, and the probability of failure of identifier generation is reduced.

Description

The method of generating identification and device
Technical field
The present invention relates to networking technology area, particularly a kind of method of generating identification and device.
Background technology
In the distributed system of disposing in multimachine room, multimachine device, multi-process, may move business process corresponding to multiple business, each business can comprise multiple business scenarios.The piece of data or the operation that produce when recording in each business scenario this business process operation, need to be for this business scenario, is that this piece of data or an operation generate a unique mark.
At present, the process of generating identification is specifically as follows: terminal sends mark to third party device and generates request, and in the time that third party device receives this mark generation request, third party device obtains the mark of storage, increase the mark of obtaining, and the mark after increasing is sent to this terminal.Wherein, the equipment that third party device is generating identification, and third party device is not the equipment in this distributed system.
Because said method is the mark that obtains current generation by increasing a upper mark, so, when multiple terminals are simultaneously to third party device request generating identification, the plurality of mark generates request can produce conflict, third party device can only handle one mark generate request after process again another mark generate request, cause the efficiency of generating identification lower.In addition, in distributed system, easily there is network problem, cause terminal and third party device connection failure, so, the probability of failure of generating identification increased according to said method.
Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method and device of generating identification.Described technical scheme is as follows:
On the one hand, provide a kind of method of generating identification, described method comprises:
In the time that business process starts, send mark to server and generate request, described mark generates the resource type of carrying described business process in request, makes described server according to described resource type, generates and the unique corresponding mark seed of described resource type;
Receive mark seed corresponding to described resource type that described server sends;
The mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type;
When generate in the current place of described business process business scenario arbitrary mark time, according to the scene type of described business scenario, generate suffix value corresponding to described scene type;
According to prefix value corresponding to described resource type and suffix value corresponding to described scene type, generate described mark.
Alternatively, the described mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type, comprising:
Mark seed corresponding described resource type is offset to predeterminated position left, obtains prefix value corresponding to described resource type.
Alternatively, described according to the scene type of described business scenario, generate suffix value corresponding to described scene type, comprising:
According to the scene type of described business scenario, from the corresponding relation between the scene type of having stored and suffix value, obtain corresponding suffix value;
Increase the suffix value of obtaining;
Suffix value after increasing is defined as to suffix value corresponding to described scene type.
Alternatively, after the suffix value that described increase is obtained, also comprise:
By in the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type replaces with the suffix value after increase.
Alternatively, describedly generate described mark according to prefix value corresponding to described resource type and suffix value corresponding to described scene type, comprising:
Prefix value corresponding described resource type and suffix value corresponding to described scene type are added, obtain described mark.
Alternatively, described according to the scene type of described business scenario, after generating suffix value corresponding to described scene type, also comprise:
Suffix value corresponding described scene type and the first predetermined threshold value are compared;
If suffix value corresponding to described scene type is more than or equal to described the first predetermined threshold value, again sends described mark to described server and generate request, to obtain new logo seed corresponding to described resource type from described server;
In the time that suffix value corresponding to described scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to described resource type, upgrades prefix value corresponding to described resource type, and described the second predetermined threshold value is greater than described the first predetermined threshold value;
By in the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type is set to default initial value.
On the other hand, provide a kind of device of generating identification, described device comprises:
Sending module, for in the time that business process starts, send mark to server and generate request, described mark generates the resource type of carrying described business process in request, make described server according to described resource type, generate and the unique corresponding mark seed of described resource type;
Receiver module, mark seed corresponding to described resource type sending for receiving described server;
The first generation module, for the mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type;
The second generation module, for when generate in the current place of described business process business scenario arbitrary mark time, according to the scene type of described business scenario, generate suffix value corresponding to described scene type;
The 3rd generation module, for according to prefix value corresponding to described resource type and suffix value corresponding to described scene type, generates described mark.
Alternatively, described the first generation module comprises:
Offset units, for mark seed corresponding described resource type is offset to predeterminated position left, obtains prefix value corresponding to described resource type.
Alternatively, described the second generation module comprises:
Acquiring unit for according to the scene type of described business scenario, obtains corresponding suffix value from the corresponding relation between the scene type of having stored and suffix value;
Increase unit, for increasing the suffix value of obtaining;
Determining unit, for being defined as suffix value corresponding to described scene type by the suffix value after increasing.
Alternatively, described the second generation module also comprises:
Replacement unit, for by the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type replaces with the suffix value after increase.
Alternatively, described the 3rd generation module comprises:
Addition unit, for prefix value corresponding described resource type and suffix value corresponding to described scene type are added, obtains described mark.
Alternatively, described device also comprises:
Comparison module, for comparing suffix value corresponding described scene type and the first predetermined threshold value;
The second sending module, if be more than or equal to described the first predetermined threshold value for suffix value corresponding to described scene type, again send described mark to described server and generate request, to obtain new logo seed corresponding to described resource type from described server;
Update module, for in the time that suffix value corresponding to described scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to described resource type, upgrades prefix value corresponding to described resource type, and described the second predetermined threshold value is greater than described the first predetermined threshold value;
Module is set, and for by the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type is set to default initial value.
In embodiments of the present invention, in the time that business process starts, from server, obtain the mark seed of the unique correspondence of this resource type, and the mark seed corresponding according to this resource type, prefix value corresponding to this resource type obtained.In the time of arbitrary mark in the business scenario of the current place of this business process of follow-up generation, obtain the suffix value corresponding to scene type of this business scenario from this locality.According to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generate this mark.That is to say, a prefix value that resource type is corresponding, and the respectively corresponding suffix value of the scene type of the each business scenario comprising in this business process, in the time that server receives multiple marks generation request, the plurality of mark generates request can not produce conflict, can obtain its corresponding prefix value and suffix value simultaneously, improve the efficiency of generating identification.In addition, the method that the embodiment of the present invention provides is just in the time that business process starts, terminal and server carry out alternately, to obtain mark seed corresponding to this resource type, reduce the interaction times between terminal and server, and then reduced the probability of connection failure between terminal and server, thereby reduce the probability of failure of generating identification.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1-1st, the system architecture diagram of a kind of generating identification that the embodiment of the present invention provides;
Fig. 1-2 is the sequential chart of a kind of generating identification of providing of the embodiment of the present invention;
Fig. 2 is the method flow diagram of a kind of generating identification of providing of the embodiment of the present invention;
Fig. 3 is the method flow diagram of the another kind of generating identification that provides of the embodiment of the present invention;
Fig. 4 is the apparatus structure schematic diagram of a kind of generating identification of providing of the embodiment of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Fig. 1-1st, the system architecture diagram of a kind of generating identification that the embodiment of the present invention provides.In this system architecture diagram, can comprise machine room 1 and machine room 2, in machine room 1, can comprise server A and server B, in machine room 2, can comprise server C and server D, in server A, server B, server C and server D, can specify a server as resource management center.In this system architecture diagram, also comprise terminal.Wherein, server A is connected with server B, and server C is connected with server D, and server B is connected with server C.In addition, server A, server B, server C and server D are connected by network with terminal respectively.On server A, server B, server C and server D, all can move multiple business process, and in terminal, also can move multiple business process, and terminal can also be carried out respectively data interaction with each server.Each server can provide business process required data for this terminal.
Fig. 1-2 is the sequential chart of a kind of generating identification of providing of the embodiment of the present invention.Comprise business module, mark generation module and resource management center at this sequential chart.Wherein, business module is used for moving business process, and for obtaining mark, and business module can be arranged in terminal, can also be arranged in server.Mark generation module is in the time that business process starts, mark seed corresponding to Gains resources type from resource management center, according to the mark seed obtaining, generate prefix value corresponding to this resource type, and obtain suffix value corresponding to scene type from this locality.And in the time that suffix value corresponding to this scene type is more than or equal to the second predetermined threshold value, from resource management center, obtain new logo seed corresponding to this resource type.Mark generation module not only can be arranged in terminal, can also be arranged in server.Resource management center can be a given server in each server in Fig. 1-1, for generating mark seed corresponding to resource type, and the mark seed of generation is sent to mark generation module.
Fig. 2 is the method flow diagram of a kind of generating identification of providing of the embodiment of the present invention.Referring to Fig. 2, the method comprises:
Step 201: in the time that business process starts, send mark generate request to server, this mark generates the resource type of carrying this business process in request, makes server according to this resource type, generates and the unique corresponding mark seed of this resource type.
Step 202: mark seed corresponding to this resource type that reception server sends.
Step 203: the mark seed corresponding according to this resource type, generates prefix value corresponding to this resource type.
Step 204: when generate in the current place of this business process business scenario arbitrary mark time, according to the scene type of this business scenario, generate suffix value corresponding to this scene type.
Step 205: according to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generating identification.
In embodiments of the present invention, in the time that business process starts, from server, obtain and the unique corresponding mark seed of this resource type, and the mark seed corresponding according to this resource type, prefix value corresponding to this resource type obtained.In the time of arbitrary mark in the business scenario of the current place of this business process of follow-up generation, obtain the suffix value corresponding to scene type of this business scenario from this locality.According to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generate this mark.That is to say, a prefix value that resource type is corresponding, and the respectively corresponding suffix value of the scene type of the each business scenario comprising in this business process, when multiple terminals are during simultaneously to server request generating identification, the plurality of mark generates request can not produce conflict, can obtain its corresponding prefix value and suffix value simultaneously, improve the efficiency of generating identification.In addition, the method that the embodiment of the present invention provides is just in the time that business process starts, terminal and server carry out alternately, to obtain the mark seed that this business process is corresponding, reduce the interaction times between terminal and server, and then reduced the probability of connection failure between terminal and server, thereby reduce the probability of failure of generating identification.
Alternatively, the mark seed corresponding according to this resource type, generates prefix value corresponding to this resource type, comprising:
Mark seed corresponding this resource type is offset to predeterminated position left, obtains prefix value corresponding to this resource type.
Alternatively, according to the scene type of this business scenario, generate suffix value corresponding to this scene type, comprising:
According to the scene type of this business scenario, from the corresponding relation between the scene type of having stored and suffix value, obtain corresponding suffix value;
Increase the suffix value of obtaining;
Suffix value after increasing is defined as to suffix value corresponding to this scene type.
Alternatively, after increasing the suffix value of obtaining, also comprise:
By in the corresponding relation between this scene type and suffix value, suffix value corresponding to this scene type replaces with the suffix value after increase.
Alternatively, according to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generating identification, comprising:
Prefix value corresponding this resource type and suffix value corresponding to this scene type are added, are identified.
Alternatively, according to the scene type of this business scenario, after generating suffix value corresponding to this scene type, also comprise:
Suffix value corresponding this scene type and the first predetermined threshold value are compared;
If suffix value corresponding to this scene type is more than or equal to the first predetermined threshold value, again sends this mark to server and generate request, to obtain new logo seed corresponding to this resource type from server;
In the time that suffix value corresponding to this scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to this resource type, upgrades prefix value corresponding to this resource type, and the second predetermined threshold value is greater than the first predetermined threshold value;
By in the corresponding relation between this scene type and suffix value, suffix value corresponding to this scene type is set to default initial value.
Above-mentioned all optional technical schemes, can form optional embodiment of the present invention according to any combination, and this is no longer going to repeat them.
Fig. 3 is the method flow diagram of a kind of generating identification of providing of the embodiment of the present invention.Referring to Fig. 3, the method comprises:
Step 301: in the time that business process starts, terminal to server sends mark and generates request, and this mark generates the resource type of carrying this business process in request.
Wherein, in the time that business process starts, terminal is according to the resource type of this business process, and generating identification generates request, and this mark is generated and asks to send to server.
Wherein, can classify to business process in advance, and distribute respectively a resource type for each class business process.Such as, third party's browser of the browser that terminal can be carried and installation etc. is divided into a class, and is that resource type of this class browser assignment is browser.
It should be added that, when this business process operates in terminal, in step 301, be that terminal to server sends mark generation request, when this business process operates in other servers, in step 301, be that other servers send mark generation request to this server, the embodiment of the present invention is not specifically limited the main body of business process operation.
Step 302: in the time that server receives this mark generation request, this server, according to this resource type, generates and the unique corresponding mark seed of this resource type.
Particularly, in the time that server receives this mark generation request, server, according to this resource type, obtains corresponding mark seed from the resource type of having stored with the corresponding relation identifying between seed.Increase the mark seed obtaining, and the mark seed after increasing is defined as and the unique corresponding mark seed of this resource type.
Wherein, mark seed is a numerical value that starts to increase progressively from default initial value, and the corresponding mark seed of each resource type.This default initial value can be 0,1,2 etc.
The concrete operations of the mark seed that wherein, increase is obtained can be: the mark seed obtaining is increased to 1.
Because the current mark seed obtaining is by the corresponding relation between resource type and mark seed, mark seed increase corresponding to this resource type obtains, so, after the mark seed that increase is obtained, can also be by the corresponding relation between resource type and mark seed, mark seed corresponding to this resource type replaces with the mark seed after increase.
For example, this resource type is browser, and server, according to this resource type browser, is 8 from resource type as shown in table 1 below with obtaining corresponding mark seed the corresponding relation identifying between seed.The mark seed 8 obtaining is increased to 1, obtain identifying seed 9, mark seed 9 is defined as to mark seed corresponding to this resource type.
Table 1
Resource type Mark seed
Browser 8
Game 5
Immediate communication tool 12
Further, the mark seed 8 obtaining is increased to 1, after obtaining identifying seed 9, the mark seed 8 in table 1 can also be replaced with to mark seed 9, obtain the corresponding relation between resource type as shown in table 2 below and mark seed.
Table 2
Resource type Mark seed
Browser 9
Game 5
Immediate communication tool 12
Step 303: mark seed corresponding this resource type is sent to this terminal by this server.
When above-mentioned steps 301-303 is business process startup, terminal is obtained the process of mark seed corresponding to this resource type from server.After terminal is obtained mark seed corresponding to this resource type, this terminal can be based on this mark seed, for this business process generating identification, specific as follows.
Step 304: in the time that this terminal receives mark seed corresponding to this resource type, the mark seed that this terminal is corresponding according to this resource type, obtains prefix value corresponding to this resource type.
Particularly, in the time that this terminal receives mark seed corresponding to this resource type, mark seed corresponding this resource type is offset predeterminated position left by this terminal, obtains prefix value corresponding to this resource type.
Wherein, the concrete operations that mark seed corresponding this resource type are offset to predeterminated position left can be: corresponding this resource type mark seed and 2n are multiplied each other, and wherein, n is predeterminated position.
Wherein, predeterminated position can be the fixed numbers arranging in advance, such as, it is fixed numbers 10 that this predeterminated position can be set.Predeterminated position can also be the numerical value calculating according to default algorithm.This default algorithm can be: the figure place of the mark generating, divided by 2, is obtained to predeterminated position.Such as, when generate be designated 32 time, it is 16 that predeterminated position can be set; When generate be designated 64 time, it is 32 that predeterminated position can be set.
For example, predeterminated position is 10, and this terminal can multiply each other mark seed corresponding this resource type 9 and 210, and obtaining prefix value corresponding to this resource type is 9216.
Wherein, in the time that business process starts, can carry out alternately, obtaining the mark seed that this business process is corresponding according to the method for above-mentioned steps 301-304 and server, and according to this mark seed, obtain prefix value corresponding to this resource type.When follow-up generating identification, can directly use this prefix value, and while not needing each generating identification, all carry out alternately with server, obtain new mark seed, and then obtain prefix value, reduce the interaction times between terminal and server, even if there is network problem, impact on generating identification is less, has reduced the probability of generating identification.
Step 305: when generate in the current place of this business process business scenario arbitrary mark time, according to the scene type of this business scenario, generate suffix value corresponding to this scene type.
Particularly, when generate in the current place of this business process business scenario arbitrary mark time, according to the scene type of this business scenario, from the corresponding relation between the scene type of having stored and suffix value, obtain corresponding suffix value; Increase the suffix value of obtaining; Suffix value after increasing is defined as to suffix value corresponding to this scene type.
Wherein, a business process may comprise multiple business scenarios, can distribute a scene type to each business scenario in advance.This scene type can be the title of this scene.Such as, in the time that this scene is shopping, corresponding scene type can be shopping; When this scene is when supplementing with money, corresponding scene type can be for supplementing with money.
Wherein, suffix value is also a numerical value that starts to increase progressively from default initial value, and the corresponding suffix value of each scene type.This default initial value can be also 0,1,2 etc.
The concrete operations of the suffix value that wherein, increase is obtained can be: the suffix value of obtaining is increased to 1.
Because the current suffix value of obtaining is by the corresponding relation between scene type and suffix value, suffix value increase corresponding to this scene type obtains, so, after the suffix value that increase is obtained, can also be by the corresponding relation between scene type and suffix value, suffix value corresponding to this scene type replaces with the suffix value after increase.
For example, this scene type is shopping, and terminal is according to the shopping of this scene type, and from the corresponding relation between scene type as shown in table 3 below and suffix value, obtaining corresponding suffix value is 10.The suffix value of obtaining 10 is increased to 1, obtain suffix value 11, suffix value 11 is defined as to suffix value corresponding to this scene type.
Table 3
Scene type Suffix value
Shopping 10
Browsing page 20
Supplement with money 15
Further, the suffix value of obtaining 10 is increased to 1, after obtaining suffix value 11, the suffix value 10 in table 3 can also be replaced with to suffix value 11, obtain the corresponding relation between scene type as shown in table 4 below and suffix value.
Table 4
Scene type Suffix value
Shopping 11
Browsing page 20
Supplement with money 15
According to said method, while obtaining suffix value corresponding to this scene type, without carrying out alternately, having greatly reduced the dependence to server with server, and then improve the availability of the method that the embodiment of the present invention provides.
Preferably, in order to reduce the complexity of generating identification, can be according to the scene type of this business scenario, after generating suffix value corresponding to this scene type, suffix value corresponding this scene type and the first predetermined threshold value are compared; If suffix value corresponding to this scene type is more than or equal to the first predetermined threshold value, again sends this mark to server and generate request, to obtain new logo seed corresponding to this resource type from server; In the time that suffix value corresponding to this scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to this resource type, upgrades prefix value corresponding to this resource type, and the second predetermined threshold value is greater than the first predetermined threshold value; By in the corresponding relation between scene type and suffix value, suffix value corresponding to this scene type is set to default initial value.
Wherein, the mark herein again sending to server generates request can be identical with the mark generation request in step 301.In the time that server receives this mark generation request, can obtain new logo seed corresponding to this resource type according to the method for step 302 and 303, in this not go into detail.
Wherein, the new logo seed corresponding according to this resource type, the concrete operations of upgrading prefix value corresponding to this resource type can be: new logo seed corresponding this resource type is offset to predeterminated position left, obtain new prefix value corresponding to this resource type, prefix value corresponding to this resource type of obtaining in step 304 replaced with to this new prefix value.
It should be added that, when the new logo seed corresponding according to this resource type, upgrade prefix value corresponding to this resource type, and by the corresponding relation between scene type and suffix value, after suffix value corresponding to this scene type is set to default initial value, if subsequent regeneration becomes when mark, prefix value that can be based on after upgrading and the suffix value resetting, generate unique mark.
Step 306: according to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generate this mark.
Particularly, prefix value corresponding this resource type and suffix value corresponding to this scene type are added, obtain this mark.
Wherein, this prefix value is that this resource type is corresponding, scene type in this business process of suffix value is corresponding, that is to say, this prefix value is unique in this resource type, and suffix value is unique in business scenario corresponding to this scene type, so, final generate be identified in this business scenario that this business process comprises to be unique, to have ensured the reliability of generating identification.
In fact, due to the introducing of scene type, in the multiple business scenarios that comprise at this business process, mark can be repetition, but in same business scenario, mark is unique, make the control granularity of generating identification thinner, and then improved the utilance of mark.In addition, along with the development of business, in the time developing new business scene, be only required to be this business scenario and distribute a scene type, and in the corresponding relation between scene type and suffix value, record corresponding to this new business scene is set, improve the extensibility of the embodiment of the present invention.
In embodiments of the present invention, in the time that business process starts, from server, obtain mark seed corresponding to this resource type, and the mark seed corresponding according to this resource type, prefix value corresponding to this resource type obtained.In the time of arbitrary mark in the business scenario of the current place of this business process of follow-up generation, from terminal this locality, obtain the suffix value corresponding to scene type of this business scenario.According to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generate this mark.That is to say, a prefix value that resource type is corresponding, and the respectively corresponding suffix value of the scene type of the each business scenario comprising in this business process, when multiple terminals are during simultaneously to server request generating identification, the plurality of mark generates request can not produce conflict, can obtain its corresponding prefix value and suffix value simultaneously, improve the efficiency of generating identification.In addition, the method that the embodiment of the present invention provides is just in the time that business process starts, terminal and server carry out alternately, to obtain mark seed corresponding to this resource type, reduce the interaction times between terminal and server, and then reduced the probability of connection failure between terminal and server, thereby reduce the probability of failure of generating identification.
Fig. 4 is the apparatus structure schematic diagram of a kind of generating identification of providing of the embodiment of the present invention.Referring to Fig. 4, this device comprises:
Sending module 401, for in the time that business process starts, send mark to server and generate request, this mark generates the resource type of carrying this business process in request, make server according to this resource type, generate and the unique corresponding mark seed of this resource type;
Receiver module 402, mark seed corresponding to this resource type sending for reception server;
The first generation module 403, for the mark seed corresponding according to this resource type, generates prefix value corresponding to this resource type;
The second generation module 404, for when generate in the current place of this business process business scenario arbitrary mark time, according to the scene type of this business scenario, generate suffix value corresponding to this scene type;
The 3rd generation module 405, for according to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generates this mark.
Alternatively, the first generation module 403 comprises:
Offset units, for mark seed corresponding this resource type is offset to predeterminated position left, obtains prefix value corresponding to this resource type.
Alternatively, the second generation module 404 comprises:
Acquiring unit for according to the scene type of this business scenario, obtains corresponding suffix value from the corresponding relation between the scene type of having stored and suffix value;
Increase unit, for increasing the suffix value of obtaining;
Determining unit, for being defined as suffix value corresponding to this scene type by the suffix value after increasing.
Alternatively, the second generation module 404 also comprises:
Replacement unit, for by the corresponding relation between this scene type and suffix value, suffix value corresponding to this scene type replaces with the suffix value after increase.
Alternatively, the 3rd generation module 405 comprises:
Addition unit, for prefix value corresponding this resource type and suffix value corresponding to this scene type are added, obtains this mark.
Alternatively, this device also comprises:
Comparison module, for comparing suffix value corresponding this scene type and the first predetermined threshold value;
The second sending module, if be more than or equal to the first predetermined threshold value for suffix value corresponding to this scene type, again send this mark to server and generates request, to obtain new logo seed corresponding to this resource type from server;
Update module, in the time that suffix value corresponding to this scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to this resource type, upgrades prefix value corresponding to this resource type, and the second predetermined threshold value is greater than the first predetermined threshold value;
Module is set, and for by the corresponding relation between this scene type and suffix value, suffix value corresponding to this scene type is set to default initial value.
In embodiments of the present invention, in the time that business process starts, from server, obtain mark seed corresponding to this resource type, and the mark seed corresponding according to this resource type, prefix value corresponding to this resource type obtained.In the time of arbitrary mark in the business scenario of the current place of this business process of follow-up generation, from terminal this locality, obtain the suffix value corresponding to scene type of this business scenario.According to prefix value corresponding to this resource type and suffix value corresponding to this scene type, generate this mark.That is to say, a prefix value that resource type is corresponding, and the respectively corresponding suffix value of the scene type of the each business scenario comprising in this business process, when multiple terminals are during simultaneously to server request generating identification, the plurality of mark generates request can not produce conflict, can obtain its corresponding prefix value and suffix value simultaneously, improve the efficiency of generating identification.In addition, the method that the embodiment of the present invention provides is just in the time that business process starts, terminal and server carry out alternately, to obtain mark seed corresponding to this resource type, reduce the interaction times between terminal and server, and then reduced the probability of connection failure between terminal and server, thereby reduce the probability of failure of generating identification.
It should be noted that: the device of the generating identification that above-described embodiment provides is in the time of generating identification, only be illustrated with the division of above-mentioned each functional module, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, be divided into different functional modules by the internal structure of device, to complete all or part of function described above.In addition, the device of the generating identification that above-described embodiment provides and the embodiment of the method for generating identification belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (12)

1. a method for generating identification, is characterized in that, described method comprises:
In the time that business process starts, send mark to server and generate request, described mark generates the resource type of carrying described business process in request, makes described server according to described resource type, generates and the unique corresponding mark seed of described resource type;
Receive mark seed corresponding to described resource type that described server sends;
The mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type;
When generate in the current place of described business process business scenario arbitrary mark time, according to the scene type of described business scenario, generate suffix value corresponding to described scene type;
According to prefix value corresponding to described resource type and suffix value corresponding to described scene type, generate described mark.
2. the method for claim 1, is characterized in that, the described mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type, comprising:
Mark seed corresponding described resource type is offset to predeterminated position left, obtains prefix value corresponding to described resource type.
3. the method for claim 1, is characterized in that, described according to the scene type of described business scenario, generates suffix value corresponding to described scene type, comprising:
According to the scene type of described business scenario, from the corresponding relation between the scene type of having stored and suffix value, obtain corresponding suffix value;
Increase the suffix value of obtaining;
Suffix value after increasing is defined as to suffix value corresponding to described scene type.
4. method as claimed in claim 3, is characterized in that, after the suffix value that described increase is obtained, also comprises:
By in the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type replaces with the suffix value after increase.
5. the method for claim 1, is characterized in that, describedly generates described mark according to prefix value corresponding to described resource type and suffix value corresponding to described scene type, comprising:
Prefix value corresponding described resource type and suffix value corresponding to described scene type are added, obtain described mark.
6. the method as described in claim as arbitrary in claim 1-5, is characterized in that, described according to the scene type of described business scenario, after generating suffix value corresponding to described scene type, also comprises:
Suffix value corresponding described scene type and the first predetermined threshold value are compared;
If suffix value corresponding to described scene type is more than or equal to described the first predetermined threshold value, again sends described mark to described server and generate request, to obtain new logo seed corresponding to described resource type from described server;
In the time that suffix value corresponding to described scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to described resource type, upgrades prefix value corresponding to described resource type, and described the second predetermined threshold value is greater than described the first predetermined threshold value;
By in the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type is set to default initial value.
7. a device for generating identification, is characterized in that, described device comprises:
Sending module, for in the time that business process starts, send mark to server and generate request, described mark generates the resource type of carrying described business process in request, make described server according to described resource type, generate and the unique corresponding mark seed of described resource type;
Receiver module, mark seed corresponding to described resource type sending for receiving described server;
The first generation module, for the mark seed corresponding according to described resource type, generates prefix value corresponding to described resource type;
The second generation module, for when generate in the current place of described business process business scenario arbitrary mark time, according to the scene type of described business scenario, generate suffix value corresponding to described scene type;
The 3rd generation module, for according to prefix value corresponding to described resource type and suffix value corresponding to described scene type, generates described mark.
8. device as claimed in claim 7, is characterized in that, described the first generation module comprises:
Offset units, for mark seed corresponding described resource type is offset to predeterminated position left, obtains prefix value corresponding to described resource type.
9. device as claimed in claim 7, is characterized in that, described the second generation module comprises:
Acquiring unit for according to the scene type of described business scenario, obtains corresponding suffix value from the corresponding relation between the scene type of having stored and suffix value;
Increase unit, for increasing the suffix value of obtaining;
Determining unit, for being defined as suffix value corresponding to described scene type by the suffix value after increasing.
10. device as claimed in claim 9, is characterized in that, described the second generation module also comprises:
Replacement unit, for by the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type replaces with the suffix value after increase.
11. devices as claimed in claim 7, is characterized in that, described the 3rd generation module comprises:
Addition unit, for prefix value corresponding described resource type and suffix value corresponding to described scene type are added, obtains described mark.
Device as described in 12. claims as arbitrary in claim 7-11, is characterized in that, described device also comprises:
Comparison module, for comparing suffix value corresponding described scene type and the first predetermined threshold value;
The second sending module, if be more than or equal to described the first predetermined threshold value for suffix value corresponding to described scene type, again send described mark to described server and generate request, to obtain new logo seed corresponding to described resource type from described server;
Update module, for in the time that suffix value corresponding to described scene type is more than or equal to the second predetermined threshold value, the new logo seed corresponding according to described resource type, upgrades prefix value corresponding to described resource type, and described the second predetermined threshold value is greater than described the first predetermined threshold value;
Module is set, and for by the corresponding relation between described scene type and suffix value, suffix value corresponding to described scene type is set to default initial value.
CN201410317647.7A 2014-07-04 2014-07-04 Generate the method and device of mark Active CN104113435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410317647.7A CN104113435B (en) 2014-07-04 2014-07-04 Generate the method and device of mark

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410317647.7A CN104113435B (en) 2014-07-04 2014-07-04 Generate the method and device of mark

Publications (2)

Publication Number Publication Date
CN104113435A true CN104113435A (en) 2014-10-22
CN104113435B CN104113435B (en) 2017-11-07

Family

ID=51710071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410317647.7A Active CN104113435B (en) 2014-07-04 2014-07-04 Generate the method and device of mark

Country Status (1)

Country Link
CN (1) CN104113435B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570097A (en) * 2016-10-31 2017-04-19 华为技术有限公司 Sequence generating method and device
CN107229555A (en) * 2017-05-04 2017-10-03 北京小度信息科技有限公司 Mark generating method and device
CN108804908A (en) * 2017-05-04 2018-11-13 腾讯科技(深圳)有限公司 A kind of device-fingerprint generation method, device and computing device
CN109783126A (en) * 2019-01-10 2019-05-21 珠海金山网络游戏科技有限公司 A kind of distribution Global ID's generation method and its device
CN110245017A (en) * 2019-05-29 2019-09-17 华为技术有限公司 The distribution method and equipment of resource identification
WO2019237538A1 (en) * 2018-06-11 2019-12-19 平安科技(深圳)有限公司 Method for configuring monitoring instance, server, and computer-readable storage medium
CN110874308A (en) * 2018-08-31 2020-03-10 北京京东尚科信息技术有限公司 Method and device for generating unique value
CN112073554A (en) * 2020-09-08 2020-12-11 腾讯科技(深圳)有限公司 Global unique identifier generation method, device and computer readable storage medium
CN112860755A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service identifier generation method, device, computer equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097454A1 (en) * 2001-11-02 2003-05-22 Nec Corporation Switching method and switch device
CN1819645A (en) * 2006-03-20 2006-08-16 北京北大方正电子有限公司 Automatic distributing generating method of identifier of TV-set programm
CN101188810A (en) * 2007-12-12 2008-05-28 华为技术有限公司 Communication method and system, and mobile switching center
CN102769667A (en) * 2012-06-29 2012-11-07 北京奇虎科技有限公司 Method, equipment and system for generating ID
CN103139255A (en) * 2011-11-30 2013-06-05 腾讯科技(深圳)有限公司 Method for allocating resource identification and identification section

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097454A1 (en) * 2001-11-02 2003-05-22 Nec Corporation Switching method and switch device
CN1819645A (en) * 2006-03-20 2006-08-16 北京北大方正电子有限公司 Automatic distributing generating method of identifier of TV-set programm
CN101188810A (en) * 2007-12-12 2008-05-28 华为技术有限公司 Communication method and system, and mobile switching center
CN103139255A (en) * 2011-11-30 2013-06-05 腾讯科技(深圳)有限公司 Method for allocating resource identification and identification section
CN102769667A (en) * 2012-06-29 2012-11-07 北京奇虎科技有限公司 Method, equipment and system for generating ID

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570097B (en) * 2016-10-31 2020-09-08 华为技术有限公司 Sequence generation method and device
CN106570097A (en) * 2016-10-31 2017-04-19 华为技术有限公司 Sequence generating method and device
CN107229555A (en) * 2017-05-04 2017-10-03 北京小度信息科技有限公司 Mark generating method and device
CN108804908A (en) * 2017-05-04 2018-11-13 腾讯科技(深圳)有限公司 A kind of device-fingerprint generation method, device and computing device
WO2019237538A1 (en) * 2018-06-11 2019-12-19 平安科技(深圳)有限公司 Method for configuring monitoring instance, server, and computer-readable storage medium
CN110874308B (en) * 2018-08-31 2024-02-06 北京京东尚科信息技术有限公司 Method and device for generating unique value
CN110874308A (en) * 2018-08-31 2020-03-10 北京京东尚科信息技术有限公司 Method and device for generating unique value
CN109783126A (en) * 2019-01-10 2019-05-21 珠海金山网络游戏科技有限公司 A kind of distribution Global ID's generation method and its device
CN110245017A (en) * 2019-05-29 2019-09-17 华为技术有限公司 The distribution method and equipment of resource identification
CN110245017B (en) * 2019-05-29 2024-03-26 华为技术有限公司 Resource identifier allocation method and equipment
CN112073554A (en) * 2020-09-08 2020-12-11 腾讯科技(深圳)有限公司 Global unique identifier generation method, device and computer readable storage medium
CN112073554B (en) * 2020-09-08 2023-04-18 腾讯科技(深圳)有限公司 Global unique identifier generation method, device and computer readable storage medium
CN112860755A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service identifier generation method, device, computer equipment and medium
CN112860755B (en) * 2021-03-22 2024-04-05 平安商业保理有限公司 Service identifier generation method, device, computer equipment and medium

Also Published As

Publication number Publication date
CN104113435B (en) 2017-11-07

Similar Documents

Publication Publication Date Title
CN104113435A (en) Method and device for generating identifier
US11258667B2 (en) Network management method and related device
CN107257392B (en) Method and device for setting equipment serial number and computer readable storage medium
CN102694861B (en) A kind of terminal application software sorting technique, Apparatus and system based on cloud
CN110995513B (en) Data sending and receiving method in Internet of things system, internet of things equipment and platform
US8903972B2 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN104468174A (en) Method and device for cluster servers to execute task
CN113778463B (en) Business service deployment method and device
CN104468368A (en) Method and device for allocating BGP neighbors
CN106873970B (en) Installation method and device of operating system
CN109819023B (en) Distributed transaction processing method and related product
CN114025021A (en) Communication method, system, medium and electronic device across Kubernetes cluster
CN104767756A (en) Equipment information processing method, client side device and server side device
CN102831000B (en) The method and system of system upgrade
CN104918112A (en) Camera resource application method and device
CN104683968A (en) Machine type communication application resource management method, node and system
CN110933192A (en) Local area network IP address allocation method, device, system and computer equipment
CN103581273A (en) Service executing method, device and system for distributed system
CN105335313A (en) Basic data transmission method and apparatus
WO2014075259A1 (en) Processing method and network device for international mobile equipment identity (imei) information
CN105072212A (en) Code checking method and code checking system
CN107534678B (en) Method, device and system for establishing connection between VNFM and VIM
CN103532852A (en) Routing scheduling method, routing scheduling device and network equipment
US20150109945A1 (en) On-demand transmission path providing system and method
CN105306614A (en) Address management method, address management system, address manager and local address management device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 511446 Guangzhou City, Guangdong Province, Panyu District, South Village, Huambo Business District Wanda Plaza, block B1, floor 28

Applicant after: Guangzhou Huaduo Network Technology Co., Ltd.

Address before: 510655, Guangzhou, Whampoa Avenue, No. 2, creative industrial park, building 3-08,

Applicant before: Guangzhou Huaduo Network Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant