WO2014101240A1 - Data storage method and apparatus, data operation method and system, and access server - Google Patents

Data storage method and apparatus, data operation method and system, and access server Download PDF

Info

Publication number
WO2014101240A1
WO2014101240A1 PCT/CN2012/088144 CN2012088144W WO2014101240A1 WO 2014101240 A1 WO2014101240 A1 WO 2014101240A1 CN 2012088144 W CN2012088144 W CN 2012088144W WO 2014101240 A1 WO2014101240 A1 WO 2014101240A1
Authority
WO
WIPO (PCT)
Prior art keywords
identifier
fragment
data
data source
user
Prior art date
Application number
PCT/CN2012/088144
Other languages
French (fr)
Chinese (zh)
Inventor
王世军
张建勋
黄堰姣
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201280002589.8A priority Critical patent/CN104040539B/en
Priority to PCT/CN2012/088144 priority patent/WO2014101240A1/en
Publication of WO2014101240A1 publication Critical patent/WO2014101240A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/256Integrating or interfacing systems involving database management systems in federated or virtual databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/186Processing of subscriber group data

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data storage method and apparatus, and a data operation method, system, and access server.
  • BACKGROUND At present, there may be multiple users of the same group customer or family customer, or the same individual customer may have multiple users, such as: broadband users, fixed-line users, and mobile phone users.
  • the user data When storing these user data, the user data may be stored in different data sources.
  • the service needs to access data of multiple users of the same group customer or home customer, it needs to access across data sources. And cross-data source access brings a lot of resource messages, and the efficiency of access is reduced. Summary of the invention
  • the embodiment of the present invention provides a data storage method and device, and a data operation method, a system, and an access server, so as to solve the problem that data of multiple users of the same client in the prior art is stored in different data sources, and when acquiring data, Issues that require access across data sources.
  • a data storage method when a customer subscribes to a service, when the client becomes a user of the service, the method includes: the data generating device determines that the client has opened an account, and obtains the first fragment identifier included in the customer identifier of the client
  • the first fragment is identified as the fragmentation identifier of the customer's customer fragment, and the customer identifier uniquely identifies the customer during the customer's life cycle, and the customer life cycle refers to the period from the time the customer opens the account to the time the customer cancels the account;
  • the generating device generates a user identifier including the first fragment identifier according to the first fragment identifier, where the user identifier uniquely identifies the user during the life cycle of the user, and the user life period refers to a period from after the user opens the account to before the user is turned off.
  • the data generating device obtains the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table according to the first fragment identifier; and stores the user data in the data source corresponding to the data source identifier, so that The first fragment identifier is identified by the access server according to the first fragment identifier included in the user identifier.
  • the corresponding data source obtains the user data, where the fragment data source correspondence table includes the correspondence between the fragment identifier of the client fragment and the data source identifier.
  • the method further includes: the data generating device is configured according to the user's resources The number, from the routing table of the number segment, the second fragment identifier corresponding to the range of the number range of the resource number, wherein the routing table includes the correspondence between the fragment identifier and the range of the number of the resource number; The second fragment identifier, or the found second fragment identifier is inconsistent with the first fragment identifier, the data generating device adds the correspondence between the resource number and the first fragment identifier to the hash table in the database,
  • the hash routing table includes a correspondence between the fragment identifier and a resource number that is not attributed to the routing table of the segment.
  • the method before the customer subscribes to the service, the method further includes: when the customer opens an account, obtaining the tenant of the customer
  • the data generating device obtains, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table, and uses the obtained fragment identifier as the first fragment identifier, where
  • the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier; the data generating device generates a client identifier including the first fragment identifier according to the first fragment identifier, and stores the client data in the first A slice identifies the corresponding data source, so that the access server obtains the data of the client from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the client identifier.
  • the method further includes: when the data generating apparatus determines that the customer does not open an account, searching for the resource number from the number segment routing table according to the resource number of the user a second fragment identifier corresponding to the range of the number segment, wherein the number segment routing table includes a correspondence between the fragment identifier and the range of the number range of the resource number; when the data generating device finds the second fragment identifier, according to the second Fragment identification, generating a customer identifier including a two-slice identifier for the client, and generating a user identifier including the second fragment identifier for the user according to the second fragment identifier, and storing the customer data and the user data in the second score
  • the data identifier corresponding to the slice identifier so that the access server obtains the data of the client and/or the user from the data source corresponding to the second fragment identifier according to the second fragment identifier included in the client identifie
  • the method further includes: obtaining, when the second fragment identifier is not found, the tenant identifier of the tenant to which the customer belongs;
  • the generating device obtains, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table, and uses the obtained fragment identifier as the first fragment identifier, where the fragment data
  • the source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier.
  • the data generating device generates a client identifier including the first fragment identifier according to the first fragment identifier, and generates a user identifier according to the first fragment identifier.
  • a user identifier including a first fragment identifier adding a correspondence between the resource number and the first fragment identifier to the hash routing table, where the hash routing table includes a fragment identifier and a resource not belonging to the segment routing table
  • the correspondence between the numbers and storing the data of the customer and the data of the user in the data source corresponding to the first fragment identifier, so as to facilitate access
  • customer service identifier and / or user identifier identifying a first slice included in the slice corresponding to the identifier from the first data source Get customer data and/or user data.
  • the method further includes: The data generating device obtains all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table according to the first data source identifier; and identifies all the fragments corresponding to the first data source according to the relocation request. Select one or more fragment identifiers that meet the relocation requirements, and set the status of one or more fragment identifiers in the fragment data source correspondence table to the relocation status, so as to prohibit the network elements except the data generation device.
  • Accessing data corresponding to one or more fragment identifiers the data generating device relocates data in the first data source corresponding to one or more fragment identifiers to the second data source; and the data generating device deletes the data in the fragment data source correspondence table Corresponding relationship between the first data source identifier and one or more fragment identifiers; the data generating device adds a number in the fragment data source correspondence table Source identification data with more than one sub-identifier corresponding relationship between the sheet, and more than one fragment identified by the non-removal state setting state, in order to allow access to more than one fragment corresponding to the identification data.
  • a second aspect a data operation method, comprising: an access server receives a data operation request sent by a data operation requesting device, where the data operation request includes an access number; and the access server obtains a customer corresponding to the access number according to the access number The fragmentation identifier of the slice; the access server obtains the data source identifier corresponding to the fragment identifier from the fragment data source correspondence table according to the fragment identifier corresponding to the access number, where the fragment data source correspondence table is saved The fragmentation identifier and the data source identifier; the access server sends the data operation request to the data source corresponding to the obtained data source identifier; and the access server receives the data operation response sent by the data source.
  • obtaining the fragment identifier corresponding to the access number according to the access number specifically: when the access number is a customer identifier or a user identifier, obtaining the client identifier or the user identifier If the access number is a resource number, the number of the fragment corresponding to the resource number is found in the hash routing table according to the resource number of the user, and when the fragment identifier corresponding to the resource number is found, If the fragment identifier of the resource number is not found, the fragment identifier corresponding to the number segment of the resource number is obtained in the routing table according to the resource number of the user, where the scatter number routing table includes The correspondence between the slice identifier and the resource number that is not attributed to the routing table of the number segment, and the routing table of the number segment includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
  • a data generating device includes: an obtaining module, a generating module, and a storage module, wherein the acquiring module is configured to: when the client subscribes to a service, when the client becomes a user of the service, determine that the client has opened an account and obtains The first fragment identifier included in the customer identifier of the customer, wherein the first fragment identifier is a fragment identifier of the customer fragment of the customer, the customer identifier uniquely identifies the customer during the customer life cycle, and the customer life cycle refers to the customer identifier After opening the account and before the customer cancels the account; the acquisition module is further used to send the inclusion to the generation module a user identifier generating request of the first fragment identifier; a generating module, configured to receive, by the acquiring module, a user identifier generating request that includes the first fragment identifier, and generate, according to the first fragment identifier, a first fragment identifier for the user The user identifier, the user identifier uniquely
  • the source correspondence table obtains the data source identifier corresponding to the first fragment identifier, and sends the data source identifier to the storage module.
  • the storage module is configured to receive the data source identifier sent by the acquiring module, and store the user data in the data source. Identifying the corresponding data source, so that the access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier, where the fragment data source correspondence table includes Correspondence between the fragmentation identifier of the client fragment and the data source identifier.
  • the acquiring module is further configured to: search, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the number segment routing table, and The storage module sends the query result, where the number segment routing table includes the correspondence between the fragment identifier and the range of the number range of the resource number; the storage module is further configured to receive the query result sent by the obtaining module, and determine, according to the query result, that the query cannot be found.
  • the corresponding relationship between the resource number and the first fragment identifier is added to the scatter table in the database, where
  • the routing table contains the correspondence between the fragment identifier and the resource number that is not attributed to the routing table of the segment.
  • the acquiring module is further configured to: before the customer subscribes to the service, the customer also obtains the tenant identifier of the customer when the customer opens the account, and according to the tenant identifier, the corresponding relationship from the fragment data source In the table, a fragment identifier of the fragment identifier corresponding to the tenant identifier is obtained, and the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes the tenant identifier and the fragment identifier.
  • the generating module configured to receive a client identity generation request that includes the first fragment identifier sent by the acquiring module, according to the first fragment identifier, The client generates a customer identifier that includes the first fragment identifier; the storage module is further configured to obtain, from the generating module, the first fragment identifier included in the client identifier, and store the data of the client in the data source corresponding to the first fragment identifier, In order for the access server to be from the first fragment according to the first fragment identifier included in the customer identifier Source identification data corresponding to the acquired customer data.
  • the acquiring module is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, searching for the second corresponding to the range of the number segment of the resource number according to the routing table of the number segment
  • the fragment identifier is sent to the generating module, and the user identifier generating request including the second fragment identifier obtained by the query and the client identifier generating request including the second fragment identifier obtained by the query are sent to the generating module, where the fragment routing table includes the fragment identifier Corresponding relationship with the range of the number of the resource number;
  • the generating module is further configured to receive the packet sent by the acquiring module a user identifier generation request including a second fragment identifier and a client identifier generation request including a second fragment identifier, and generating, by the second fragment identifier, a client identifier including the second fragment identifier according to the second fragment identifier; the acquiring module, further used for Obtaining, according to the
  • the acquiring module is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, searching for the second corresponding to the range of the number of the resource number from the number segment routing table The segment identifier, where the segment routing table includes the correspondence between the fragment identifier and the range of the number of the resource number.
  • the tenant identifier of the tenant to which the client belongs is obtained; and according to the tenant identifier, Obtaining, from the fragment data source correspondence table, a fragment identifier in the fragment identifier corresponding to the tenant identifier, and obtaining a fragment identifier as the first fragment identifier, where the fragment data source correspondence table further includes Corresponding relationship between the tenant identifier and the fragment identifier, and sending a user identifier generation request including the first fragment identifier and a client identifier generation request including the first fragment identifier to the generating module; the generating module is further configured to receive the sending by the acquiring module User identification generation request including the first fragment identification and customer identification generation including the first fragment identification And obtaining, by the first fragment identifier, a customer identifier that includes the first fragment identifier for the client; the storage module is further configured to add the correspondence between the resource number and the first fragment identifier to the hash routing table, where The scatter number routing table includes the correspondence between the
  • the method further includes: a relocation module, configured to obtain, according to the first data source identifier, all the points corresponding to the first data source identifier from the fragment data source correspondence table According to the relocation requirement, one or more fragment identifiers that meet the relocation requirements are selected from all the fragment identifiers corresponding to the first data source identifier, and one or more fragment identifiers in the fragment data source correspondence table are identified. The data in the first data source corresponding to one or more fragment identifiers is relocated to the second data source.
  • a relocation module configured to obtain, according to the first data source identifier, all the points corresponding to the first data source identifier from the fragment data source correspondence table According to the relocation requirement, one or more fragment identifiers that meet the relocation requirements are selected from all the fragment identifiers corresponding to the first data source identifier, and one or more fragment identifiers in the fragment data source correspondence table are identified. The data in the first data source corresponding to one or more fragment identifiers is relocated to the second data
  • the correspondence between the first data source identifier and one or more fragment identifiers is deleted; in the fragment data source correspondence table, the second data source identifier and one or more fragment identifiers are added.
  • Correspondence relationship and set the state of one or more slice identifiers to a non-relocation state, so as to allow access to more than one slice identifier corresponding to Data.
  • an access server includes: a transceiver and a processor, where the transceiver is configured to receive a data operation request sent by a data operation requesting device, where the data operation request includes an access number, and sends the access number to the processor Sending an access number; a processor, configured to receive an access number sent by the transceiver, obtain a fragment identifier of the client fragment corresponding to the access number according to the access number; and according to the fragment identifier corresponding to the access number, The data source identifier corresponding to the fragment identifier is obtained, and the data source identifier is sent to the transceiver, where the fragment data source correspondence table holds the fragment identifier and the data source identifier; the transceiver, Further, the method is configured to receive a data source identifier sent by the processor, and send the data operation request to a data source corresponding to the data source identifier, and receive a data operation response sent by the data source.
  • the processor is specifically configured to: when the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier; when the access number is a resource If the number is not the same as the resource number of the user, the shard ID corresponding to the resource number is found in the scatter number routing table. When the shard ID corresponding to the resource number is found, the shard ID is obtained. When the fragment is identified, the fragment identifier corresponding to the number segment to which the resource number belongs is obtained according to the resource number of the user, where the scatter number routing table includes the fragment identifier and the resource not attributed to the routing table of the number segment.
  • the correspondence between the numbers and the number segment routing table includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
  • a fifth aspect a data operating system, comprising any data of the fourth aspect or the fourth aspect, the first possibility, the second possibility, the third possibility, the fourth possible or the fifth possible implementation Generating the apparatus and any of the first possible access servers as in the fifth aspect or the fifth aspect.
  • the first fragment identifier included in the user identifier generated by the data generating device and the first fragment identifier included in the client identifier are the same, and the same fragment identifier corresponds to the same data source, so that the user identifier can be implemented.
  • the data of different users of the same customer is stored in the same data source, which solves the problem of accessing across data sources.
  • FIG. 1A is a schematic diagram of a scenario structure applied to an embodiment of the present invention
  • FIG. 1B is a flowchart of an embodiment of a data storage method according to the present invention:
  • FIG. 2 is a flow chart of another embodiment of a data storage method according to the present invention.
  • FIG. 3 is a flow chart of another embodiment of a data storage method according to the present invention.
  • FIG. 4 is a flow chart of an embodiment of a data relocation method according to the present invention
  • FIG. 5 is a flowchart of an embodiment of a data operation method according to the present invention
  • Figure 6 is a block diagram of an embodiment of a data generating apparatus of the present invention.
  • Figure 7 is a block diagram of another embodiment of a data generating apparatus of the present invention.
  • FIG. 8 is a block diagram of an embodiment of an access server of the present invention.
  • FIG. 9 is a block diagram of another embodiment of an access server of the present invention.
  • FIG. 10 is a block diagram of one embodiment of a data operating system of the present invention. detailed description
  • the following embodiments of the present invention provide a data storage method and apparatus, a data operation method, a system, and an access server.
  • a tenant refers to an operator that provides communication services in a certain area, for example: Beijing Telecom is a tenant 1, Beijing Mobile is a tenant 2, Beijing Unicom For tenants 3.
  • Customer refers to an individual, group or legal organization that has signed an agreement with a tenant and has ordered or may order products and services provided by the tenant.
  • the customer may be a consumer customer, such as a natural person; the customer may also be a group customer. (group customer), for example: a household customer or a corporate customer; a tenant contains a plurality of customers.
  • the data generating device When the customer opens an account, the data generating device generates a customer identification for the customer, and the customer identification uniquely identifies the customer during the customer life cycle, the customer life The period refers to the fragmentation identifier of the customer segment to which the customer belongs, from the time the customer opens the account to the time before the customer is posted.
  • the customer subscribes to a product or service at a tenant
  • the customer becomes a subscriber of the tenant.
  • the customer has processed multiple products or services
  • the customer becomes a plurality of users of the tenant, that is, one
  • the customer can correspond to multiple users, and each user has a unique resource number.
  • the broadband user corresponds to a broadband number
  • the mobile phone user corresponds to a mobile phone number.
  • the client determines a resource number or the tenant allocates a resource number.
  • the data generating device For the customer, the data generating device generates a user identifier for the user, and the user identifier uniquely identifies the user during the life cycle of the user, and the user life cycle refers to the user identifier from the time the user opens the account to the time before the user accounts for the user.
  • the fragment ID contained is the same as the fragment ID contained in the customer ID of the customer to which the user belongs.
  • a home customer can include broadband users, fixed-line users, and mobile phone users.
  • Data source, used to store customer data and user data such as: can be a database, a database diagram (Schema) or a database table (table).
  • a customer segment is defined in advance.
  • Each client segment can correspond to a certain number of customers.
  • the segmentation identifier of the client segment can also be called the Customer Partition Index (CPI), and then each data segment can be assigned to each client segment.
  • the data corresponding to the user identifier and/or the customer identifier of the fragment identifier of the client fragment may be stored in the data source corresponding to the fragment identifier.
  • each data source can correspond to at least one client fragment.
  • the customer shards have a mapping relationship with the tenant, the customer, and the data source.
  • One tenant corresponds to more than one customer shard, and the data source.
  • One tenant corresponds to more than one customer shard, and the data source corresponding to each customer shard may be different, for example: customer shard 1 corresponds Data source 1, customer fragment 2 corresponds to data source 2.
  • a relationship table is also introduced, and a segment data source correspondence table generated based on a relationship between a client fragment and a data source is used, and the fragment data source correspondence table is used to save the client fragment.
  • the fragment data source correspondence table further includes a fragment identification status and a migration target data source identifier, and is used by the system to relocate the routing data according to the customer fragment, wherein the fragment identification status may indicate whether to relocate The status of the fragment identification status is 0 for the non-relocation status, and the fragment identification status is 1 for the relocation status.
  • the migration destination data source identifier is the identifier of the target data source to which the routing data is migrated.
  • the segment routing table is used to store the correspondence between the fragment identifier and the range of the number to which the resource number belongs.
  • the range of the number segment is represented by the start number and the cutoff number, that is, the resource number between the start number and the cutoff number belongs to the The range of the number, the resource number here can be a mobile phone number, a broadband number or a fixed number.
  • the routing table of the segment may further include a tenant identifier corresponding to the fragment identifier, and an effective time and an expiration time of the routing table of the segment.
  • the scatter table is initially empty. In the process of generating routing data, the scatter table will be used to store the correspondence between the shard ID and the resource number not attributed to the hop routing table.
  • the access type and the access number are included, and the access type includes the type of access by the customer identifier, the type of access by the user identifier, or the type of access by the resource number.
  • the access number may be a customer identifier, and the user identifier.
  • the resource number, and the scatter table further includes the effective time and expiration time of the scatter table.
  • the above-mentioned fragment data source correspondence table, the scatter number routing table, and the segment routing table may be stored locally in the data generating device, or may be separately stored in a database other than the data generating device.
  • FIG. 1A is a schematic diagram of a scenario architecture applied to an embodiment of the present invention:
  • the right side of Figure 1A shows the network entities involved in the data storage process, including the data generating device, and the database; the network entities involved in the data operation process, including the Gateway GPRS Support Node (GGSN), session description Session Description Protocol (SDP) Control Point, Access Server, and Database.
  • the data generating device can be generally set in the operator's business hall; the above-mentioned fragment data source correspondence table, the segment routing table, and the scatter table are set in the database.
  • the data generating device may save the correspondence between the fragment identifier and the data source identifier, and the correspondence between the fragment identifier and the tenant's tenant identifier to the fragment data source in the database according to the pre-planned client fragment.
  • the correspondence between the fragment identifier and the range of the number of the resource number is saved in the number segment routing table in the database; when the customer opens an account, or the customer's user opens an account, or the customer opens an account with the user at the same time, the data
  • the generating device may generate a customer representation for the client and generate a user identifier for the user by searching a fragment data source correspondence table in the database, or a segment routing table; the data generating device may obtain the scatter resource number obtained in the process of generating the routing data.
  • the correspondence with the fragment identifier is saved in the scatter table.
  • the data maintenance module of the data generating device can also send the data of the client or the data of the user to the data source corresponding to the fragment identifier.
  • the GGSN or the SDP After receiving the data operation request, the GGSN or the SDP sends the data operation request to the access server, where the data operation request can query the data request, or add a data request, or delete the data request, etc., and the access server obtains the data operation request.
  • the access number included in the data operation request is analyzed to obtain a fragment identifier, and the database is searched according to the fragment identifier, and the data source identifier corresponding to the fragment identifier is obtained, and the service corresponding to the access number is routed to The data source identifies the corresponding data source.
  • the database can be one or more. If there are multiple databases, the consistency of various data and routing tables maintained by each database through data synchronization.
  • the database can contain multiple data sources.
  • the data sources can also be independent and can be located outside the database.
  • the data source that stores customer data and user data can be a separate database located outside the database.
  • FIG. 1B it is a flowchart of an embodiment of a data storage method according to the present invention.
  • the method includes:
  • Step 101 The data generating apparatus determines that the customer has opened an account, and obtains a first fragmentation identifier included in the customer identifier of the customer, where the first fragmentation identifier is a fragmentation identifier of the customer fragment of the customer, and the customer identifier is in the customer life cycle.
  • the customer life cycle refers to the period from the time the customer opens the account to the time the customer cancels the account.
  • the customer has opened an account and has generated the customer ID of the customer.
  • the customer subscribes to a certain customer.
  • the customer may select a resource number or the tenant allocates a resource number to the client.
  • the data generating device obtains the first fragment identifier included in the client identifier, and the first fragment identifier may be a prefix of the client identifier. It can also be the suffix of the customer ID, or the number of specific locations in the customer ID. For example, the first five digits of the eighteen customer identification are the first fragment identification.
  • the method further includes: obtaining, by the customer, the tenant identifier of the customer when the account is opened; the data generating device obtains the fragment identifier corresponding to the tenant identifier from the correspondence data source correspondence table according to the tenant identifier a fragment identifier, the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier; and the data generating device is configured according to the first fragment.
  • Step 102 The data generating device generates, according to the first fragment identifier, a user identifier that includes the first fragment identifier, where the user identifier uniquely identifies the user during the user lifetime, and the user life cycle refers to the user after the account is opened to the user. During the period before the household.
  • Step 103 The data generating device obtains, according to the first fragment identifier, the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table, and stores the user data in the data source corresponding to the data source identifier.
  • the access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier, where the fragment data source correspondence table includes the fragment identifier of the client fragment. Correspondence with the data source identifier.
  • the data generating device searches, according to the resource number of the user, the second fragment identifier corresponding to the range of the number range of the resource number from the routing table of the number segment, where the routing table includes the fragment identifier and the resource number.
  • the correspondence between the resource number and the first fragment identifier by the data generating device Add to the scatter table in the database, where the scatter table contains the correspondence between the shard ID and the resource number that is not attributed to the hop routing table.
  • the data generating device determines, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs according to the resource number of the user, where the routing table of the number segment includes Corresponding relationship between the slice identifier and the range of the number of the resource number; when the second fragment identifier is found, the data generating device generates a customer identifier including the second fragment identifier for the client according to the second fragment identifier, and according to the second a fragment identifier, generating a user identifier including a second fragment identifier for the user, and storing the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the client identifier and/or
  • the second fragment identifier included in the user identifier acquires data of the client and/or data of the user from a data source corresponding to the second fragment identifier.
  • the second fragment identifier when the second fragment identifier is not found, obtaining the tenant identifier of the tenant to which the client belongs; data generation The device obtains a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table according to the tenant identifier, and uses the obtained fragment identifier as the first fragment identifier, where the fragment data source is
  • the correspondence relationship table further includes a correspondence between the tenant identifier and the fragment identifier.
  • the data generating device generates a client identifier including the first fragment identifier for the client according to the first fragment identifier, and generates the inclusion for the user according to the first fragment identifier.
  • a user identifier of the first fragment identifier adding a correspondence between the resource number and the first fragment identifier to the scatter number routing table, where the scatter number routing table includes the fragment identifier and the resource number not attributed to the segment routing table Corresponding relationship, and storing the data of the client and the data of the user in the data source corresponding to the first fragment identifier, so that the access server according to the first fragment identifier included in the customer identifier and/or the user identifier, from the first A slice identifies the data of the customer and/or the data of the user in the corresponding data source.
  • the data generating device obtains, according to the first data source identifier, all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table; and corresponding to the first data source identifier according to the relocation request Select one or more fragment identifiers that meet the relocation requirements in all the fragment identifiers, and set the status of one or more fragment identifiers in the fragment data source correspondence table to the relocation status, so as to prohibit the data generation device from being disabled.
  • the outer network element accesses data corresponding to one or more fragment identifiers; the data generating device relocates data in the first data source corresponding to one or more fragment identifiers to the second data source; and the data generation device corresponds to the fragment data source
  • the correspondence between the first data source identifier and one or more fragment identifiers is deleted, and the data generating device adds a correspondence between the second data source identifier and one or more fragment identifiers in the fragment data source correspondence table, and
  • the status of one or more fragment identifiers is set to a non-relocation state, so as to allow access to the number corresponding to one or more fragment identifiers. according to.
  • FIG. 2 it is a flowchart of another embodiment of a data storage method according to the present invention, including:
  • Step 201 When the customer opens an account, the data generating device obtains the tenant identifier of the tenant to which the customer belongs; after the customer selects a tenant, the customer opens the account under the tenant, so the data generating device naturally obtains the tenant identifier of the tenant to which the customer belongs.
  • Step 202 The data generating device acquires a fragment identifier in the fragment identifier corresponding to the tenant identifier, and uses the obtained fragment identifier as the first fragment identifier.
  • the data generating device may randomly select one fragment identifier from all the fragment identifiers, or determine the requirements of the data source according to the attributes of the client, and then select a data source that meets the requirements, and the correspondence table from the fragment data source.
  • the segment identifier corresponding to the data source identifier of the data source is determined. For example: the data generating device identifies that the customer is an important customer, and the security requirement level of the customer data is the highest level, and selects the highest-level security data source from the plurality of data sources to store the customer corresponding to the fragment identifier.
  • Data or user data, and from the fragment data source correspondence table determine the fragment identifier corresponding to the data source identifier of the data source.
  • Step 203 The data generating apparatus generates, according to the first fragment identifier, a first fragment identifier for the client.
  • the customer identifier is stored in the data source corresponding to the first fragmentation identifier, and the customer identifier is the unique identifier of the customer during the life cycle of the customer, and the customer life cycle is from the time the customer opens the account to the time before the customer cancels the account. Throughout the period.
  • the first fragment identifier may be used as a prefix of the customer identifier, or may be used as a suffix of the customer identifier, and may also be a specific digit of the customer identifier, for example, the customer identifier is an 18-digit number.
  • the first 1-4 bits are the first slice identifier, and the fifth bit is the type flag.
  • the type flag bit 0 indicates the client identifier, and the 6-18 bits are the sequence numbers generated according to certain rules.
  • the customer's data here can be the customer identification, the customer's name left by the customer when opening the account, the customer's home address, the customer's work unit, and so on.
  • the data storage process of the customer's user when opening an account includes:
  • Step 204 When the client subscribes to a certain service, that is, when the customer becomes a user of the service, the data generating device obtains the first fragment identifier included in the customer identifier of the customer.
  • a resource number or a tenant can slice a resource number for the user, such as a mobile phone number, a broadband number, or a Subscriber Identity Module (SIM) card number.
  • SIM Subscriber Identity Module
  • Step 205 Generate, according to the obtained first fragment identification data generating device, a user identifier that includes the first fragment identifier, and save the user data in a data source corresponding to the first fragment identifier, so as to facilitate
  • the access server obtains data of the user from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier.
  • the user's data may include the resource number, the type of service of the user, the type of the service, the validity period of the user's business, and the like.
  • the first fragment identifier may be a prefix of the user identifier, or may be a suffix of the user identifier, or may be a specific digit of the user identifier, for example, the user identifier is an 18-digit number.
  • the first 1-4 bits are the first fragment identification, and the fifth digit is the type identifier.
  • the type flag bit 1 indicates the user identifier, the 6-18 bits are the sequence number generated according to a certain rule, or the resource number of the user.
  • Step 206 According to the resource number of the user, the data generating device searches for the second fragment identifier corresponding to the range of the number segment of the resource number.
  • Step 207 If the data generating device does not find the second fragment identifier, or if the second fragment identifier found by the data generating device is inconsistent with the first fragment identifier, the data generating device saves the resource in the hash routing table. The correspondence between the number and the first fragment ID.
  • the number of segments in the routing table is The resource number is not included in the scope.
  • the second fragment identifier corresponding to the range of the number segment that is, the second CPI, is obtained when the range of the number of the segment number includes the resource number.
  • the data generating apparatus needs to determine the second fragment identifier and the first fragment that are found because the first fragment identifier selected may be different from the second fragment identifier that is found according to the resource number when the client opens the account.
  • the data generating device saves the correspondence between the resource number and the first fragment identifier in the hash routing table, and thereafter
  • the fragment identifier corresponding to the resource number is the first fragment identifier. Therefore, the subsequent access server searches for the fragment identifier corresponding to the user by using the resource number, and needs to first search from the hash table, and then the slave segment routing table. If the second fragment identifier that is found by the data generating device is consistent with the first fragment identifier, the correspondence between the range of the number segment to which the resource number belongs and the first fragment identifier is pre-stored. Therefore, the data generating device does not need to save the range of the number segment to which the resource number belongs and the first fragment identifier in the routing table. Correspondence relationship.
  • FIG. 3 it is a flowchart of another embodiment of a data storage method according to the present invention.
  • the embodiment shows that when a customer accounts for a service, the customer subscribes to a certain service, that is, the customer becomes a user of the service, and the data storage.
  • Step 301 According to the resource number of the user, look up the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the routing table of the number segment.
  • Step 302 Determine whether the second fragment identifier is found. When the second fragment identifier is found, step 303 is performed. When the second fragment identifier is not found, step 304 is performed.
  • Step 303 When the second fragment identifier is found, generate a client identifier that includes the second fragment identifier for the client according to the second fragment identifier, and generate a second fragment identifier for the user according to the second fragment identifier. a user identifier, and storing the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the second fragment identifier included in the customer identifier and/or the user identifier.
  • the data source of the customer and/or the data of the user are obtained from the data source corresponding to the two-slice identification.
  • Step 304 When the second fragment identifier is not found, obtain the tenant identifier of the tenant to which the client belongs.
  • the range of any number in the routing table of the number segment does not include the resource number.
  • Step 305-step 307 The same as steps 202-204, and details are not described herein again.
  • Step 308 The data generating apparatus generates a user identifier including the first fragment identifier for the user according to the first fragment identifier, and saves the correspondence between the resource number and the first fragment identifier in the hash routing table, and the user's
  • the data is stored in the data source corresponding to the first fragment identifier, so that the access server obtains the data of the user from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier.
  • the data of the client can be User data is stored in the same data source. And according to the attributes of the customer, the requirements of the data source can be determined, so that the data source that meets the requirements can be flexibly allocated to the customer and the user.
  • any method embodiment of data storage based on FIG. 1B-3 is a flowchart of an embodiment of a data migration method according to the present invention.
  • the embodiment shows a process of data migration in units of client shards: 401:
  • the data generating device obtains, according to the first data source identifier, all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table.
  • the basic resource of the first data source may not be able to support all the customers under it, and some data under the first data source is needed.
  • the data relocation and migration can be performed in units of customer fragments.
  • Step 402 According to the relocation request, select one or more fragment identifiers that meet the relocation requirement from all the fragment identifiers corresponding to the first data source identifier, and set the status of one or more fragment identifiers in the fragment data source correspondence table. It is set to the relocation state, so that the network element other than the data generating device is prohibited from accessing data corresponding to one or more fragment identifiers.
  • the data corresponding to the customer segment of the first data source that exceeds 1% of the data source may be relocated, or the data of the important customer in the first data source may be requested to be relocated, or may be required. Randomly relocate the corresponding data of half of the fragment IDs of all the fragment identifiers.
  • one or more fragment identifiers that meet the requirements are selected from all the fragment identifiers corresponding to the first data source identifier according to the relocation request, one or more fragments in the corresponding data source correspondence table need to be separately selected.
  • the status of the logo is set to the relocation status.
  • Step 403 Relocate data in the first data source corresponding to one or more slice identifiers to the second data source.
  • Step 404 In the fragment data source correspondence table, delete the correspondence between the first data source identifier and one or more fragment identifiers. In the fragment data source correspondence table, add the second data source identifier and one or more fragments. Corresponding relationship of the identifiers, and setting the status of one or more fragment identifiers to a non-relocation state, so as to allow the network element to access data corresponding to more than one fragment identifier.
  • FIG. 5 it is a flowchart of an embodiment of a data operation method according to the present invention. The embodiment is based on any of the foregoing data storage method embodiments of FIG.
  • Step 501 The access server receives a data operation request sent by the data operation requesting device, and the data operation request includes an access number.
  • the data operation requesting device may be a GGSN or another access device such as an SDP.
  • Step 502 The access server obtains a fragment identifier of the client fragment corresponding to the access number according to the access number.
  • the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier;
  • the fragment identifier corresponding to the resource number is searched in the hash routing table according to the resource number of the user, and the fragment identifier is obtained when the fragment identifier corresponding to the resource number is found;
  • the fragment identifier corresponding to the resource number is found, the fragment identifier corresponding to the number segment to which the resource number belongs is obtained according to the resource number of the user, where the scatter number routing table includes the fragment identifier and the non-attribute to The correspondence between the resource numbers of the routing table of the number segment, and the routing table of the number segment includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
  • Step 503 The access server obtains a data source identifier corresponding to the fragment identifier from the fragment data source correspondence table according to the fragment identifier corresponding to the access number, where the fragment data source correspondence table holds the fragment identifier. With the data source ID.
  • Step 504 The access server sends a data operation request to the data source corresponding to the obtained data source identifier.
  • Step 505 The access server receives a data operation response sent by the data source.
  • the present invention also provides an embodiment of a data generation apparatus, system, and access server.
  • a data generation apparatus system, and access server.
  • FIG. 6 based on the method embodiment of FIG. 1B-5 above, a block diagram of an embodiment of the data generating apparatus of the present invention is shown:
  • the device includes: an apparatus comprising: an obtaining module 610, a generating module 620, and a storage module 630, wherein the obtaining module 610 is configured to: when the client subscribes to a service, when the client becomes a user of the service, determine The customer has opened an account and obtained the first fragmentation identifier included in the customer's customer identification.
  • the first fragmentation identifier is the fragmentation identifier of the customer's customer segment.
  • the customer identifier uniquely identifies the customer during the customer's life cycle. Refers to the period from the time the customer opens the account to the time before the customer cancels the account;
  • the obtaining module 610 is further configured to send, to the generating module 620, a user identifier generating request that includes the first fragment identifier;
  • the generating module 620 is configured to receive the user identifier generating request that includes the first fragment identifier, and generate, according to the first fragment identifier, a user identifier that includes the first fragment identifier, where the user identifier is in the user life cycle.
  • the user is uniquely identified, and the user life cycle refers to the period from the time the user opens the account to the time before the user cancels the account;
  • the obtaining module 610 is further configured to obtain, according to the first fragment identifier, the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table, and send the data source identifier to the storage module 630;
  • the storage module 630 is configured to receive the data source identifier sent by the obtaining module 610, and store the data of the user in a data source corresponding to the data source identifier, so that the access server obtains the first fragment identifier according to the user identifier.
  • the user data is obtained from the data source corresponding to the first fragment identifier, where the fragment data source correspondence table includes the correspondence between the fragment identifier of the client fragment and the data source identifier.
  • the obtaining module 610 is further configured to: search, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the routing table, and send the query result to the storage module 630, where
  • the segment routing table includes a correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
  • the storage module 630 is further configured to receive the query result sent by the obtaining module 610, and determine, according to the query result, that the second score is not found.
  • the slice identifier, or the found second fragment identifier is inconsistent with the first fragment identifier, add the correspondence between the resource number and the first fragment identifier to the scatter number routing table in the database, where the scatter number routing table Contains the correspondence between the fragment identifier and the resource number that is not attributed to the segment routing table.
  • the obtaining module 610 is further configured to: before the customer subscribes to the service, the customer obtains the tenant identifier of the customer when the customer opens the account, and obtains the corresponding point of the tenant identifier from the corresponding data of the fragment data source according to the tenant identifier.
  • a slice identifier of the slice identifier, the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier, and is sent to the generating module 620.
  • a client identifier generation request including a first fragment identifier correspondingly, the generating module 620 is configured to receive a client identifier generation request that includes the first fragment identifier sent by the obtaining module 610, and generate the inclusion for the client according to the first fragment identifier.
  • the customer identifier of the first fragment identifier; correspondingly, the storage module 630 is further configured to obtain, by the generating module 620, the first fragment identifier included in the client identifier, and store the data of the client in the data source corresponding to the first fragment identifier. In order to facilitate the access server according to the first fragment identifier included in the customer identifier, from the first fragment Identify the data of the customer in the corresponding data source.
  • the obtaining module 610 is further configured to: when the customer is not open, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment of the resource number is searched from the routing table of the number, and the generating module 620 is configured.
  • the generating module 620 is further configured to receive, by the acquiring module, a user identifier generating request that includes the second fragment identifier and a client identifier generating request that includes the second fragment identifier, according to the second fragment identifier, The client generates a customer identifier that includes the second fragment identifier, and generates a user identifier that includes the second fragment identifier for the user according to the second fragment identifier.
  • the obtaining module 610 is further configured to use the second fragment identifier from the fragment.
  • the data source correspondence table obtains the data source identifier corresponding to the second fragment identifier, and the data source identifier
  • the storage module 630 is further configured to store the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the client identifier and/or the user identifier.
  • the second fragment identifier included in the method, the customer data and/or the user data are obtained from the data source corresponding to the second fragment identifier.
  • the obtaining module 610 is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, the second fragment identifier corresponding to the range of the number range of the resource number is obtained from the routing table of the number segment, where the number of the route is The table contains the corresponding relationship between the fragment ID and the range of the number of the resource number.
  • the tenant ID of the tenant to which the customer belongs is obtained; and according to the tenant ID, from the fragment data source correspondence table And obtaining a fragment identifier in the fragment identifier corresponding to the tenant identifier, and the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier.
  • the generating module 620 is further configured to receive, by the acquiring module 610, the first a user identification generation request for the fragment identification and a customer identification generation request including the first fragment identification.
  • the storage module 630 is further configured to add the correspondence between the resource number and the first fragment identifier to the scatter number routing table, according to the first fragment identifier,
  • the scatter number routing table includes a correspondence between the shard ID and the resource number that is not attributed to the hop routing table, and the customer data is stored in the data source corresponding to the first shard identifier, so that the access server is based on the client.
  • the first fragment identifier included in the identifier and/or the user identifier is obtained from the data source corresponding to the first fragment identifier.
  • the data generating apparatus further includes: a relocation module 640, configured to obtain, according to the first data source identifier, all the points corresponding to the first data source identifier from the fragment data source correspondence table. Slice identification; According to the relocation requirement, select one of the fragmentation identifiers corresponding to the first data source identifier that meets the relocation requirements.
  • the above fragment identifiers are set, and the state of one or more fragment identifiers in the fragment data source correspondence table is set to a relocation state, so as to prohibit the network elements other than the data generating device from accessing one or more fragment identifiers.
  • the data in the first data source corresponding to one or more slice identifiers is relocated to the second data source; in the data source correspondence table, the correspondence between the first data source identifier and one or more fragment identifiers is deleted.
  • the corresponding relationship between the second data source identifier and one or more fragment identifiers is added in the fragment data source correspondence table, and the state of one or more fragment identifiers is set to a non-relocation state, so as to allow access to more than one point.
  • the slice identifies the corresponding data.
  • FIG. 8 a block diagram of an embodiment of the access server according to the foregoing FIG. 1B-5 is a block diagram of an embodiment of an access server according to the present invention.
  • the method includes: a transceiver 810 and a processor 820, where
  • the transceiver 810 is configured to receive a data operation request sent by the data operation requesting device, where the data operation request includes an access number, and send the access number to the processor 820;
  • the processor 820 is configured to receive an access number sent by the transceiver 810, obtain a fragment identifier of the client fragment corresponding to the access number according to the access number, and obtain the fragmentation data according to the fragment identifier corresponding to the access number.
  • the data source identifier corresponding to the fragment identifier is obtained, and the data source identifier is sent to the transceiver 810, where the fragment data source correspondence table stores the fragment identifier and the data source identifier;
  • the transceiver 810 is further configured to receive the data source identifier sent by the processor 820, and send the data operation request to the data source corresponding to the data source identifier, and receive the data operation response sent by the data source.
  • the processor 820 is specifically configured to: when the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier; when the access number is a resource number, according to the user The resource number, in the hash routing table, the fragment identifier corresponding to the resource number, and when the fragment identifier corresponding to the resource number is found, the fragment identifier is obtained; when the fragment identifier corresponding to the resource number is not found, And obtaining, according to the resource number of the user, the fragment identifier corresponding to the number segment to which the resource number belongs, where the scatter number routing table includes the correspondence between the fragment identifier and the resource number not attributed to the routing table of the number segment.
  • the segment routing table contains the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
  • FIG. 9 is a block diagram of an embodiment of a data generating apparatus according to the present invention
  • the data generating apparatus in the embodiment of the present invention may be implemented based on a computer system, and the method shown in FIG. 1B-4 may be in a data generating apparatus based on a computer system.
  • the data generating apparatus in this embodiment may include: a processor 901, a memory 902, and a communication interface 903.
  • the memory 902 is used to store program codes.
  • the processor 901 is configured to execute program code stored in the memory 902.
  • the memory 902 stores the first program code
  • the processor 901 is configured to execute the first program code, and the following operations are performed: when the client subscribes to a service, when the client becomes a user of the service, the method includes The customer has opened an account and obtained the first fragmentation identifier included in the customer's customer identification.
  • the first fragmentation identifier is the fragmentation identifier of the customer's customer fragment.
  • the customer identifier is only in the customer life cycle.
  • a customer identification, the customer life cycle refers to the period from the customer opening the account to the customer before the customer is posted; according to the first fragment identification, the user identifier containing the first fragment identification is generated for the user, and the user identifier is in the user life cycle.
  • the user lifetime refers to the period from the time the user opens the account to the time before the user cancels the account.
  • the data source identifier corresponding to the first fragment identifier is obtained from the fragment data source correspondence table. And storing the user data in the data source corresponding to the data source identifier, so that the access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier.
  • the fragment data source correspondence table includes a correspondence between the fragment identifier of the client fragment and the data source identifier.
  • the communication interface 903 is configured to communicate with an external device, such as with an access server.
  • the processor 901 processes the message received by the communication interface 903 according to the program code in the memory 902, and interacts with the external device through the communication interface 903.
  • the processor 901 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like.
  • the device for processing the ICE address in this embodiment may include a bus 904.
  • the processor 901, the memory 902, and the communication interface 903 can be connected and communicated via a bus 904.
  • the memory 902 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function.
  • the call context in the embodiment of the present invention can be cached in the RAM.
  • FIG. 9 is a block diagram of an embodiment of an access server according to the present invention
  • the access server in the embodiment of the present invention may be implemented based on a computer system, and the method shown in FIG. 5 may be implemented in an access server based on a computer system.
  • the access server in this embodiment may include: a processor 901, a memory 902, and a communication interface 903.
  • the memory 902 is used to store program codes.
  • the processor 901 is configured to execute program code stored in the memory 902.
  • the memory 902 stores a first program code
  • the processor 901 is configured to execute the first program code, including: performing a data operation request sent by the data operation requesting device, where the data operation request includes accessing The number is obtained according to the access number, and the fragment identifier of the client fragment corresponding to the access number is obtained. According to the fragment identifier corresponding to the access number, the data source corresponding to the fragment identifier is obtained from the fragment data source correspondence table. The identifier, where the fragment data source correspondence table holds the fragment identifier and the data source identifier; sends the data operation request to the data source corresponding to the obtained data source identifier; and receives the data operation response sent by the data source.
  • the communication interface 903 is configured to communicate with an external device, such as a data generating module. Messages that interact between the data generating device and the access server (as shown in FIG. 1B-5 of the method embodiment) are both transmitted and received via communication interface 903.
  • the processor 901 processes the message received by the communication interface 903 according to the program code in the memory 902, and interacts with the external device through the communication interface 903.
  • the processor 901 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like.
  • the device for processing the ICE address in this embodiment may include a bus 904.
  • the processor 901, the memory 902, and the communication interface 903 can be connected and communicated via a bus 904.
  • the memory 902 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function.
  • the call context in the embodiment of the present invention can be cached in the RAM.
  • the client data and the user data can be both Stored in the same data source. And according to the attributes of the customer, the requirements of the data source can be determined, so that the data source that meets the requirements can be flexibly allocated to the customer and the user.
  • a schematic structural diagram of a data operating system includes a data generating apparatus 1010 as shown in FIG. 6, 7 or 9, and an access server 1020 as shown in FIG. 8 or FIG.
  • the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data storage method and apparatus, a data operation method and system, and an access server. The method includes that when a client subscribes a service and then the client becomes a user of the service, the method includes that: determined is that the client has opened an account; a first slice identifier included in a client identifier of the client is acquired, wherein the first slice identifier is a slice identifier of a client slice to which the client belongs; according to the first slice identifier, a user identifier including the first slice identifier is generated for the user, wherein the user identifier uniquely identifies the user in a user lifecycle, and the user lifecycle is a period from the time at which the user opens the account to the time at which the user logs out the account; according to the first slice identifier, a data source identifier corresponding to the first slice identifier is acquired from a slice and data source correspondence table; and user data is stored in the data source corresponding to the data source identifier, thus the access server acquire the user data from the data source corresponding to the first slice identifier according to the first slice identifier included in the user identifier.

Description

数据存储方法和装置、 数据操作方法、 系统及接入服务器  Data storage method and device, data operation method, system and access server
技术领域 本发明涉及通信技术领域, 特别涉及数据存储方法和装置, 以及数据操作方法、 系统及接入服务器。 背景技术 目前, 同一个集团客户或者家庭客户可能存在多个用户, 或者, 同一个个人客户 可能有多个用户, 比如: 宽带用户, 固话用户, 手机用户。 而存储这些用户数据时, 可能将这些用户数据存储到不同的数据源中,在有些场景下, 当业务需要访问同一个 集团客户或者家庭客户的多个用户的数据时, 需要跨数据源进行访问, 而跨数据源访 问会带来很大的资源消息, 以及访问的效率的降低。 发明内容 TECHNICAL FIELD The present invention relates to the field of communications technologies, and in particular, to a data storage method and apparatus, and a data operation method, system, and access server. BACKGROUND At present, there may be multiple users of the same group customer or family customer, or the same individual customer may have multiple users, such as: broadband users, fixed-line users, and mobile phone users. When storing these user data, the user data may be stored in different data sources. In some scenarios, when the service needs to access data of multiple users of the same group customer or home customer, it needs to access across data sources. And cross-data source access brings a lot of resource messages, and the efficiency of access is reduced. Summary of the invention
本发明实施例提供数据存储方法和装置,以及数据操作方法、系统及接入服务器, 以解决现有技术中同一个客户的多个用户的数据存储在不同的数据源,在进行获取数 据时, 需要跨数据源访问的问题。  The embodiment of the present invention provides a data storage method and device, and a data operation method, a system, and an access server, so as to solve the problem that data of multiple users of the same client in the prior art is stored in different data sources, and when acquiring data, Issues that require access across data sources.
为了解决上述技术问题, 本发明实施例公开了如下技术方案:  In order to solve the above technical problem, the embodiment of the present invention discloses the following technical solutions:
第一方面, 一种数据存储方法, 客户订阅了一个业务时, 客户成为了业务的用户 时, 该方法包括: 数据生成装置确定客户已经开户, 获得客户的客户标识中包含的第 一分片标识, 其中, 第一分片标识为客户所属客户分片的分片标识, 客户标识在客户 生命周期内唯一标识客户, 客户生命周期指的是从客户开户后到客户销户前的期间 内; 数据生成装置根据第一分片标识, 为用户生成包含第一分片标识的用户标识, 用 户标识在用户生命周期内唯一标识用户,用户生命周期指的是从用户开户后到用户销 户前的期间内; 数据生成装置根据第一分片标识, 从分片数据源对应关系表, 获得第 一分片标识对应的数据源标识; 并将用户的数据存储在数据源标识对应的数据源中, 以便于接入服务器根据用户标识中包含的第一分片标识,从第一分片标识对应的数据 源中获取用户的数据,其中, 分片数据源对应关系表包含客户分片的分片标识与数据 源标识的对应关系。  In a first aspect, a data storage method, when a customer subscribes to a service, when the client becomes a user of the service, the method includes: the data generating device determines that the client has opened an account, and obtains the first fragment identifier included in the customer identifier of the client The first fragment is identified as the fragmentation identifier of the customer's customer fragment, and the customer identifier uniquely identifies the customer during the customer's life cycle, and the customer life cycle refers to the period from the time the customer opens the account to the time the customer cancels the account; The generating device generates a user identifier including the first fragment identifier according to the first fragment identifier, where the user identifier uniquely identifies the user during the life cycle of the user, and the user life period refers to a period from after the user opens the account to before the user is turned off. The data generating device obtains the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table according to the first fragment identifier; and stores the user data in the data source corresponding to the data source identifier, so that The first fragment identifier is identified by the access server according to the first fragment identifier included in the user identifier. The corresponding data source obtains the user data, where the fragment data source correspondence table includes the correspondence between the fragment identifier of the client fragment and the data source identifier.
在第一方面的第一种可能的实现方式中,还包括: 数据生成装置根据用户的资源 号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二分片标识, 其中, 号 段路由表包含了分片标识与资源号码所属号段范围的对应关系;确定查找不到第二分 片标识, 或者查找到的第二分片标识与第一分片标识不一致时,数据生成装置将资源 号码与第一分片标识的对应关系添加到数据库中的散号路由表中,其中, 散号路由表 包含分片标识与不归属于号段路由表的资源号码的对应关系。 In a first possible implementation manner of the first aspect, the method further includes: the data generating device is configured according to the user's resources The number, from the routing table of the number segment, the second fragment identifier corresponding to the range of the number range of the resource number, wherein the routing table includes the correspondence between the fragment identifier and the range of the number of the resource number; The second fragment identifier, or the found second fragment identifier is inconsistent with the first fragment identifier, the data generating device adds the correspondence between the resource number and the first fragment identifier to the hash table in the database, The hash routing table includes a correspondence between the fragment identifier and a resource number that is not attributed to the routing table of the segment.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的 实现方式中, 在客户订阅业务之前, 方法还包括: 客户进行开户时, 获得客户所属租 户标识; 数据生成装置根据租户标识, 从分片数据源对应关系表中, 获取租户标识对 应的分片标识中一个分片标识, 将获取到的一个分片标识作为第一分片标识, 其中, 分片数据源对应关系表还包含租户标识与分片标识的对应关系;数据生成装置根据第 一分片标识, 为客户生成包含第一分片标识的客户标识, 并将客户的数据存储在第一 分片标识对应的数据源中, 以便于接入服务器根据客户标识中包含的第一分片标识, 从第一分片标识对应的数据源中获取客户的数据。  In combination with the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, before the customer subscribes to the service, the method further includes: when the customer opens an account, obtaining the tenant of the customer The data generating device obtains, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table, and uses the obtained fragment identifier as the first fragment identifier, where The fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier; the data generating device generates a client identifier including the first fragment identifier according to the first fragment identifier, and stores the client data in the first A slice identifies the corresponding data source, so that the access server obtains the data of the client from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the client identifier.
结合第一方面的实现方式, 在第一方面的第三种可能的实现方式中, 还包括: 数 据生成装置确定客户未开户时, 根据用户的资源号码, 从号段路由表中, 查找资源号 码所属号段范围对应的第二分片标识,其中, 号段路由表包含了分片标识与资源号码 所属号段范围的对应关系; 数据生成装置当查找到第二分片标识时,根据第二分片标 识, 为客户生成包含二分片标识的客户标识, 以及根据第二分片标识, 为用户生成包 含第二分片标识的用户标识,以及将客户的数据和用户的数据存储在第二分片标识对 应的数据源中, 以便于接入服务器根据客户标识和 /或用户标识中包含的第二分片标 识, 从第二分片标识对应的数据源中获取客户的数据和 /或用户的数据。  In conjunction with the implementation of the first aspect, in a third possible implementation manner of the first aspect, the method further includes: when the data generating apparatus determines that the customer does not open an account, searching for the resource number from the number segment routing table according to the resource number of the user a second fragment identifier corresponding to the range of the number segment, wherein the number segment routing table includes a correspondence between the fragment identifier and the range of the number range of the resource number; when the data generating device finds the second fragment identifier, according to the second Fragment identification, generating a customer identifier including a two-slice identifier for the client, and generating a user identifier including the second fragment identifier for the user according to the second fragment identifier, and storing the customer data and the user data in the second score The data identifier corresponding to the slice identifier, so that the access server obtains the data of the client and/or the user from the data source corresponding to the second fragment identifier according to the second fragment identifier included in the client identifier and/or the user identifier. data.
结合第一方面的第三种可能的实现方式, 在第一方面的第四种可能的实现方式 中, 还包括: 当未查找到第二分片标识时, 获得客户所属租户的租户标识; 数据生成 装置根据租户标识, 从分片数据源对应关系表中, 获取租户标识对应的分片标识中一 个分片标识, 将获取到的一个分片标识作为第一分片标识, 其中, 分片数据源对应关 系表还包含租户标识与分片标识的对应关系; 数据生成装置根据第一分片标识, 为客 户生成包含第一分片标识的客户标识, 以及根据第一分片标识, 为用户生成包含第一 分片标识的用户标识; 将资源号码与第一分片标识的对应关系添加到散号路由表中, 其中, 散号路由表包含分片标识与不归属于号段路由表的资源号码的对应关系, 以及 将客户的数据和用户的数据存储在第一分片标识对应的数据源中,以便于接入服务器 根据客户标识和 /或用户标识中包含的第一分片标识, 从第一分片标识对应的数据源 中获取客户的数据和 /或用户的数据。 In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes: obtaining, when the second fragment identifier is not found, the tenant identifier of the tenant to which the customer belongs; The generating device obtains, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table, and uses the obtained fragment identifier as the first fragment identifier, where the fragment data The source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier. The data generating device generates a client identifier including the first fragment identifier according to the first fragment identifier, and generates a user identifier according to the first fragment identifier. a user identifier including a first fragment identifier; adding a correspondence between the resource number and the first fragment identifier to the hash routing table, where the hash routing table includes a fragment identifier and a resource not belonging to the segment routing table The correspondence between the numbers, and storing the data of the customer and the data of the user in the data source corresponding to the first fragment identifier, so as to facilitate access According to customer service identifier and / or user identifier identifying a first slice included in the slice corresponding to the identifier from the first data source Get customer data and/or user data.
结合第一方面、第一方面的第一种可能、第二种可能、第三种可能或第四种可能 的实现方式, 在第一方面的第五种可能的实现方式中, 方法还包括: 数据生成装置根 据第一数据源标识, 从分片数据源对应关系表中, 获得第一数据源标识对应的所有的 分片标识; 根据搬迁要求, 从第一数据源标识对应的所有的分片标识中选择符合搬迁 要求的一个以上分片标识,并将在分片数据源对应关系表中一个以上分片标识的状态 均设定为搬迁状态,以便于禁止除数据生成装置之外的网元访问一个以上分片标识对 应的数据;数据生成装置将一个以上分片标识对应的第一数据源中的数据搬迁到第二 数据源中; 数据生成装置在分片数据源对应关系表中,删除第一数据源标识与一个以 上分片标识的对应关系; 数据生成装置在分片数据源对应关系表中,添加第二数据源 标识与一个以上分片标识的对应关系,并将一个以上分片标识的状态设定为非搬迁状 态, 以便于允许访问一个以上分片标识对应的数据。  With reference to the first aspect, the first possible, the second possible, the third possible or the fourth possible implementation of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes: The data generating device obtains all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table according to the first data source identifier; and identifies all the fragments corresponding to the first data source according to the relocation request. Select one or more fragment identifiers that meet the relocation requirements, and set the status of one or more fragment identifiers in the fragment data source correspondence table to the relocation status, so as to prohibit the network elements except the data generation device. Accessing data corresponding to one or more fragment identifiers; the data generating device relocates data in the first data source corresponding to one or more fragment identifiers to the second data source; and the data generating device deletes the data in the fragment data source correspondence table Corresponding relationship between the first data source identifier and one or more fragment identifiers; the data generating device adds a number in the fragment data source correspondence table Source identification data with more than one sub-identifier corresponding relationship between the sheet, and more than one fragment identified by the non-removal state setting state, in order to allow access to more than one fragment corresponding to the identification data.
第二方面、 一种数据操作方法, 包括: 接入服务器接收数据操作请求装置发送的 数据操作请求, 数据操作请求包含接入号码; 接入服务器根据接入号码, 获得接入号 码对应的客户分片的分片标识; 接入服务器根据接入号码对应的分片标识, 从分片数 据源对应关系表中, 获得与分片标识对应的数据源标识, 其中, 分片数据源对应关系 表保存分片标识与数据源标识;接入服务器将数据操作请求发送到获得的数据源标识 对应的数据源中; 接入服务器接收数据源发送的数据操作响应。  A second aspect, a data operation method, comprising: an access server receives a data operation request sent by a data operation requesting device, where the data operation request includes an access number; and the access server obtains a customer corresponding to the access number according to the access number The fragmentation identifier of the slice; the access server obtains the data source identifier corresponding to the fragment identifier from the fragment data source correspondence table according to the fragment identifier corresponding to the access number, where the fragment data source correspondence table is saved The fragmentation identifier and the data source identifier; the access server sends the data operation request to the data source corresponding to the obtained data source identifier; and the access server receives the data operation response sent by the data source.
在第二方面的第一种可能的实现方式中,根据接入号码, 获得接入号码对应的分 片标识, 具体包括: 当接入号码为客户标识或用户标识时, 获得客户标识或用户标识 包含的分片标识;当接入号码为资源号码时,根据用户的资源号码,在散号路由表中, 查找资源号码对应的分片标识,当查找到资源号码对应的分片标识时,获得分片标识; 当未查找到资源号码对应的分片标识时, 根据用户的资源号码, 在号段路由表中, 获 得资源号码所属号段对应的分片标识,其中, 散号路由表包含分片标识与不归属于号 段路由表的资源号码的对应关系,号段路由表包含分片标识与资源号码所属的号段范 围的对应关系。  In a first possible implementation manner of the second aspect, obtaining the fragment identifier corresponding to the access number according to the access number, specifically: when the access number is a customer identifier or a user identifier, obtaining the client identifier or the user identifier If the access number is a resource number, the number of the fragment corresponding to the resource number is found in the hash routing table according to the resource number of the user, and when the fragment identifier corresponding to the resource number is found, If the fragment identifier of the resource number is not found, the fragment identifier corresponding to the number segment of the resource number is obtained in the routing table according to the resource number of the user, where the scatter number routing table includes The correspondence between the slice identifier and the resource number that is not attributed to the routing table of the number segment, and the routing table of the number segment includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
第三方面、一种数据生成装置,装置包括获取模块、生成模块和存储模块,其中, 获取模块, 用于当客户订阅了一个业务时, 客户成为了业务的用户时, 确定客户已经 开户, 获得客户的客户标识中包含的第一分片标识, 其中, 第一分片标识为客户所属 客户分片的分片标识, 客户标识在客户生命周期内唯一标识客户, 客户生命周期指的 是从客户开户后到客户销户前的期间内; 获取模块,进一步用于向生成模块发送包含 第一分片标识的用户标识生成请求; 生成模块,用于接收获取模块发送包含第一分片 标识的用户标识生成请求, 并根据第一分片标识, 为用户生成包含第一分片标识的用 户标识,用户标识在用户生命周期内唯一标识用户,用户生命周期指的是从用户开户 后到用户销户前的期间内; 获取模块, 进一步用于根据第一分片标识, 从分片数据源 对应关系表,获得第一分片标识对应的数据源标识,并将数据源标识发送给存储模块; 存储模块,用于接收获取模块发送的数据源标识, 并将用户的数据存储在数据源标识 对应的数据源中, 以便于接入服务器根据用户标识中包含的第一分片标识, 从第一分 片标识对应的数据源中获取用户的数据,其中, 分片数据源对应关系表包含客户分片 的分片标识与数据源标识的对应关系。 In a third aspect, a data generating device includes: an obtaining module, a generating module, and a storage module, wherein the acquiring module is configured to: when the client subscribes to a service, when the client becomes a user of the service, determine that the client has opened an account and obtains The first fragment identifier included in the customer identifier of the customer, wherein the first fragment identifier is a fragment identifier of the customer fragment of the customer, the customer identifier uniquely identifies the customer during the customer life cycle, and the customer life cycle refers to the customer identifier After opening the account and before the customer cancels the account; the acquisition module is further used to send the inclusion to the generation module a user identifier generating request of the first fragment identifier; a generating module, configured to receive, by the acquiring module, a user identifier generating request that includes the first fragment identifier, and generate, according to the first fragment identifier, a first fragment identifier for the user The user identifier, the user identifier uniquely identifies the user during the life cycle of the user, and the user life cycle refers to the period from the time the user opens the account to the time before the user cancels the account; the obtaining module is further used to segment the data according to the first fragment identifier. The source correspondence table obtains the data source identifier corresponding to the first fragment identifier, and sends the data source identifier to the storage module. The storage module is configured to receive the data source identifier sent by the acquiring module, and store the user data in the data source. Identifying the corresponding data source, so that the access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier, where the fragment data source correspondence table includes Correspondence between the fragmentation identifier of the client fragment and the data source identifier.
在第三方面的第一种可能的实现方式中, 获取模块,进一步用于根据用户的资源 号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二分片标识, 并向存储 模块发送查询结果,其中, 号段路由表包含了分片标识与资源号码所属号段范围的对 应关系; 存储模块, 进一步用于接收获取模块发送的查询结果, 根据查询结果, 确定 查找不到第二分片标识, 或者查找到的第二分片标识与第一分片标识不一致时,将资 源号码与第一分片标识的对应关系添加到数据库中的散号路由表中,其中, 散号路由 表包含分片标识与不归属于号段路由表的资源号码的对应关系。  In a first possible implementation manner of the third aspect, the acquiring module is further configured to: search, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the number segment routing table, and The storage module sends the query result, where the number segment routing table includes the correspondence between the fragment identifier and the range of the number range of the resource number; the storage module is further configured to receive the query result sent by the obtaining module, and determine, according to the query result, that the query cannot be found. If the second fragment identifier is different from the first fragment identifier, the corresponding relationship between the resource number and the first fragment identifier is added to the scatter table in the database, where The routing table contains the correspondence between the fragment identifier and the resource number that is not attributed to the routing table of the segment.
在第三方面的第二种可能的实现方式中, 获取模块,进一步用于在客户订阅业务 之前, 客户还进行客户开户时, 获得客户所属租户标识, 根据租户标识, 从分片数据 源对应关系表中, 获取租户标识对应的分片标识中一个分片标识,将获取到的一个分 片标识作为第一分片标识,其中, 分片数据源对应关系表还包含租户标识与分片标识 的对应关系, 并向生成模块发送包含第一分片标识的客户标识生成请求; 生成模块, 用于接收获取模块发送的包含第一分片标识的客户标识生成请求, 根据第一分片标 识, 为客户生成包含第一分片标识的客户标识; 存储模块, 进一步用于从生成模块获 取到客户标识包含的第一分片标识,将客户的数据存储在第一分片标识对应的数据源 中, 以便于接入服务器根据客户标识中包含的第一分片标识, 从第一分片标识对应的 数据源中获取客户的数据。  In a second possible implementation manner of the third aspect, the acquiring module is further configured to: before the customer subscribes to the service, the customer also obtains the tenant identifier of the customer when the customer opens the account, and according to the tenant identifier, the corresponding relationship from the fragment data source In the table, a fragment identifier of the fragment identifier corresponding to the tenant identifier is obtained, and the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes the tenant identifier and the fragment identifier. Corresponding relationship, and sending a client identity generation request including a first fragment identifier to the generating module; the generating module, configured to receive a client identity generation request that includes the first fragment identifier sent by the acquiring module, according to the first fragment identifier, The client generates a customer identifier that includes the first fragment identifier; the storage module is further configured to obtain, from the generating module, the first fragment identifier included in the client identifier, and store the data of the client in the data source corresponding to the first fragment identifier, In order for the access server to be from the first fragment according to the first fragment identifier included in the customer identifier Source identification data corresponding to the acquired customer data.
在第三方面的第三种可能的实现方式中, 获取模块,进一步用于确定客户未开户 时, 根据用户的资源号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二 分片标识,并向生成模块发送包含查询得到的第二分片标识的用户标识生成请求和包 含查询得到的第二分片标识的客户标识生成请求,其中, 号段路由表包含了分片标识 与资源号码所属号段范围的对应关系; 生成模块,进一步用于接收获取模块发送的包 含第二分片标识的用户标识生成请求和包含第二分片标识的客户标识生成请求,根据 第二分片标识, 为客户生成包含第二分片标识的客户标识; 获取模块, 进一步用于根 据第二分片标识, 从分片数据源对应关系表, 获得第二分片标识对应的数据源标识, 并将数据源标识发送给存储模块; 存储模块,进一步用于将客户的数据存储在第二分 片标识对应的数据源中, 以便于接入服务器根据客户标识中包含的第二分片标识, 从 第二分片标识对应的数据源中获取客户的数据。 In a third possible implementation manner of the third aspect, the acquiring module is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, searching for the second corresponding to the range of the number segment of the resource number according to the routing table of the number segment The fragment identifier is sent to the generating module, and the user identifier generating request including the second fragment identifier obtained by the query and the client identifier generating request including the second fragment identifier obtained by the query are sent to the generating module, where the fragment routing table includes the fragment identifier Corresponding relationship with the range of the number of the resource number; the generating module is further configured to receive the packet sent by the acquiring module a user identifier generation request including a second fragment identifier and a client identifier generation request including a second fragment identifier, and generating, by the second fragment identifier, a client identifier including the second fragment identifier according to the second fragment identifier; the acquiring module, further used for Obtaining, according to the second fragment identifier, the data source identifier corresponding to the second fragment identifier from the fragment data source correspondence table, and sending the data source identifier to the storage module; the storage module is further configured to store the customer data in the The second fragment identifies the corresponding data source, so that the access server obtains the data of the client from the data source corresponding to the second fragment identifier according to the second fragment identifier included in the client identifier.
在第三方面的第四种可能的实现方式中, 获取模块,进一步用于确定客户未开户 时, 根据用户的资源号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二 分片标识, 其中, 号段路由表包含了分片标识与资源号码所属号段范围的对应关系, 当未查询到第二分片标识时, 获得客户所属租户的租户标识; 并根据租户标识, 从分 片数据源对应关系表中, 获取租户标识对应的分片标识中一个分片标识,将获取到的 一个分片标识作为第一分片标识,其中, 分片数据源对应关系表还包含租户标识与分 片标识的对应关系,以及向生成模块发送包含第一分片标识的用户标识生成请求和包 含第一分片标识的客户标识生成请求; 生成模块,进一步用于接收获取模块发送的包 含第一分片标识的用户标识生成请求和包含第一分片标识的客户标识生成请求,根据 第一分片标识, 为客户生成包含第一分片标识的客户标识; 存储模块, 进一步用于将 资源号码与第一分片标识的对应关系添加到散号路由表中,其中, 散号路由表包含分 片标识与不归属于号段路由表的资源号码的对应关系,以及将客户的数据存储在第一 分片标识对应的数据源中, 以便于接入服务器根据客户标识中包含的第一分片标识, 从第一分片标识对应的数据源中获取客户的数据。  In a fourth possible implementation manner of the third aspect, the acquiring module is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, searching for the second corresponding to the range of the number of the resource number from the number segment routing table The segment identifier, where the segment routing table includes the correspondence between the fragment identifier and the range of the number of the resource number. When the second fragment identifier is not queried, the tenant identifier of the tenant to which the client belongs is obtained; and according to the tenant identifier, Obtaining, from the fragment data source correspondence table, a fragment identifier in the fragment identifier corresponding to the tenant identifier, and obtaining a fragment identifier as the first fragment identifier, where the fragment data source correspondence table further includes Corresponding relationship between the tenant identifier and the fragment identifier, and sending a user identifier generation request including the first fragment identifier and a client identifier generation request including the first fragment identifier to the generating module; the generating module is further configured to receive the sending by the acquiring module User identification generation request including the first fragment identification and customer identification generation including the first fragment identification And obtaining, by the first fragment identifier, a customer identifier that includes the first fragment identifier for the client; the storage module is further configured to add the correspondence between the resource number and the first fragment identifier to the hash routing table, where The scatter number routing table includes the correspondence between the fragment identifier and the resource number not attributed to the segment routing table, and stores the data of the client in the data source corresponding to the first fragment identifier, so that the access server is configured according to the customer identifier. The first fragment identifier included, and the data of the client is obtained from the data source corresponding to the first fragment identifier.
在第三方面的第五种可能的实现方式中, 还包括: 搬迁模块, 用于根据第一数据 源标识, 从分片数据源对应关系表中, 获得第一数据源标识对应的所有的分片标识; 根据搬迁要求,从第一数据源标识对应的所有的分片标识中选择符合搬迁要求的一个 以上分片标识,并将在分片数据源对应关系表中一个以上分片标识的状态均设定为搬 迁状态, 以便于禁止除数据生成装置之外的网元访问一个以上分片标识对应的数据; 将一个以上分片标识对应的第一数据源中的数据搬迁到第二数据源中;在分片数据源 对应关系表中,删除第一数据源标识与一个以上分片标识的对应关系; 在分片数据源 对应关系表中,添加第二数据源标识与一个以上分片标识的对应关系, 并将一个以上 分片标识的状态设定为非搬迁状态, 以便于允许访问一个以上分片标识对应的数据。  In a fifth possible implementation manner of the third aspect, the method further includes: a relocation module, configured to obtain, according to the first data source identifier, all the points corresponding to the first data source identifier from the fragment data source correspondence table According to the relocation requirement, one or more fragment identifiers that meet the relocation requirements are selected from all the fragment identifiers corresponding to the first data source identifier, and one or more fragment identifiers in the fragment data source correspondence table are identified. The data in the first data source corresponding to one or more fragment identifiers is relocated to the second data source. In the fragment data source correspondence table, the correspondence between the first data source identifier and one or more fragment identifiers is deleted; in the fragment data source correspondence table, the second data source identifier and one or more fragment identifiers are added. Correspondence relationship, and set the state of one or more slice identifiers to a non-relocation state, so as to allow access to more than one slice identifier corresponding to Data.
第四方面, 一种接入服务器, 包括: 收发器和处理器, 其中, 收发器, 用于接收 数据操作请求装置发送的数据操作请求,数据操作请求包含接入号码, 并向处理器发 送接入号码; 处理器, 用于接收收发器发送的接入号码, 根据接入号码, 获得接入号 码对应的客户分片的分片标识; 并根据接入号码对应的分片标识, 从分片数据源对应 关系表中, 获得与分片标识对应的数据源标识, 并向收发器发送数据源标识, 其中, 分片数据源对应关系表保存分片标识与数据源标识; 收发器,进一步用于接收处理器 发送的数据源标识, 并将数据操作请求发送到数据源标识对应的数据源中, 以及接收 数据源发送的数据操作响应。 In a fourth aspect, an access server includes: a transceiver and a processor, where the transceiver is configured to receive a data operation request sent by a data operation requesting device, where the data operation request includes an access number, and sends the access number to the processor Sending an access number; a processor, configured to receive an access number sent by the transceiver, obtain a fragment identifier of the client fragment corresponding to the access number according to the access number; and according to the fragment identifier corresponding to the access number, The data source identifier corresponding to the fragment identifier is obtained, and the data source identifier is sent to the transceiver, where the fragment data source correspondence table holds the fragment identifier and the data source identifier; the transceiver, Further, the method is configured to receive a data source identifier sent by the processor, and send the data operation request to a data source corresponding to the data source identifier, and receive a data operation response sent by the data source.
在第四面的第一种可能的实现方式中, 处理器具体用于, 当接入号码为客户标识 或用户标识时,获得客户标识或用户标识包含的分片标识;当接入号码为资源号码时, 根据用户的资源号码, 在散号路由表中, 查找资源号码对应的分片标识, 当查找到资 源号码对应的分片标识时, 获得分片标识; 当未查找到资源号码对应的分片标识时, 根据用户的资源号码, 在号段路由表中, 获得资源号码所属号段对应的分片标识, 其 中, 散号路由表包含分片标识与不归属于号段路由表的资源号码的对应关系, 号段路 由表包含分片标识与资源号码所属的号段范围的对应关系。  In a first possible implementation manner of the fourth aspect, the processor is specifically configured to: when the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier; when the access number is a resource If the number is not the same as the resource number of the user, the shard ID corresponding to the resource number is found in the scatter number routing table. When the shard ID corresponding to the resource number is found, the shard ID is obtained. When the fragment is identified, the fragment identifier corresponding to the number segment to which the resource number belongs is obtained according to the resource number of the user, where the scatter number routing table includes the fragment identifier and the resource not attributed to the routing table of the number segment. The correspondence between the numbers and the number segment routing table includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
第五方面、 一种数据操作系统, 包括如第四方面或第四方面第一种可能, 第二种 可能,第三种可能,第四种可能或第五种可能的实现方式的任一数据生成装置和如第 五方面或第五方面第一种可能的任一接入服务器。  A fifth aspect, a data operating system, comprising any data of the fourth aspect or the fourth aspect, the first possibility, the second possibility, the third possibility, the fourth possible or the fifth possible implementation Generating the apparatus and any of the first possible access servers as in the fifth aspect or the fifth aspect.
本发明实施例中,由于数据生成装置生成的用户标识包含的第一分片标识和客户 标识包含的第一分片标识是相同, 以及同一分片标识对应了相同的数据源, 因此就可 以实现了同一个客户的不同用户的数据存储在相同的数据源,解决了跨数据源访问的 问题。 附图说明  In the embodiment of the present invention, the first fragment identifier included in the user identifier generated by the data generating device and the first fragment identifier included in the client identifier are the same, and the same fragment identifier corresponds to the same data source, so that the user identifier can be implemented. The data of different users of the same customer is stored in the same data source, which solves the problem of accessing across data sources. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现 有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings to be used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图 1A为一种本发明实施例应用的场景架构示意图;  FIG. 1A is a schematic diagram of a scenario structure applied to an embodiment of the present invention; FIG.
图 1B为本发明数据存储方法的一个实施例流程图:  FIG. 1B is a flowchart of an embodiment of a data storage method according to the present invention:
图 2为本发明数据存储方法的另一个实施例流程图;  2 is a flow chart of another embodiment of a data storage method according to the present invention;
图 3为本发明数据存储方法的另一个实施例流程图;  3 is a flow chart of another embodiment of a data storage method according to the present invention;
图 4为本发明数据搬迁方法的一个实施例流程图; 图 5为本发明数据操作方法的一个实施例流程图; 4 is a flow chart of an embodiment of a data relocation method according to the present invention; FIG. 5 is a flowchart of an embodiment of a data operation method according to the present invention; FIG.
图 6为本发明数据生成装置的一个实施例框图;  Figure 6 is a block diagram of an embodiment of a data generating apparatus of the present invention;
图 7为本发明数据生成装置的另一个实施例框图;  Figure 7 is a block diagram of another embodiment of a data generating apparatus of the present invention;
图 8为本发明接入服务器的一个实施例框图;  Figure 8 is a block diagram of an embodiment of an access server of the present invention;
图 9为本发明接入服务器的另一个实施例框图;  9 is a block diagram of another embodiment of an access server of the present invention;
图 10为本发明数据操作系统的一个实施例框图。 具体实施方式  Figure 10 is a block diagram of one embodiment of a data operating system of the present invention. detailed description
本发明如下实施例提供了数据存储方法和装置、数据操作方法、系统及接入服务 器。  The following embodiments of the present invention provide a data storage method and apparatus, a data operation method, a system, and an access server.
为了使本技术领域的人员更好地理解本发明实施例中的技术方案,并使本发明实 施例的上述目的、特征和优点能够更加明显易懂, 下面结合附图对本发明实施例中技 术方案作进一步详细的说明。  The above-mentioned objects, features, and advantages of the embodiments of the present invention will become more apparent and understood. Give further details.
首先介绍一下本发明实施例中的几个技术术语, 租户 (tenant) 指的是在某个区 域内, 提供通信服务的运营商, 比如: 北京电信为租户 1, 北京移动为租户 2, 北京 联通为租户 3。 客户 (customer) 指的是与租户签署协议, 已经订购或可能订购租户 提供的产品和服务的个人、 团体或者法人组织, 客户可以是个人客户 (consumer customer), 比如自然人; 客户还可以是集团客户(group customer), 比如: 家庭客户或 企业客户; 一个租户包含了多个客户, 在客户开户时, 数据生成装置为该客户生成客 户标识, 客户标识在客户生命周期内唯一标识该客户, 客户生命周期指的是从客户开 户后到该客户销户前的整个期间内,该客户标识包含了该客户所属客户分片的分片标 识。 当客户在租户处订阅了一个产品或服务后, 该客户即成为租户的一个用户 (subscriber), 当客户办理了多个产品或服务后, 该客户即成为租户的多个用户, 也就 是说一个客户可以对应多个用户, 每个用户都唯一对应的一个资源号码, 比如: 宽带 用户对应一个宽带号码, 手机用户对应一个手机号码, 在用户开户时, 客户确定一个 资源号码或者租户分配一个资源号码给该客户, 数据生成装置为该用户生成用户标 识,用户标识在用户生命周期内唯一标识该用户,用户生命周期指的是从用户开户后 到该用户销户前的整个期间内,该用户标识包含的分片标识与该用户所属客户的客户 标识包含的分片标识相同的。 比如: 某个家庭客户, 可以包含宽带用户, 固话用户以 及手机用户。 数据源, 用于存储客户数据和用户数据, 比如: 可以是数据库, 数据库 图表 (Schema) 或者数据库表 (table)。 在本发明实施例中, 事先定义了一个客户分 片, 每一个客户分片可以对应一定数量的客户, 客户分片的分片标识也可以称为客户 分区前缀 (Customer Partition Index, CPI), 然后可以分别为每一个客户分片分配一 个数据源, 这样后续包含该客户分片的分片标识的用户标识和 /或客户标识对应的数 据就可以存储在该分片标识对应的数据源中。其中, 每个数据源可以对应至少一个客 户分片。 客户分片同时与租户、 客户及数据源之间具有映射关系, 一个租户对应了一 个以上的客户分片, 而每一个客户分片对应的数据源可能是不同的, 比如: 客户分片 1对应的数据源 1, 客户分片 2对应的数据源 2。 First, several technical terms in the embodiments of the present invention are introduced. A tenant refers to an operator that provides communication services in a certain area, for example: Beijing Telecom is a tenant 1, Beijing Mobile is a tenant 2, Beijing Unicom For tenants 3. Customer (customer) refers to an individual, group or legal organization that has signed an agreement with a tenant and has ordered or may order products and services provided by the tenant. The customer may be a consumer customer, such as a natural person; the customer may also be a group customer. (group customer), for example: a household customer or a corporate customer; a tenant contains a plurality of customers. When the customer opens an account, the data generating device generates a customer identification for the customer, and the customer identification uniquely identifies the customer during the customer life cycle, the customer life The period refers to the fragmentation identifier of the customer segment to which the customer belongs, from the time the customer opens the account to the time before the customer is posted. When a customer subscribes to a product or service at a tenant, the customer becomes a subscriber of the tenant. When the customer has processed multiple products or services, the customer becomes a plurality of users of the tenant, that is, one The customer can correspond to multiple users, and each user has a unique resource number. For example, the broadband user corresponds to a broadband number, and the mobile phone user corresponds to a mobile phone number. When the user opens an account, the client determines a resource number or the tenant allocates a resource number. For the customer, the data generating device generates a user identifier for the user, and the user identifier uniquely identifies the user during the life cycle of the user, and the user life cycle refers to the user identifier from the time the user opens the account to the time before the user accounts for the user. The fragment ID contained is the same as the fragment ID contained in the customer ID of the customer to which the user belongs. For example: A home customer can include broadband users, fixed-line users, and mobile phone users. Data source, used to store customer data and user data, such as: can be a database, a database diagram (Schema) or a database table (table). In the embodiment of the present invention, a customer segment is defined in advance. Each client segment can correspond to a certain number of customers. The segmentation identifier of the client segment can also be called the Customer Partition Index (CPI), and then each data segment can be assigned to each client segment. The data corresponding to the user identifier and/or the customer identifier of the fragment identifier of the client fragment may be stored in the data source corresponding to the fragment identifier. Wherein, each data source can correspond to at least one client fragment. The customer shards have a mapping relationship with the tenant, the customer, and the data source. One tenant corresponds to more than one customer shard, and the data source corresponding to each customer shard may be different, for example: customer shard 1 corresponds Data source 1, customer fragment 2 corresponds to data source 2.
本发明实施例中,还介绍了几个关系表,基于客户分片与数据源之间的关系生成 的分片数据源对应关系表,该分片数据源对应关系表用于保存客户分片的分片标识与 数据源标识的对应关系,及分片标识与租户的租户标识之间的对应关系,其中每个数 据源标识对应至少一个分片标识, 以及每个租户标识对应至少一个分片标识,进一步 该分片数据源对应关系表还包含了分片标识状态和迁移目标数据源标识,用于系统对 路由数据按照客户分片进行搬迁时使用,其中, 分片标识状态可以为表示是否搬迁的 状态, 如分片标识状态为 0表示非搬迁状态, 分片标识状态为 1表示搬迁状态; 迁移 目标数据源标识为; 将路由数据迁移到的目标数据源的标识。号段路由表用于保存分 片标识与资源号码所归属的号段范围的对应关系,号段范围由起始号码和截止号码表 示, 即起始号码和截止号码之间的资源号码都属于该号段范围,这里的资源号码可以 是手机号码, 宽带号码或固定号码等。进一步该号段路由表中还可以包含与分片标识 对应的租户标识, 以及号段路由表的生效时间和失效时间。 散号路由表初始时为空, 后续在生成路由数据的过程中,散号路由表将用于保存分片标识与不归属于号段路由 表的资源号码的对应关系; 散号路由表进一步的包含了接入类型和接入号码,接入类 型包括了通过客户标识接入的类型,通过用户标识接入的类型, 或者通过资源号码接 入的类型, 接入号码可以是客户标识, 用户标识或资源号码, 以及散号路由表进一步 还包含散号路由表的生效时间和失效时间。上述分片数据源对应关系表、散号路由表 以及号段路由表均可以保存在数据生成装置的本地,也均可以单独保存在数据生成装 置之外的数据库中。  In the embodiment of the present invention, a relationship table is also introduced, and a segment data source correspondence table generated based on a relationship between a client fragment and a data source is used, and the fragment data source correspondence table is used to save the client fragment. The correspondence between the fragment identifier and the data source identifier, and the correspondence between the fragment identifier and the tenant identifier of the tenant, where each data source identifier corresponds to at least one fragment identifier, and each tenant identifier corresponds to at least one fragment identifier. Further, the fragment data source correspondence table further includes a fragment identification status and a migration target data source identifier, and is used by the system to relocate the routing data according to the customer fragment, wherein the fragment identification status may indicate whether to relocate The status of the fragment identification status is 0 for the non-relocation status, and the fragment identification status is 1 for the relocation status. The migration destination data source identifier is the identifier of the target data source to which the routing data is migrated. The segment routing table is used to store the correspondence between the fragment identifier and the range of the number to which the resource number belongs. The range of the number segment is represented by the start number and the cutoff number, that is, the resource number between the start number and the cutoff number belongs to the The range of the number, the resource number here can be a mobile phone number, a broadband number or a fixed number. Further, the routing table of the segment may further include a tenant identifier corresponding to the fragment identifier, and an effective time and an expiration time of the routing table of the segment. The scatter table is initially empty. In the process of generating routing data, the scatter table will be used to store the correspondence between the shard ID and the resource number not attributed to the hop routing table. The access type and the access number are included, and the access type includes the type of access by the customer identifier, the type of access by the user identifier, or the type of access by the resource number. The access number may be a customer identifier, and the user identifier. Or the resource number, and the scatter table further includes the effective time and expiration time of the scatter table. The above-mentioned fragment data source correspondence table, the scatter number routing table, and the segment routing table may be stored locally in the data generating device, or may be separately stored in a database other than the data generating device.
参见图 1A, 为一种本发明实施例应用的场景架构示意图:  FIG. 1A is a schematic diagram of a scenario architecture applied to an embodiment of the present invention:
图 1A中右侧示出了数据存储过程中涉及的网络实体, 包括数据生成装置, 以及 数据库;数据操作过程中涉及的网络实体,包括网关 GPRS支持节点(Gateway GPRS Support Node, GGSN)、 会话描述协议 (Session Description Protocol, SDP) 控制点、 接入服务器及数据库。 其中,数据生成装置通常可以设置在运营商的营业厅内; 数据库中设置了上述分 片数据源对应关系表, 号段路由表以及散号路由表。 The right side of Figure 1A shows the network entities involved in the data storage process, including the data generating device, and the database; the network entities involved in the data operation process, including the Gateway GPRS Support Node (GGSN), session description Session Description Protocol (SDP) Control Point, Access Server, and Database. The data generating device can be generally set in the operator's business hall; the above-mentioned fragment data source correspondence table, the segment routing table, and the scatter table are set in the database.
对于数据存储过程: 数据生成装置可以按照预先规划的客户分片,将分片标识与 数据源标识,及分片标识与租户的租户标识之间的对应关系保存到数据库中的分片数 据源对应关系表中,以及将分片标识与资源号码归属的号段范围的对应关系保存到数 据库中的号段路由表中; 当客户开户, 或者客户的用户开户, 或者客户与其用户同时 开户时,数据生成装置可以通过查找数据库中的分片数据源对应关系表, 或者号段路 由表为客户生成客户表示和为用户生成用户标识;数据生成装置可以将在生成路由数 据过程中获得的散号资源号码与分片标识的对应关系保存到散号路由表中。数据生成 装置的数据维护模块,还可以将客户的数据或用户的数据发送到分片标识对应的数据 源中。  For the data storage process: the data generating device may save the correspondence between the fragment identifier and the data source identifier, and the correspondence between the fragment identifier and the tenant's tenant identifier to the fragment data source in the database according to the pre-planned client fragment. In the relationship table, the correspondence between the fragment identifier and the range of the number of the resource number is saved in the number segment routing table in the database; when the customer opens an account, or the customer's user opens an account, or the customer opens an account with the user at the same time, the data The generating device may generate a customer representation for the client and generate a user identifier for the user by searching a fragment data source correspondence table in the database, or a segment routing table; the data generating device may obtain the scatter resource number obtained in the process of generating the routing data. The correspondence with the fragment identifier is saved in the scatter table. The data maintenance module of the data generating device can also send the data of the client or the data of the user to the data source corresponding to the fragment identifier.
GGSN或 SDP接收到数据操作请求后, 将该数据操作请求发送到接入服务器, 该数据操作请求可以查询数据请求, 或者增加数据请求, 或者删除数据请求等等, 接 入服务器获取到数据操作请求时,对该数据操作请求包含的接入号码,进行分析获得 分片标识, 并根据该分片标识查找数据库, 获得该分片标识对应的数据源标识, 并将 接入号码对应的业务路由到该数据源标识对应的数据源。  After receiving the data operation request, the GGSN or the SDP sends the data operation request to the access server, where the data operation request can query the data request, or add a data request, or delete the data request, etc., and the access server obtains the data operation request. The access number included in the data operation request is analyzed to obtain a fragment identifier, and the database is searched according to the fragment identifier, and the data source identifier corresponding to the fragment identifier is obtained, and the service corresponding to the access number is routed to The data source identifies the corresponding data source.
数据库可以为一个, 也可以为多个, 如果数据库为多个的时候, 各个数据库通过 数据同步保持的各种数据和路由表的一致性。数据库可以包含多个数据源,数据源也 可以独立的, 可以位置于数据库之外, 例如: 存储客户数据和用户数据的数据源可以 是位于数据库之外的独立的数据库。  The database can be one or more. If there are multiple databases, the consistency of various data and routing tables maintained by each database through data synchronization. The database can contain multiple data sources. The data sources can also be independent and can be located outside the database. For example: The data source that stores customer data and user data can be a separate database located outside the database.
下面结合上述内容对本发明数据存储方法和获取数据方法的实施例进行详细描 述。  The embodiments of the data storage method and the data acquisition method of the present invention are described in detail below in conjunction with the above.
参见图 1B, 为本发明数据存储方法的一个实施例流程图, 客户订阅了一个业务 时, 所述客户成为了所述业务的用户时, 包括:  Referring to FIG. 1B, it is a flowchart of an embodiment of a data storage method according to the present invention. When a client subscribes to a service, when the client becomes a user of the service, the method includes:
步骤 101 : 数据生成装置确定客户已经开户, 获得客户的客户标识中包含的第一 分片标识, 其中, 第一分片标识为客户所属客户分片的分片标识, 客户标识在客户生 命周期内唯一标识客户, 客户生命周期指的是从客户开户后到客户销户前的期间内; 本实施例中的客户已经开户, 并已经生成了该客户的客户标识,此时当客户订阅 了某个业务时, 该客户可以选择一个的资源号码或者租户分配一个资源号码给该客 户,此时数据生成装置获取客户标识中包含的第一分片标识,第一分片标识可以为客 户标识的前缀,也可以为客户标识的后缀,还可以为客户标识中特定的几个位置的数, 例如十八位客户标识的前五位数字为第一分片标识。 Step 101: The data generating apparatus determines that the customer has opened an account, and obtains a first fragmentation identifier included in the customer identifier of the customer, where the first fragmentation identifier is a fragmentation identifier of the customer fragment of the customer, and the customer identifier is in the customer life cycle. Uniquely identifies the customer. The customer life cycle refers to the period from the time the customer opens the account to the time the customer cancels the account. In this embodiment, the customer has opened an account and has generated the customer ID of the customer. At this time, the customer subscribes to a certain customer. During the service, the customer may select a resource number or the tenant allocates a resource number to the client. The data generating device obtains the first fragment identifier included in the client identifier, and the first fragment identifier may be a prefix of the client identifier. It can also be the suffix of the customer ID, or the number of specific locations in the customer ID. For example, the first five digits of the eighteen customer identification are the first fragment identification.
可选的: 在客户订阅业务之前, 方法还包括: 客户进行开户时, 获得客户所属租 户标识; 数据生成装置根据租户标识, 从分片数据源对应关系表中, 获取租户标识对 应的分片标识中一个分片标识, 将获取到的一个分片标识作为第一分片标识, 其中, 分片数据源对应关系表还包含租户标识与分片标识的对应关系;数据生成装置根据第 一分片标识, 为客户生成包含第一分片标识的客户标识, 并将客户的数据存储在第一 分片标识对应的数据源中, 以便于接入服务器根据客户标识中包含的第一分片标识, 从第一分片标识对应的数据源中获取客户的数据。  Optional: Before the customer subscribes to the service, the method further includes: obtaining, by the customer, the tenant identifier of the customer when the account is opened; the data generating device obtains the fragment identifier corresponding to the tenant identifier from the correspondence data source correspondence table according to the tenant identifier a fragment identifier, the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier; and the data generating device is configured according to the first fragment. And identifying, by the customer, the customer identifier that includes the first fragment identifier, and storing the data of the client in the data source corresponding to the first fragment identifier, so that the access server is configured according to the first fragment identifier included in the client identifier. The customer's data is obtained from the data source corresponding to the first fragment identification.
步骤 102: 数据生成装置根据第一分片标识, 为用户生成包含第一分片标识的用 户标识,用户标识在用户生命周期内唯一标识用户,用户生命周期指的是从用户开户 后到用户销户前的期间内。  Step 102: The data generating device generates, according to the first fragment identifier, a user identifier that includes the first fragment identifier, where the user identifier uniquely identifies the user during the user lifetime, and the user life cycle refers to the user after the account is opened to the user. During the period before the household.
步骤 103 : 数据生成装置根据第一分片标识, 从分片数据源对应关系表, 获得第 一分片标识对应的数据源标识; 并将用户的数据存储在数据源标识对应的数据源中, 以便于接入服务器根据用户标识中包含的第一分片标识,从第一分片标识对应的数据 源中获取用户的数据,其中, 分片数据源对应关系表包含客户分片的分片标识与数据 源标识的对应关系。  Step 103: The data generating device obtains, according to the first fragment identifier, the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table, and stores the user data in the data source corresponding to the data source identifier. The access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier, where the fragment data source correspondence table includes the fragment identifier of the client fragment. Correspondence with the data source identifier.
可选的, 数据生成装置根据用户的资源号码, 从号段路由表中, 查找资源号码所 属号段范围对应的第二分片标识,其中, 号段路由表包含了分片标识与资源号码所属 号段范围的对应关系; 确定查找不到第二分片标识, 或者查找到的第二分片标识与第 一分片标识不一致时,数据生成装置将资源号码与第一分片标识的对应关系添加到数 据库中的散号路由表中,其中, 散号路由表包含分片标识与不归属于号段路由表的资 源号码的对应关系。  Optionally, the data generating device searches, according to the resource number of the user, the second fragment identifier corresponding to the range of the number range of the resource number from the routing table of the number segment, where the routing table includes the fragment identifier and the resource number. Corresponding relationship between the range of the number of segments; determining that the second fragment identifier is not found, or the second fragment identifier that is found is inconsistent with the first fragment identifier, the correspondence between the resource number and the first fragment identifier by the data generating device Add to the scatter table in the database, where the scatter table contains the correspondence between the shard ID and the resource number that is not attributed to the hop routing table.
可选的, 数据生成装置确定客户未开户时, 根据用户的资源号码, 从号段路由表 中, 查找资源号码所属号段范围对应的第二分片标识, 其中, 号段路由表包含了分片 标识与资源号码所属号段范围的对应关系; 数据生成装置当查找到第二分片标识时, 根据第二分片标识, 为客户生成包含第二分片标识的客户标识, 以及根据第二分片标 识, 为用户生成包含第二分片标识的用户标识, 以及将客户的数据和用户的数据存储 在第二分片标识对应的数据源中, 以便于接入服务器根据客户标识和 /或用户标识中 包含的第二分片标识, 从第二分片标识对应的数据源中获取客户的数据和 /或用户的 数据。  Optionally, the data generating device determines, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs according to the resource number of the user, where the routing table of the number segment includes Corresponding relationship between the slice identifier and the range of the number of the resource number; when the second fragment identifier is found, the data generating device generates a customer identifier including the second fragment identifier for the client according to the second fragment identifier, and according to the second a fragment identifier, generating a user identifier including a second fragment identifier for the user, and storing the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the client identifier and/or The second fragment identifier included in the user identifier acquires data of the client and/or data of the user from a data source corresponding to the second fragment identifier.
可选的, 当未查找到第二分片标识时, 获得客户所属租户的租户标识; 数据生成 装置根据租户标识, 从分片数据源对应关系表中, 获取租户标识对应的分片标识中一 个分片标识, 将获取到的一个分片标识作为第一分片标识, 其中, 分片数据源对应关 系表还包含租户标识与分片标识的对应关系; 数据生成装置根据第一分片标识, 为客 户生成包含第一分片标识的客户标识, 以及根据第一分片标识, 为用户生成包含第一 分片标识的用户标识; 将资源号码与第一分片标识的对应关系添加到散号路由表中, 其中, 散号路由表包含分片标识与不归属于号段路由表的资源号码的对应关系, 以及 将客户的数据和用户的数据存储在第一分片标识对应的数据源中,以便于接入服务器 根据客户标识和 /或用户标识中包含的第一分片标识, 从第一分片标识对应的数据源 中获取客户的数据和 /或用户的数据。 Optionally, when the second fragment identifier is not found, obtaining the tenant identifier of the tenant to which the client belongs; data generation The device obtains a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table according to the tenant identifier, and uses the obtained fragment identifier as the first fragment identifier, where the fragment data source is The correspondence relationship table further includes a correspondence between the tenant identifier and the fragment identifier. The data generating device generates a client identifier including the first fragment identifier for the client according to the first fragment identifier, and generates the inclusion for the user according to the first fragment identifier. a user identifier of the first fragment identifier; adding a correspondence between the resource number and the first fragment identifier to the scatter number routing table, where the scatter number routing table includes the fragment identifier and the resource number not attributed to the segment routing table Corresponding relationship, and storing the data of the client and the data of the user in the data source corresponding to the first fragment identifier, so that the access server according to the first fragment identifier included in the customer identifier and/or the user identifier, from the first A slice identifies the data of the customer and/or the data of the user in the corresponding data source.
可选的, 数据生成装置根据第一数据源标识, 从分片数据源对应关系表中, 获得 第一数据源标识对应的所有的分片标识; 根据搬迁要求, 从第一数据源标识对应的所 有的分片标识中选择符合搬迁要求的一个以上分片标识,并将在分片数据源对应关系 表中一个以上分片标识的状态均设定为搬迁状态,以便于禁止除数据生成装置之外的 网元访问一个以上分片标识对应的数据;数据生成装置将一个以上分片标识对应的第 一数据源中的数据搬迁到第二数据源中; 数据生成装置在分片数据源对应关系表中, 删除第一数据源标识与一个以上分片标识的对应关系;数据生成装置在分片数据源对 应关系表中,添加第二数据源标识与一个以上分片标识的对应关系, 并将一个以上分 片标识的状态设定为非搬迁状态, 以便于允许访问一个以上分片标识对应的数据。  Optionally, the data generating device obtains, according to the first data source identifier, all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table; and corresponding to the first data source identifier according to the relocation request Select one or more fragment identifiers that meet the relocation requirements in all the fragment identifiers, and set the status of one or more fragment identifiers in the fragment data source correspondence table to the relocation status, so as to prohibit the data generation device from being disabled. The outer network element accesses data corresponding to one or more fragment identifiers; the data generating device relocates data in the first data source corresponding to one or more fragment identifiers to the second data source; and the data generation device corresponds to the fragment data source In the table, the correspondence between the first data source identifier and one or more fragment identifiers is deleted, and the data generating device adds a correspondence between the second data source identifier and one or more fragment identifiers in the fragment data source correspondence table, and The status of one or more fragment identifiers is set to a non-relocation state, so as to allow access to the number corresponding to one or more fragment identifiers. according to.
参见图 2, 为本发明数据存储方法的另一个实施例流程图, 包括:  Referring to FIG. 2, it is a flowchart of another embodiment of a data storage method according to the present invention, including:
步骤 201 : 当客户开户时, 数据生成装置获得客户所属租户的租户标识; 客户选定一个租户后,在该租户下进行客户开户, 因此数据生成装置自然获得了 客户所属租户的租户标识。  Step 201: When the customer opens an account, the data generating device obtains the tenant identifier of the tenant to which the customer belongs; after the customer selects a tenant, the customer opens the account under the tenant, so the data generating device naturally obtains the tenant identifier of the tenant to which the customer belongs.
步骤 202: 数据生成装置获取租户标识对应的分片标识中一个分片标识, 将获取 到的一个分片标识作为第一分片标识。  Step 202: The data generating device acquires a fragment identifier in the fragment identifier corresponding to the tenant identifier, and uses the obtained fragment identifier as the first fragment identifier.
数据生成装置可以随机的从所有分片标识中选择一个分片标识,也可以根据客户 的属性, 确定对数据源的要求, 然后选择一个符合要求的数据源, 以及从分片数据源 对应关系表中, 确定该数据源的数据源标识对应的分片标识。例如: 数据生成装置识 别该客户是重要客户,其客户数据的安全性要求的等级为最高级, 则从多个数据源中 选择最高级的安全性的数据源存储该分片标识对应的客户的数据或用户的数据,并从 分片数据源对应关系表中, 确定该数据源的数据源标识对应的分片标识。  The data generating device may randomly select one fragment identifier from all the fragment identifiers, or determine the requirements of the data source according to the attributes of the client, and then select a data source that meets the requirements, and the correspondence table from the fragment data source. The segment identifier corresponding to the data source identifier of the data source is determined. For example: the data generating device identifies that the customer is an important customer, and the security requirement level of the customer data is the highest level, and selects the highest-level security data source from the plurality of data sources to store the customer corresponding to the fragment identifier. Data or user data, and from the fragment data source correspondence table, determine the fragment identifier corresponding to the data source identifier of the data source.
步骤 203 : 数据生成装置根据第一分片标识, 为该客户生成包含第一分片标识的 客户标识, 并将该客户的数据存储在第一分片标识对应的数据源中, 该客户标识为该 客户生命周期内唯一标识该客户,客户生命周期为从客户开户后到客户销户前的整个 期间内。 Step 203: The data generating apparatus generates, according to the first fragment identifier, a first fragment identifier for the client. The customer identifier is stored in the data source corresponding to the first fragmentation identifier, and the customer identifier is the unique identifier of the customer during the life cycle of the customer, and the customer life cycle is from the time the customer opens the account to the time before the customer cancels the account. Throughout the period.
在本发明的各个实施例中,第一分片标识可以作为客户标识的前缀, 也可以作为 客户标识的后缀, 还可以作为客户标识的特定的几位数字, 比如: 客户标识为 18位 号码, 第 1-4位为第一分片标识, 第 5位为类型标志, 比如, 类型标志位 0表示客户 标识, 第 6-18位为按一定规则生成的序列号。  In various embodiments of the present invention, the first fragment identifier may be used as a prefix of the customer identifier, or may be used as a suffix of the customer identifier, and may also be a specific digit of the customer identifier, for example, the customer identifier is an 18-digit number. The first 1-4 bits are the first slice identifier, and the fifth bit is the type flag. For example, the type flag bit 0 indicates the client identifier, and the 6-18 bits are the sequence numbers generated according to certain rules.
这里的客户的数据可以是客户标识,客户开户时留下的客户姓名,客户家庭地址, 客户工作单位等等。  The customer's data here can be the customer identification, the customer's name left by the customer when opening the account, the customer's home address, the customer's work unit, and so on.
在客户已经开户后, 该客户的用户开户时的数据存储过程包括:  After the customer has opened an account, the data storage process of the customer's user when opening an account includes:
步骤 204: 当客户订阅某个业务时, 即该客户成为了该业务的用户时时, 数据生 成装置获得该客户的客户标识中包含的第一分片标识。  Step 204: When the client subscribes to a certain service, that is, when the customer becomes a user of the service, the data generating device obtains the first fragment identifier included in the customer identifier of the customer.
客户订阅某个业务时,客户可以选择一个资源号码或者租户分片一个资源号码给 用户所使用,例如:手机号码, 宽带号码或客户识别模块(Subscriber Identity Module, SIM) 卡号等。  When a customer subscribes to a service, the customer can select a resource number or a tenant to slice a resource number for the user, such as a mobile phone number, a broadband number, or a Subscriber Identity Module (SIM) card number.
步骤 205: 根据获得的第一分片标识数据生成装置, 为用户生成包含该第一分片 标识的用户标识, 并将用户的数据保存在该第一分片标识对应的数据源中, 以便于接 入服务器根据用户标识中包含的第一分片标识,从第一分片标识对应的数据源中获取 用户的数据。  Step 205: Generate, according to the obtained first fragment identification data generating device, a user identifier that includes the first fragment identifier, and save the user data in a data source corresponding to the first fragment identifier, so as to facilitate The access server obtains data of the user from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier.
用户的数据可以包括资源号码, 用户的业务类型, 业务的资费类型, 用户的业务 的有效期等等。  The user's data may include the resource number, the type of service of the user, the type of the service, the validity period of the user's business, and the like.
在本发明的各个实施例中,第一分片标识可以是用户标识的前缀, 也可以是用户 标识的后缀, 还可以是用户标识的特定的几位数字, 比如: 用户标识为 18位号码, 第 1-4位为第一分片标识, 第 5位为类型标志, 比如, 类型标志位 1表示用户标识, 第 6-18位为按一定规则生成的序列号, 或者该用户的资源号码。  In various embodiments of the present invention, the first fragment identifier may be a prefix of the user identifier, or may be a suffix of the user identifier, or may be a specific digit of the user identifier, for example, the user identifier is an 18-digit number. The first 1-4 bits are the first fragment identification, and the fifth digit is the type identifier. For example, the type flag bit 1 indicates the user identifier, the 6-18 bits are the sequence number generated according to a certain rule, or the resource number of the user.
步骤 206: 根据用户的资源号码, 从号段路由表中, 数据生成装置查找资源号码 所属号段范围对应的第二分片标识。  Step 206: According to the resource number of the user, the data generating device searches for the second fragment identifier corresponding to the range of the number segment of the resource number.
步骤 207: 如果数据生成装置查找不到第二分片标识, 或者如果数据生成装置查 找到的第二分片标识与第一分片标识不一致时,数据生成装置将在散号路由表中保存 资源号码与第一分片标识的对应关系。  Step 207: If the data generating device does not find the second fragment identifier, or if the second fragment identifier found by the data generating device is inconsistent with the first fragment identifier, the data generating device saves the resource in the hash routing table. The correspondence between the number and the first fragment ID.
例如当用户携号转网, 从一个租户转到另一租户时, 号段路由表中任意一个号段 范围都没有包含该资源号码。 或者当号段路由表中某个号段范围包含了该资源号码, 则获得该号段范围对应的第二分片标识, 即第二 CPI。 由于在进行客户开户时, 选择 的第一分片标识与根据资源号码查找到的第二分片标识可能存在不同,因此数据生成 装置还需要判断查找到的第二分片标识与第一分片标识是否一致,如果数据生成装置 查找到的第二分片标识与第一分片标识不一致时,数据生成装置将在散号路由表中保 存资源号码与第一分片标识的对应关系,此后该资源号码对应的分片标识就是第一分 片标识, 因此后续接入服务器在通过资源号码来查找用户对应的分片标识, 需要首先 从散号路由表进行查找,其次才从号段路由表中进行查找, 如果数据生成装置查找到 的第二分片标识与第一分片标识一致时,由于号段路由表已经预先保存了该资源号码 所属的号段范围与第一分片标识的对应关系,因此数据生成装置就无需在号段路由表 中保存该资源号码所属的号段范围与第一分片标识的对应关系。 For example, when a user transfers a number to another tenant, the number of segments in the routing table is The resource number is not included in the scope. Or the second fragment identifier corresponding to the range of the number segment, that is, the second CPI, is obtained when the range of the number of the segment number includes the resource number. The data generating apparatus needs to determine the second fragment identifier and the first fragment that are found because the first fragment identifier selected may be different from the second fragment identifier that is found according to the resource number when the client opens the account. If the identifier is consistent, if the second fragment identifier found by the data generating device is inconsistent with the first fragment identifier, the data generating device saves the correspondence between the resource number and the first fragment identifier in the hash routing table, and thereafter The fragment identifier corresponding to the resource number is the first fragment identifier. Therefore, the subsequent access server searches for the fragment identifier corresponding to the user by using the resource number, and needs to first search from the hash table, and then the slave segment routing table. If the second fragment identifier that is found by the data generating device is consistent with the first fragment identifier, the correspondence between the range of the number segment to which the resource number belongs and the first fragment identifier is pre-stored. Therefore, the data generating device does not need to save the range of the number segment to which the resource number belongs and the first fragment identifier in the routing table. Correspondence relationship.
参见图 3, 为本发明数据存储方法的另一个实施例流程图, 该实施例示出了客户 开户是同时, 该客户的订阅了某个业务时, 即该客户成为了该业务的用户, 数据存储 过程:  Referring to FIG. 3, it is a flowchart of another embodiment of a data storage method according to the present invention. The embodiment shows that when a customer accounts for a service, the customer subscribes to a certain service, that is, the customer becomes a user of the service, and the data storage. Process:
步骤 301 : 根据用户的资源号码, 从号段路由表中, 查找资源号码所属号段范围 对应的第二分片标识。  Step 301: According to the resource number of the user, look up the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the routing table of the number segment.
步骤 302: 判断是否查找到第二分片标识, 当查找到第二分片标识时, 执行步骤 303 , 当没有查找到第二分片标识时, 执行步骤 304。  Step 302: Determine whether the second fragment identifier is found. When the second fragment identifier is found, step 303 is performed. When the second fragment identifier is not found, step 304 is performed.
步骤 303 : 当查找到第二分片标识时, 根据第二分片标识, 为客户生成包含第二 分片标识的客户标识, 以及根据第二分片标识, 为用户生成包含第二分片标识的用户 标识, 以及将客户的数据和用户的数据存储在第二分片标识对应的数据源中, 以便于 接入服务器根据客户标识和 /或用户标识中包含的第二分片标识, 从第二分片标识对 应的数据源中获取客户的数据和 /或用户的数据。  Step 303: When the second fragment identifier is found, generate a client identifier that includes the second fragment identifier for the client according to the second fragment identifier, and generate a second fragment identifier for the user according to the second fragment identifier. a user identifier, and storing the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the second fragment identifier included in the customer identifier and/or the user identifier. The data source of the customer and/or the data of the user are obtained from the data source corresponding to the two-slice identification.
步骤 304: 当未查找到第二分片标识时, 获得客户所属租户的租户标识。  Step 304: When the second fragment identifier is not found, obtain the tenant identifier of the tenant to which the client belongs.
例如当用户携号转网, 从一个租户转到另一租户时, 号段路由表中任意一个号段 范围都没有包含该资源号码。  For example, when a user transfers a number to a tenant and transfers from one tenant to another tenant, the range of any number in the routing table of the number segment does not include the resource number.
步骤 305-步骤 307: 分别与步骤 202-204相同, 在此不再赘述。  Step 305-step 307: The same as steps 202-204, and details are not described herein again.
步骤 308: 数据生成装置根据第一分片标识, 为用户生成包含第一分片标识的用 户标识, 并在散号路由表中保存资源号码与第一分片标识的对应关系, 以及将用户的 数据存储在第一分片标识对应的数据源中,以便于接入服务器根据用户标识中包含的 第一分片标识, 从第一分片标识对应的数据源中获取用户的数据。 由上述图 IB至图 3示出的实施例可见, 由于客户标识与用户标识包含了相同的 客户分片的分片标识, 而一个分片对应的是一个数据源, 因此可以将客户的数据和用 户的数据都存储在相同的数据源中。并且可以根据客户的属性,确定对数据源的要求, 从而可以为客户和用户灵活的分配符合要求的数据源。 Step 308: The data generating apparatus generates a user identifier including the first fragment identifier for the user according to the first fragment identifier, and saves the correspondence between the resource number and the first fragment identifier in the hash routing table, and the user's The data is stored in the data source corresponding to the first fragment identifier, so that the access server obtains the data of the user from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier. As can be seen from the embodiment shown in FIG. 1B to FIG. 3, since the customer identifier and the user identifier include the same fragmentation identifier of the client fragment, and one fragment corresponds to a data source, the data of the client can be User data is stored in the same data source. And according to the attributes of the customer, the requirements of the data source can be determined, so that the data source that meets the requirements can be flexibly allocated to the customer and the user.
参见图 4, 基于图 1B-3 的数据存储的任一方法实施例, 为本发明数据迁移方法 的一个实施例流程图, 该实施例示出了以客户分片为单位进行数据迁移的过程: 步骤 401 : 数据生成装置根据第一数据源标识, 从分片数据源对应关系表中, 获 得第一数据源标识对应的所有的分片标识。  Referring to FIG. 4, any method embodiment of data storage based on FIG. 1B-3 is a flowchart of an embodiment of a data migration method according to the present invention. The embodiment shows a process of data migration in units of client shards: 401: The data generating device obtains, according to the first data source identifier, all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table.
例如: 当第一数据源所包含的客户的数据和用户的数据不断增加, 则该第一数据 源的基础资源可能无法支撑其下的所有客户,此时需要将第一数据源下的部分数据搬 迁到第二数据源上,本发明实施例中由于对客户进行了分片, 因此可以以客户分片为 单位进行数据搬迁迁移。  For example: When the data of the customer and the data of the user included in the first data source are continuously increased, the basic resource of the first data source may not be able to support all the customers under it, and some data under the first data source is needed. After being relocated to the second data source, in the embodiment of the present invention, since the customer is fragmented, the data relocation and migration can be performed in units of customer fragments.
步骤 402: 根据搬迁要求, 从第一数据源标识对应的所有的分片标识中选择符合 搬迁要求的一个以上分片标识,并将在分片数据源对应关系表中一个以上分片标识的 状态设定为搬迁状态,以便于禁止除数据生成装置之外的网元访问一个以上分片标识 对应的数据。  Step 402: According to the relocation request, select one or more fragment identifiers that meet the relocation requirement from all the fragment identifiers corresponding to the first data source identifier, and set the status of one or more fragment identifiers in the fragment data source correspondence table. It is set to the relocation state, so that the network element other than the data generating device is prohibited from accessing data corresponding to one or more fragment identifiers.
例如: 可以要求搬迁第一数据源的占用资源超过第一数据源资源 1%的客户分片 对应的数据进行搬迁, 或者可以要求搬迁第一数据源中的重要客户的数据等等, 或者 可以要求随机搬迁所有分片标识中的一半的分片标识对应的数据。  For example, the data corresponding to the customer segment of the first data source that exceeds 1% of the data source may be relocated, or the data of the important customer in the first data source may be requested to be relocated, or may be required. Randomly relocate the corresponding data of half of the fragment IDs of all the fragment identifiers.
当根据搬迁要求, 从第一数据源标识对应的所有的分片标识中,选择出符合要求 的 1个或多个分片标识时,需要分别将分片数据源对应关系表中一个以上分片标识的 状态设定为搬迁状态。  When one or more fragment identifiers that meet the requirements are selected from all the fragment identifiers corresponding to the first data source identifier according to the relocation request, one or more fragments in the corresponding data source correspondence table need to be separately selected. The status of the logo is set to the relocation status.
步骤 403 : 将一个以上分片标识对应的第一数据源中的数据搬迁到第二数据源 中。  Step 403: Relocate data in the first data source corresponding to one or more slice identifiers to the second data source.
步骤 404: 在分片数据源对应关系表中, 删除第一数据源标识与一个以上分片标 识的对应关系; 在分片数据源对应关系表中,添加第二数据源标识与一个以上分片标 识的对应关系, 并将一个以上分片标识的状态设定为非搬迁状态, 以便于允许网元访 问一个以上分片标识对应的数据。  Step 404: In the fragment data source correspondence table, delete the correspondence between the first data source identifier and one or more fragment identifiers. In the fragment data source correspondence table, add the second data source identifier and one or more fragments. Corresponding relationship of the identifiers, and setting the status of one or more fragment identifiers to a non-relocation state, so as to allow the network element to access data corresponding to more than one fragment identifier.
由上述实施例可见, 在进行数据迁移时, 由于资源号码、 客户标识和用户标识与 分片标识的对应关系无需做改动,仅需修改搬迁的客户分片的分片标识与数据源标识 的映射关系即可, 而分片标识与数据源标识的映射关系数据量很小, 因此在搬迁时减 少了路由数据的修改, 并且搬迁的客户分片不影响其他客户分片的业务, 因此降低了 客户搬迁的复杂度。 It can be seen from the foregoing embodiment that, in the data migration, since the correspondence between the resource number, the customer identifier, the user identifier, and the fragment identifier does not need to be changed, only the mapping of the fragment identifier and the data source identifier of the relocated client fragment needs to be modified. The relationship is OK, and the mapping relationship between the fragment identifier and the data source identifier is small, so it is reduced during the relocation. There is less modification of routing data, and the relocated customer shards do not affect the business of other customer shards, thus reducing the complexity of customer relocation.
参见图 5, 为本发明数据操作方法的实施例流程图, 该实施例基于前述图 1-3的 任一数据存储方法实施例:  Referring to FIG. 5, it is a flowchart of an embodiment of a data operation method according to the present invention. The embodiment is based on any of the foregoing data storage method embodiments of FIG.
步骤 501 : 接入服务器接收数据操作请求装置发送的数据操作请求, 数据操作请 求包含接入号码。  Step 501: The access server receives a data operation request sent by the data operation requesting device, and the data operation request includes an access number.
数据操作请求装置可以是 GGSN, 也可以是 SDP等其他接入装置。  The data operation requesting device may be a GGSN or another access device such as an SDP.
步骤 502:接入服务器根据接入号码,获得接入号码对应的客户分片的分片标识。 当接入号码为客户标识或用户标识时, 获得客户标识或用户标识包含的分片标 识;  Step 502: The access server obtains a fragment identifier of the client fragment corresponding to the access number according to the access number. When the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier;
当接入号码为资源号码时, 根据用户的资源号码, 在散号路由表中, 查找资源号 码对应的分片标识, 当查找到资源号码对应的分片标识时, 获得分片标识; 当未查找 到资源号码对应的分片标识时, 根据用户的资源号码, 在号段路由表中, 获得资源号 码所属号段对应的分片标识,其中, 散号路由表包含分片标识与不归属于号段路由表 的资源号码的对应关系,号段路由表包含分片标识与资源号码所属的号段范围的对应 关系。  When the access number is the resource number, the fragment identifier corresponding to the resource number is searched in the hash routing table according to the resource number of the user, and the fragment identifier is obtained when the fragment identifier corresponding to the resource number is found; When the fragment identifier corresponding to the resource number is found, the fragment identifier corresponding to the number segment to which the resource number belongs is obtained according to the resource number of the user, where the scatter number routing table includes the fragment identifier and the non-attribute to The correspondence between the resource numbers of the routing table of the number segment, and the routing table of the number segment includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
步骤 503 : 接入服务器根据接入号码对应的分片标识, 从分片数据源对应关系表 中, 获得与分片标识对应的数据源标识, 其中, 分片数据源对应关系表保存分片标识 与数据源标识。  Step 503: The access server obtains a data source identifier corresponding to the fragment identifier from the fragment data source correspondence table according to the fragment identifier corresponding to the access number, where the fragment data source correspondence table holds the fragment identifier. With the data source ID.
步骤 504: 接入服务器将数据操作请求发送到获得的数据源标识对应的数据源 中。  Step 504: The access server sends a data operation request to the data source corresponding to the obtained data source identifier.
步骤 505 : 接入服务器接收数据源发送的数据操作响应。  Step 505: The access server receives a data operation response sent by the data source.
由上述实施例可见,在按照本发明实施例生成的路由数据进行路由时, 实现了多 种接入号码的快速路由, 提高了路由的灵活性。  It can be seen from the foregoing embodiment that when routing data generated according to an embodiment of the present invention is routed, fast routing of multiple access numbers is implemented, and routing flexibility is improved.
与本发明数据存储方法和数据操作方法的实施例相对应,本发明还提供了数据生 成装置、 系统及接入服务器的实施例。 参见图 6, 基于上述图 1B-5 的方法实施例, 为本发明数据生成装置的一个实施 例框图:  Corresponding to embodiments of the data storage method and data manipulation method of the present invention, the present invention also provides an embodiment of a data generation apparatus, system, and access server. Referring to FIG. 6, based on the method embodiment of FIG. 1B-5 above, a block diagram of an embodiment of the data generating apparatus of the present invention is shown:
该装置包括: 装置包括获取模块 610、 生成模块 620和存储模块 630, 其中, 获取模块 610, 用于当客户订阅了一个业务时, 客户成为了业务的用户时, 确定 客户已经开户, 获得客户的客户标识中包含的第一分片标识, 其中, 第一分片标识为 客户所属客户分片的分片标识, 客户标识在客户生命周期内唯一标识客户, 客户生命 周期指的是从客户开户后到客户销户前的期间内; The device includes: an apparatus comprising: an obtaining module 610, a generating module 620, and a storage module 630, wherein the obtaining module 610 is configured to: when the client subscribes to a service, when the client becomes a user of the service, determine The customer has opened an account and obtained the first fragmentation identifier included in the customer's customer identification. The first fragmentation identifier is the fragmentation identifier of the customer's customer segment. The customer identifier uniquely identifies the customer during the customer's life cycle. Refers to the period from the time the customer opens the account to the time before the customer cancels the account;
获取模块 610, 进一步用于向生成模块 620发送包含第一分片标识的用户标识生 成请求;  The obtaining module 610 is further configured to send, to the generating module 620, a user identifier generating request that includes the first fragment identifier;
生成模块 620, 用于接收获取模块 610发送包含第一分片标识的用户标识生成请 求, 并根据第一分片标识, 为用户生成包含第一分片标识的用户标识, 用户标识在用 户生命周期内唯一标识用户,用户生命周期指的是从用户开户后到用户销户前的期间 内;  The generating module 620 is configured to receive the user identifier generating request that includes the first fragment identifier, and generate, according to the first fragment identifier, a user identifier that includes the first fragment identifier, where the user identifier is in the user life cycle. The user is uniquely identified, and the user life cycle refers to the period from the time the user opens the account to the time before the user cancels the account;
获取模块 610, 进一步用于根据第一分片标识, 从分片数据源对应关系表, 获得 第一分片标识对应的数据源标识, 并将数据源标识发送给存储模块 630;  The obtaining module 610 is further configured to obtain, according to the first fragment identifier, the data source identifier corresponding to the first fragment identifier from the fragment data source correspondence table, and send the data source identifier to the storage module 630;
存储模块 630, 用于接收获取模块 610发送的数据源标识, 并将用户的数据存储 在数据源标识对应的数据源中,以便于接入服务器根据用户标识中包含的第一分片标 识, 从第一分片标识对应的数据源中获取用户的数据, 其中, 分片数据源对应关系表 包含客户分片的分片标识与数据源标识的对应关系。  The storage module 630 is configured to receive the data source identifier sent by the obtaining module 610, and store the data of the user in a data source corresponding to the data source identifier, so that the access server obtains the first fragment identifier according to the user identifier. The user data is obtained from the data source corresponding to the first fragment identifier, where the fragment data source correspondence table includes the correspondence between the fragment identifier of the client fragment and the data source identifier.
可选的, 获取模块 610, 进一步用于根据用户的资源号码, 从号段路由表中, 查 找资源号码所属号段范围对应的第二分片标识, 并向存储模块 630发送查询结果,其 中, 号段路由表包含了分片标识与资源号码所属号段范围的对应关系; 相应的, 存储 模块 630, 进一步用于接收获取模块 610发送的查询结果, 根据查询结果, 确定查找 不到第二分片标识, 或者查找到的第二分片标识与第一分片标识不一致时,将资源号 码与第一分片标识的对应关系添加到数据库中的散号路由表中,其中, 散号路由表包 含分片标识与不归属于号段路由表的资源号码的对应关系。  Optionally, the obtaining module 610 is further configured to: search, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the routing table, and send the query result to the storage module 630, where The segment routing table includes a correspondence between the fragment identifier and the range of the number segment to which the resource number belongs. Correspondingly, the storage module 630 is further configured to receive the query result sent by the obtaining module 610, and determine, according to the query result, that the second score is not found. If the slice identifier, or the found second fragment identifier is inconsistent with the first fragment identifier, add the correspondence between the resource number and the first fragment identifier to the scatter number routing table in the database, where the scatter number routing table Contains the correspondence between the fragment identifier and the resource number that is not attributed to the segment routing table.
可选的, 获取模块 610, 进一步用于在客户订阅业务之前, 客户还进行客户开户 时, 获得客户所属租户标识, 根据租户标识, 从分片数据源对应关系表中, 获取租户 标识对应的分片标识中一个分片标识, 将获取到的一个分片标识作为第一分片标识, 其中, 分片数据源对应关系表还包含租户标识与分片标识的对应关系, 并向生成模块 620发送包含第一分片标识的客户标识生成请求; 相应的, 生成模块 620, 用于接收 获取模块 610发送的包含第一分片标识的客户标识生成请求,根据第一分片标识, 为 客户生成包含第一分片标识的客户标识; 相应的, 存储模块 630, 进一步用于从生成 模块 620获取到客户标识包含的第一分片标识,将客户的数据存储在第一分片标识对 应的数据源中, 以便于接入服务器根据客户标识中包含的第一分片标识, 从第一分片 标识对应的数据源中获取客户的数据。 Optionally, the obtaining module 610 is further configured to: before the customer subscribes to the service, the customer obtains the tenant identifier of the customer when the customer opens the account, and obtains the corresponding point of the tenant identifier from the corresponding data of the fragment data source according to the tenant identifier. A slice identifier of the slice identifier, the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier, and is sent to the generating module 620. a client identifier generation request including a first fragment identifier; correspondingly, the generating module 620 is configured to receive a client identifier generation request that includes the first fragment identifier sent by the obtaining module 610, and generate the inclusion for the client according to the first fragment identifier. The customer identifier of the first fragment identifier; correspondingly, the storage module 630 is further configured to obtain, by the generating module 620, the first fragment identifier included in the client identifier, and store the data of the client in the data source corresponding to the first fragment identifier. In order to facilitate the access server according to the first fragment identifier included in the customer identifier, from the first fragment Identify the data of the customer in the corresponding data source.
可选的, 获取模块 610, 进一步用于确定客户未开户时, 根据用户的资源号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二分片标识, 并向生成模块 620 发送包含查询得到的第二分片标识的用户标识生成请求和包含查询得到的第二 分片标识的客户标识生成请求,其中, 号段路由表包含了分片标识与资源号码所属号 段范围的对应关系; 相应的, 生成模块 620, 进一步用于接收获取模块发送的包含第 二分片标识的用户标识生成请求和包含第二分片标识的客户标识生成请求,根据第二 分片标识, 为客户生成包含第二分片标识的客户标识, 以及根据第二分片标识, 为用 户生成包含第二分片标识的用户标识;获取模块 610,进一步用于根据第二分片标识, 从分片数据源对应关系表, 获得第二分片标识对应的数据源标识, 并将数据源标识发 送给存储模块 630; 相应的, 存储模块 630, 进一步用于将客户的数据和用户的数据 存储在第二分片标识对应的数据源中, 以便于接入服务器根据客户标识和 /或用户标 识中包含的第二分片标识, 从第二分片标识对应的数据源中获取客户的数据和 /或用 户的数据。  Optionally, the obtaining module 610 is further configured to: when the customer is not open, according to the resource number of the user, the second fragment identifier corresponding to the range of the number segment of the resource number is searched from the routing table of the number, and the generating module 620 is configured. Sending a user identity generation request including the second fragment identifier obtained by the query and a client identity generation request including the second fragment identifier obtained by the query, where the number segment routing table includes the fragment identifier and the range of the number range of the resource number Correspondingly, the generating module 620 is further configured to receive, by the acquiring module, a user identifier generating request that includes the second fragment identifier and a client identifier generating request that includes the second fragment identifier, according to the second fragment identifier, The client generates a customer identifier that includes the second fragment identifier, and generates a user identifier that includes the second fragment identifier for the user according to the second fragment identifier. The obtaining module 610 is further configured to use the second fragment identifier from the fragment. The data source correspondence table obtains the data source identifier corresponding to the second fragment identifier, and the data source identifier The storage module 630 is further configured to store the data of the client and the data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the client identifier and/or the user identifier. The second fragment identifier included in the method, the customer data and/or the user data are obtained from the data source corresponding to the second fragment identifier.
可选的, 获取模块 610, 进一步用于确定客户未开户时, 根据用户的资源号码, 从号段路由表中, 查找资源号码所属号段范围对应的第二分片标识, 其中, 号段路由 表包含了分片标识与资源号码所属号段范围的对应关系, 当未查询到第二分片标识 时, 获得客户所属租户的租户标识; 并根据租户标识, 从分片数据源对应关系表中, 获取租户标识对应的分片标识中一个分片标识,将获取到的一个分片标识作为第一分 片标识, 其中, 分片数据源对应关系表还包含租户标识与分片标识的对应关系, 以及 向生成模块 620 发送包含第一分片标识的用户标识生成请求和包含第一分片标识的 客户标识生成请求; 相应的, 生成模块 620, 进一步用于接收获取模块 610发送的包 含第一分片标识的用户标识生成请求和包含第一分片标识的客户标识生成请求,根据 第一分片标识, 为客户生成包含第一分片标识的客户标识; 相应的, 存储模块 630, 进一步用于将资源号码与第一分片标识的对应关系添加到散号路由表中,其中, 散号 路由表包含分片标识与不归属于号段路由表的资源号码的对应关系,以及将客户的数 据存储在第一分片标识对应的数据源中, 以便于接入服务器根据客户标识和 /或用户 标识中包含的第一分片标识, 从第一分片标识对应的数据源中获取客户的数据。  Optionally, the obtaining module 610 is further configured to: when determining that the customer has not opened the account, according to the resource number of the user, the second fragment identifier corresponding to the range of the number range of the resource number is obtained from the routing table of the number segment, where the number of the route is The table contains the corresponding relationship between the fragment ID and the range of the number of the resource number. When the second fragment ID is not queried, the tenant ID of the tenant to which the customer belongs is obtained; and according to the tenant ID, from the fragment data source correspondence table And obtaining a fragment identifier in the fragment identifier corresponding to the tenant identifier, and the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier. And generating, by the generating module 620, a user identifier generating request that includes the first fragment identifier and a client identifier generating request that includes the first fragment identifier; and correspondingly, the generating module 620 is further configured to receive, by the acquiring module 610, the first a user identification generation request for the fragment identification and a customer identification generation request including the first fragment identification. Correspondingly, the storage module 630 is further configured to add the correspondence between the resource number and the first fragment identifier to the scatter number routing table, according to the first fragment identifier, The scatter number routing table includes a correspondence between the shard ID and the resource number that is not attributed to the hop routing table, and the customer data is stored in the data source corresponding to the first shard identifier, so that the access server is based on the client. The first fragment identifier included in the identifier and/or the user identifier is obtained from the data source corresponding to the first fragment identifier.
可选的, 如图 7所示, 数据生成装置还包括: 搬迁模块 640, 用于根据第一数据 源标识, 从分片数据源对应关系表中, 获得第一数据源标识对应的所有的分片标识; 根据搬迁要求,从第一数据源标识对应的所有的分片标识中选择符合搬迁要求的一个 以上分片标识,并将在分片数据源对应关系表中一个以上分片标识的状态均设定为搬 迁状态, 以便于禁止除数据生成装置之外的网元访问一个以上分片标识对应的数据; 将一个以上分片标识对应的第一数据源中的数据搬迁到第二数据源中;在分片数据源 对应关系表中,删除第一数据源标识与一个以上分片标识的对应关系; 在分片数据源 对应关系表中,添加第二数据源标识与一个以上分片标识的对应关系, 并将一个以上 分片标识的状态设定为非搬迁状态, 以便于允许访问一个以上分片标识对应的数据。 Optionally, as shown in FIG. 7, the data generating apparatus further includes: a relocation module 640, configured to obtain, according to the first data source identifier, all the points corresponding to the first data source identifier from the fragment data source correspondence table. Slice identification; According to the relocation requirement, select one of the fragmentation identifiers corresponding to the first data source identifier that meets the relocation requirements. The above fragment identifiers are set, and the state of one or more fragment identifiers in the fragment data source correspondence table is set to a relocation state, so as to prohibit the network elements other than the data generating device from accessing one or more fragment identifiers. Data: The data in the first data source corresponding to one or more slice identifiers is relocated to the second data source; in the data source correspondence table, the correspondence between the first data source identifier and one or more fragment identifiers is deleted. The corresponding relationship between the second data source identifier and one or more fragment identifiers is added in the fragment data source correspondence table, and the state of one or more fragment identifiers is set to a non-relocation state, so as to allow access to more than one point. The slice identifies the corresponding data.
参见图 8, 基于上述图 1B-5 的方法实施例, 为本发明接入服务器的一个实施例 框图: 包括: 收发器 810和处理器 820, 其中,  Referring to FIG. 8, a block diagram of an embodiment of the access server according to the foregoing FIG. 1B-5 is a block diagram of an embodiment of an access server according to the present invention. The method includes: a transceiver 810 and a processor 820, where
收发器 810, 用于接收数据操作请求装置发送的数据操作请求, 数据操作请求包 含接入号码, 并向处理器 820发送接入号码;  The transceiver 810 is configured to receive a data operation request sent by the data operation requesting device, where the data operation request includes an access number, and send the access number to the processor 820;
处理器 820, 用于接收收发器 810发送的接入号码, 根据接入号码, 获得接入号 码对应的客户分片的分片标识; 并根据接入号码对应的分片标识, 从分片数据源对应 关系表中, 获得与分片标识对应的数据源标识, 并向收发器 810发送数据源标识, 其 中, 分片数据源对应关系表保存分片标识与数据源标识;  The processor 820 is configured to receive an access number sent by the transceiver 810, obtain a fragment identifier of the client fragment corresponding to the access number according to the access number, and obtain the fragmentation data according to the fragment identifier corresponding to the access number. In the source correspondence table, the data source identifier corresponding to the fragment identifier is obtained, and the data source identifier is sent to the transceiver 810, where the fragment data source correspondence table stores the fragment identifier and the data source identifier;
收发器 810, 进一步用于接收处理器 820发送的数据源标识, 并将数据操作请求 发送到数据源标识对应的数据源中, 以及接收数据源发送的数据操作响应。  The transceiver 810 is further configured to receive the data source identifier sent by the processor 820, and send the data operation request to the data source corresponding to the data source identifier, and receive the data operation response sent by the data source.
可选的, 其特征在于, 处理器 820具体用于, 当接入号码为客户标识或用户标识 时, 获得客户标识或用户标识包含的分片标识; 当接入号码为资源号码时, 根据用户 的资源号码, 在散号路由表中, 查找资源号码对应的分片标识, 当查找到资源号码对 应的分片标识时, 获得分片标识; 当未查找到资源号码对应的分片标识时, 根据用户 的资源号码, 在号段路由表中, 获得资源号码所属号段对应的分片标识, 其中, 散号 路由表包含分片标识与不归属于号段路由表的资源号码的对应关系,号段路由表包含 分片标识与资源号码所属的号段范围的对应关系。  Optionally, the processor 820 is specifically configured to: when the access number is a customer identifier or a user identifier, obtain a fragment identifier included in the customer identifier or the user identifier; when the access number is a resource number, according to the user The resource number, in the hash routing table, the fragment identifier corresponding to the resource number, and when the fragment identifier corresponding to the resource number is found, the fragment identifier is obtained; when the fragment identifier corresponding to the resource number is not found, And obtaining, according to the resource number of the user, the fragment identifier corresponding to the number segment to which the resource number belongs, where the scatter number routing table includes the correspondence between the fragment identifier and the resource number not attributed to the routing table of the number segment. The segment routing table contains the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs.
参见图 9, 为本发明数据生成装置的实施例框图, 本发明实施例中的数据生成装 置可以基于计算机系统来实现, 图 1B-4所示的方法均可在基于计算机系统的数据生 成装置中实现。 本实施例中数据生成装置可以包括: 处理器 901、 存储器 902和通信 接口 903。 存储器 902用于存储程序代码。 处理器 901用于执行存储器 902中存储的 程序代码。本发明一个实施例中, 存储器 902存储有第一程序代码, 处理器 901用于 执行该第一程序代码, 包括执行如下操作: 客户订阅了一个业务时, 客户成为了业务 的用户时,方法包括:定客户已经开户,获得客户的客户标识中包含的第一分片标识, 其中,第一分片标识为客户所属客户分片的分片标识, 客户标识在客户生命周期内唯 一标识客户, 客户生命周期指的是从客户开户后到客户销户前的期间内; 根据第一分 片标识, 为用户生成包含第一分片标识的用户标识,用户标识在用户生命周期内唯一 标识用户,用户生命周期指的是从用户开户后到用户销户前的期间内; 根据第一分片 标识, 从分片数据源对应关系表, 获得第一分片标识对应的数据源标识; 并将用户的 数据存储在数据源标识对应的数据源中,以便于接入服务器根据用户标识中包含的第 一分片标识, 从第一分片标识对应的数据源中获取用户的数据, 其中, 分片数据源对 应关系表包含客户分片的分片标识与数据源标识的对应关系。 通信接口 903, 用于与 外部设备通信,如与接入服务器通信。数据生成装置与接入服务器之间交互的消息(如 方法实施例图 1B-5所示) 均通过通信接口 903发送和接收。 其中, 处理器 901根据 存储器 902中的程序代码对通信接口 903接收到的消息进行处理, 并通过通信接口 903与外部设备交互。 处理器 901可以是中央处理器 (central processing unit, CPU)、 专用集成电路 (application-specific integrated circuit, ASIC) 等。 其中, 本实施例中的 处理 ICE地址的装置可以包括总线 904。 处理器 901、 存储器 902以及通信接口 903 之间可通过总线 904连接并通信。其中,存储器 902可以包括:随机存取存储器 ( random access memory, RAM), 只读存储器(read-only memory, ROM), 磁盘等具有存储功能 的实体。 本发明实施例中的呼叫上下文可缓存在 RAM中。 Referring to FIG. 9, which is a block diagram of an embodiment of a data generating apparatus according to the present invention, the data generating apparatus in the embodiment of the present invention may be implemented based on a computer system, and the method shown in FIG. 1B-4 may be in a data generating apparatus based on a computer system. achieve. The data generating apparatus in this embodiment may include: a processor 901, a memory 902, and a communication interface 903. The memory 902 is used to store program codes. The processor 901 is configured to execute program code stored in the memory 902. In an embodiment of the present invention, the memory 902 stores the first program code, and the processor 901 is configured to execute the first program code, and the following operations are performed: when the client subscribes to a service, when the client becomes a user of the service, the method includes The customer has opened an account and obtained the first fragmentation identifier included in the customer's customer identification. The first fragmentation identifier is the fragmentation identifier of the customer's customer fragment. The customer identifier is only in the customer life cycle. A customer identification, the customer life cycle refers to the period from the customer opening the account to the customer before the customer is posted; according to the first fragment identification, the user identifier containing the first fragment identification is generated for the user, and the user identifier is in the user life cycle. Uniquely identifies the user. The user lifetime refers to the period from the time the user opens the account to the time before the user cancels the account. According to the first fragment identifier, the data source identifier corresponding to the first fragment identifier is obtained from the fragment data source correspondence table. And storing the user data in the data source corresponding to the data source identifier, so that the access server obtains the user data from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier. The fragment data source correspondence table includes a correspondence between the fragment identifier of the client fragment and the data source identifier. The communication interface 903 is configured to communicate with an external device, such as with an access server. Messages that interact between the data generating device and the access server (as shown in FIG. 1B-5 of the method embodiment) are both transmitted and received via communication interface 903. The processor 901 processes the message received by the communication interface 903 according to the program code in the memory 902, and interacts with the external device through the communication interface 903. The processor 901 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like. The device for processing the ICE address in this embodiment may include a bus 904. The processor 901, the memory 902, and the communication interface 903 can be connected and communicated via a bus 904. The memory 902 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function. The call context in the embodiment of the present invention can be cached in the RAM.
仍然参见图 9, 为本发明接入服务器的实施例框图, 本发明实施例中的接入服务 器可以基于计算机系统来实现,图 5所示的方法可在基于计算机系统的接入服务器中 实现。 本实施例中接入服务器可以包括: 处理器 901、 存储器 902和通信接口 903。 存储器 902用于存储程序代码。 处理器 901用于执行存储器 902中存储的程序代码。 本发明一个实施例中,存储器 902存储有第一程序代码, 处理器 901用于执行该第一 程序代码, 包括执行如下操作: 接收数据操作请求装置发送的数据操作请求, 数据操 作请求包含接入号码; 根据接入号码, 获得接入号码对应的客户分片的分片标识; 根 据接入号码对应的分片标识, 从分片数据源对应关系表中, 获得与分片标识对应的数 据源标识, 其中, 分片数据源对应关系表保存分片标识与数据源标识; 将数据操作请 求发送到获得的数据源标识对应的数据源中; 接收数据源发送的数据操作响应。通信 接口 903, 用于与外部设备通信, 如与数据生成模块通信。 数据生成装置与接入服务 器之间交互的消息 (如方法实施例图 1B-5所示) 均通过通信接口 903发送和接收。 其中,处理器 901根据存储器 902中的程序代码对通信接口 903接收到的消息进行处 理, 并通过通信接口 903 与外部设备交互。 处理器 901 可以是中央处理器 (central processing unit, CPU)、专用集成电路 (application-specific integrated circuit, ASIC)等。 其中,本实施例中的处理 ICE地址的装置可以包括总线 904。处理器 901、存储器 902 以及通信接口 903之间可通过总线 904连接并通信。其中, 存储器 902可以包括: 随 机存取存储器(random access memory, RAM),只读存储器(read-only memory, ROM), 磁盘等具有存储功能的实体。 本发明实施例中的呼叫上下文可缓存在 RAM中。 Still referring to FIG. 9, which is a block diagram of an embodiment of an access server according to the present invention, the access server in the embodiment of the present invention may be implemented based on a computer system, and the method shown in FIG. 5 may be implemented in an access server based on a computer system. The access server in this embodiment may include: a processor 901, a memory 902, and a communication interface 903. The memory 902 is used to store program codes. The processor 901 is configured to execute program code stored in the memory 902. In one embodiment of the present invention, the memory 902 stores a first program code, and the processor 901 is configured to execute the first program code, including: performing a data operation request sent by the data operation requesting device, where the data operation request includes accessing The number is obtained according to the access number, and the fragment identifier of the client fragment corresponding to the access number is obtained. According to the fragment identifier corresponding to the access number, the data source corresponding to the fragment identifier is obtained from the fragment data source correspondence table. The identifier, where the fragment data source correspondence table holds the fragment identifier and the data source identifier; sends the data operation request to the data source corresponding to the obtained data source identifier; and receives the data operation response sent by the data source. The communication interface 903 is configured to communicate with an external device, such as a data generating module. Messages that interact between the data generating device and the access server (as shown in FIG. 1B-5 of the method embodiment) are both transmitted and received via communication interface 903. The processor 901 processes the message received by the communication interface 903 according to the program code in the memory 902, and interacts with the external device through the communication interface 903. The processor 901 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like. The device for processing the ICE address in this embodiment may include a bus 904. The processor 901, the memory 902, and the communication interface 903 can be connected and communicated via a bus 904. The memory 902 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function. The call context in the embodiment of the present invention can be cached in the RAM.
由上述实施例可见,本发明实施例由于客户标识与用户标识包含了相同的客户分 片的分片标识, 而一个分片对应的是一个数据源, 因此可以将客户的数据和用户的数 据都存储在相同的数据源中。 并且可以根据客户的属性, 确定对数据源的要求, 从而 可以为客户和用户灵活的分配符合要求的数据源。  As can be seen from the foregoing embodiment, in the embodiment of the present invention, since the customer identifier and the user identifier include the same fragmentation identifier of the client fragment, and one fragment corresponds to a data source, the client data and the user data can be both Stored in the same data source. And according to the attributes of the customer, the requirements of the data source can be determined, so that the data source that meets the requirements can be flexibly allocated to the customer and the user.
如图 10所示, 本发明实施例的一种数据操作系统的结构示意图, 包括如图 6,7 或 9所示的数据生成装置 1010和如图 8或图 9的接入服务器 1020。  As shown in FIG. 10, a schematic structural diagram of a data operating system according to an embodiment of the present invention includes a data generating apparatus 1010 as shown in FIG. 6, 7 or 9, and an access server 1020 as shown in FIG. 8 or FIG.
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需 的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上 或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产 品可以存储在存储介质中, 如 ROM/RAM、磁碟、光盘等, 包括若干指令用以使得一 台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施 例或者实施例的某些部分所述的方法。  It will be apparent to those skilled in the art that the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部 分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同之处。尤其, 对于 系统实施例而言, 由于其基本相似于方法实施例, 所以描述的比较简单, 相关之处参 见方法实施例的部分说明即可。  The various embodiments in the present specification are described in a progressive manner, and the same or similar portions between the various embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method embodiment.
以上所述的本发明实施方式, 并不构成对本发明保护范围的限定。任何在本发明 的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明的保护范围之 内。  The embodiments of the present invention described above are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种数据存储方法, 其特征在于, 客户订阅了一个业务时, 所述客户成 为了所述业务的用户时, 所述方法包括: A data storage method, characterized in that, when a customer subscribes to a service, and the client becomes a user of the service, the method includes:
数据生成装置确定所述客户已经开户,获得所述客户的客户标识中包含的第 一分片标识, 其中, 所述第一分片标识为所述客户所属客户分片的分片标识, 所 述客户标识在客户生命周期内唯一标识所述客户,所述客户生命周期指的是从客 户开户后到客户销户前的期间内;  The data generating device determines that the client has opened an account, and obtains a first fragment identifier included in the client identifier of the client, where the first fragment identifier is a fragment identifier of the client fragment to which the client belongs, The customer identification uniquely identifies the customer during the customer's life cycle, and the customer life cycle refers to the period from the time the customer opens the account to the time the customer signs the account;
所述数据生成装置根据所述第一分片标识,为所述用户生成包含所述第一分 片标识的用户标识, 所述用户标识在用户生命周期内唯一标识所述用户, 所述用 户生命周期指的是从用户开户后到用户销户前的期间内;  The data generating device generates, according to the first fragment identifier, a user identifier that includes the first fragment identifier for the user, where the user identifier uniquely identifies the user during a user lifetime, and the user life The period refers to the period from the time the user opens the account to the time before the user cancels the account;
所述数据生成装置根据所述第一分片标识, 从分片数据源对应关系表, 获得 所述第一分片标识对应的数据源标识;并将所述用户的数据存储在所述数据源标 识对应的数据源中, 以便于接入服务器根据所述用户标识中包含的第一分片标 识, 从所述第一分片标识对应的数据源中获取所述用户的数据, 其中, 所述分片 数据源对应关系表包含客户分片的分片标识与数据源标识的对应关系。  The data generating device obtains, according to the first fragment identifier, a data source identifier corresponding to the first fragment identifier from a fragment data source correspondence table, and stores the user data in the data source. And identifying, by the access server, the data of the user from the data source corresponding to the first fragment identifier according to the first fragment identifier included in the user identifier, where The fragment data source correspondence table contains the correspondence between the fragment identifier of the client fragment and the data source identifier.
2、 根据权利要求 1所述的方法, 其特征在于, 还包括:  2. The method according to claim 1, further comprising:
所述数据生成装置根据所述用户的资源号码, 从号段路由表中, 查找所述资 源号码所属号段范围对应的第二分片标识, 其中, 所述号段路由表包含了所述分 片标识与资源号码所属号段范围的对应关系;  The data generating device searches for a second fragment identifier corresponding to the range of the number segment to which the resource number belongs from the number segment routing table according to the resource number of the user, where the number segment routing table includes the score Correspondence between the slice identifier and the range of the number segment to which the resource number belongs;
确定查找不到所述第二分片标识,或者查找到的所述第二分片标识与所述第 一分片标识不一致时,所述数据生成装置将所述资源号码与所述第一分片标识的 对应关系添加到数据库中的散号路由表中, 其中, 所述散号路由表包含分片标识 与不归属于号段路由表的资源号码的对应关系。  Determining that the second fragment identifier is not found, or the found second fragment identifier is inconsistent with the first fragment identifier, the data generating device uses the resource number and the first score The corresponding relationship of the slice identifier is added to the scatter number routing table in the database, where the scatter number routing table includes a correspondence between the fragment identifier and the resource number not attributed to the segment routing table.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 在客户订阅业务之前, 所述方法还包括:  The method according to claim 1 or 2, wherein before the client subscribes to the service, the method further includes:
所述客户进行开户时, 获得所述客户所属租户标识;  When the customer opens an account, the tenant identifier of the customer is obtained;
所述数据生成装置根据所述租户标识, 从所述分片数据源对应关系表中, 获 取所述租户标识对应的分片标识中一个分片标识,将获取到的所述一个分片标识 作为第一分片标识, 其中, 所述分片数据源对应关系表还包含租户标识与分片标 识的对应关系;  The data generating device acquires, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier from the fragment data source correspondence table, and uses the obtained fragment identifier as a first fragment identifier, where the fragment data source correspondence table further includes a correspondence between a tenant identifier and a fragment identifier;
所述数据生成装置根据所述第一分片标识,为所述客户生成包含所述第一分 片标识的客户标识,并将所述客户的数据存储在所述第一分片标识对应的数据源 中, 以便于所述接入服务器根据所述客户标识中包含的第一分片标识, 从所述第 一分片标识对应的数据源中获取所述客户的数据。 Generating, by the data generating device, the first score for the client according to the first fragment identifier a customer identifier of the slice identifier, and the data of the client is stored in a data source corresponding to the first fragment identifier, so that the access server is configured according to the first fragment identifier included in the client identifier. Acquiring the data of the client in the data source corresponding to the first fragment identifier.
4、 根据权利要求 1所述的方法, 其特征在于, 还包括:  4. The method according to claim 1, further comprising:
所述数据生成装置确定所述客户未开户时, 根据所述用户的资源号码, 从号 段路由表中, 查找所述资源号码所属号段范围对应的第二分片标识, 其中, 所述 号段路由表包含了所述分片标识与资源号码所属号段范围的对应关系;  When the data generating device determines that the client has not opened an account, the second fragment identifier corresponding to the range of the number segment to which the resource number belongs is searched according to the resource number of the user, where the number is The segment routing table includes the correspondence between the fragment identifier and the range of the number segment to which the resource number belongs;
所述数据生成装置当查找到所述第二分片标识时, 根据所述第二分片标识, 为所述客户生成包含所述二分片标识的客户标识, 以及根据所述第二分片标识, 为所述用户生成包含所述第二分片标识的用户标识,以及将客户的数据和用户的 数据存储在所述第二分片标识对应的数据源中,以便于所述接入服务器根据所述 客户标识和 /或用户标识中包含的第二分片标识, 从所述第二分片标识对应的数 据源中获取所述客户的数据和 /或用户的数据。  When the second fragment identifier is found, the data generating device generates, according to the second fragment identifier, a client identifier that includes the two-part identifier, and the second fragment identifier according to the second fragment identifier. Generating, for the user, a user identifier that includes the second fragment identifier, and storing data of the client and data of the user in a data source corresponding to the second fragment identifier, so that the access server is configured according to the And the second fragment identifier included in the customer identifier and/or the user identifier, and acquiring data of the client and/or data of the user from a data source corresponding to the second fragment identifier.
5、 根据权利要求 4所述的方法, 其特征在于, 还包括:  5. The method according to claim 4, further comprising:
当未查找到所述第二分片标识时, 获得所述客户所属租户的租户标识; 所述数据生成装置根据所述租户标识, 从所述分片数据源对应关系表中, 获 取所述租户标识对应的分片标识中一个分片标识,将获取到的所述一个分片标识 作为第一分片标识, 其中, 所述分片数据源对应关系表还包含租户标识与分片标 识的对应关系;  Obtaining the tenant identifier of the tenant to which the client belongs when the second fragment identifier is not found; the data generating device acquiring the tenant from the fragment data source correspondence table according to the tenant identifier Identifying a fragment identifier of the corresponding fragment identifier, and the obtained fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier. Relationship
所述数据生成装置根据所述第一分片标识,为所述客户生成包含所述第一分 片标识的客户标识, 以及根据所述第一分片标识, 为所述用户生成包含所述第一 分片标识的用户标识;  The data generating device generates, according to the first fragment identifier, a client identifier that includes the first fragment identifier for the client, and generates, according to the first fragment identifier, the user that includes the first a user ID identified by a slice;
将所述资源号码与所述第一分片标识的对应关系添加到散号路由表中, 其 中, 所述散号路由表包含分片标识与不归属于号段路由表的资源号码的对应关 系, 以及将客户的数据和用户的数据存储在所述第一分片标识对应的数据源中, 以便于所述接入服务器根据所述客户标识和 /或用户标识中包含的第一分片标 识, 从所述第一分片标识对应的数据源中获取所述客户的数据和 /或用户的数据。  Adding the corresponding relationship between the resource number and the first fragment identifier to the scatter number routing table, where the scatter number routing table includes a correspondence between the fragment identifier and a resource number not belonging to the segment routing table. And storing the data of the customer and the data of the user in a data source corresponding to the first fragment identifier, so that the access server is configured according to the first fragment identifier included in the customer identifier and/or the user identifier. And acquiring data of the client and/or data of the user from a data source corresponding to the first fragment identifier.
6、 根据权利要求 1至 5任意一项所述的方法, 其特征在于, 所述方法还包 括:  The method according to any one of claims 1 to 5, wherein the method further comprises:
所述数据生成装置根据第一数据源标识, 从所述分片数据源对应关系表中, 获得所述第一数据源标识对应的所有的分片标识;  The data generating device obtains, according to the first data source identifier, all the fragment identifiers corresponding to the first data source identifier from the fragment data source correspondence table;
根据搬迁要求,从所述第一数据源标识对应的所有的分片标识中选择符合所 述搬迁要求的一个以上分片标识,并将在所述分片数据源对应关系表中所述一个 以上分片标识的状态均设定为搬迁状态,以便于禁止除所述数据生成装置之外的 网元访问所述一个以上分片标识对应的数据; According to the relocation request, selecting the matching object from all the fragment identifiers corresponding to the first data source identifier Determining one or more fragment identifiers of the relocation request, and setting the state of the one or more fragment identifiers in the fragment data source correspondence table to a relocation state, so as to prohibit prohibition of the data generation device The network element accesses data corresponding to the one or more fragment identifiers;
所述数据生成装置将所述一个以上分片标识对应的所述第一数据源中的数 据搬迁到所述第二数据源中;  The data generating device relocates data in the first data source corresponding to the one or more fragment identifiers to the second data source;
所述数据生成装置在所述分片数据源对应关系表中,删除所述第一数据源标 识与所述一个以上分片标识的对应关系;  The data generating device deletes, in the fragment data source correspondence table, a correspondence between the first data source identifier and the one or more fragment identifiers;
所述数据生成装置在所述分片数据源对应关系表中,添加所述第二数据源标 识与所述一个以上分片标识的对应关系,并将所述一个以上分片标识的状态设定 为非搬迁状态, 以便于允许访问所述一个以上分片标识对应的数据。  And the data generating device adds a correspondence between the second data source identifier and the one or more fragment identifiers in the fragment data source correspondence table, and sets a state of the one or more fragment identifiers It is a non-relocation state, so as to allow access to the data corresponding to the one or more fragment identifiers.
7、 一种数据操作方法, 其特征在于, 包括:  7. A data operation method, comprising:
接入服务器接收数据操作请求装置发送的数据操作请求,所述数据操作请求 包含接入号码;  The access server receives a data operation request sent by the data operation requesting device, where the data operation request includes an access number;
所述接入服务器根据所述接入号码,获得所述接入号码对应的客户分片的分 片标识;  And obtaining, by the access server, a fragment identifier of the client fragment corresponding to the access number according to the access number;
所述接入服务器根据所述接入号码对应的分片标识,从分片数据源对应关系 表中, 获得与所述分片标识对应的数据源标识, 其中, 所述分片数据源对应关系 表保存分片标识与数据源标识;  The access server obtains a data source identifier corresponding to the fragment identifier from the fragment data source correspondence table according to the fragment identifier corresponding to the access number, where the fragment data source correspondence The table saves the fragment identifier and the data source identifier;
所述接入服务器将所述数据操作请求发送到获得的所述数据源标识对应的 数据源中;  Sending, by the access server, the data operation request to the obtained data source corresponding to the data source identifier;
所述接入服务器接收所述数据源发送的数据操作响应。  The access server receives a data operation response sent by the data source.
8、 根据权利要求 7所述的方法, 其特征在于, 所述根据所述接入号码, 获 得所述接入号码对应的分片标识, 具体包括:  The method according to claim 7, wherein the obtaining, according to the access number, the fragment identifier corresponding to the access number, specifically includes:
当所述接入号码为客户标识或用户标识时,获得所述客户标识或用户标识包 含的分片标识;  And obtaining, when the access number is a customer identifier or a user identifier, a fragment identifier included in the customer identifier or the user identifier;
当所述接入号码为资源号码时,根据所述用户的资源号码,在散号路由表中, 查找所述资源号码对应的分片标识, 当查找到所述资源号码对应的分片标识时, 获得所述分片标识; 当未查找到所述资源号码对应的分片标识时, 根据所述用户 的资源号码,在所述号段路由表中,获得所述资源号码所属号段对应的分片标识, 其中,所述散号路由表包含所述分片标识与不归属于所述号段路由表的资源号码 的对应关系,所述号段路由表包含所述分片标识与所述资源号码所属的号段范围 的对应关系。 When the access number is a resource number, the fragment identifier corresponding to the resource number is searched in the hash routing table according to the resource number of the user, and when the fragment identifier corresponding to the resource number is found, Obtaining the fragment identifier; when the fragment identifier corresponding to the resource number is not found, obtaining, according to the resource number of the user, the number segment corresponding to the resource number in the number segment routing table a slice identifier, where the scatter number table includes a correspondence between the slice identifier and a resource number not attributed to the number segment routing table, where the number segment routing table includes the fragment identifier and the The correspondence between the range of the number segment to which the resource number belongs.
9、 一种数据生成装置, 其特征在于, 所述装置包括获取模块、 生成模块和 存储模块, 其中, A data generating device, comprising: an obtaining module, a generating module, and a storage module, wherein
所述获取模块, 用于当客户订阅了一个业务时, 所述客户成为了所述业务的 用户时, 确定所述客户已经开户, 获得所述客户的客户标识中包含的第一分片标 识, 其中, 所述第一分片标识为所述客户所属客户分片的分片标识, 所述客户标 识在客户生命周期内唯一标识所述客户,所述客户生命周期指的是从客户开户后 到客户销户前的期间内;  The obtaining module is configured to: when a customer subscribes to a service, when the client becomes a user of the service, determine that the client has opened an account, and obtain a first fragment identifier included in the client identifier of the client, The first fragment is identified as a fragment identifier of the client fragment to which the customer belongs, and the customer identifier uniquely identifies the client during a customer lifetime, and the customer life cycle refers to after the customer opens an account. During the period before the customer cancels the account;
所述获取模块,进一步用于向所述生成模块发送包含所述第一分片标识的用 户标识生成请求;  The obtaining module is further configured to send, to the generating module, a user identity generation request that includes the first fragment identifier;
所述生成模块,用于接收所述获取模块发送包含所述第一分片标识的用户标 识生成请求, 并根据所述第一分片标识, 为所述用户生成包含所述第一分片标识 的用户标识, 所述用户标识在用户生命周期内唯一标识所述用户, 所述用户生命 周期指的是从用户开户后到用户销户前的期间内;  The generating module is configured to receive, by the acquiring module, a user identifier generation request that includes the first fragment identifier, and generate, according to the first fragment identifier, a first fragment identifier for the user The user identifier, the user identifier uniquely identifies the user during the life cycle of the user, and the user life cycle refers to a period from after the user opens the account to before the user cancels the account;
所述获取模块, 进一步用于根据所述第一分片标识, 从分片数据源对应关系 表, 获得所述第一分片标识对应的数据源标识, 并将所述数据源标识发送给所述 存储模块;  The obtaining module is further configured to obtain, according to the first fragment identifier, a data source identifier corresponding to the first fragment identifier from a fragment data source correspondence table, and send the data source identifier to the Storage module
所述存储模块, 用于接收获取模块发送的所述数据源标识, 并将所述用户的 数据存储在所述数据源标识对应的数据源中,以便于接入服务器根据所述用户标 识中包含的第一分片标识,从所述第一分片标识对应的数据源中获取所述用户的 数据, 其中, 所述分片数据源对应关系表包含客户分片的分片标识与数据源标识 的对应关系。  The storage module is configured to receive the data source identifier sent by the acquiring module, and store the data of the user in a data source corresponding to the data source identifier, so that the access server is included according to the user identifier. The first fragment identifier, the data of the user is obtained from a data source corresponding to the first fragment identifier, where the fragment data source correspondence table includes a fragment identifier and a data source identifier of the client fragment. Correspondence.
10、 根据权利要求 9所述的装置, 其特征在于, 所述获取模块, 进一步用于 根据所述用户的资源号码, 从号段路由表中, 查找所述资源号码所属号段范围对 应的第二分片标识, 并向所述存储模块发送查询结果, 其中, 所述号段路由表包 含了所述分片标识与资源号码所属号段范围的对应关系;  The device according to claim 9, wherein the acquiring module is further configured to: according to the resource number of the user, search for a range corresponding to a range of the number range of the resource number from the number segment routing table a segmentation identifier, and sending a query result to the storage module, where the number segment routing table includes a correspondence between the fragment identifier and a range of a number range of the resource number;
所述存储模块, 进一步用于接收所述获取模块发送的查询结果, 根据所述查 询结果, 确定查找不到所述第二分片标识, 或者查找到的所述第二分片标识与所 述第一分片标识不一致时,将所述资源号码与所述第一分片标识的对应关系添加 到数据库中的散号路由表中, 其中, 所述散号路由表包含分片标识与不归属于号 段路由表的资源号码的对应关系。  The storage module is further configured to receive the query result sent by the acquiring module, and determine, according to the query result, that the second fragment identifier is not found, or the second fragment identifier that is found is When the first fragment identifiers are inconsistent, the corresponding relationship between the resource number and the first fragment identifier is added to the scatter number routing table in the database, where the scatter number routing table includes the fragment identifier and the non-attribute Correspondence of resource numbers in the routing table of the segment.
11、 根据权利要求 9或 10所述的装置, 其特征在于, 所述获取模块, 进一 步用于在客户订阅业务之前, 客户还进行客户开户时, 获得客户所属租户标识, 根据所述租户标识, 从所述分片数据源对应关系表中, 获取所述租户标识对应的 分片标识中一个分片标识, 将获取到的所述一个分片标识作为第一分片标识, 其 中, 所述分片数据源对应关系表还包含租户标识与分片标识的对应关系, 并向所 述生成模块发送包含所述第一分片标识的客户标识生成请求; The device according to claim 9 or 10, wherein the obtaining module is further configured to: before the customer subscribes to the service, the customer also obtains the tenant identifier of the customer when the customer opens the account, And obtaining, according to the tenant identifier, a fragment identifier in the fragment identifier corresponding to the tenant identifier, and using the obtained fragment identifier as the first fragment identifier. The fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier, and sends a client identifier generation request including the first fragment identifier to the generating module.
所述生成模块,用于接收获取模块发送的包含所述第一分片标识的客户标识 生成请求, 根据所述第一分片标识, 为所述客户生成包含所述第一分片标识的客 户标识;  The generating module is configured to receive a client identity generation request that is sent by the acquiring module and includes the first fragment identifier, and generate, by the first fragment identifier, a client that includes the first fragment identifier according to the first fragment identifier. Identification
所述存储模块,进一步用于从生成模块获取到所述客户标识包含的第一分片 标识, 将所述客户的数据存储在所述第一分片标识对应的数据源中, 以便于所述 接入服务器根据所述客户标识中包含的第一分片标识,从所述第一分片标识对应 的数据源中获取所述客户的数据。  The storage module is further configured to: obtain, by the generating module, the first fragment identifier included in the customer identifier, and store the data of the client in a data source corresponding to the first fragment identifier, so as to facilitate the The access server obtains data of the client from a data source corresponding to the first fragment identifier according to the first fragment identifier included in the client identifier.
12、 根据权利要求 9所述的装置, 其特征在于, 所述获取模块, 进一步用于 确定所述客户未开户时, 根据所述用户的资源号码, 从号段路由表中, 查找所述 资源号码所属号段范围对应的第二分片标识,并向所述生成模块发送包含查询得 到的所述第二分片标识的用户标识生成请求和包含查询得到的所述第二分片标 识的客户标识生成请求, 其中, 所述号段路由表包含了所述分片标识与资源号码 所属号段范围的对应关系;  The device according to claim 9, wherein the obtaining module is further configured to: when the client is not open, according to the resource number of the user, look up the resource from a segment routing table. a second fragment identifier corresponding to the range of the number segment, and sending, to the generating module, a user identifier generation request including the second fragment identifier obtained by the query, and a client including the second fragment identifier obtained by the query An identifier generation request, where the number segment routing table includes a correspondence between the fragment identifier and a range of a number range to which the resource number belongs;
所述生成模块,进一步用于接收所述获取模块发送的包含所述第二分片标识 的用户标识生成请求和包含所述第二分片标识的客户标识生成请求,根据所述第 二分片标识, 为所述客户生成包含所述第二分片标识的客户标识;  The generating module is further configured to receive a user identifier generation request that includes the second fragment identifier sent by the acquiring module, and a client identifier generation request that includes the second fragment identifier, according to the second fragment Identifying, generating, for the customer, a customer identifier that includes the second fragment identifier;
所述获取模块, 进一步用于根据所述第二分片标识, 从分片数据源对应关系 表, 获得所述第二分片标识对应的数据源标识, 并将所述数据源标识发送给所述 存储模块;  The obtaining module is further configured to obtain, according to the second fragment identifier, a data source identifier corresponding to the second fragment identifier from the fragment data source correspondence table, and send the data source identifier to the Storage module
所述存储模块,进一步用于将客户的数据存储在所述第二分片标识对应的数 据源中, 以便于所述接入服务器根据所述客户标识中包含的第二分片标识, 从所 述第二分片标识对应的数据源中获取所述客户的数据。  The storage module is further configured to store the data of the client in a data source corresponding to the second fragment identifier, so that the access server obtains the second fragment identifier included in the client identifier. The data of the customer is obtained from a data source corresponding to the second fragment identifier.
13、 根据权利要求 9所述的装置, 其特征在于, 所述获取模块, 进一步用于 确定所述客户未开户时, 根据所述用户的资源号码, 从号段路由表中, 查找所述 资源号码所属号段范围对应的第二分片标识, 其中, 所述号段路由表包含了所述 分片标识与资源号码所属号段范围的对应关系, 当未查询到所述第二分片标识 时, 获得所述客户所属租户的租户标识; 并根据所述租户标识, 从所述分片数据 源对应关系表中, 获取所述租户标识对应的分片标识中一个分片标识, 将获取到 的所述一个分片标识作为第一分片标识, 其中, 所述分片数据源对应关系表还包 含租户标识与分片标识的对应关系,以及向所述生成模块发送包含所述第一分片 标识的用户标识生成请求和包含所述第一分片标识的客户标识生成请求; The device according to claim 9, wherein the acquiring module is further configured to: when the client is not open, according to the resource number of the user, look up the resource from a segment routing table. The second fragment identifier corresponding to the range of the number segment of the number, wherein the number of the segment identifiers includes the correspondence between the fragment identifier and the range of the number of the resource number, and the second fragment identifier is not queried. Obtaining a tenant identifier of the tenant identifier corresponding to the tenant identifier from the fragment data source correspondence table according to the tenant identifier, and obtaining a fragment identifier in the fragment identifier corresponding to the tenant identifier, The one fragment identifier is used as the first fragment identifier, where the fragment data source correspondence table further includes a correspondence between the tenant identifier and the fragment identifier, and the first module is sent to the generating module. a user identification generation request of the slice identifier and a client identity generation request including the first fragmentation identifier;
所述生成模块,进一步用于接收所述获取模块发送的包含所述第一分片标识 的用户标识生成请求和包含所述第一分片标识的客户标识生成请求,根据所述第 一分片标识, 为所述客户生成包含所述第一分片标识的客户标识;  The generating module is further configured to receive a user identifier generation request that includes the first fragment identifier sent by the acquiring module, and a client identifier generation request that includes the first fragment identifier, according to the first fragment Identifying, generating, for the customer, a customer identifier that includes the first fragment identifier;
所述存储模块,进一步用于将所述资源号码与所述第一分片标识的对应关系 添加到散号路由表中, 其中, 所述散号路由表包含分片标识与不归属于号段路由 表的资源号码的对应关系,以及将客户的数据存储在所述第一分片标识对应的数 据源中, 以便于所述接入服务器根据所述客户标识中包含的第一分片标识, 从所 述第一分片标识对应的数据源中获取所述客户的数据。  The storage module is further configured to add a correspondence between the resource number and the first fragment identifier to a scatter number routing table, where the scatter number routing table includes a fragment identifier and a non-attribution number segment Corresponding relationship between the resource numbers of the routing table, and storing the data of the client in the data source corresponding to the first fragment identifier, so that the access server is configured according to the first fragment identifier included in the client identifier. Obtaining data of the client from a data source corresponding to the first fragment identifier.
14、 根据权利要求 9至 13任意一项所述的装置, 其特征在于, 还包括: 搬 迁模块, 用于根据第一数据源标识, 从所述分片数据源对应关系表中, 获得所述 第一数据源标识对应的所有的分片标识; 根据搬迁要求, 从所述第一数据源标识 对应的所有的分片标识中选择符合所述搬迁要求的一个以上分片标识,并将在所 述分片数据源对应关系表中所述一个以上分片标识的状态均设定为搬迁状态,以 便于禁止除所述数据生成装置之外的网元访问所述一个以上分片标识对应的数 据;将所述一个以上分片标识对应的所述第一数据源中的数据搬迁到所述第二数 据源中; 在所述分片数据源对应关系表中, 删除所述第一数据源标识与所述一个 以上分片标识的对应关系; 在所述分片数据源对应关系表中, 添加所述第二数据 源标识与所述一个以上分片标识的对应关系,并将所述一个以上分片标识的状态 设定为非搬迁状态, 以便于允许访问所述一个以上分片标识对应的数据。  The device according to any one of claims 9 to 13, further comprising: a relocation module, configured to obtain, according to the first data source identifier, the fragment data source correspondence table All the fragment identifiers corresponding to the first data source identifier are selected; and one or more fragment identifiers that meet the relocation request are selected from all the fragment identifiers corresponding to the first data source identifier according to the relocation request, and The state of the one or more fragment identifiers in the segment data source correspondence table is set to a relocation state, so as to prevent the network element except the data generating device from accessing the data corresponding to the one or more fragment identifiers. Relocating data in the first data source corresponding to the one or more fragment identifiers to the second data source; deleting the first data source identifier in the fragment data source correspondence table Corresponding relationship with the one or more fragment identifiers; adding, in the fragment data source correspondence table, the second data source identifier and the one or more fragment identifiers Corresponding relationship, and said more than one fragment identified non relocation state setting state, in order to allow access to the more than one fragment corresponding to the identification data.
15、 一种接入服务器, 其特征在于, 包括: 收发器和处理器, 其中, 所述收发器, 用于接收数据操作请求装置发送的数据操作请求, 所述数据操 作请求包含接入号码, 并向所述处理器发送接入号码;  An access server, comprising: a transceiver and a processor, wherein the transceiver is configured to receive a data operation request sent by a data operation requesting device, where the data operation request includes an access number, And sending an access number to the processor;
所述处理器, 用于接收所述收发器发送的接入号码, 根据所述接入号码, 获 得所述接入号码对应的客户分片的分片标识;并根据所述接入号码对应的分片标 识, 从分片数据源对应关系表中, 获得与所述分片标识对应的数据源标识, 并向 所述收发器发送所述数据源标识, 其中, 所述分片数据源对应关系表保存分片标 识与数据源标识;  The processor is configured to receive an access number sent by the transceiver, obtain a fragment identifier of a client fragment corresponding to the access number according to the access number, and obtain a corresponding identifier according to the access number. a fragment identifier, the data source identifier corresponding to the fragment identifier is obtained from the fragment data source correspondence table, and the data source identifier is sent to the transceiver, where the fragment data source correspondence is The table saves the fragment identifier and the data source identifier;
收发器, 进一步用于接收所述处理器发送的所述数据源标识, 并将所述数据 操作请求发送到所述数据源标识对应的数据源中,以及接收所述数据源发送的数 据操作响应。 The transceiver is further configured to receive the data source identifier sent by the processor, and send the data operation request to a data source corresponding to the data source identifier, and receive the number sent by the data source According to the operation response.
16、 根据权利要求 15所述的接入服务器, 其特征在于, 所述处理器具体用 于, 当所述接入号码为客户标识或用户标识时, 获得所述客户标识或用户标识包 含的分片标识; 当所述接入号码为资源号码时, 根据所述用户的资源号码, 在散 号路由表中, 查找所述资源号码对应的分片标识, 当查找到所述资源号码对应的 分片标识时, 获得所述分片标识; 当未查找到所述资源号码对应的分片标识时, 根据所述用户的资源号码, 在所述号段路由表中, 获得所述资源号码所属号段对 应的分片标识, 其中, 所述散号路由表包含所述分片标识与不归属于所述号段路 由表的资源号码的对应关系,所述号段路由表包含所述分片标识与所述资源号码 所属的号段范围的对应关系。  The access server according to claim 15, wherein the processor is specifically configured to: when the access number is a customer identifier or a user identifier, obtain the score included in the customer identifier or the user identifier. a slice identifier; when the access number is a resource number, searching for a fragment identifier corresponding to the resource number in the hash number routing table according to the resource number of the user, and searching for a score corresponding to the resource number When the fragment is identified, the fragment identifier is obtained. When the fragment identifier corresponding to the resource number is not found, the resource number belongs to the number segment routing table according to the resource number of the user. a fragment identifier corresponding to the segment, where the scatter number routing table includes a correspondence between the fragment identifier and a resource number not attributed to the number segment routing table, where the number segment routing table includes the fragment identifier Correspondence with the range of the number segment to which the resource number belongs.
17、 一种数据操作系统, 其特征在于, 包括如权利要求 9-14的任一数据生 成装置和如权利要求 15-16的任一接入服务器。  A data operating system, comprising: a data generating device according to any of claims 9-14 and any access server according to claims 15-16.
PCT/CN2012/088144 2012-12-31 2012-12-31 Data storage method and apparatus, data operation method and system, and access server WO2014101240A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280002589.8A CN104040539B (en) 2012-12-31 2012-12-31 Date storage method and device, data manipulation method, system and access server
PCT/CN2012/088144 WO2014101240A1 (en) 2012-12-31 2012-12-31 Data storage method and apparatus, data operation method and system, and access server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/088144 WO2014101240A1 (en) 2012-12-31 2012-12-31 Data storage method and apparatus, data operation method and system, and access server

