CN104113435B - Generate the method and device of mark - Google Patents

Generate the method and device of mark Download PDF

Info

Publication number
CN104113435B
CN104113435B CN201410317647.7A CN201410317647A CN104113435B CN 104113435 B CN104113435 B CN 104113435B CN 201410317647 A CN201410317647 A CN 201410317647A CN 104113435 B CN104113435 B CN 104113435B
Authority
CN
China
Prior art keywords
value
mark
type
resource type
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.)
Active
Application number
CN201410317647.7A
Other languages
Chinese (zh)
Other versions
CN104113435A (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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of method and device for generating mark, belong to network technique field.Methods described includes:When business process starts, mark generation request is sent to server, the resource type of the business process is carried in the mark generation request, make server according to the resource type, generation and the unique corresponding mark seed of the resource type;Receive the corresponding mark seed of the resource type that the server is sent;According to the corresponding mark seed of the resource type, the corresponding prefix value of the resource type is generated;When the generation business process is currently located any mark in business scenario, according to the scene type of the business scenario, the corresponding suffix value of the scene type is generated;According to the corresponding prefix value of the resource type and the corresponding suffix value of the scene type, the mark is generated.The present invention improves the efficiency of generation mark, and reduces the probability of failure of generation mark.

Description

Generate the method and device of mark
Technical field
The present invention relates to network technique field, more particularly to a kind of method and device for generating mark.
Background technology
In many computer rooms, many machines, the distributed system of multi-process deployment, the corresponding business of multiple business may be run Process, each business can include multiple business scenarios.Produced to record when the business process is run in each business scenario A data or an operation, it is necessary to for the business scenario, be a data or an operation generation one only One mark.
At present, the process of generation mark is specifically as follows:Terminal sends mark generation request to third party device, when the 3rd When method, apparatus receives mark generation request, third party device obtains the mark of storage, increases the mark obtained, and will increase Mark afterwards is sent to the terminal.Wherein, the equipment that third party device identifies for generation, and third party device is not the distribution Equipment in system.
Because the above method is to identify the mark being currently generated by increasing upper one, so, when multiple terminals are same When to third party device request generation mark, it is the plurality of mark generation request can produce conflict, third party device can only have been handled Another mark generation request is reprocessed in one mark generation after asking, cause the less efficient of generation mark.In addition, dividing Easily there is network problem in cloth system, cause terminal and third party device connection failure, so, increased according to the above method The probability of failure of generation mark.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of method and device for generating mark.Institute State technical scheme as follows:
On the one hand there is provided a kind of method for generating mark, methods described includes:
When business process starts, mark generation request is sent to server, carries described in the mark generation request The resource type of business process, makes the server according to the resource type, generates uniquely corresponding with the resource type Identify seed;
Receive the corresponding mark seed of the resource type that the server is sent;
According to the corresponding mark seed of the resource type, the corresponding prefix value of the resource type is generated;
When the generation business process is currently located any mark in business scenario, according to the field of the business scenario Scape type, generates the corresponding suffix value of the scene type;
According to the corresponding prefix value of the resource type and the corresponding suffix value of the scene type, the mark is generated.
Alternatively, it is described according to the corresponding mark seed of the resource type, before the generation resource type is corresponding Sew value, including:
The corresponding mark seed of the resource type is offset into predeterminated position to the left, the resource type is obtained corresponding Prefix value.
Alternatively, the scene type according to the business scenario, generates the corresponding suffix value of the scene type, bag Include:
According to the scene type of the business scenario, in the corresponding relation between the scene type and suffix value stored Obtain corresponding suffix value;
Increase the suffix value obtained;
Suffix value after increase is defined as the corresponding suffix value of the scene type.
Alternatively, after the suffix value that the increase is obtained, in addition to:
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type is replaced with Suffix value after increase.
Alternatively, it is described according to the corresponding prefix value of the resource type and the corresponding suffix value of the scene type, it is raw Into the mark, including:
The corresponding prefix value of resource type suffix value corresponding with the scene type is added, obtains described Mark.
Alternatively, the scene type according to the business scenario, generate the corresponding suffix value of the scene type it Afterwards, in addition to:
The corresponding suffix value of the scene type and the first predetermined threshold value are compared;
If the corresponding suffix value of the scene type is more than or equal to first predetermined threshold value, to the server The mark generation request is sent again, to obtain the corresponding new logo seed of the resource type from the server;
When the corresponding suffix value of the scene type is more than or equal to the second predetermined threshold value, according to the resource type pair The new logo seed answered, updates the corresponding prefix value of the resource type, it is pre- that second predetermined threshold value is more than described first If threshold value;
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type is set to Default initial value.
On the other hand there is provided a kind of device for generating mark, described device includes:
Sending module, for when business process starts, sending mark generation request to server, the mark generation please Seek the middle resource type for carrying the business process, make the server according to the resource type, generation with it is described resources-type The unique corresponding mark seed of type;
Receiving module, for receiving the corresponding mark seed of the resource type that the server is sent;
First generation module, for according to the corresponding mark seed of the resource type, generating the resource type pair The prefix value answered;
Second generation module, for when generating the business process and being currently located any mark in business scenario, root According to the scene type of the business scenario, the corresponding suffix value of the scene type is generated;
3rd generation module, for according to the corresponding prefix value of the resource type and the corresponding suffix of the scene type Value, generates the mark.
Alternatively, first generation module includes:
Offset units, for the corresponding mark seed of the resource type to be offset into predeterminated position to the left, obtain described The corresponding prefix value of resource type.
Alternatively, second generation module includes:
Acquiring unit, for the scene type according to the business scenario, from the scene type stored and suffix value it Between corresponding relation in obtain corresponding suffix value;
Adding unit, for increasing the suffix value obtained;
Determining unit, for the suffix value after increase to be defined as into the corresponding suffix value of the scene type.
Alternatively, second generation module also includes:
Replacement unit, for by the corresponding relation between the scene type and suffix value, the scene type to be corresponding Suffix value replace with increase after suffix value.
Alternatively, the 3rd generation module includes:
Addition unit, for the corresponding prefix value of the resource type and the corresponding suffix value of the scene type to be carried out It is added, obtains the mark.
Alternatively, described device also includes:
Comparison module, for the corresponding suffix value of the scene type and the first predetermined threshold value to be compared;
Second sending module, if being more than or equal to the described first default threshold for the corresponding suffix value of the scene type Value, then send the mark generation request again to the server, to obtain the resource type correspondence from the server New logo seed;
Update module, for when the corresponding suffix value of the scene type be more than or equal to the second predetermined threshold value when, according to The corresponding new logo seed of the resource type, updates the corresponding prefix value of the resource type, second predetermined threshold value More than first predetermined threshold value;
Setup module, for by the corresponding relation between the scene type and suffix value, the scene type to be corresponding Suffix value be set to default initial value.
In embodiments of the present invention, when business process starts, the resource type is obtained from server uniquely corresponding Seed is identified, and according to the corresponding mark seed of the resource type, obtains the corresponding prefix value of the resource type.When follow-up When generating any mark that the business process is currently located in business scenario, from the scene type pair for locally obtaining the business scenario The suffix value answered.According to the corresponding prefix value of resource type suffix value corresponding with the scene type, the mark is generated.Namely It is, the corresponding prefix value of a resource type, and the scene type point of each business scenario included in the business process Not Dui Ying a suffix value, when server receives multiple mark generation requests, the generation request of the plurality of mark will not be produced Conflict, its corresponding prefix value and suffix value can be obtained simultaneously, improve the efficiency of generation mark.In addition, the present invention is implemented The method that example is provided is simply when business process starts, and terminal is interacted with server, corresponding to obtain the resource type Seed is identified, the interaction times between terminal and server is reduced, and then reduces connection between terminal and server and lose The probability lost, so as to reduce the probability of failure of generation mark.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1-1 is a kind of system architecture diagram for generating mark provided in an embodiment of the present invention;
Fig. 1-2 is a kind of timing diagram for generating mark provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram for generating mark provided in an embodiment of the present invention;
Fig. 3 is the method flow diagram of another generation mark provided in an embodiment of the present invention;
Fig. 4 is a kind of apparatus structure schematic diagram for generating mark provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1-1 is a kind of system architecture diagram for generating mark provided in an embodiment of the present invention.Can in the system architecture diagram Can include that in server A and server B, computer room 2 server C kimonos can be included including computer room 1 and computer room 2, in computer room 1 Be engaged in device D, and a server can be specified as resource management center in server A, server B, server C and server D.Should Also include terminal in system architecture diagram.Wherein, server A is connected with server B, server C and server D connections, and service Device B is connected with server C.In addition, server A, server B, server C and server D pass through network connection with terminal respectively. Multiple business process can be run on server A, server B, server C and server D, and can also be run in terminal many Individual business process, and terminal can also carry out data interaction respectively with each server.Each server can be the terminal Data needed for business process are provided.
Fig. 1-2 is a kind of timing diagram for generating mark provided in an embodiment of the present invention.Include business mould in the timing diagram Block, identifier generation module and resource management center.Wherein, business module is used to run business process, and for obtaining mark, And business module can be located in terminal, may be located in server.Identifier generation module is used for when business process starts, The corresponding mark seed of resource type is obtained from resource management center, according to the mark seed of acquisition, the resource is generated The corresponding prefix value of type, and obtain the corresponding suffix value of scene type from local.And after the scene type is corresponding When sewing value more than or equal to the second predetermined threshold value, the corresponding new logo seed of the resource type is obtained from resource management center Value.Identifier generation module not may be positioned only in terminal, may be located in server.Resource management center can be Fig. 1-1 In each server in a given server, for generating the corresponding mark seed of resource type, and by generation Mark seed is sent to identifier generation module.
Fig. 2 is a kind of method flow diagram for generating mark provided in an embodiment of the present invention.Referring to Fig. 2, this method includes:
Step 201:When business process starts, mark generation request is sent to server, is taken in mark generation request Resource type with the business process, makes server according to the resource type, generation and the unique corresponding mark of the resource type Seed.
Step 202:The corresponding mark seed of the resource type that the reception server is sent.
Step 203:According to the corresponding mark seed of the resource type, the corresponding prefix value of the resource type is generated.
Step 204:When generate the business process be currently located any mark in business scenario when, according to the business scenario Scene type, generate the corresponding suffix value of the scene type.
Step 205:According to the corresponding prefix value of resource type suffix value corresponding with the scene type, generation mark.
In embodiments of the present invention, when business process starts, obtain uniquely corresponding with the resource type from server Mark seed, and according to the corresponding mark seed of the resource type, obtain the corresponding prefix value of the resource type.When after When continuous generation business process is currently located any mark in business scenario, from the scene type for locally obtaining the business scenario Corresponding suffix value.According to the corresponding prefix value of resource type suffix value corresponding with the scene type, the mark is generated. It is, the corresponding prefix value of a resource type, and the scene type of each business scenario included in the business process A suffix value is corresponded to respectively, and when multiple terminals are identified to server request generation simultaneously, the plurality of mark generation request is not Conflict can be produced, its corresponding prefix value and suffix value can be obtained simultaneously, the efficiency of generation mark is improved.In addition, this hair The method that bright embodiment is provided is simply when business process starts, and terminal is interacted with server, to obtain the business process Corresponding mark seed, reduces the interaction times between terminal and server, and then reduce between terminal and server The probability of connection failure, so as to reduce the probability of failure of generation mark.
Alternatively, according to the corresponding mark seed of the resource type, the corresponding prefix value of the resource type is generated, is wrapped Include:
The corresponding mark seed of the resource type is offset into predeterminated position to the left, the corresponding prefix of the resource type is obtained Value.
Alternatively, according to the scene type of the business scenario, the corresponding suffix value of the scene type is generated, including:
According to the scene type of the business scenario, obtained in the corresponding relation between the scene type and suffix value stored Take corresponding suffix value;
Increase the suffix value obtained;
Suffix value after increase is defined as the corresponding suffix value of the scene type.
Alternatively, after the suffix value that increase is obtained, in addition to:
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type replaces with increase Suffix value afterwards.
Alternatively, according to the corresponding prefix value of resource type suffix value corresponding with the scene type, generation mark, bag Include:
The corresponding prefix value of resource type suffix value corresponding with the scene type is added, identified.
Alternatively, according to the scene type of the business scenario, generate after the corresponding suffix value of the scene type, also wrap Include:
The corresponding suffix value of the scene type and the first predetermined threshold value are compared;
If the corresponding suffix value of the scene type is more than or equal to the first predetermined threshold value, this is sent again to server Mark generation request, to obtain the corresponding new logo seed of the resource type from server;
It is corresponding according to the resource type when the corresponding suffix value of the scene type is more than or equal to the second predetermined threshold value New logo seed, updates the corresponding prefix value of the resource type, and the second predetermined threshold value is more than the first predetermined threshold value;
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type is set to preset Initial value.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the present invention according to any combination, not another herein One repeats.
Fig. 3 is a kind of method flow diagram for generating mark provided in an embodiment of the present invention.Referring to Fig. 3, this method includes:
Step 301:When business process starts, terminal to server sends mark generation request, mark generation request The middle resource type for carrying the business process.
Wherein, when business process starts, terminal is according to the resource type of the business process, and generation mark, which is generated, asks, And mark generation request is sent to server.
Wherein it is possible to classify in advance to business process, and for each class business process distribute respectively one it is resources-type Type.Such as, the browser and third party's browser of installation that can carry terminal etc. are divided into a class, and are browsed for a class It is browser that device, which distributes a resource type,.
It should be added that, when business process operation is that terminal to server is sent in the terminal, in step 301 Mark generation request, is that other servers are sent out to the server in step 301 when the business process is operated in other servers Mark generation request is sent, the main body that the embodiment of the present invention is run to business process is not specifically limited.
Step 302:When server receives mark generation request, the server according to the resource type, generation with The unique corresponding mark seed of the resource type.
Specifically, when server receives mark generation request, server is according to the resource type, from what is stored Corresponding mark seed is obtained in corresponding relation between resource type and mark seed.Increase the mark seed obtained Value, and the mark seed after increase is defined as and the unique corresponding mark seed of the resource type.
Wherein, mark seed is an incremental numerical value since default initial value, and each resource type corresponding one Individual mark seed.The default initial value can be 0,1,2 etc..
Wherein, increasing the concrete operations of the mark seed obtained can be:The mark seed of acquisition is increased by 1.
Due to the mark seed currently obtained be by resource type and mark seed between corresponding relation in, the money The corresponding mark seed increase of Source Type is obtained, so, can also be by resource after the mark seed that increase is obtained In corresponding relation between type and mark seed, the corresponding mark seed of the resource type replaces with the mark after increase Seed.
For example, the resource type is browser, server is according to the resource type browser, from money as shown in table 1 below It is 8 that corresponding mark seed is obtained in corresponding relation between Source Type and mark seed.By the mark seed 8 of acquisition Increase by 1, is obtained identifying seed 9, and mark seed 9 is defined as into the corresponding mark seed of the resource type.
Table 1
Resource type Identify seed
Browser 8
Game 5
Immediate communication tool 12
Further, the mark seed 8 of acquisition is increased by 1, obtain mark seed 9 after, can also be by table 1 Mark seed 8 replaces with mark seed 9, obtains corresponding between resource type as shown in table 2 below and mark seed Relation.
Table 2
Resource type Identify seed
Browser 9
Game 5
Immediate communication tool 12
Step 303:The corresponding mark seed of the resource type is sent to the terminal by the server.
When above-mentioned steps 301-303 is that business process starts, terminal obtains the corresponding mark of the resource type from server Know the process of seed.When terminal obtain the resource type it is corresponding mark seed after, the terminal can be based on the mark Seed, generates for the business process and identifies, specific as follows.
Step 304:When the terminal receive the resource type it is corresponding mark seed when, the terminal is resources-type according to this The corresponding mark seed of type, obtains the corresponding prefix value of the resource type.
Specifically, when the terminal receives the corresponding mark seed of the resource type, the terminal is by the resource type Corresponding mark seed offsets predeterminated position to the left, obtains the corresponding prefix value of the resource type.
Wherein, the corresponding mark seed of the resource type being offset into the concrete operations of predeterminated position to the left can be:Will The corresponding mark seed of the resource type is multiplied with 2n, wherein, n is predeterminated position.
Wherein, predeterminated position can be the fixed numbers set in advance, such as, it is solid that can set the predeterminated position Fixed number value 10.Predeterminated position can also be the numerical value calculated according to default algorithm.The default algorithm can be:Will be raw Into mark digit divided by 2, obtain predeterminated position.Such as, when generation is when being designated 32, the predeterminated position can be set to be 16;When generation is when being designated 64, it is 32 that can set predeterminated position.
For example, predeterminated position is 10, the terminal can be by the corresponding mark seed 9 of the resource type and 210 progress phases Multiply, it is 9216 to obtain the corresponding prefix value of the resource type.
Wherein, when business process starts, it can be interacted according to above-mentioned steps 301-304 method with server, The corresponding mark seed of the business process is obtained, and according to the mark seed, obtains the corresponding prefix value of the resource type. The prefix value can be directly used when being subsequently generated mark, during without generation mark every time, is all interacted with server, New mark seed is obtained, and then obtains prefix value, the interaction times between terminal and server are reduced, even if going out existing network Network problem, the influence to generation mark is smaller, reduces the probability of generation mark.
Step 305:When generate the business process be currently located any mark in business scenario when, according to the business scenario Scene type, generate the corresponding suffix value of the scene type.
Specifically, when generate the business process be currently located any mark in business scenario when, according to the business scenario Scene type, from the scene type stored suffix value corresponding with being obtained in the corresponding relation between suffix value;Increase is obtained The suffix value taken;Suffix value after increase is defined as the corresponding suffix value of the scene type.
Wherein, a business process potentially includes multiple business scenarios, can distribute one to each business scenario in advance Scene type.The scene type can be the title of the scene.Such as, when the scene is shopping, corresponding scene type can Think shopping;When the scene for when supplementing with money, corresponding scene type can be to supplement with money.
Wherein, suffix value is also an incremental numerical value since default initial value, and each scene type is corresponding one Suffix value.The default initial value can also be 0,1,2 etc..
Wherein, increasing the concrete operations of the suffix value obtained can be:The suffix value of acquisition is increased by 1.
Because the suffix value currently obtained is the scene type pair by the corresponding relation between scene type and suffix value What the suffix value increase answered was obtained, so, can also be by between scene type and suffix value after the suffix value that increase is obtained Corresponding relation in, the corresponding suffix value of the scene type replace with increase after suffix value.
For example, the scene type is shopping, terminal is done shopping according to the scene type, from scene type as shown in table 3 below It is 10 that corresponding suffix value is obtained in corresponding relation between suffix value.The suffix value 10 of acquisition is increased by 1, suffix value is obtained 11, suffix value 11 is defined as the corresponding suffix value of the scene type.
Table 3
Scene type Suffix value
Shopping 10
Browse webpage 20
Supplement with money 15
Further, the suffix value 10 of acquisition is increased by 1, can also be by the suffix value in table 3 after obtaining suffix value 11 10 replace with 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
Browse webpage 20
Supplement with money 15
According to the above method, when obtaining the corresponding suffix value of the scene type, without being interacted with server, subtract significantly Lack the dependence to server, and then improve the availability of method provided in an embodiment of the present invention.
Preferably, in order to reduce the complexity of generation mark, this can be generated according to the scene type of the business scenario After the corresponding suffix value of scape type, the corresponding suffix value of the scene type and the first predetermined threshold value are compared;If should The corresponding suffix value of scene type is more than or equal to the first predetermined threshold value, then sends mark generation request again to server, To obtain the corresponding new logo seed of the resource type from server;When the corresponding suffix value of the scene type is more than or equal to During the second predetermined threshold value, according to the corresponding new logo seed of the resource type, the corresponding prefix value of the resource type is updated, the Two predetermined threshold values are more than the first predetermined threshold value;By in the corresponding relation between scene type and suffix value, the scene type is corresponding Suffix value be set to default initial value.
Wherein, the mark generation request sent again to server herein can be generated with the mark in step 301 asks It is identical.When server receives mark generation request, the resource type can be obtained according to step 302 and 303 method Corresponding new logo seed, in this not go into detail.
Wherein, according to the corresponding new logo seed of the resource type, the tool of the corresponding prefix value of the resource type is updated Gymnastics is made:The corresponding new logo seed of the resource type is offset into predeterminated position to the left, the resource type pair is obtained The new prefix value answered, the new prefix value is replaced with by the corresponding prefix value of the resource type obtained in step 304.
It should be added that, when according to the corresponding new logo seed of the resource type, update the resource type pair The prefix value answered, and by the corresponding relation between scene type and suffix value, the corresponding suffix value of the scene type is set to , can be raw based on the prefix value after renewal and the suffix value reset if subsequent regeneration is into mark after default initial value Into unique mark.
Step 306:According to the corresponding prefix value of resource type suffix value corresponding with the scene type, the mark is generated Know.
Specifically, the corresponding prefix value of resource type suffix value corresponding with the scene type is added, obtained The mark.
Wherein, the prefix value is that the resource type is corresponding, and the scene type in the suffix value business process is corresponding, It is that the prefix value is unique in the resource type, and suffix value is unique in the corresponding business scenario of the scene type , so, the mark ultimately generated is unique in the business scenario that the business process includes, it is ensured that generation mark Reliability.
In fact, due to the introducing of scene type, in multiple business scenarios that the business process includes, mark can be Repeat, but in same business scenario, mark is unique, the Control granularity for identifying generation is thinner, and then improves The utilization rate of mark.In addition, with the development of business, only need to be business scenario distribution when developing new business scene The corresponding record of the new business scene is set in one scene type, and corresponding relation between scene type and suffix value, Improve the scalability of the embodiment of the present invention.
In embodiments of the present invention, when business process starts, the corresponding mark of the resource type is obtained from server Seed, and according to the corresponding mark seed of the resource type, obtain the corresponding prefix value of the resource type.When being subsequently generated When the business process is currently located any mark in business scenario, the scene type of the business scenario is obtained from terminal local Corresponding suffix value.According to the corresponding prefix value of resource type suffix value corresponding with the scene type, the mark is generated. It is, the corresponding prefix value of a resource type, and the scene type of each business scenario included in the business process A suffix value is corresponded to respectively, and when multiple terminals are identified to server request generation simultaneously, the plurality of mark generation request is not Conflict can be produced, its corresponding prefix value and suffix value can be obtained simultaneously, the efficiency of generation mark is improved.In addition, this hair The method that bright embodiment is provided is simply when business process starts, and terminal is interacted with server, to obtain the resource type Corresponding mark seed, reduces the interaction times between terminal and server, and then reduce between terminal and server The probability of connection failure, so as to reduce the probability of failure of generation mark.
Fig. 4 is a kind of apparatus structure schematic diagram for generating mark provided in an embodiment of the present invention.Referring to Fig. 4, the device bag Include:
Sending module 401, for when business process starts, mark generation request, mark generation to be sent to server The resource type of the business process is carried in request, makes server according to the resource type, it is uniquely right with the resource type to generate The mark seed answered;
Receiving module 402, the corresponding mark seed of the resource type sent for the reception server;
First generation module 403, for according to the corresponding mark seed of the resource type, generating resource type correspondence Prefix value;
Second generation module 404, for when generate the business process be currently located any mark in business scenario when, root According to the scene type of the business scenario, the corresponding suffix value of the scene type is generated;
3rd generation module 405, for according to the corresponding prefix value of resource type suffix corresponding with the scene type Value, generates the mark.
Alternatively, the first generation module 403 includes:
Offset units, for the corresponding mark seed of the resource type to be offset into predeterminated position to the left, obtain the resource The corresponding prefix value of type.
Alternatively, the second generation module 404 includes:
Acquiring unit, for the scene type according to the business scenario, between the scene type and suffix value stored Corresponding relation in obtain corresponding suffix value;
Adding unit, for increasing the suffix value obtained;
Determining unit, for the suffix value after increase to be defined as into the corresponding suffix value of the scene type.
Alternatively, the second generation module 404 also includes:
Replacement unit, for by the corresponding relation between the scene type and suffix value, after the scene type is corresponding Sew value and replace with the suffix value after increase.
Alternatively, the 3rd generation module 405 includes:
Addition unit, for the corresponding prefix value of resource type suffix value corresponding with the scene type to be carried out into phase Plus, obtain the mark.
Alternatively, the device also includes:
Comparison module, for the corresponding suffix value of the scene type and the first predetermined threshold value to be compared;
Second sending module, if being more than or equal to the first predetermined threshold value for the corresponding suffix value of the scene type, Mark generation request is sent again to server, to obtain the corresponding new logo seed of the resource type from server;
Update module, for when the corresponding suffix value of the scene type is more than or equal to the second predetermined threshold value, according to this The corresponding new logo seed of resource type, updates the corresponding prefix value of the resource type, it is pre- that the second predetermined threshold value is more than first If threshold value;
Setup module, for by the corresponding relation between the scene type and suffix value, after the scene type is corresponding Sew value and be set to default initial value.
In embodiments of the present invention, when business process starts, the corresponding mark of the resource type is obtained from server Seed, and according to the corresponding mark seed of the resource type, obtain the corresponding prefix value of the resource type.When being subsequently generated When the business process is currently located any mark in business scenario, the scene type of the business scenario is obtained from terminal local Corresponding suffix value.According to the corresponding prefix value of resource type suffix value corresponding with the scene type, the mark is generated. It is, the corresponding prefix value of a resource type, and the scene type of each business scenario included in the business process A suffix value is corresponded to respectively, and when multiple terminals are identified to server request generation simultaneously, the plurality of mark generation request is not Conflict can be produced, its corresponding prefix value and suffix value can be obtained simultaneously, the efficiency of generation mark is improved.In addition, this hair The method that bright embodiment is provided is simply when business process starts, and terminal is interacted with server, to obtain the resource type Corresponding mark seed, reduces the interaction times between terminal and server, and then reduce between terminal and server The probability of connection failure, so as to reduce the probability of failure of generation mark.
It should be noted that:The device for the generation mark that above-described embodiment is provided is when generating mark, only with above-mentioned each work( The division progress of energy module is for example, in practical application, as needed can distribute above-mentioned functions by different functions Module is completed, i.e., the internal structure of device is divided into different functional modules, described above all or part of to complete Function.In addition, the device and the embodiment of the method for generation mark of the generation mark that above-described embodiment is provided belong to same design, its The process of implementing refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.

Claims (12)

1. a kind of method for generating mark, it is characterised in that methods described includes:
When business process starts, mark generation request is sent to server, the business is carried in the mark generation request The resource type of process, makes the server according to the resource type, generation and the unique corresponding mark of the resource type Seed;
Receive the corresponding mark seed of the resource type that the server is sent;
According to the corresponding mark seed of the resource type, the corresponding prefix value of the resource type is generated;
When the generation business process is currently located any mark in business scenario, according to the scene class of the business scenario Type, generates the corresponding suffix value of the scene type;
According to the corresponding prefix value of the resource type and the corresponding suffix value of the scene type, the mark is generated.
2. the method as described in claim 1, it is characterised in that described according to the corresponding mark seed of the resource type, The corresponding prefix value of the resource type is generated, including:
The corresponding mark seed of the resource type is offset into predeterminated position to the left, the corresponding prefix of the resource type is obtained Value.
3. the method as described in claim 1, it is characterised in that the scene type according to the business scenario, generates institute The corresponding suffix value of scene type is stated, including:
According to the scene type of the business scenario, obtained in the corresponding relation between the scene type and suffix value stored Corresponding suffix value;
Increase the suffix value obtained;
Suffix value after increase is defined as the corresponding suffix value of the scene type.
4. method as claimed in claim 3, it is characterised in that after the suffix value that the increase is obtained, in addition to:
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type replaces with increase Suffix value afterwards.
5. the method as described in claim 1, it is characterised in that described according to the corresponding prefix value of the resource type and described The corresponding suffix value of scene type, generates the mark, including:
The corresponding prefix value of resource type suffix value corresponding with the scene type is added, the mark is obtained Know.
6. the method as described in claim 1-5 any claims, it is characterised in that the field according to the business scenario After scape type, the corresponding suffix value of the generation scene type, in addition to:
The corresponding suffix value of the scene type and the first predetermined threshold value are compared;
If the corresponding suffix value of the scene type is more than or equal to first predetermined threshold value, to the server again The mark generation request is sent, to obtain the corresponding new logo seed of the resource type from the server;
It is corresponding according to the resource type when the corresponding suffix value of the scene type is more than or equal to the second predetermined threshold value New logo seed, updates the corresponding prefix value of the resource type, and second predetermined threshold value is more than the described first default threshold Value;
By in the corresponding relation between the scene type and suffix value, the corresponding suffix value of the scene type is set to preset Initial value.
7. a kind of device for generating mark, it is characterised in that described device includes:
Sending module, for when business process starts, mark generation request being sent to server, in the mark generation request The resource type of the business process is carried, makes the server according to the resource type, generation and the resource type are only One corresponding mark seed;
Receiving module, for receiving the corresponding mark seed of the resource type that the server is sent;
First generation module, for according to the corresponding mark seed of the resource type, generating the resource type corresponding Prefix value;
Second generation module, for when the generation business process is currently located any mark in business scenario, according to institute The scene type of business scenario is stated, the corresponding suffix value of the scene type is generated;
3rd generation module, for according to the corresponding prefix value of the resource type and the corresponding suffix value of the scene type, The generation mark.
8. device as claimed in claim 7, it is characterised in that first generation module includes:
Offset units, for the corresponding mark seed of the resource type to be offset into predeterminated position to the left, obtain the resource The corresponding prefix value of type.
9. device as claimed in claim 7, it is characterised in that second generation module includes:
Acquiring unit, for the scene type according to the business scenario, between the scene type and suffix value stored Corresponding suffix value is obtained in corresponding relation;
Adding unit, for increasing the suffix value obtained;
Determining unit, for the suffix value after increase to be defined as into the corresponding suffix value of the scene type.
10. device as claimed in claim 9, it is characterised in that second generation module also includes:
Replacement unit, for by the corresponding relation between the scene type and suffix value, after the scene type is corresponding Sew value and replace with the suffix value after increase.
11. device as claimed in claim 7, it is characterised in that the 3rd generation module includes:
Addition unit, for the corresponding prefix value of the resource type and the corresponding suffix value of the scene type to be carried out into phase Plus, obtain the mark.
12. the device as described in claim 7-11 any claims, it is characterised in that described device also includes:
Comparison module, for the corresponding suffix value of the scene type and the first predetermined threshold value to be compared;
Second sending module, if being more than or equal to first predetermined threshold value for the corresponding suffix value of the scene type, Then the mark generation request is sent again to the server, it is corresponding new to obtain the resource type from the server Identify seed;
Update module, for when the corresponding suffix value of the scene type is more than or equal to the second predetermined threshold value, according to described The corresponding new logo seed of resource type, updates the corresponding prefix value of the resource type, and second predetermined threshold value is more than First predetermined threshold value;
Setup module, for by the corresponding relation between the scene type and suffix value, after the scene type is corresponding Sew value and be 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 CN104113435A (en) 2014-10-22
CN104113435B true 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)

Families Citing this family (9)

* 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
CN107229555B (en) * 2017-05-04 2021-07-20 北京星选科技有限公司 Identification generation method and device
CN108804908B (en) * 2017-05-04 2023-05-09 腾讯科技(深圳)有限公司 Equipment fingerprint generation method and device and computing equipment
CN109032655B (en) * 2018-06-11 2021-10-29 平安科技(深圳)有限公司 Configuration method of monitoring instance, server and computer readable storage medium
CN110874308B (en) * 2018-08-31 2024-02-06 北京京东尚科信息技术有限公司 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
CN110245017B (en) * 2019-05-29 2024-03-26 华为技术有限公司 Resource identifier allocation method and equipment
CN112073554B (en) * 2020-09-08 2023-04-18 腾讯科技(深圳)有限公司 Global unique identifier generation method, device and computer readable storage medium
CN112860755B (en) * 2021-03-22 2024-04-05 平安商业保理有限公司 Service identifier generation method, device, computer equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3879594B2 (en) * 2001-11-02 2007-02-14 日本電気株式会社 Switch method, apparatus and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN104113435A (en) 2014-10-22

Similar Documents

Publication Publication Date Title
CN104113435B (en) Generate the method and device of mark
CN109949111B (en) Electronic bill identification distribution method, electronic bill generation method, device and system
US11146502B2 (en) Method and apparatus for allocating resource
CN104539743B (en) A kind of cloud computing system and its control method
CN110995513B (en) Data sending and receiving method in Internet of things system, internet of things equipment and platform
CN102137007B (en) Method and system for generating network topology as well as coordinator
CN107087033A (en) Information push method, device, storage medium and computer equipment
CN104243301A (en) Method, device and system for generating service path
CN105429811B (en) network management system and method
CN109981279B (en) Block chain system, communication method, device, equipment and medium
CN104917721A (en) Authorization method, apparatus and system based on oAuth protocol
US20120096136A1 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN108833610B (en) Information updating method, device and system
CN111163130A (en) Network service system and data transmission method thereof
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN109587997A (en) Method, electronic equipment and the computer readable storage medium of distribution server position
CN103391249A (en) Neighborship establishing method and device in IS-IS (intermediate system to intermediate system) network
WO2016198004A1 (en) Network gambit configuration method and apparatus under virtualization technology
CN111654559B (en) Container data transmission method and device
CN106210159A (en) A kind of domain name analytic method and equipment
JP2015517140A (en) Method and apparatus for forming software fault containment units (SFCCUs) in a distributed real-time system
CN108228310B (en) Balanced deployment method and device of virtual network function
CN103259639B (en) A kind of clock synchronizing method of stack equipment and equipment
CN105117401A (en) Method, device and system for parallel transmission of pictures
US20230198648A1 (en) Time synchronization method, device and apparatus, and storage medium

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