Summary of the invention
The technical problem to be solved in the embodiments of the present application is that providing a kind of list identifier generation method and a kind of list
Shunt method can be convenient for the list triage operator of applied business layer.
Correspondingly, the embodiment of the present application also provides a kind of list identifier generating means and a kind of list part flow arrangement,
To guarantee the implementation and application of the above method.
To solve the above-mentioned problems, this application discloses a kind of list identifier generation methods, comprising:
Unique mark part and routing mark part are generated, including: it is raw that routing rule is shunted according to preset list
Part is indicated at the routing;
The identifier of the list is generated according to unique mark part and the routing marking part subassembly.
It is further, described that routing rule generation routing mark part is shunted according to preset list, comprising:
Library is divided to indicate position according to the generation of preset list point library routing rule.
It is further, described that routing rule generation routing mark part is shunted according to preset list, further includes:
Divide table routing rule raw component list mark position according to preset list.
Further, described point of library mark position and described table mark position is divided to include at least 2 characters.
It is further, described that routing rule generation routing mark part is shunted according to preset list, comprising:
Selected characteristic position indicates part as the routing in user's identifier.
Further, the unique mark part of the generation, comprising:
The first mark part, and the life according to the list are generated according to the relevant parameter of application corresponding to the list
The sequence number of the list is generated at sequence.
Further, the relevant parameter of the application according to corresponding to list generates first mark part, comprising:
Position is indicated according to the date of formation on date of the application service;
Versions of data position, system version position, system mark position and business mark are generated according to the start-up parameter of the application
Position.
The embodiment of the present application also discloses a kind of list shunt method, comprising:
Receive the list that gateway shunts, wherein the identifier of the list is generated according to preceding method;
Obtain the identifier of the list;
Read the routing mark part in the list identifier;
The list is shunted according to the routing of list mark part.
It is further, described that the list is shunted according to the routing of list mark part, comprising:
Point library mark position contained according to the routing marking part subpackage, the list is diverted to and indicates position with described point of library
In corresponding database;
Divide table to indicate position according to what the routing marking part subpackage contained, the list is diverted in the database and institute
It states in point corresponding table set in table mark position.
The embodiment of the present application also discloses a kind of list identifier generating means, comprising:
First mark generation unit is configurable to generate unique mark part;
Second mark generation unit is configured as shunting the routing rule generation routing marking part according to preset list
Point;
Combination producing unit is configured as generating institute according to unique mark part and the routing marking part subassembly
State the identifier of list.
Further, the second mark generation unit is configured as being generated according to preset list point library routing rule and divide
Library indicates position.
Further, the second mark generation unit, is additionally configured to that table routing rule is divided to generate according to preset list
Table is divided to indicate position.
The embodiment of the present application also discloses a kind of list part flow arrangement, comprising:
Receiving unit is configured as receiving the list that gateway shunts, wherein the identifier of the list is according to preceding method
It generates;
Acquiring unit is configured as obtaining the identifier of the list;
Reading unit is configured as reading the routing mark part in the list identifier;
Dividing cell is configured as shunting the list according to the routing of list mark part.
Further, dividing cell includes:
Divide library subelement, point library mark position contained according to the routing marking part subpackage is configured as, by the list point
It flows in database corresponding with described point of library mark position;
Divide table subelement, is configured as dividing table to indicate position according to what the routing marking part subpackage contained, by the list point
It flows in the database and divides in the corresponding table set in table mark position with described.
Compared with prior art, the embodiment of the present application includes the following advantages:
The embodiment of the present application generates unique mark of list by shunting routing rule using unique mark part and list
Show symbol, applied business layer is perceived and carries out list shunting using these information, it is particularly possible to using in identifier
To shunt routing rule progress list shunting according to scheduled list in routing mark part.The side of the generation list unique identifier
Method is also convenient for utilization of the applied business layer in the case where table environment is divided in point library other than the Global ID's uniqueness that can satisfy technological layer
The routing iinformation for including in list identifier carries out list triage operator, is point of large-scale mass data under distributed environment
Library divides the fractionation of table to provide good scalability and routing rule.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real
Applying mode, the present application will be further described in detail.
Referring to Fig.1, a kind of step flow chart of list identifier generation method embodiment of the application is shown, specifically may be used
To include the following steps:
Step 101, unique mark part and routing mark part are generated.
In the present embodiment, the device (the hereinafter referred to as device) of the generation list unique identifier, which firstly generates, forms the mark
Show each section of symbol, including generate unique mark part and routing mark part, wherein unique mark part may include first
Mark part and sequence number.It specifically may is that the relevant parameter of the application according to corresponding to list generates the first mark part;Root
Routing rule, which is shunted, according to preset list generates routing mark part;The sequence number of list is obtained according to the formation sequence of list.
The generation of each section can be carried out sequentially or simultaneously, and order is without limitation.
Wherein, the first mark part can be generated according to start-up parameter of application etc., can specifically include date information, version
This information, business information etc..
Routing indicates routing rule when part is shunted according to preset list to generate, such as list shunts routing
Rule then needs in the routing mark part of the generation comprising user to shunt the list of same user in same database
Identification information.In subsequent progress list shunting, carrying out shunting according to routing mark part can be realized scheduled routing rule
Then.
If the shunting of list only carries out a point library, routing mark part can be only comprising dividing library to indicate position, if table
Single shunting is to carry out a point library to divide table, then routing mark part may include point library mark position and table is divided to indicate position.
The serial number that the sequence number of list namely the list generate.In order to support enough data volumes, which can be set
It is set to 8.
Step 102, the identifier of list is generated according to unique mark part and routing marking part subassembly.
After obtaining above-mentioned first mark part, routing mark part and sequence number, this step can be according to certain
Sequence or rule be combined generate list unique identifier, such as successively by first mark part, routing mark part and
Sequence number, which is stitched together, produces the unique identifier of the list.
The embodiment of the present application passes through the relevant parameter using application, list shunts the sequence number next life of routing rule and list
At the unique identifier of list, applied business layer is perceived and carries out list shunting using these information, it is particularly possible to
List shunting is carried out using the routing mark part in identifier to shunt routing rule according to scheduled list.The generation list
The method of unique identifier is also convenient for applied business layer in point library point other than the Global ID's uniqueness that can satisfy technological layer
List triage operator is carried out using the routing iinformation for including in list identifier under table environment, is extensive under distributed environment
Point library of mass data divide the fractionation of table to provide good scalability and routing rule.
In another embodiment of the application, the relevant parameter of device application according to corresponding to list generates the first mark
Show the process of part, as shown in Fig. 2, may include:
Step 201, position is indicated according to the date of formation on date of application service.
The date of the available current application service of the device, and intercept 8 date character strings as the date and indicate position.
Step 202, versions of data position, system version position, system mark position and business are generated according to the start-up parameter of application
Indicate position.
The device can configure setting versions of data position and system version position according to the start-up parameter of application, wherein data
Version position and system version position may each be 1.
The system that the device can be arranged 3 according to application start-up parameter indicates position, for indicating list unique identifier
It is to be generated by the application of which of cluster;
The device is arranged 3 business according to application start-up parameter and indicates position, for indicating this associated pen of list identifier
Data are any business.
Above-mentioned steps can according to need adjustment sequence, herein without limitation.
In another embodiment of the application, which shunts routing rule according to preset list and generates routing marking part
The process divided, as shown in figure 3, may include:
Step 301, library is divided to indicate position according to the generation of preset list point library routing rule.
The device can indicate position according to needing the routing rule followed to generate point library in the list identifier when point library.
For example, the list that the routing rule that need to be followed when point library is same subscriber is diverted in same database, then it can be from user's
In identification information, such as Q-character therein is extracted in uid (userId), it is such as 1st, 2 reciprocal, as in list identifier
Library is divided to indicate position.This is divided to library mark position that can have two, to support the extension of 100 physical libraries.
Divide in the scene of table if the present embodiment is applied to a point library, and table is divided to be also required to follow a certain routing rule, then also
Step 302 can be executed.
Step 302, divide table routing rule raw component list mark position according to preset list.
The device can divide table to indicate position according to dividing the routing rule that needs follow when table to generate in the list identifier.
For example, the list that the routing rule that need to be followed when dividing table is same subscriber is diverted in the same table set of same database, then
Other Q-characters therein can be extracted from the identification information of user, such as in uid (userId), it is such as 3rd, 4 reciprocal,
Table is divided to indicate position as in list identifier.This is divided to table mark position that can also have two, to support the extension of 100 points of tables.
Point library mark position and divide the digit of table mark position that can be determined according to required physical library and table collective number.
According to the method for above-described embodiment, in a specific example, it is assumed that the date generated according to the date of application service
Indicating position is 20141212;Versions of data position, system version position, system mark position and the industry generated according to the start-up parameter of application
Business mark position is followed successively by 0,1,001,001;In on-line transaction payment system, because being to log in done business behaviour based on user
Make, thus the device can be chosen according to uid (userId) appoint which as this Fen Ku, divide table indicate position, such as
The uid=20188199965812 of user, agreement, which is chosen low level 1st, 2 reciprocal and is used as, divides library to indicate position, low level inverse the 3rd, 4
Position, which is used as, divides table to indicate position;NextValue is obtained as the sequence number in list identifier from class sequence, sets sequence number
It is 8,0 polishing is filled in digit not enough front, it is assumed that the Serial No. 28945699 of acquisition.
After obtaining above- mentioned information, being stitched together, it is as shown in Figure 4 by 8 (date)+1 (data versions to generate
Originally)+1 (system version position)+3 (system mark position)+3 (business mark position)+2 (table is divided to indicate position)+2 (point libraries
Indicate position)+8 (sequence number), the unique identifier of the list of 28 characters composition in total
2014121201001001581228945699。
Wherein, list identifier can be according to preceding 8 date+serial numbers according to time sequence;Single table can support enough data
Amount, rear 8 serial numbers one day can most 100,000,000 data records;Point library mark position can support the extension of 100 physical libraries;Point
Table mark position can support the extension of 100 points of tables.
The list identifier generated according to the method described above, the corresponding list of every business datum all can explicitly have user
Uid information, therefore the list of the same user can all divide in table falling on same point of library, conducive to the aggregation of data.Pass through
The globally unique identifier of the business of the specification, service application layer can be easy to list point library and divide table and moving costs
It is small, very good basis is brought for the data framework layer of entire business, the landing of business datum has and can also have very well
Scalability.
Referring to Fig. 5, a kind of step flow chart of list shunt method embodiment of the application is shown, can specifically include
Following steps:
Step 501, the list that gateway shunts is received.
In the present embodiment, which specifically can be application server etc..Wherein, the identifier of the list can
To be generated according to the method for previous embodiment.It include the relevant parameter of the application according to corresponding to list in the list identifier
The the first mark part generated;The routing that routing rule generates, which is shunted, according to preset list indicates part;According to the life of list
At the sequence number for the list that sequence obtains.
Step 502, the identifier of list is obtained.
Step 503, the routing read in list identifier indicates part.
It include the shunting routing rule of list in routing mark part in the list identifier.
Step 504, list is shunted according to the routing of list mark part.
The information that the list part flow arrangement can contain according to routing marking part subpackage carries out list shunting, point obtained accordingly
Stream result can embody scheduled shunting routing rule.
The embodiment of the present application is in the environment of table is divided in a point library, by can be with using the routing iinformation for including in list identifier
Table is divided and moving costs is small in point library for easily carrying out list, for entire business data framework layer bring it is very good
Basis, the landing of business datum have and can also have good scalability.
In another embodiment, the mistake which shunts list according to the routing mark part of list
Journey, as shown in fig. 6, may include:
Step 601, position is indicated according to point library that routing marking part subpackage contains, list is diverted to corresponding with point library mark position
Database in.
Marking part subpackage is routed in list identifier in the present embodiment containing point library mark position and table is divided to indicate position, for example,
List identifier is 2014121201001001581228945699, and dividing library mark position is 12, and dividing table mark position is 58, this step
The list is diverted in database 12.
Step 602, divide table to indicate position according to what routing marking part subpackage contained, list is diverted in database and divides table mark
Show in the corresponding table set in position.
This step continues for above-mentioned list to be diverted in database 12 in table set corresponding with table mark position 58 is divided.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method
It closes, but those skilled in the art should understand that, the embodiment of the present application is not limited by the described action sequence, because according to
According to the embodiment of the present application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should
Know, the embodiments described in the specification are all preferred embodiments, and related movement not necessarily the application is implemented
Necessary to example.
Referring to Fig. 7, show a kind of structural block diagram of list identifier Installation practice of the application, can specifically include as
Lower unit:
First mark generation unit 701 is configurable to generate unique mark part.
Second mark generation unit 702 is configured as shunting the routing rule generation routing mark according to preset list
Show part.
Combination producing unit 703 is configured as according to unique mark part and routing marking part grouping symphysis
At the identifier of the list.
The device shunts the sequence number of routing rule and list by relevant parameter, the list using application to generate list
Unique identifier, allow applied business layer perceive and utilize these information carry out list shunting, it is particularly possible to using mark
Show that the routing mark part in symbol to shunt routing rule progress list shunting according to scheduled list.The generation list is uniquely marked
Show that the device of symbol other than the Global ID's uniqueness that can satisfy technological layer, is also convenient for applied business layer in a point library and divides table environment
Under using include in list identifier routing iinformation carry out list triage operator, be distributed environment under large-scale magnanimity
Point library of data divides the fractionation of table to provide good scalability and routing rule.
In another embodiment, the second mark generation unit 702, can be configured as and routed according to preset list point library
Rule, which generates, divides library to indicate position;It can be additionally configured to divide table routing rule raw component list mark position according to preset list.
Second mark generation unit 702 specifically can be configured as in user's identifier described in the conduct of selected characteristic position
Routing mark part.
Wherein, point library mark position and it is described divide table mark position to include at least 2 characters, the sequence number includes at least 8
Position character.
In another embodiment, the first mark generation unit 701 can be configured as the application according to corresponding to the list
Relevant parameter generate the first mark part, and generate according to the formation sequence of the list sequence number of the list.It can be with
Further comprise:
First generates subelement, is configured as indicating position according to the date of formation on date of the application service.
Second generates subelement, is configured as generating versions of data position, system version according to the start-up parameter of the application
Position, system mark position and business indicate position.
Third generates subelement, is configured as generating the sequence number of the list according to the formation sequence of the list.
Wherein, the first date for generating that subelement and the second generation subelement generate indicated position, versions of data position, system version
One's own department or unit, system mark position and business mark position are as aforementioned first mark part.Third generates the sequence that subelement generates list
Number.
Referring to Fig. 8, a kind of structural block diagram of list part flow arrangement embodiment of the application is shown, can specifically include as follows
Unit:
Receiving unit 801 is configured as receiving the list that gateway shunts.
Acquiring unit 802 is configured as obtaining the identifier of the list.
Reading unit 803 is configured as reading the routing mark part in the list identifier.
Dividing cell 804 is configured as shunting the list according to the routing of list mark part.
The device is in the environment of table is divided in a point library, by that can be easy to using the routing iinformation for including in list identifier
Table is divided in point library that ground carries out list and moving costs is small, brings very good basis for the data framework layer of entire business,
The landing of business datum has and can also have good scalability.
In another embodiment, as shown in figure 9, dividing cell 804 may further include:
Divide library subelement 901, point library mark position contained according to the routing marking part subpackage is configured as, by the list
It is diverted in database corresponding with described point of library mark position.
Divide table subelement 902, is configured as dividing table to indicate position according to what the routing marking part subpackage contained, by the list
It is diverted in the database and divides in the corresponding table set in table mark position with described.
The embodiment of the present application also provides a kind of servers, including memory and processor.
Processor and memory are connected with each other by bus;Bus can be isa bus, pci bus or eisa bus etc..
The bus can be divided into address bus, data/address bus, control bus etc..
Wherein, memory is for storing a Duan Chengxu, and specifically, program may include program code, said program code
Including computer operation instruction.Memory may include high speed RAM memory, it is also possible to further include nonvolatile memory
(non-volatile memory), for example, at least a magnetic disk storage.
Processor is used to read the program code in memory, executes following steps:
Unique mark part and routing mark part are generated, including: it is raw that routing rule is shunted according to preset list
Part is indicated at the routing;
The identifier of the list is generated according to unique mark part and the routing marking part subassembly.
The embodiment of the present application also provides a kind of servers, including memory, transceiver and processor.
Processor and memory, transceiver are connected with each other by bus;Bus can be isa bus, pci bus or EISA
Bus etc..The bus can be divided into address bus, data/address bus, control bus etc..
Wherein, memory is for storing a Duan Chengxu, and specifically, program may include program code, said program code
Including computer operation instruction.Memory may include high speed RAM memory, it is also possible to further include nonvolatile memory
(non-volatile memory), for example, at least a magnetic disk storage.
Transceiver is used to receive the list of gateway shunting.
Processor is used to read the program code in memory, executes following steps:
Obtain the identifier of the list;
Read the routing mark part in the list identifier;
The list is shunted according to the routing of list mark part.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiments of the present application may be provided as method, apparatus or calculating
Machine program product.Therefore, the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present application can be used one or more wherein include computer can
With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
In a typical configuration, the computer equipment includes one or more processors (CPU), input/output
Interface, network interface and memory.Memory may include the non-volatile memory in computer-readable medium, random access memory
The forms such as device (RAM) and/or Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is to calculate
The example of machine readable medium.Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be with
Realize that information is stored by any method or technique.Information can be computer readable instructions, data structure, the module of program or
Other data.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory
(SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory
(ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only
Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or
Other magnetic storage devices or any other non-transmission medium, can be used for storage can be accessed by a computing device information.According to
Herein defines, and computer-readable medium does not include non-persistent computer readable media (transitory media), such as
The data-signal and carrier wave of modulation.
The embodiment of the present application is referring to according to the method for the embodiment of the present application, terminal device (system) and computer program
The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions
In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these
Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices
Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices
In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet
The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram
The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that
Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus
The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart
And/or in one or more blocks of the block diagram specify function the step of.
Although preferred embodiments of the embodiments of the present application have been described, once a person skilled in the art knows bases
This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as
Including preferred embodiment and all change and modification within the scope of the embodiments of the present application.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap
Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article
Or the element that terminal device is intrinsic.In the absence of more restrictions, limited by sentence " including one ... "
Element, it is not excluded that including identical being wanted in the process, method of the element, article or terminal device there is also other
Element.
Above to a kind of list identifier generation method provided herein, a kind of list shunt method, a kind of list
Identifier generating means and a kind of list part flow arrangement, are described in detail, and specific case used herein is to the application
Principle and embodiment be expounded, the present processes that the above embodiments are only used to help understand and its core
Thought is thought;At the same time, for those skilled in the art in specific embodiment and applies model according to the thought of the application
Place that there will be changes, in conclusion the contents of this specification should not be construed as limiting the present application.