Publications (1)

Publication Number Publication Date
WO2014101240A1 true WO2014101240A1 (en) 2014-07-03

Family

ID=51019822

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/088144 WO2014101240A1 (en) 2012-12-31 2012-12-31 Data storage method and apparatus, data operation method and system, and access server

Country Status (2)

Country Link
CN (1) CN104040539B (en)
WO (1) WO2014101240A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117422A (en) * 2017-06-23 2019-01-01 中国软件与技术服务股份有限公司 Globally unique number rapid generation and system in a kind of extensive high concurrent system
EP3668046A1 (en) * 2018-12-12 2020-06-17 Telia Company AB Access management to user related data

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795315A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Method and device for monitoring service
CN110221988B (en) * 2019-05-05 2021-04-30 福建天泉教育科技有限公司 Cache optimization method and system for third-party data
CN110737663B (en) * 2019-10-15 2024-06-11 腾讯科技(深圳)有限公司 Data storage method, device, equipment and storage medium
CN111126537B (en) * 2019-12-17 2024-03-12 北京达佳互联信息技术有限公司 Identification code ID generation method and related product
CN115396275B (en) * 2021-05-06 2023-12-29 华为技术有限公司 Data acquisition method, system and device
CN113645304B (en) * 2021-08-13 2023-06-16 恒生电子股份有限公司 Data service processing method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585548A (en) * 2004-05-25 2005-02-23 中兴通讯股份有限公司 Realizing method for distributed access positioning register VLR
CN101093482A (en) * 2006-06-19 2007-12-26 上海全成通信技术有限公司 Method for storing and retrieving mass information
CN101551826A (en) * 2009-05-19 2009-10-07 成都市华为赛门铁克科技有限公司 Data retrieval process, set and system
CN102594852A (en) * 2011-01-04 2012-07-18 中国移动通信集团公司 Data access method, node and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585548A (en) * 2004-05-25 2005-02-23 中兴通讯股份有限公司 Realizing method for distributed access positioning register VLR
CN101093482A (en) * 2006-06-19 2007-12-26 上海全成通信技术有限公司 Method for storing and retrieving mass information
CN101551826A (en) * 2009-05-19 2009-10-07 成都市华为赛门铁克科技有限公司 Data retrieval process, set and system
CN102594852A (en) * 2011-01-04 2012-07-18 中国移动通信集团公司 Data access method, node and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117422A (en) * 2017-06-23 2019-01-01 中国软件与技术服务股份有限公司 Globally unique number rapid generation and system in a kind of extensive high concurrent system
EP3668046A1 (en) * 2018-12-12 2020-06-17 Telia Company AB Access management to user related data
US11316949B2 (en) 2018-12-12 2022-04-26 Telia Company Ab Access management to user related data

Also Published As

Publication number Publication date
CN104040539A (en) 2014-09-10
CN104040539B (en) 2017-06-06

Similar Documents

Publication Publication Date Title
WO2014101240A1 (en) Data storage method and apparatus, data operation method and system, and access server
US10666661B2 (en) Authorization processing method and device
US9762449B2 (en) Distributing information
CN105959433B (en) A kind of domain name analytic method and its domain name analysis system
US7548945B2 (en) System, network device, method, and computer program product for active load balancing using clustered nodes as authoritative domain name servers
WO2017114205A1 (en) Short link processing method, device and server
JP7036899B2 (en) Alias management method and device
US20150043561A1 (en) Wireless network access technology
CN111291043A (en) Identification value query method, identification resolution server and storage medium
JP2016523416A (en) Account login method, device and system
WO2011088657A1 (en) Method, device and internet system for processing internet address information
CN101924785A (en) Data uploading and downloading methods and system
WO2014101777A1 (en) Flow table matching method and device, and switch
EP2824872A1 (en) Host providing system and communication control method
US9479490B2 (en) Methods and systems for single sign-on while protecting user privacy
CN109769249B (en) Authentication method, system and device
WO2014012424A1 (en) Method and system for communications and computer storage medium
WO2008033063A1 (en) A method and arrangement for enabling communication with a client device
WO2014075450A1 (en) Resource download method, service server and cellular phone client
CN106899621B (en) A kind of scheduling system and method
CN107547688B (en) Message processing method and device
CN112217653B (en) Strategy issuing method, device and system
WO2014206152A1 (en) Network safety monitoring method and system
WO2017097092A1 (en) Method and system for processing cache cluster service
CN104581977B (en) WLAN user management method, apparatus and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12890763

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12890763

Country of ref document: EP

Kind code of ref document: A1