[go: up one dir, main page]

CN104735103A - Method and device for managing distributed data and method and device for receiving distributed data - Google Patents

Method and device for managing distributed data and method and device for receiving distributed data Download PDF

Info

Publication number
CN104735103A
CN104735103A CN201310705903.5A CN201310705903A CN104735103A CN 104735103 A CN104735103 A CN 104735103A CN 201310705903 A CN201310705903 A CN 201310705903A CN 104735103 A CN104735103 A CN 104735103A
Authority
CN
China
Prior art keywords
user
data
account identification
account
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310705903.5A
Other languages
Chinese (zh)
Other versions
CN104735103B (en
Inventor
刘磊
肖京建
伍显峰
蔡俊
孙华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Hunan Co Ltd
Original Assignee
China Mobile Group Hunan Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Group Hunan Co Ltd filed Critical China Mobile Group Hunan Co Ltd
Priority to CN201310705903.5A priority Critical patent/CN104735103B/en
Publication of CN104735103A publication Critical patent/CN104735103A/en
Application granted granted Critical
Publication of CN104735103B publication Critical patent/CN104735103B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及通信技术领域,尤其涉及一种分布式数据的管理和接收方法、装置,以解决现有技术的分布式计费系统中,由于计费服务器的资源无法共享,造成不同的计费服务器的资源利用情况不同,导致计费系统中的计费服务器资源无法有效利用的问题。本发明实施例通过为用户标识确定一个序列号作为账户标识,为每个进程分配一个序号,将账号标识的序列号除以系统中全部计费服务器能够运行的进程的总数量得到的余数作为该账户标识对应的进程的序号;将全部账号标识近似平均的分配至每个进程中,使每个计费服务器对应的用户数量近似相等,实现合理利用系统中的计费服务器资源,以及实现不同计费服务器的之间的负载均衡,提高了系统中的资源利用率。

The present invention relates to the field of communication technology, in particular to a method and device for managing and receiving distributed data, so as to solve the problem that different charging servers cannot share the resources of the charging servers in the existing distributed charging system. The resource utilization of each server is different, which leads to the problem that the resources of the accounting server in the accounting system cannot be effectively utilized. In the embodiment of the present invention, a sequence number is determined as the account identifier for the user identifier, a sequence number is assigned to each process, and the remainder obtained by dividing the sequence number of the account identifier by the total number of processes that can be run by all billing servers in the system is used as the remainder. The serial number of the process corresponding to the account ID; distribute all account IDs to each process approximately evenly, so that the number of users corresponding to each accounting server is approximately equal, realize rational use of accounting server resources in the system, and realize different accounting The load balancing between fee servers improves the resource utilization in the system.

Description

一种分布式数据的管理和接收方法、装置A method and device for managing and receiving distributed data

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种分布式数据的管理和接收方法、装置。The invention relates to the field of communication technology, in particular to a method and device for managing and receiving distributed data.

背景技术Background technique

随着人们生活水平不断提高,移动通信用户量逐年激增,如何能够实时快速的处理用户的消费数据,越来越受到运营商和用户的关注。With the continuous improvement of people's living standards, the number of mobile communication users has increased rapidly year by year. How to process user consumption data in real time and quickly has attracted more and more attention from operators and users.

现有技术中计费处理的方式是在一个行政省中根据划分的行政地市,为每个城市配置一个计费服务器进行计费。当数据服务器接收到一个用户数据后,根据用户标识判断该用户数据对应用户的所属地,将该用户数据发送至用户所属地对应的计费服务器。用户所属地对应的计费服务器中包含多个存储空间,每个存储空间对应一个计费进程;当接收到一个用户数据后,计费服务器根据用户数据确定对应的存储空间进行计费处理。当一个城市中的用户量较大,或用户数据较多时,就会造成该城市对应的计费服务器的资源被占用率较高,甚至出现资源不足的情况;而另外一些城市的用户量较小,该城市对应的计费服务器的资源的利用率就较低。现有的计费处理方法中,不同的计费服务器接收不同城市的用户数据,并根据该城市制定的计费策略进行计费,在进行计费处理时,需要依靠这些数据进行处理,因此不同计费服务器的资源无法共享。The billing processing method in the prior art is to configure a billing server for each city to perform billing according to the divided administrative cities in an administrative province. When the data server receives a piece of user data, it judges according to the user identification that the user data corresponds to the place where the user belongs, and sends the user data to the billing server corresponding to the place where the user belongs. The billing server corresponding to the place where the user belongs contains multiple storage spaces, and each storage space corresponds to a billing process; after receiving a piece of user data, the billing server determines the corresponding storage space according to the user data to perform billing processing. When the number of users in a city is large, or there are a lot of user data, the resources of the billing server corresponding to the city will be occupied at a high rate, or even insufficient resources; while the number of users in other cities is small , the resource utilization rate of the billing server corresponding to the city is low. In the existing billing processing method, different billing servers receive user data in different cities, and perform billing according to the billing strategy formulated by the city. When performing billing processing, these data need to be relied on for processing, so different The resources of the billing server cannot be shared.

因此现有技术的分布式计费系统中,由于计费服务器的资源无法共享,造成不同的计费服务器的资源利用情况不同,导致计费系统中的计费服务器资源无法有效利用。Therefore, in the distributed charging system of the prior art, since the resources of the charging servers cannot be shared, resource utilization conditions of different charging servers are different, resulting in that the resources of the charging servers in the charging system cannot be effectively utilized.

发明内容Contents of the invention

本发明实施例提供一种分布式数据的分配及计费方法、装置,以解决现有技术的分布式计费系统中,由于计费服务器的资源无法共享,造成不同的计费服务器的资源利用情况不同,导致计费系统中的计费服务器资源无法有效利用的问题。The embodiment of the present invention provides a distributed data distribution and billing method and device to solve the problem of resource utilization of different billing servers in the distributed billing system of the prior art because the resources of the billing servers cannot be shared. The situation is different, resulting in the problem that the charging server resources in the charging system cannot be effectively utilized.

本发明实施例提供了一种分布式数据的分配方法,该方法包括:An embodiment of the present invention provides a method for distributing distributed data, the method comprising:

数据服务器接收到用户数据,根据用户数据中的用户标识确定对应的账户标识;The data server receives the user data, and determines the corresponding account ID according to the user ID in the user data;

所述数据服务器根据账户标识确定对该用户数据进行计费处理的进程,确定该账户标识对应的用户标识,记录用户标识与进程的对应关系;The data server determines the process of charging the user data according to the account identifier, determines the user identifier corresponding to the account identifier, and records the correspondence between the user identifier and the process;

所述数据服务器确定所述进程对应的计费服务器,将所述用户数据以及用户标识与进程的对应关系发送至对应的计费服务器;The data server determines the billing server corresponding to the process, and sends the user data and the correspondence between the user ID and the process to the corresponding billing server;

其中所述账户标识为一个序列号;所述数据服务器根据全部计费服务器能够运行的进程的总数量,为每个进程分配一个序号;所述数据服务器将账户标识的序列号除以所述进程的总数量得到的余数作为该账户标识对应的进程的序号;所述数据服务器根据进程的序号确定该进程对应的计费服务器。Wherein the account identification is a serial number; the data server assigns a serial number to each process according to the total number of processes that all billing servers can run; the data server divides the account identification serial number by the process The remainder obtained from the total amount is used as the serial number of the process corresponding to the account identifier; the data server determines the billing server corresponding to the process according to the serial number of the process.

上述实施例中通过为用户的用户标识确定一个序列号作为账户标识,为每个进程分配一个序号,将账号标识的序列号除以系统中全部计费服务器能够运行的进程的总数量得到的余数作为该账户标识对应的进程的序号;采用上述方法将系统中的全部账号近似平均的分配至每个进程中,使每个计费服务器对应的用户数量近似相等,实现了合理利用系统中的计费服务器资源,以及实现了不同计费服务器的之间的负载均衡,提高了系统中的资源利用率。In the above embodiment, a sequence number is determined as the account identifier for the user ID of the user, a sequence number is assigned to each process, and the remainder obtained by dividing the sequence number of the account identifier by the total number of processes that can be run by all billing servers in the system As the serial number of the process corresponding to the account identifier; using the above method, all the accounts in the system are approximately evenly distributed to each process, so that the number of users corresponding to each accounting server is approximately equal, and the rational use of accounting in the system is realized. Billing server resources and load balancing between different billing servers are realized, which improves resource utilization in the system.

进一步的,本发明实施例中所述数据服务器根据用户数据中的用户标识确定对应的账户标识,具体包括:Further, the data server in the embodiment of the present invention determines the corresponding account identifier according to the user identifier in the user data, specifically including:

所述数据服务器预先存储用户标识与账户标识的对应关系,根据预先存储的用户标识与账户标识的对应关系确定该用户数据中的用户标识对应的账户标识。The data server pre-stores the corresponding relationship between the user ID and the account ID, and determines the account ID corresponding to the user ID in the user data according to the pre-stored corresponding relationship between the user ID and the account ID.

上述实施例中数据服务器中预先存储了用户标识与账户标识的对应关系,接收到用户数据后,确定用户数据中的用户标识对应的账户标识。In the above embodiment, the data server pre-stores the correspondence between the user ID and the account ID, and after receiving the user data, determines the account ID corresponding to the user ID in the user data.

本发明实施例中还包括:Embodiments of the present invention also include:

所述数据服务器对所述用户标识对应的账户标识进行变更,确定用户标识对应的变更后的账户标识,存储用户标识与变更后的账户标识的对应关系;The data server changes the account ID corresponding to the user ID, determines the changed account ID corresponding to the user ID, and stores the corresponding relationship between the user ID and the changed account ID;

所述数据服务器确定用户标识与变更后的账户标识的对应关系的生效时间;到达生效时间前,所述数据服务器确定用户标识对应变更前的账户标识;到达生效时间,所述数据服务器确定用户标识对应变更后的账户标识。The data server determines the effective time of the corresponding relationship between the user ID and the changed account ID; before the effective time is reached, the data server determines that the user ID corresponds to the account ID before the change; when the effective time is reached, the data server determines the user ID Corresponding to the changed account ID.

上述实施例中数据服务器确定用户标识与变更后的账户标识的对应关系的生效时间,根据生效时间确定何时根据用户标识确定变更后的账户标识。如用户在本月变更了对应的账户,数据服务器立刻更新用户标识与账户标识的对应关系,但在本月仍旧使用原有的用户标识与存储空间的地址的对应关系,在下个月初始使用用户标识与变更后的账户标识的对应关系,方便对用户对应的账户进行数据监控。In the above embodiment, the data server determines the effective time of the corresponding relationship between the user ID and the changed account ID, and determines when to determine the changed account ID based on the user ID according to the effective time. If the user changes the corresponding account this month, the data server will update the corresponding relationship between the user ID and the account ID immediately, but the original corresponding relationship between the user ID and the address of the storage space will still be used this month. The corresponding relationship between the ID and the changed account ID facilitates data monitoring of the account corresponding to the user.

本发明实施例中所述数据服务器根据用户数据中的用户标识确定对应的账户标识,具体包括:In the embodiment of the present invention, the data server determines the corresponding account ID according to the user ID in the user data, specifically including:

所述数据服务器确定预先存储的用户标识与账户标识的对应关系中未存储该用户标识对应的账户标识,则所述数据服务器随机生成一个序列号,将该序列号作为该用户标识对应的账户标识。The data server determines that the account identifier corresponding to the user identifier is not stored in the pre-stored correspondence between the user identifier and the account identifier, then the data server randomly generates a serial number, and uses the serial number as the account identifier corresponding to the user identifier .

上述实施例中当用户首次使用该用户标识时,数据服务器为其生成一个序列号作为账户,以便于根据账户标识确定对该用户数据进行计费处理的进程。In the above embodiment, when the user uses the user ID for the first time, the data server generates a serial number as an account, so as to determine the process of charging the user data according to the account ID.

本发明实施例还包括:Embodiments of the invention also include:

所述数据服务器确定计费服务器的数量发生变化,重新确定全部计费服务器能够运行的进程的总数量,重新为每个进程分配序号;The data server determines that the number of billing servers has changed, re-determines the total number of processes that all billing servers can run, and reassigns a serial number to each process;

所述数据服务器将账户标识的序列号除以重新确定的进程的总数量得到一个余数,将该余数作为账户标识对应的更新后的进程的序号;所述数据服务器根据更新后的进程的序号确定该进程对应的计费服务器。The data server divides the serial number of the account identifier by the total number of re-determined processes to obtain a remainder, and uses the remainder as the serial number of the updated process corresponding to the account identifier; the data server determines the process according to the serial number of the updated process Accounting server corresponding to this process.

上述实施例中当计费系统扩容后,数据服务器根据扩容后的计费服务器能够运行的进程的总数量重新对账户进行分配,使扩容后的计费系统中的服务器实现负载均衡。In the above embodiment, after the billing system is expanded, the data server re-allocates accounts according to the total number of processes that the billing server can run after the billing, so that the servers in the billing system after the billing can achieve load balancing.

本发明实施例还提供了一种分布式数据的接收方法,该方法包括:The embodiment of the present invention also provides a distributed data receiving method, the method comprising:

计费服务器接收数据服务器发送的用户数据以及用户标识与进程的对应关系;The billing server receives the user data sent by the data server and the corresponding relationship between the user ID and the process;

所述计费服务器根据用户标识与进程的对应关系将用户数据发送至计费服务器对应的进程中;The billing server sends the user data to the process corresponding to the billing server according to the correspondence between the user identifier and the process;

所述计费服务器的进程根据用户标识确定对应的计费规则,根据确定的计费规则对所述用户数据进行计费处理。The process of the charging server determines a corresponding charging rule according to the user identifier, and performs charging processing on the user data according to the determined charging rule.

上述实施例中计费服务器根据用户标识与进程的对应关系确定进行计费处理的进程,进程根据用户标识确定对用户数据进行计费处理的计费规则。由于计费服务器的进程中存储了全部的计费规则,能够根据接收到的用户数据的用户标识对用户数据进行计费处理,避免了计费服务器只能对固定区域的用户数据进行计费处理的问题。In the above embodiment, the charging server determines the process for charging processing according to the correspondence between the user identifier and the process, and the process determines the charging rule for performing charging processing on user data according to the user identifier. Since all billing rules are stored in the process of the billing server, the user data can be billed according to the user ID of the received user data, avoiding that the billing server can only bill the user data in a fixed area The problem.

本发明实施例提供了一种分布式数据的管理装置,该装置包括:An embodiment of the present invention provides a distributed data management device, which includes:

账户标识确定单元,用于接收到用户数据,根据用户数据中的用户标识确定对应的账户标识;The account identifier determination unit is configured to receive the user data, and determine the corresponding account identifier according to the user identifier in the user data;

用户数据划分单元,用于根据账户标识确定对该用户数据进行计费处理的进程,确定该账户标识对应的用户标识,记录用户标识与进程的对应关系;The user data division unit is used to determine the process of charging the user data according to the account identifier, determine the user identifier corresponding to the account identifier, and record the corresponding relationship between the user identifier and the process;

用户数据发送单元,用于确定所述进程对应的计费服务器,将所述用户数据以及用户标识与进程的对应关系发送至对应的计费服务器;The user data sending unit is configured to determine the billing server corresponding to the process, and send the user data and the correspondence between the user ID and the process to the corresponding billing server;

其中所述账户标识为一个序列号;所述用户数据划分单元还用于:根据全部计费服务器能够运行的进程的总数量,为每个进程分配一个序号;将账户标识的序列号除以所述进程的总数量得到的余数作为该账户标识对应的进程的序号;根据进程的序号确定该进程对应的计费服务器。Wherein the account identification is a serial number; the user data division unit is also used for: assigning a serial number to each process according to the total number of processes that all billing servers can run; dividing the serial number of the account identification by the The remainder obtained from the total number of the above-mentioned processes is used as the serial number of the process corresponding to the account identifier; and the billing server corresponding to the process is determined according to the serial number of the process.

上述实施例中通过为用户的用户标识确定一个序列号作为账户标识,为每个进程分配一个序号,将账号标识的序列号除以系统中全部计费服务器能够运行的进程的总数量得到的余数作为该账户标识对应的进程的序号;采用上述方法将系统中的全部账号近似平均的分配至每个进程中,使每个计费服务器对应的用户数量近似相等,实现了合理利用系统中的计费服务器资源,以及实现了不同计费服务器的之间的负载均衡,提高了系统中的资源利用率。In the above embodiment, a sequence number is determined as the account identifier for the user ID of the user, a sequence number is assigned to each process, and the remainder obtained by dividing the sequence number of the account identifier by the total number of processes that can be run by all billing servers in the system As the serial number of the process corresponding to the account identifier; using the above method, all the accounts in the system are approximately evenly distributed to each process, so that the number of users corresponding to each accounting server is approximately equal, and the rational use of accounting in the system is realized. Billing server resources and load balancing between different billing servers are realized, which improves resource utilization in the system.

进一步的,本发明实施例中所述账户标识确定单元具体用于:Further, the account identification determination unit described in the embodiment of the present invention is specifically used for:

预先存储用户标识与账户标识的对应关系,根据预先存储的用户标识与账户标识的对应关系确定该用户数据中的用户标识对应的账户标识。The corresponding relationship between the user ID and the account ID is stored in advance, and the account ID corresponding to the user ID in the user data is determined according to the pre-stored corresponding relationship between the user ID and the account ID.

上述实施例中数据服务器中预先存储了用户标识与账户标识的对应关系,接收到用户数据后,确定用户数据中的用户标识对应的账户标识。In the above embodiment, the data server pre-stores the correspondence between the user ID and the account ID, and after receiving the user data, determines the account ID corresponding to the user ID in the user data.

本发明实施例中所述账户标识确定单元还用于:The account identification determination unit in the embodiment of the present invention is also used for:

对所述用户标识对应的账户标识进行变更,确定用户标识对应的变更后的账户标识,存储用户标识与变更后的账户标识的对应关系;确定用户标识与变更后的账户标识的对应关系的生效时间;到达生效时间前,确定用户标识对应变更前的账户标识;到达生效时间,确定用户标识对应变更后的账户标识。Change the account ID corresponding to the user ID, determine the changed account ID corresponding to the user ID, store the corresponding relationship between the user ID and the changed account ID; determine the effectiveness of the corresponding relationship between the user ID and the changed account ID Time; before the effective time is reached, it is determined that the user ID corresponds to the account ID before the change; when the effective time is reached, it is determined that the user ID corresponds to the account ID after the change.

上述实施例中数据服务器确定用户标识与变更后的账户标识的对应关系的生效时间,根据生效时间确定何时根据用户标识确定变更后的账户标识。如用户在本月变更了对应的账户,数据服务器立刻更新用户标识与账户标识的对应关系,但在本月仍旧使用原有的用户标识与存储空间的地址的对应关系,在下个月初始使用用户标识与变更后的账户标识的对应关系,方便对用户对应的账户进行数据监控。In the above embodiment, the data server determines the effective time of the corresponding relationship between the user ID and the changed account ID, and determines when to determine the changed account ID based on the user ID according to the effective time. If the user changes the corresponding account this month, the data server will update the corresponding relationship between the user ID and the account ID immediately, but the original corresponding relationship between the user ID and the address of the storage space will still be used this month. The corresponding relationship between the ID and the changed account ID facilitates data monitoring of the account corresponding to the user.

本发明实施例中所述账户标识确定单元具体用于:The account identification determination unit described in the embodiment of the present invention is specifically used for:

确定预先存储的用户标识与账户标识的对应关系中未存储该用户标识对应的账户标识,则随机生成一个序列号,将该序列号作为该用户标识对应的账户标识。If it is determined that the account identifier corresponding to the user identifier is not stored in the pre-stored correspondence between the user identifier and the account identifier, a serial number is randomly generated, and the serial number is used as the account identifier corresponding to the user identifier.

上述实施例中当用户首次使用该用户标识时,数据服务器为其生成一个序列号作为账户,以便于根据账户标识确定对该用户数据进行计费处理的进程。In the above embodiment, when the user uses the user ID for the first time, the data server generates a serial number as an account, so as to determine the process of charging the user data according to the account ID.

本发明实施例中所述用户数据划分单元还用于:The user data division unit described in the embodiment of the present invention is also used for:

确定计费服务器的数量发生变化,重新确定全部计费服务器能够运行的进程的总数量,重新为每个进程分配序号;将账户标识的序列号除以重新确定的进程的总数量得到一个余数,将该余数作为账户标识对应的更新后的进程的序号;根据更新后的进程的序号确定该进程对应的计费服务器。Determine that the number of billing servers has changed, re-determine the total number of processes that all billing servers can run, and reassign a serial number to each process; divide the serial number of the account ID by the total number of re-determined processes to get a remainder, The remainder is used as the serial number of the updated process corresponding to the account identifier; and the billing server corresponding to the process is determined according to the serial number of the updated process.

上述实施例中当计费系统扩容后,数据服务器根据扩容后的计费服务器能够运行的进程的总数量重新对账户进行分配,使扩容后的计费系统中的服务器实现负载均衡。In the above embodiment, after the billing system is expanded, the data server re-allocates accounts according to the total number of processes that the billing server can run after the billing, so that the servers in the billing system after the billing can achieve load balancing.

本发明实施例还提供了一种分布式数据的接收装置,该装置包括:The embodiment of the present invention also provides a distributed data receiving device, which includes:

数据接收单元,用于接收数据服务器发送的用户数据以及用户标识与进程的对应关系;The data receiving unit is used to receive the user data sent by the data server and the corresponding relationship between the user identification and the process;

数据发送单元,用于根据用户标识与进程的对应关系将用户数据发送至计费服务器对应的进程中;A data sending unit, configured to send user data to a process corresponding to the billing server according to the correspondence between the user identifier and the process;

计费处理单元,用于根据用户标识确定对应的计费规则,根据确定的计费规则对所述用户数据进行计费处理。The charging processing unit is configured to determine a corresponding charging rule according to the user identifier, and perform charging processing on the user data according to the determined charging rule.

上述实施例中装置根据用户标识与进程的对应关系确定进行计费处理的进程,进程根据用户标识确定对用户数据进行计费处理的计费规则。由于装置的进程中存储了全部的计费规则,能够根据接收到的用户数据的用户标识对用户数据进行计费处理,避免了计费服务器只能对固定区域的用户数据进行计费处理的问题。In the above embodiment, the device determines the process for charging processing according to the correspondence between the user ID and the process, and the process determines the charging rule for charging user data according to the user ID. Since all billing rules are stored in the process of the device, user data can be billed according to the user ID of the received user data, avoiding the problem that the billing server can only bill user data in a fixed area .

本发明实施例中通过为用户的用户标识确定一个序列号作为账户标识,为每个进程分配一个序号,将账号标识的序列号除以系统中全部计费服务器能够运行的进程的总数量得到的余数作为该账户标识对应的进程的序号;采用上述方法将系统中的全部账号近似平均的分配至每个进程中,使每个计费服务器对应的用户数量近似相等,实现了合理利用系统中的计费服务器资源,以及实现了不同计费服务器的之间的负载均衡,提高了系统中的资源利用率。In the embodiment of the present invention, a serial number is determined as the account identifier for the user ID of the user, a serial number is assigned to each process, and the serial number of the account identifier is divided by the total number of processes that can be run by all billing servers in the system to obtain The remainder is used as the sequence number of the process corresponding to the account identifier; using the above method, all accounts in the system are approximately evenly distributed to each process, so that the number of users corresponding to each billing server is approximately equal, and a reasonable utilization of the system is realized. Accounting server resources and load balancing between different accounting servers are realized, which improves resource utilization in the system.

附图说明Description of drawings

图1为本发明实施例中一种分布式数据的管理方法的流程示意图;FIG. 1 is a schematic flow diagram of a method for managing distributed data in an embodiment of the present invention;

图2为本发明实施例中数据迁移的示意图;Fig. 2 is the schematic diagram of data migration in the embodiment of the present invention;

图3为本发明实施例中一种分布式数据的具体管理方法的流程示意图;FIG. 3 is a schematic flowchart of a specific management method for distributed data in an embodiment of the present invention;

图4为本发明实施例中一种用户标识变更对应的进程的方法的流程示意图;FIG. 4 is a schematic flowchart of a method for changing a process corresponding to a user ID in an embodiment of the present invention;

图5为本发明实施例中一种分布式数据的发送方法的流程示意图;FIG. 5 is a schematic flowchart of a method for sending distributed data in an embodiment of the present invention;

图6为本发明实施例中一种分布式数据的接收方法的流程示意图;FIG. 6 is a schematic flowchart of a method for receiving distributed data in an embodiment of the present invention;

图7为本发明实施例中一种分布式数据的管理装置的示意图;FIG. 7 is a schematic diagram of a distributed data management device in an embodiment of the present invention;

图8为本发明实施例中一种分布式数据的接收装置的示意图。FIG. 8 is a schematic diagram of a device for receiving distributed data in an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例提供了一种分布式数据的分配及计费方法、装置,由于将系统中的全部账号近似平均的分配至每个进程中,使每个计费服务器对应的用户数量近似相等,实现了合理利用系统中的计费服务器资源,以及实现了不同计费服务器的之间的负载均衡,提高了系统中的资源利用率。The embodiment of the present invention provides a distributed data distribution and billing method and device. Since all accounts in the system are approximately evenly distributed to each process, the number of users corresponding to each billing server is approximately equal. Realize the reasonable use of the accounting server resources in the system, and realize the load balance between different accounting servers, and improve the resource utilization rate in the system.

下面结合说明书附图进行进一步说明。Further description will be made below in conjunction with the accompanying drawings of the description.

如图1所示,为本发明实施例中一种分布式数据的管理方法,该方法包括:As shown in Figure 1, it is a distributed data management method in the embodiment of the present invention, the method includes:

步骤101:数据服务器接收到用户数据,根据用户数据中的用户标识确定对应的账户标识;Step 101: The data server receives the user data, and determines the corresponding account ID according to the user ID in the user data;

步骤102:数据服务器根据账户标识确定对该用户数据进行计费处理的进程,确定该账户标识对应的用户标识,记录用户标识与进程的对应关系;Step 102: The data server determines the process of charging the user data according to the account ID, determines the user ID corresponding to the account ID, and records the correspondence between the user ID and the process;

步骤103:数据服务器确定进程对应的计费服务器,将用户数据以及用户标识与进程的对应关系发送至对应的计费服务器;Step 103: The data server determines the billing server corresponding to the process, and sends the user data and the correspondence between the user ID and the process to the corresponding billing server;

其中账户标识为一个序列号;数据服务器根据全部计费服务器能够运行的进程的总数量,为每个进程分配一个序号;数据服务器将账户标识的序列号除以进程的总数量得到的余数作为该账户标识对应的进程的序号;数据服务器根据进程的序号确定该进程对应的计费服务器。The account ID is a serial number; the data server assigns a serial number to each process according to the total number of processes that all accounting servers can run; the data server divides the serial number of the account ID by the total number of processes as the remainder. The serial number of the process corresponding to the account identifier; the data server determines the accounting server corresponding to the process according to the serial number of the process.

步骤101中数据服务器根据用户数据中的用户标识确定对应的账户标识,具体包括:In step 101, the data server determines the corresponding account identifier according to the user identifier in the user data, specifically including:

数据服务器预先存储用户标识与账户标识的对应关系,根据预先存储的用户标识与账户标识的对应关系确定该用户数据中的用户标识对应的账户标识。若数据服务器确定预先存储的用户标识与账户标识的对应关系中未存储该用户标识对应的账户标识,则数据服务器随机生成一个序列号,将该序列号作为该用户标识对应的账户标识。The data server pre-stores the correspondence between the user ID and the account ID, and determines the account ID corresponding to the user ID in the user data according to the pre-stored correspondence between the user ID and the account ID. If the data server determines that the account ID corresponding to the user ID is not stored in the pre-stored correspondence between the user ID and the account ID, the data server randomly generates a serial number and uses the serial number as the account ID corresponding to the user ID.

其中每个用户标识唯一对应一个账户标识,每个账户标识对应至少一个用户标识。用户标识是每个终端唯一对应的一个标识,如一个终端对应的电话号码就可以作为一个用户标识;数据服务器可以为一个用户标识生成一个账户标识。一个账户标识也可以对应多个用户标识,如一个公司的员工,每个员工的一个终端对应一个用户标识,所有员工的全部用户终端对应的全部用户标识对应同一个账户标识。Each user ID uniquely corresponds to an account ID, and each account ID corresponds to at least one user ID. The user ID is an ID uniquely corresponding to each terminal, for example, the phone number corresponding to a terminal can be used as a user ID; the data server can generate an account ID for a user ID. One account identifier can also correspond to multiple user identifiers. For example, for employees of a company, one terminal of each employee corresponds to one user identifier, and all user identifiers corresponding to all user terminals of all employees correspond to the same account identifier.

较佳地,步骤101中还包括:数据服务器对用户标识对应的账户标识进行变更,确定用户标识对应的变更后的账户标识,存储用户标识与变更后的账户标识的对应关系;数据服务器确定用户标识与变更后的账户标识的对应关系的生效时间;到达生效时间前,数据服务器确定用户标识对应变更前的账户标识;到达生效时间,数据服务器确定用户标识对应变更后的账户标识。Preferably, step 101 also includes: the data server changes the account ID corresponding to the user ID, determines the changed account ID corresponding to the user ID, and stores the corresponding relationship between the user ID and the changed account ID; the data server determines the user The effective time of the corresponding relationship between the identifier and the changed account identifier; before the effective time is reached, the data server determines that the user identifier corresponds to the account identifier before the change; when the effective time is reached, the data server determines that the user identifier corresponds to the changed account identifier.

数据服务器对用户标识对应的账户标识进行变更时,同时设定用户标识与变更后的账户标识的对应关系的生效时间,以及用户标识与变更前的账户标识的对应关系的失效时间,失效时间略晚于生效时间;当到达生效时间前,数据服务器确定用户标识对应变更前的账户标识;到达生效时间后,数据服务器确定用户标识对应变更后的账户标识,并将用户数据同时发送至变更前的账户标识对应的进程和变更后账户标识对应的进程;到达失效时间后,数据服务器确定用户标识对应变更后的账户标识,并将用户数据只发送至变更后的账户标识对应的进程。When the data server changes the account ID corresponding to the user ID, it also sets the effective time of the corresponding relationship between the user ID and the changed account ID, and the expiration time of the corresponding relationship between the user ID and the account ID before the change. The expiration time is abbreviated. Later than the effective time; before the effective time is reached, the data server determines that the user ID corresponds to the account ID before the change; after the effective time is reached, the data server determines that the user ID corresponds to the changed account ID, and simultaneously sends the user data to the account ID before the change The process corresponding to the account ID and the process corresponding to the changed account ID; when the expiration time is reached, the data server determines that the user ID corresponds to the changed account ID, and only sends the user data to the process corresponding to the changed account ID.

步骤102中数据服务器根据账户标识确定对该用户数据进行计费处理的进程,确定该账户标识对应的用户标识,记录用户标识与进程的对应关系,具体包括:数据服务器确定系统中全部计费服务器能够运行的进程的总数量N,并为每个进程分配一个序号,序号从0~N-1,其中N为正整数;数据服务器确定账户标识的序列号,将账户标识的序列号除以进程的总数量N得到一个余数,将得到的余数作为该账户标识对应的进程,根据进程的编号确定对应的计费服务器。如系统中有5个计费服务器,共有57个进程,1号计费服务器的进程序号从0~11,2号计费服务器的进程序号从12~23,3号计费服务器的进程序号从24~35,4号计费服务器的进程序号从36~47,5号计费服务器的进程序号从48~57,当一个账户标识对应得到的余数为15,则确定该账户标识对应的进程的序号为15,序号为15的进程位于2号计费服务器中,则该账户标识对应的计费服务器为2号服务器;根据该账户标识对应的用户标识,记录该账户标识对应的用户标识与进程序号的对应关系。每个计费服务器中运行的进程的数量可以是相同也可以不相同。每个计费服务器能够运行的进程的数量越多,计费系统的扩容性也就越好,但是每个计费服务器的处理能力有限,因此,每个服务器运行的进程的数量根据当前用户的数量以及计费处理器的处理能力确定。In step 102, the data server determines the process of charging the user data according to the account identifier, determines the user identifier corresponding to the account identifier, and records the corresponding relationship between the user identifier and the process, specifically including: the data server determines that all billing servers in the system The total number N of processes that can run, and assign a serial number to each process, the serial number is from 0 to N-1, where N is a positive integer; the data server determines the serial number of the account ID, and divides the serial number of the account ID by the process A remainder is obtained from the total number N, and the obtained remainder is used as the process corresponding to the account identifier, and the corresponding billing server is determined according to the number of the process. For example, there are 5 billing servers in the system, and there are 57 processes in total. The incoming program numbers of No. 1 billing server range from 0 to 11, the incoming program numbers of No. 24 to 35, the incoming program number of No. 4 billing server is from 36 to 47, and the incoming program number of No. 5 billing server is from 48 to 57. When the remainder corresponding to an account ID is 15, determine the number of the process corresponding to the account ID. The serial number is 15, and the process with the serial number 15 is located in the No. 2 billing server, then the billing server corresponding to the account ID is the No. 2 server; according to the user ID corresponding to the account ID, record the user ID and process corresponding to the account ID Correspondence between serial numbers. The number of processes running in each accounting server may be the same or different. The more processes that each accounting server can run, the better the scalability of the accounting system, but the processing capacity of each accounting server is limited. Therefore, the number of processes that each server can run depends on the current user's The quantity and processing capacity of the billing processor are determined.

本发明实施例中优选的采用除余数法确定每个账户标识对应的进程,其他能够将账户标识平均分配至每个进程的方法也适用于本发明,在此不再一一列举。In the embodiment of the present invention, the division method is preferably used to determine the process corresponding to each account ID. Other methods that can evenly distribute the account ID to each process are also applicable to the present invention, and will not be listed here.

步骤102中还包括:当用户标识变更对应的账户标识后,根据账户标识更新用户标识对应的进程,并在用户标识与变更后的账户标识的对应关系生效的同时,触发更新的用户标识与进程的对应关系生效;并在用户标识与变更前的账户标识的对应关系到达失效时间,触发更新前的用户标识与进程的对应关系失效;确定用户标识对应的原进程中的该用户标识对应的用户数据全部处理完毕,将原进程中的用户标识对应的用户数据迁移至更新后的进程中。Step 102 also includes: when the user ID changes the corresponding account ID, update the process corresponding to the user ID according to the account ID, and trigger the updated user ID and process when the corresponding relationship between the user ID and the changed account ID takes effect. The corresponding relationship between the user ID and the account ID before the change reaches the expiration time, triggering the invalidation of the corresponding relationship between the user ID and the process before the update; determine the user corresponding to the user ID in the original process corresponding to the user ID After all the data is processed, the user data corresponding to the user ID in the original process is migrated to the updated process.

步骤102中还包括:数据服务器确定计费服务器的数量发生变化,重新确定全部计费服务器能够运行的进程的总数量,重新为每个进程分配序号;数据服务器将账户标识的序列号除以重新确定的进程的总数量得到一个余数,将该余数作为账户标识对应的更新后的进程的序号;数据服务器根据更新后的进程的序号确定该进程对应的计费服务器。数据服务器将账户标识对应的更新前的进程中的数据迁移至账户标识对应的更新后的进程中。Step 102 also includes: the data server determines that the number of accounting servers has changed, re-determines the total number of processes that all accounting servers can run, and redistributes a sequence number for each process; the data server divides the sequence number of the account identifier by the new A remainder is obtained from the determined total number of processes, and the remainder is used as the sequence number of the updated process corresponding to the account identifier; the data server determines the billing server corresponding to the process according to the sequence number of the updated process. The data server migrates the data in the pre-update process corresponding to the account identifier to the updated process corresponding to the account identifier.

如图2所示为本发明实施例中数据迁移的示意图,其中21为用户标识对应的变更前的进程中存储用户标识对应的用户数据的存储空间,22为用户标识对应的变更后的进程中存储用户标识对应的用户数据的存储空间;T0为用户标识变更对应的进程的时刻,T1为用户标识与变更后的进程的生效时刻,T2为用户标识与变更前的进程的失效时刻;201为数据迁移准备窗口,202为数据迁移窗口,203为数据清理窗口;T0时刻数据服务器接收到用户标识变更对应的进程的信息,准备将变更前的进程的存储空间MDB1中的用户标识对应的用户数据进行迁移,此时数据服务器将用户数据依然发送至变更前的进程中;当到达用户标识与变更后的进程的生效时刻T1,变更前的进程将存储空间MDB1中的用户数据迁移至变更后的进程的存储空间MDB2中,此时数据服务器将用户数据同时发送至变更前的进程和变更后的进程中;当到达用户标识与变更前的进程的失效时刻T2,数据服务器只将用户数据同时发送至变更后的进程中,并同时清理变更前的进程的存储空间MDB1中的用户数据,完成数据迁移。Figure 2 is a schematic diagram of data migration in the embodiment of the present invention, where 21 is the storage space for storing user data corresponding to the user ID in the process before the change corresponding to the user ID, and 22 is the process after the change corresponding to the user ID The storage space for storing the user data corresponding to the user ID; T 0 is the moment when the user ID changes the corresponding process, T 1 is the effective time of the user ID and the changed process, and T 2 is the invalidation time of the user ID and the process before the change ; 201 is the data migration preparation window, 202 is the data migration window, and 203 is the data cleaning window; at T0 , the data server receives the information of the process corresponding to the user identification change, and prepares to transfer the user in the storage space MDB 1 of the process before the change The user data corresponding to the identification is migrated. At this time, the data server still sends the user data to the process before the change; when the effective time T 1 of the user ID and the process after the change is reached, the process before the change will store the data in the MDB 1 The user data is migrated to the storage space MDB 2 of the changed process. At this time, the data server sends the user data to the process before the change and the process after the change at the same time; , the data server only sends the user data to the changed process at the same time, and cleans up the user data in the storage space MDB 1 of the process before the change at the same time to complete the data migration.

如图3所示,为本发明实施例中一种分布式数据的具体管理方法,该方法包括:As shown in Figure 3, it is a specific management method of distributed data in the embodiment of the present invention, the method includes:

步骤301:数据服务器为用户标识随机生成一个序列号作为账户标识,存储账户标识与用户标识的对应关系;Step 301: The data server randomly generates a serial number for the user ID as the account ID, and stores the corresponding relationship between the account ID and the user ID;

步骤302:数据服务器确定全部计费服务器能够运行的进程的总数量,并为每个进程分配一个序号;Step 302: the data server determines the total number of processes that all accounting servers can run, and assigns a serial number to each process;

步骤303:数据服务器根据每个计费服务器划分的存储空间的数量确定计费服务器包含的存储空间的总数量;Step 303: the data server determines the total amount of storage space included in the accounting server according to the amount of storage space divided by each accounting server;

步骤304:数据服务器将账户标识的序列号除以进程的总数量得到的余数作为该账户标识对应的进程的序号;Step 304: The data server divides the serial number of the account ID by the total number of processes to obtain the remainder as the serial number of the process corresponding to the account ID;

步骤305:数据服务器根据进程的序号确定对应的计费服务器;Step 305: the data server determines the corresponding billing server according to the sequence number of the process;

步骤306:数据服务器根据账户标识与用户标识的对应关系,确定用户标识与进程的对应关系,并结束本流程。Step 306: The data server determines the corresponding relationship between the user ID and the process according to the corresponding relationship between the account ID and the user ID, and ends the process.

如图4所示,为本发明实施例中一种用户标识变更对应的进程的方法,该方法包括:As shown in Figure 4, it is a method for changing the corresponding process of the user ID in the embodiment of the present invention, the method includes:

步骤401:数据服务器接收到用户标识变更对应的账户标识的信息;Step 401: The data server receives information about the account ID corresponding to the user ID change;

步骤402:数据服务器确定用户标识对应的变更后的账户标识;Step 402: The data server determines the changed account ID corresponding to the user ID;

步骤403:数据服务器设置用户标识对应的变更后的账户标识的生效时间,以及用户标识对应的变更前的账户标识的失效时间;Step 403: The data server sets the effective time of the changed account ID corresponding to the user ID, and the expiration time of the account ID before the change corresponding to the user ID;

步骤404:数据服务器确定用户标识对应的变更后的账户标识对应的进程;存储用户标识于变更后的进程的对应关系,并结束本流程。Step 404: The data server determines the process corresponding to the changed account ID corresponding to the user ID; stores the corresponding relationship between the user ID and the changed process, and ends the process.

如图5所示,为本发明实施例中一种分布式数据的发送方法,该方法包括:As shown in Figure 5, it is a method for sending distributed data in the embodiment of the present invention, the method includes:

步骤501:数据服务器接收到用户数据;Step 501: the data server receives user data;

步骤502:数据服务器判断该用户数据中的用户标识对应的进程是否发生变更,若未发生变更,则执行步骤503,否则执行步骤504;Step 502: The data server judges whether the process corresponding to the user identifier in the user data has changed, if not, execute step 503, otherwise execute step 504;

步骤503:数据服务器根据用户标识与进程的对应关系将用户数据发送至对应的进程中,并结束本流程;Step 503: The data server sends the user data to the corresponding process according to the correspondence between the user ID and the process, and ends the process;

步骤504:数据服务器判断是否到达用户标识与变更后的进程的生效时间,若到达,则执行步骤505,否则执行步骤506;Step 504: The data server judges whether the effective time of the user ID and the changed process has been reached, if so, execute step 505, otherwise execute step 506;

步骤505:数据服务器将用户数据发送至变更后的进程中,并结束本流程;Step 505: the data server sends the user data to the changed process, and ends the process;

步骤506:数据服务器将用户数据发送至变更前的进程中,并结束本流程。Step 506: The data server sends the user data to the process before the change, and ends the process.

如图6所示,为本发明实施例中一种分布式数据的接收方法,该方法包括:As shown in Figure 6, it is a distributed data receiving method in the embodiment of the present invention, the method includes:

步骤601:计费服务器接收数据服务器发送的用户数据以及用户标识与进程的对应关系;Step 601: The billing server receives the user data sent by the data server and the corresponding relationship between the user ID and the process;

步骤602:计费服务器根据用户标识与进程的对应关系将用户数据发送至计费服务器对应的进程中;Step 602: The billing server sends the user data to the process corresponding to the billing server according to the correspondence between the user identifier and the process;

步骤603:计费服务器的进程根据用户标识确定对应的计费规则,根据确定的计费规则对用户数据进行计费处理。Step 603: The process of the charging server determines the corresponding charging rule according to the user identifier, and performs charging processing on the user data according to the determined charging rule.

其中步骤602中计费服务器根据预先存储的用户标识与进程的对应关系确定用户标识对应的进程;计费服务器接收到数据服务器发送的用户数据以及用户标识与进程的对应关系,确定用户标识对应的进程,将用户数据发送至对应的进程中。Wherein in step 602, the billing server determines the process corresponding to the user ID according to the corresponding relationship between the user ID and the process stored in advance; the billing server receives the user data sent by the data server and the corresponding relationship between the user ID and the process, and determines the corresponding Process, send user data to the corresponding process.

步骤603中计费服务器的进程根据用户标识确定对应的计费规则,根据确定的计费规则对用户数据进行计费处理;每个进程中都存储了全部的计费规则,根据接收到的用户标识,确定该用户标识对应的计费规则,对接收到的用户数据进行计费处理。In step 603, the process of the charging server determines the corresponding charging rule according to the user identification, and performs charging processing on the user data according to the determined charging rule; all charging rules are stored in each process, and according to the received user ID, determine the charging rule corresponding to the user ID, and perform charging processing on the received user data.

基于同一发明构思,本发明实施例中还提供了一种分布式数据的管理装置,由于该装置解决问题的原理与本发明实施例一种分布式数据的管理方法相似,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, an embodiment of the present invention also provides a distributed data management device. Since the problem-solving principle of the device is similar to a distributed data management method in the embodiment of the present invention, the implementation of the device can Refer to the implementation of the method, and the repetition will not be repeated.

如图7所示,为本发明实施例中一种分布式数据的管理装置,该装置包括:As shown in Figure 7, it is a distributed data management device in the embodiment of the present invention, which includes:

账户标识确定单元701,用于接收到用户数据,根据用户数据中的用户标识确定对应的账户标识;An account identifier determining unit 701, configured to receive user data, and determine a corresponding account identifier according to the user identifier in the user data;

用户数据划分单元702,用于根据账户标识确定对该用户数据进行计费处理的进程,确定该账户标识对应的用户标识,记录用户标识与进程的对应关系;The user data division unit 702 is configured to determine the process of charging the user data according to the account identifier, determine the user identifier corresponding to the account identifier, and record the correspondence between the user identifier and the process;

用户数据发送单元703,用于确定进程对应的计费服务器,将用户数据以及用户标识与进程的对应关系发送至对应的计费服务器;The user data sending unit 703 is configured to determine the billing server corresponding to the process, and send the user data and the correspondence between the user ID and the process to the corresponding billing server;

其中账户标识为一个序列号;用户数据划分单元702还用于:根据全部计费服务器能够运行的进程的总数量,为每个进程分配一个序号;将账户标识的序列号除以所述进程的总数量得到的余数作为该账户标识对应的进程的序号;根据进程的序号确定该进程对应的计费服务器。Wherein the account identification is a serial number; the user data division unit 702 is also used for: according to the total number of processes that all charging servers can run, assign a serial number to each process; divide the serial number of the account identification by the process number The remainder obtained from the total amount is used as the serial number of the process corresponding to the account identifier; the billing server corresponding to the process is determined according to the serial number of the process.

账户标识确定单元701具体用于:预先存储用户标识与账户标识的对应关系,根据预先存储的用户标识与账户标识的对应关系确定该用户数据中的用户标识对应的账户标识。若确定预先存储的用户标识与账户标识的对应关系中未存储该用户标识对应的账户标识,则随机生成一个序列号,将该序列号作为该用户标识对应的账户标识。The account identifier determining unit 701 is specifically configured to: pre-store the correspondence between the user identifier and the account identifier, and determine the account identifier corresponding to the user identifier in the user data according to the pre-stored correspondence between the user identifier and the account identifier. If it is determined that the account identifier corresponding to the user identifier is not stored in the pre-stored correspondence between the user identifier and the account identifier, a serial number is randomly generated and used as the account identifier corresponding to the user identifier.

其中每个用户标识唯一对应一个账户标识,每个账户标识对应至少一个用户标识。用户标识是每个终端唯一对应的一个标识,如一个终端对应的电话号码就可以作为一个用户标识;数据服务器可以为一个用户标识生成一个账户标识。一个账户标识也可以对应多个用户标识,如一个公司的员工,每个员工的一个终端对应一个用户标识,所有员工的全部用户终端对应的全部用户标识对应同一个账户标识。Each user ID uniquely corresponds to an account ID, and each account ID corresponds to at least one user ID. The user ID is an ID uniquely corresponding to each terminal, for example, the phone number corresponding to a terminal can be used as a user ID; the data server can generate an account ID for a user ID. One account identifier can also correspond to multiple user identifiers. For example, for employees of a company, one terminal of each employee corresponds to one user identifier, and all user identifiers corresponding to all user terminals of all employees correspond to the same account identifier.

较佳地,账户标识确定单元701该用于:对用户标识对应的账户标识进行变更,确定用户标识对应的变更后的账户标识,存储用户标识与变更后的账户标识的对应关系;确定用户标识与变更后的账户标识的对应关系的生效时间;到达生效时间前,确定用户标识对应变更前的账户标识;到达生效时间,确定用户标识对应变更后的账户标识。Preferably, the account identifier determining unit 701 is used to: change the account identifier corresponding to the user identifier, determine the changed account identifier corresponding to the user identifier, store the corresponding relationship between the user identifier and the changed account identifier; determine the user identifier The effective time of the corresponding relationship with the changed account ID; before the effective time is reached, it is determined that the user ID corresponds to the account ID before the change; when the effective time is reached, it is determined that the user ID corresponds to the changed account ID.

对用户标识对应的账户标识进行变更时,同时设定用户标识与变更后的账户标识的对应关系的生效时间,以及用户标识与变更前的账户标识的对应关系的失效时间,失效时间略晚于生效时间;当到达生效时间前,确定用户标识对应变更前的账户标识;到达生效时间后,确定用户标识对应变更后的账户标识,并将用户数据同时发送至变更前的账户标识对应的进程和变更后账户标识对应的进程;到达失效时间后,确定用户标识对应变更后的账户标识,并将用户数据只发送至变更后的账户标识对应的进程。When changing the account ID corresponding to the user ID, at the same time set the effective time of the corresponding relationship between the user ID and the changed account ID, and the expiration time of the corresponding relationship between the user ID and the account ID before the change. The expiration time is slightly later than Effective time; before the effective time is reached, it is determined that the user ID corresponds to the account ID before the change; after the effective time is reached, it is determined that the user ID corresponds to the changed account ID, and the user data is simultaneously sent to the process corresponding to the account ID before the change and The process corresponding to the changed account ID; after the expiration time is reached, it is determined that the user ID corresponds to the changed account ID, and the user data is only sent to the process corresponding to the changed account ID.

用户数据划分单元702具体用于:数据服务器确定系统中全部计费服务器能够运行的进程的总数量N,并为每个进程分配一个序号,序号从0~N-1,其中N为正整数;数据服务器确定账户标识的序列号,将账户标识的序列号除以进程的总数量N得到一个余数,将得到的余数作为该账户标识对应的进程,根据进程的编号确定对应的计费服务器。每个计费服务器中运行的进程的数量可以是相同也可以不相同。每个计费服务器能够运行的进程的数量越多,计费系统的扩容性也就越好,但是每个计费服务器的处理能力有限,因此,每个服务器运行的进程的数量根据当前用户的数量以及计费处理器的处理能力确定。The user data division unit 702 is specifically used for: the data server determines the total number N of processes that all accounting servers in the system can run, and assigns a serial number to each process, and the serial number is from 0 to N-1, wherein N is a positive integer; The data server determines the serial number of the account ID, divides the serial number of the account ID by the total number N of processes to obtain a remainder, uses the obtained remainder as the process corresponding to the account ID, and determines the corresponding billing server according to the process number. The number of processes running in each accounting server may be the same or different. The more processes that each accounting server can run, the better the scalability of the accounting system, but the processing capacity of each accounting server is limited. Therefore, the number of processes that each server can run depends on the current user's The quantity and processing capacity of the billing processor are determined.

本发明实施例中优选的采用除余数法确定每个账户标识对应的进程,其他能够将账户标识平均分配至每个进程的方法也适用于本发明,在此不再一一列举。In the embodiment of the present invention, the division method is preferably used to determine the process corresponding to each account ID. Other methods that can evenly distribute the account ID to each process are also applicable to the present invention, and will not be listed here.

用户数据划分单元702还用于:当用户标识变更对应的账户标识后,根据账户标识更新用户标识对应的进程,并在用户标识与变更后的账户标识的对应关系生效的同时,触发更新的用户标识与进程的对应关系生效;在用户标识与变更前的账户标识的对应关系到达失效时间,触发更新前的用户标识与进程的对应关系失效;确定用户标识对应的原进程中的该用户标识对应的用户数据全部处理完毕,将原进程中的用户标识对应的用户数据迁移至更新后的进程中。The user data division unit 702 is also used for: when the user ID changes the corresponding account ID, update the process corresponding to the user ID according to the account ID, and trigger the updated user ID when the corresponding relationship between the user ID and the changed account ID takes effect. The corresponding relationship between the ID and the process takes effect; when the corresponding relationship between the user ID and the account ID before the change reaches the expiration time, the corresponding relationship between the user ID and the process before triggering the update becomes invalid; determine the corresponding user ID in the original process corresponding to the user ID After all the user data has been processed, the user data corresponding to the user ID in the original process is migrated to the updated process.

用户数据划分单元702还用于:确定计费服务器的数量发生变化,重新确定全部计费服务器能够运行的进程的总数量,重新为每个进程分配序号;将账户标识的序列号除以重新确定的进程的总数量得到一个余数,将该余数作为账户标识对应的更新后的进程的序号;根据更新后的进程的序号确定该进程对应的计费服务器。将账户标识对应的更新前的进程中的数据迁移至账户标识对应的更新后的进程中。The user data division unit 702 is also used to: determine that the number of billing servers has changed, re-determine the total number of processes that all billing servers can run, and re-allocate a serial number for each process; divide the serial number of the account identifier by the newly determined A remainder is obtained from the total number of processes, and the remainder is used as the sequence number of the updated process corresponding to the account identifier; and the billing server corresponding to the process is determined according to the sequence number of the updated process. Migrate the data in the pre-update process corresponding to the account ID to the updated process corresponding to the account ID.

如图8所示,为本发明实施例中一种分布式数据的接收装置,该装置包括:As shown in Figure 8, it is a distributed data receiving device in the embodiment of the present invention, which includes:

数据接收单元801,用于接收数据服务器发送的用户数据以及用户标识与进程的对应关系;The data receiving unit 801 is configured to receive the user data sent by the data server and the corresponding relationship between the user ID and the process;

数据发送单元802,用于根据用户标识与进程的对应关系将用户数据发送至计费服务器对应的进程中;A data sending unit 802, configured to send user data to a process corresponding to the charging server according to the correspondence between the user identifier and the process;

计费处理单元803,用于根据用户标识确定对应的计费规则,根据确定的计费规则对用户数据进行计费处理。The charging processing unit 803 is configured to determine a corresponding charging rule according to the user identifier, and perform charging processing on the user data according to the determined charging rule.

其中数据发送单元802具体用于:根据预先存储的用户标识与进程的对应关系确定用户标识对应的进程;接收到数据服务器发送的用户数据以及用户标识与进程的对应关系,确定用户标识对应的进程,将用户数据发送至对应的进程中。The data sending unit 802 is specifically configured to: determine the process corresponding to the user ID according to the pre-stored correspondence between the user ID and the process; receive the user data sent by the data server and the corresponding relationship between the user ID and the process, and determine the process corresponding to the user ID , to send user data to the corresponding process.

计费处理单元803具体用于:计费服务器的进程根据用户标识确定对应的计费规则,根据确定的计费规则对用户数据进行计费处理;每个进程中都存储了全部的计费规则,根据接收到的用户标识,确定该用户标识对应的计费规则,对接收到的用户数据进行计费处理。The billing processing unit 803 is specifically used for: the process of the billing server determines the corresponding billing rule according to the user identifier, and performs billing processing on the user data according to the determined billing rule; all billing rules are stored in each process , according to the received user ID, determine the charging rule corresponding to the user ID, and perform charging processing on the received user data.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (12)

1. a management method for distributed data, is characterized in that, the method comprises:
Data server receives user data, determines corresponding account identification according to the user ID in user data;
Described data server determines the process of this user data being carried out to charging process according to account identification, determines the user ID of account mark correspondence, the corresponding relation of record user identifications and process;
Described data server determines the accounting server that described process is corresponding, and described user data and user ID are sent to corresponding accounting server with the corresponding relation of process;
Wherein said account identification is a sequence number; The total quantity of the process that described data server can run according to whole accounting server is each course allocation sequence number; The remainder that the sequence number of account identification obtains divided by the total quantity of described process by described data server is as the sequence number of process corresponding to account mark; Described data server determines according to the sequence number of process the accounting server that this process is corresponding.
2. the method for claim 1, is characterized in that, described data server determines corresponding account identification according to the user ID in user data, specifically comprises:
Described data server prestores the corresponding relation of user ID and account identification, the account identification that the user ID determined in this user data according to the user ID prestored and the corresponding relation of account identification is corresponding.
3. method as claimed in claim 2, it is characterized in that, the method also comprises:
The account identification that described data server is corresponding to described user ID changes, and determines the account identification after the change that user ID is corresponding, the corresponding relation of the account identification after storing user ID and changing;
The entry-into-force time of the corresponding relation of described data server determination user ID and the account identification after changing; Before the received letter of acceptance time, the corresponding account identification before changing of described data server determination user ID; The received letter of acceptance time, the account identification after described data server determination user ID correspondence changes.
4. method as claimed in claim 2, is characterized in that, described data server determines corresponding account identification according to the user ID in user data, specifically comprises:
Described data server is determined not store account identification corresponding to this user ID in the corresponding relation of user ID and the account identification prestored, then described data server stochastic generation sequence number, using this sequence number as account identification corresponding to this user ID.
5. the method for claim 1, is characterized in that, the method also comprises:
The quantity of described data server determination accounting server changes, and redefines the total quantity of the process that whole accounting server can run, and is each course allocation sequence number again;
The sequence number of account identification is obtained a remainder divided by the total quantity of the process redefined by described data server, using the sequence number of this remainder as the process after renewal corresponding to account identification; Described data server determines according to the sequence number of the process after renewal the accounting server that this process is corresponding.
6. a method of reseptance for distributed data, is characterized in that, the method comprises:
Accounting server receives the user data of data server transmission and the corresponding relation of user ID and process;
User data is sent in process corresponding to accounting server according to user ID with the corresponding relation of process by described accounting server;
The process of described accounting server determines corresponding charging regulation according to user ID, carries out charging process according to the charging regulation determined to described user data.
7. a management devices for distributed data, is characterized in that, this device comprises:
Account identification determining unit, for receiving user data, determines corresponding account identification according to the user ID in user data;
User data division unit, for determining the process of this user data being carried out to charging process according to account identification, determines the user ID of account mark correspondence, the corresponding relation of record user identifications and process;
User data transmitting element, for determining the accounting server that described process is corresponding, is sent to corresponding accounting server by described user data and user ID with the corresponding relation of process;
Wherein said account identification is a sequence number; Described user data division unit also for: according to the total quantity of the process that whole accounting server can run, be each course allocation sequence number; The remainder obtained divided by the total quantity of described process by the sequence number of account identification is as the sequence number of process corresponding to account mark; The accounting server that this process is corresponding is determined according to the sequence number of process.
8. device as claimed in claim 7, is characterized in that, described account identification determining unit specifically for:
Prestore the corresponding relation of user ID and account identification, the account identification that the user ID determined in this user data according to the user ID prestored and the corresponding relation of account identification is corresponding.
9. device as claimed in claim 8, is characterized in that, described account identification determining unit also for:
The account identification corresponding to described user ID changes, and determines the account identification after the change that user ID is corresponding, the corresponding relation of the account identification after storing user ID and changing; The entry-into-force time of the corresponding relation of the account identification after determining user ID and changing; Before the received letter of acceptance time, determine the corresponding account identification before changing of user ID; The received letter of acceptance time, determine the account identification after the change of user ID correspondence.
10. device as claimed in claim 8, is characterized in that, described account identification determining unit specifically for:
Determine not store account identification corresponding to this user ID in the corresponding relation of user ID and the account identification prestored, then stochastic generation sequence number, using this sequence number as account identification corresponding to this user ID.
11. devices as claimed in claim 7, is characterized in that, described user data division unit also for:
Determining that the quantity of accounting server changes, redefine the total quantity of the process that whole accounting server can run, is each course allocation sequence number again; The sequence number of account identification is obtained a remainder divided by the total quantity of the process redefined, using the sequence number of this remainder as the process after renewal corresponding to account identification; Sequence number according to the process after renewal determines the accounting server that this process is corresponding.
The receiving system of 12. 1 kinds of distributed datas, is characterized in that, this device comprises:
Data receipt unit, for receiving the user data and the corresponding relation of user ID and process that data server sends;
Data transmission unit, for being sent in process corresponding to accounting server with the corresponding relation of process by user data according to user ID;
Charging processing unit, for determining corresponding charging regulation according to user ID, carries out charging process according to the charging regulation determined to described user data.
CN201310705903.5A 2013-12-19 2013-12-19 A kind of management of distributed data and method of reseptance, device Active CN104735103B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310705903.5A CN104735103B (en) 2013-12-19 2013-12-19 A kind of management of distributed data and method of reseptance, device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310705903.5A CN104735103B (en) 2013-12-19 2013-12-19 A kind of management of distributed data and method of reseptance, device

Publications (2)

Publication Number Publication Date
CN104735103A true CN104735103A (en) 2015-06-24
CN104735103B CN104735103B (en) 2018-08-28

Family

ID=53458536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310705903.5A Active CN104735103B (en) 2013-12-19 2013-12-19 A kind of management of distributed data and method of reseptance, device

Country Status (1)

Country Link
CN (1) CN104735103B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547758A (en) * 2015-09-17 2017-03-29 阿里巴巴集团控股有限公司 A kind of method and apparatus of data branch mailbox
CN106941532A (en) * 2017-03-30 2017-07-11 北京奇艺世纪科技有限公司 A kind of data transmission method and device applied to distributed system
CN107818170A (en) * 2017-11-14 2018-03-20 北京思特奇信息技术股份有限公司 A kind of method and system for accessing data-base recording
CN107959697A (en) * 2016-10-17 2018-04-24 腾讯科技(深圳)有限公司 Source Data Acquisition method and system in big data off-line calculation
CN111064586A (en) * 2020-03-16 2020-04-24 成都吉胜科技有限责任公司 Distributed parallel charging method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296092A (en) * 2007-04-26 2008-10-29 华为技术有限公司 User service data charging method, system and equipment
CN101384015A (en) * 2008-09-28 2009-03-11 华为技术有限公司 Distributed telecommunication apparatus and service processing method for distributed telecommunication apparatus
US20100248685A1 (en) * 2007-10-30 2010-09-30 Xiangyang Li Method, apparatus and system for supporting distributed ims charging
CN102201922A (en) * 2010-03-22 2011-09-28 阿里巴巴集团控股有限公司 Data charging method and relevant apparatus
CN102238012A (en) * 2010-04-23 2011-11-09 华为技术有限公司 Charging method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296092A (en) * 2007-04-26 2008-10-29 华为技术有限公司 User service data charging method, system and equipment
US20100248685A1 (en) * 2007-10-30 2010-09-30 Xiangyang Li Method, apparatus and system for supporting distributed ims charging
CN101384015A (en) * 2008-09-28 2009-03-11 华为技术有限公司 Distributed telecommunication apparatus and service processing method for distributed telecommunication apparatus
CN102201922A (en) * 2010-03-22 2011-09-28 阿里巴巴集团控股有限公司 Data charging method and relevant apparatus
CN102238012A (en) * 2010-04-23 2011-11-09 华为技术有限公司 Charging method and system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547758A (en) * 2015-09-17 2017-03-29 阿里巴巴集团控股有限公司 A kind of method and apparatus of data branch mailbox
CN106547758B (en) * 2015-09-17 2021-02-02 创新先进技术有限公司 Data binning method and device
CN107959697A (en) * 2016-10-17 2018-04-24 腾讯科技(深圳)有限公司 Source Data Acquisition method and system in big data off-line calculation
CN107959697B (en) * 2016-10-17 2019-12-06 腾讯科技(深圳)有限公司 Source data acquisition method and system in big data offline calculation
CN106941532A (en) * 2017-03-30 2017-07-11 北京奇艺世纪科技有限公司 A kind of data transmission method and device applied to distributed system
CN107818170A (en) * 2017-11-14 2018-03-20 北京思特奇信息技术股份有限公司 A kind of method and system for accessing data-base recording
CN107818170B (en) * 2017-11-14 2021-09-28 北京思特奇信息技术股份有限公司 Method and system for accessing database records
CN111064586A (en) * 2020-03-16 2020-04-24 成都吉胜科技有限责任公司 Distributed parallel charging method

Also Published As

Publication number Publication date
CN104735103B (en) 2018-08-28

Similar Documents

Publication Publication Date Title
CN105224392B (en) A kind of virtual computing resource quota management method and platform
CN104735103B (en) A kind of management of distributed data and method of reseptance, device
CN109451088A (en) A kind of data access method and device
CN102387222B (en) Address distribution method, apparatus and system thereof
CN106685724B (en) Node server management method based on election, apparatus and system
WO2015096681A1 (en) Method and device for processing service access
US10379834B2 (en) Tenant allocation in multi-tenant software applications
CN105791254B (en) Network request processing method and device and terminal
WO2017016113A1 (en) Method and device for monitoring network traffic
CN109085999A (en) data processing method and processing system
CN104348928B (en) A kind of method, management equipment, request equipment and the system of distribution address resource
CN110599148B (en) Cluster data processing method and device, computer cluster and readable storage medium
CN103078965A (en) IP (Internet Protocol) address management method of virtual machines
CN106713375A (en) Method and device for allocating cloud resources
CN109510775A (en) Orient dispatching method, authentication device, the network equipment and the storage medium of flow
CN111585798A (en) Network resource parameter configuration method, device and computer readable storage medium
CN111309440A (en) A method and device for managing scheduling of multiple types of GPUs
CN102970161A (en) Cloud machine deployment platform and deployment method
CN107943423A (en) The management method and computer-readable recording medium of storage resource in cloud system
CN104519145A (en) An address resource managing method, system and DHCP server
CN106982126B (en) Resource sharing charging method and charging device, and memory bank
US20220286564A1 (en) Method and Apparatus for Dynamic Realtime Sharing of Credit Units for Online Charging
CN112732528B (en) Index collection method, system, equipment and storage medium based on IT operation and maintenance monitoring
CN109428733B (en) Method and device for directional flow charging
CN109995551B (en) Service metering method and device of cloud computing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant