CN110417561B - Block chain-based distributed charging method, device and system - Google Patents

Block chain-based distributed charging method, device and system Download PDF

Info

Publication number
CN110417561B
CN110417561B CN201810402130.6A CN201810402130A CN110417561B CN 110417561 B CN110417561 B CN 110417561B CN 201810402130 A CN201810402130 A CN 201810402130A CN 110417561 B CN110417561 B CN 110417561B
Authority
CN
China
Prior art keywords
charging
sub
node
quota
account
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810402130.6A
Other languages
Chinese (zh)
Other versions
CN110417561A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201810402130.6A priority Critical patent/CN110417561B/en
Publication of CN110417561A publication Critical patent/CN110417561A/en
Application granted granted Critical
Publication of CN110417561B publication Critical patent/CN110417561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/14Payment architectures specially adapted for billing systems
    • G06Q20/145Payments according to the detected use or quantity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1403Architecture for metering, charging or billing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/58Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP based on statistics of usage or network monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/61Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP based on the service used
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/70Administration or customization aspects; Counter-checking correct charges
    • H04M15/785Reserving amount on the account
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/83Notification aspects
    • H04M15/85Notification aspects characterised by the type of condition triggering a notification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/83Notification aspects
    • H04M15/85Notification aspects characterised by the type of condition triggering a notification
    • H04M15/854Available credit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M15/00Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
    • H04M15/88Provision for limiting connection, or expenditure

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a distributed charging method, a device and a system based on a block chain, wherein a plurality of charging sub-nodes arranged at the edge are introduced between a terminal and a charging node of an operator, each charging sub-node provides charging service for the terminal in a network, the situation that the charging node of the operator directly provides charging service for massive terminals in the prior art is avoided, and the processing bottleneck of a charging process is reduced; meanwhile, the charging sub-node is a block link point in the charging sub-network, the operator charging node is a block link point in the quota distribution network, the quota distribution network comprises the charging sub-network, and the credit distribution record is maintained by distributing accounts through the quota in the quota distribution network, so that the credit of the main account and the sub-account can be effectively prevented from being tampered, the charging structure is maintained through the charging sub-account in the charging sub-network, the charging result is prevented from being tampered, and the reliability of the charging process is improved.

Description

Block chain-based distributed charging method, device and system
Technical Field
The present invention relates to the field of communication charging, and in particular, to a distributed charging method, apparatus, and system based on a block chain.
Background
In the field of telecommunications, the basic flow of online charging is as follows: when a user uses a Service (e.g., voice call or internet access), an MSC (Mobile Service Switching Center) initiates a Service use request to an SCP (Service Control Point), the SCP initiates a Charging request to an OCS (Online Charging System) device by sending a CCR message, the OCS device obtains a balance of the user, deducts a certain fee and gives the SCP a certain Service use limit (call duration or data traffic), and the SCP receives the limit and provides the Service for the user. When the quota is not enough, the SCP can continuously send the CCR message to the OCS equipment to apply for a new service quota, and the OCS deducts the used quota and sends the new quota to the SCP after receiving the CCR message. The SCP may continue to send the CCR to the OCS until the subscriber ends service usage or the subscriber balance is exhausted.
Early billing models were essentially one account per device, so each device was managed (top-up, billing, etc.) individually. Later, services like group numbers, family paternity numbers, etc. appeared, and single accounts began to support multiple devices. With the development of technologies such as the internet of things, the number of devices that a single account needs to support increases, and the devices may all be online at the same time. For example: an internet of things service provider can access over million sensor devices to charge through an operator network at the same time, but the provider may only need one account to count to pay, and how to charge and manage the single-account mass terminal is a problem to be solved urgently at present.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a block chain-based distributed charging system, apparatus, and system. The problem of charging mass terminals of the same account in the prior art can be solved.
In order to solve the above technical problem, the present application provides a distributed charging method based on a block chain, including:
the charging sub-node acquires a service charging request, wherein the service charging request carries a user identifier and service use statistical information; the user identification represents the identity of the terminal to be charged, and the charging sub-node is a block link point in the charging sub-network; under the condition that the amount of the sub-account associated with the user identifier on the charging sub-node is not larger than the amount threshold, the charging sub-node requests an operator charging node associated with the user identifier to distribute the amount; the operator charging node is a block link point in a quota distribution network, and the quota distribution network comprises a charging subnet; after the consensus network in the quota distribution network achieves consensus on the quota distribution transaction, the charging sub-node writes the quota distribution transaction into a quota distribution account book; the quota allocation transaction comprises quota allocated to the sub-account by the operator charging node, the identifier of the charging sub-node and the user identifier; the charging sub-node distributes the allocated quota to update the quota of the sub-account; and the charging sub-node charges the terminal according to the updated sub-account and the service use statistical information.
By implementing the embodiment of the invention, a plurality of charging sub-nodes arranged at the edge are introduced between the terminal and the operator charging node, and each charging sub-node provides charging service for the terminal in the network, so that the situation that the operator charging node directly provides charging service for massive terminals in the prior art is avoided, and the processing bottleneck of a charging process is reduced; meanwhile, the charging sub-node is a block link point in the charging sub-network, the operator charging node is a block link point in the quota distribution network, the quota distribution network comprises the charging sub-network, and the quota distribution record is maintained through a quota distribution account book in the quota distribution network, so that the tampering of the quota of the main account and the sub-account can be effectively avoided, and the reliability of the charging process is improved.
In one possible design, the charging sub-node performs charging processing on the terminal according to the updated sub-account and service usage statistical information, and the charging processing includes:
the charging sub-node generates a charging transaction according to the charging rule information and the service usage statistical information; wherein the billing transaction includes an amount of consumption; after the consensus network in the charging sub-network achieves consensus on the charging transaction, the charging sub-node writes the charging transaction into a charging sub-account book; and the charging sub-node updates the amount of the sub-account according to the consumption amount.
According to the above description, the charging sub-node maintains the charging result of the sub-account through the charging sub-account, so as to prevent the charging result from being falsified, and further improve the reliability of the charging process.
In one possible design, the charging rule information includes intelligent contracts pre-stored or pre-configured at respective block link points of the charging sub-network.
In one possible design, further comprising:
under the condition that the limit return condition is met, the charging sub-node generates limit return transaction, and the limit return transaction comprises a return limit, an identifier of the charging sub-node and a user identifier; after the consensus network in the quota distribution network agrees on the quota return transaction, the charging sub-node writes the quota return transaction into the quota distribution book.
In one possible design, the credit return condition includes: the service of the terminal is finished or the amount u of the sub-account is not updated after exceeding the preset time.
In a possible design, after the charging sub-node obtains the service charging request, the method further includes:
the charging sub-node inquires an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account associated with the main account on the charging sub-node on the index server; or
And the charging sub-node inquires an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account of the main account associated on the charging sub-node in the limit distribution account book.
In a second aspect, the present application provides a block chain-based distributed charging apparatus, including:
an obtaining unit, configured to obtain a service charging request; the service charging request carries a user identifier and service usage statistical information, the user identifier represents the identity of a terminal to be charged, and the distributed charging device is a block chain node in a charging sub-network;
the request unit is used for requesting the allocation of the quota to an operator charging node associated with the user identifier under the condition that the quota of the sub-account associated with the user identifier on the distributed charging device is not larger than a quota threshold value; the operator charging node is a block chain link point in a quota distribution network, and the quota distribution network comprises the charging sub-network;
a writing unit, configured to write, in a credit allocation account book, a credit allocation transaction including a credit allocated by the operator charging node for the sub-account, an identifier of the distributed charging apparatus, and the user identifier, in a case where a consensus network in the credit allocation network agrees to the credit allocation transaction;
the updating unit is used for updating the quota of the sub-account according to the allocated quota;
and the charging unit is used for charging the terminal according to the updated sub-account and the service usage statistical information.
In one possible design, the charging unit is specifically configured to:
generating a charging transaction according to the charging rule information and the service usage statistical information; wherein the billing transaction includes an amount of consumption;
after the consensus network in the charging sub-network achieves consensus on the charging transaction, writing the charging transaction into a charging sub-account book;
and updating the limit of the sub-account according to the consumption amount.
In one possible design, the charging rule information includes intelligent contracts pre-stored or pre-configured at respective block link points of the charging sub-network.
In one possible design, further comprising:
the generating unit is used for generating the credit return transaction under the condition that the credit return condition is met; wherein the credit return transaction comprises returning credit, the identifier of the distributed charging device and the user identifier;
the writing unit is further configured to write the credit return transaction into the credit distribution ledger after a consensus network in the credit distribution network agrees with the credit return transaction.
In one possible design, the credit return condition includes:
the service of the terminal is finished; or
And the amount of the sub-account is not updated when exceeding the preset time.
In one possible design, further comprising:
the query unit is used for querying an operator charging node associated with the user identifier, a main account associated with the user identifier and a sub-account associated with the main account on the distributed charging device on an index server; or
And inquiring an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account associated with the main account on the distributed charging device in the limit distribution account book.
In a third aspect, the present application provides a block chain-based distributed charging method, including:
the operator charging node receives an amount application request from the charging sub-node, wherein the amount application request carries a user identifier and a node identifier, the charging sub-node is a block chain node in a charging sub-network, the operator node is a block chain node in an amount distribution network, and the amount distribution network comprises the charging sub-network; the operator charging node determines the associated main account and the limit of the main account according to the user identification; the operator main node allocates a quota for a sub-account associated with the main account on the charging sub-node, and the node identifier is used for indicating the charging sub-node; after the consensus network in the quota distribution network achieves consensus on quota distribution transaction, the operator charging node writes quota distribution transaction into a quota distribution account book, wherein the quota distribution transaction comprises a quota distributed by the operator charging node for a sub-account; and the operator charging node updates the quota of the main account according to the quota distributed for the sub-account.
In one possible design, the allocating, by the operator charging node, the quota for the sub-account associated with the main account on the charging sub-account includes:
the operator charging node allocates a quota for the sub-account associated with the main account on the charging sub-node according to a preset proportional value; or
And the operator charging node allocates a fixed limit for the sub-account associated with the main account on the charging sub-node.
In one possible design, further comprising:
the operator charging node acquires the credit return transaction; wherein the credit return transaction comprises returning credit and the user identification;
after the consensus network in the quota distribution network agrees with the quota return transaction, the operator charging node writes the quota return transaction into the quota distribution book;
and the operator charging node determines the main account according to the user identification, and updates the line of the main account according to the return line.
In a fourth aspect, the present application provides a block chain-based distributed charging apparatus, including:
the receiving unit is used for receiving the quota application request from the charging sub-node; the quota application request carries a user identifier and a node identifier, the charging sub-node is a block link point in a charging sub-network, the distributed charging device is a block link point in a quota distribution network, and the quota distribution network comprises the charging sub-network;
the determining unit is used for determining the associated main account and the limit of the main account according to the user identification;
the distribution unit is also used for distributing the quota for the sub-account related to the main account on the charging sub-node; wherein the node identifier is used for indicating the charging sub-node;
a write-in unit, configured to write, by the operator charging node, the credit allocation transaction into a credit allocation ledger after a consensus network in the credit allocation network agrees on the credit allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator charging node;
and the updating unit is used for updating the quota of the main account according to the quota distributed to the sub-account.
In one possible design, the allocation unit is specifically configured to:
allocating a quota for a sub-account associated with the main account on the charging sub-node according to a preset proportional value; or
And allocating a fixed quota for the sub-account associated with the main account on the charging sub-node.
In one possible design of the system, the system may be,
the receiving unit is also used for acquiring the credit return transaction; wherein the credit return transaction comprises returning credit and the user identification;
the writing unit is further configured to write the credit return transaction into the credit distribution ledger after a consensus network in the credit distribution network agrees with the credit return transaction;
the updating unit is also used for determining the main account according to the user identification and updating the line of the main account according to the return line.
In a fifth aspect, the present application provides a charging system, including: the system comprises an operator charging node and a charging sub-node, wherein the operator charging node is a block chain node in a quota distribution network, the charging sub-node is a block chain node in a charging sub-network, and the charging sub-network is one of at least one charging sub-network included in the quota distribution network; wherein the content of the first and second substances,
the charging sub-node is used for acquiring a service charging request; the service charging request carries a user identifier and service usage statistical information, wherein the user identifier represents the identity of a terminal to be charged;
sending an quota application request to an operator charging node associated with the user identifier under the condition that the quota of the sub-account associated with the user identifier on the charging sub-node is not greater than a quota threshold; wherein, the request for applying for quota includes the user identification and the identification of the charging sub-node;
writing the quota allocation transaction into a quota allocation ledger under the condition that a consensus network in the quota allocation network agrees on a quota allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator;
updating the quota of the sub-account according to the allocated quota;
charging the terminal according to the updated sub-account and the service usage statistical information;
the operator charging node is configured to:
receiving a quota application request from the charging sub-node;
determining a related main account and the amount of the main account according to the user identification;
allocating an amount for a sub-account associated with the main account on a charging sub-node;
after the consensus network in the quota distribution network achieves consensus on quota distribution transaction, writing the quota distribution transaction into a quota distribution account book; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator charging node;
and updating the quota of the main account according to the quota distributed to the sub-account.
Yet another aspect of the present application provides an apparatus, comprising: a memory and a processor; wherein the memory stores a set of program codes, and the processor is configured to call the program codes stored in the memory and execute the method of the aspects.
Yet another aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
Yet another aspect of the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1a is a schematic structural diagram of a block chain according to an embodiment of the present invention;
fig. 1b is a schematic structural diagram of a distributed charging system based on a block chain according to an embodiment of the present invention;
fig. 1c is a schematic structural diagram of a charging sub-node in the embodiment of the present invention;
fig. 2 is an interaction diagram of a distributed charging method based on a block chain according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a distributed charging apparatus based on a block chain according to an embodiment of the present invention;
fig. 4 is another schematic structural diagram of a distributed charging apparatus based on a block chain according to an embodiment of the present invention;
fig. 5 is another schematic structural diagram of a distributed charging apparatus based on a block chain according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Fig. 1a is a schematic structural diagram of a blockchain, where the blockchain is a distributed ledger, and a technical solution for collectively maintaining a reliable database in a decentralized and distrusted manner. The block chain comprises a plurality of blocks, wherein a plurality of transaction records are recorded in each block (Bblock), and the transaction records also comprise the hash value of the previous block, so that all the blocks are connected in sequence to form the block chain.
The smart contracts (chaincodes) are event driven, have status (executed or not) and run on top of each ledger in the blockchain network, enabling management of programs of data on the ledger. The intelligent contract is represented as a computing program, which is similar to the contract in real life, the computer code of the intelligent contract specifies the rules and logic of transaction, the intelligent contract is executed after meeting the transaction conditions after a user calls the intelligent contract, and the transaction result is written into the account book.
For example: if the user wants to buy the assets, a transaction calling a BuyOneasset intelligent contract function is sent, the intelligent contract reads the fund balance and the residual quantity of the assets of the user from the block chain, the fund balance and the asset quantity of the user are modified after the transaction condition is met, and when the transaction result is agreed and written into an account book, the user is indicated to finish the transaction of purchasing the assets successfully.
One of core technologies of the blockchain is a consensus mechanism, and the consensus mechanism in the blockchain aims to solve a Byzantine fault-tolerant consensus scene, that is, nodes in the blockchain network are not trusted with each other, and there may be malicious lying nodes. Each node in the blockchain network is likely to be a "lying" node, but when a plurality of nodes are gathered in a network, the consensus result is a credible result. The main role of the consensus algorithm is to let all nodes in the block chain record the same valid transaction block.
For example: a fast consensus mechanism, namely, PoE (proof of end) provided by the fabric project is described. The core mechanism of the consensus mechanism is that a plurality of endorsement nodes (endorser peers) run intelligent contracts and endorse running results (endorsements) (the endorser peers are guaranteed to be the results sent by a specific endorser peer by signing the contents of the running results of the endorser peers per se). The endorser peer is a certain peer established according to specific service requirements, and is not different from other peers. The user can set an endrser peer to be trusted by the intelligent contract and a verification policy (endrse policy) for a plurality of endrsements according to actual requirements. For example: the client (client) sends an intelligent contract running request (progress) to the 3 endorser peers, and endorse policy may require that the 3 endorsegents contents must be consistent, or that at least two endorsegents contents are consistent. The endpiece returned by the collector endrser peer is contained in the transaction block and is broadcast to all peer nodes (including endrser peers) in the blockchain network by the inclusion of an orderer (a node or cluster providing consensus services, also known as a consensus network) in one transaction block. The peer checks the received transaction block, and the transaction block satisfying endirsepolarity is considered as a valid transaction block, and the transaction block is written into the block chain.
In the block chain network, different peers can form different channels, when a transaction block is sent to an orderer for broadcasting, the orderer only broadcasts the transaction block to the peers in the channel corresponding to the transaction block, and peers not corresponding to the channel do not receive the transaction block. Thus, the effect of protecting data privacy can be achieved. An orderer is a service (ordering service) in itself, and different channels can use either the same orderer or different orderers to distribute the load.
The embodiment of the invention provides a structural schematic diagram of a distributed charging system based on a block chain, which is called as a charging system for short, and the charging system comprises: one or more charging subnetworks, one or more operator charging nodes, one or more service control nodes, one or more terminals, and a consensus network.
Each charging sub-network is a block chain network, different charging sub-networks have different charging sub-channels, and data in different charging sub-channels are isolated from each other. Each charging sub-network comprises a plurality of charging sub-nodes, and the charging sub-nodes can be network elements deployed by a telecommunication operator or network elements deployed by a third party. Each charging sub-node in the charging sub-network is a block chain node, each charging sub-node is stored with a charging sub-account book and an amount distribution account book, the charging sub-account book records the charging result of the charging sub-node, and the amount distribution account book records the amount distribution record of the main account. Optionally, each charging sub-node includes an OCS (online charging system), an AMA, and a peer (peer node), where the OCS is configured to calculate a charging result according to the charging request, the AMA is configured to update an amount of a sub-account according to the charging result, and the peer is responsible for recording a charging sub-account and allocating an account for the amount, and interacting with other block link nodes.
The quota distribution network is also a blockchain network and comprises a plurality of blockchain nodes. It should be noted that, because the credit allocation network includes the charging subnet, the charging child node in the charging subnet is not only the block link node in the charging subnet, but also the block link node in the credit allocation network. The quota distribution network corresponds to one charging main channel, different operators have different charging main channels, and data in different channels are isolated from each other. The operator charging node is stored with an amount distribution account book, and the amount distribution account book records the amounts of main accounts of all users and the amounts of sub-accounts of the main accounts on each charging sub-node. The service control node is used for acquiring the user information and the service information of the terminal and sending the user information and the service information of the terminal to the charging sub-node in the charging sub-network for charging.
The consensus network is used for achieving consensus on data in the block chain network, and all block chain link points in the block chain network record the same block. And a consensus network is arranged in each charging sub-network, and the consensus network in the charging sub-networks comprises a plurality of charging sub-nodes in the charging sub-networks. The quota distribution network is also provided with a consensus network, and the consensus network comprises a plurality of nodes (which can be charging sub-nodes, operator charging nodes, or both charging sub-nodes and operator charging nodes) in the quota distribution network.
Optionally, the charging system may further include an index server, where the index server is configured to store a mapping relationship between the user identifier and the primary account, and a mapping relationship between the primary account and a sub-account on each charging sub-node.
The following takes fig. 1b as an example to specifically describe the structure of the charging system of the embodiment of the present invention, and the charging system includes: the system comprises a charging sub-network 1, a charging sub-network 2, a consensus network and operator main charging node 1, a plurality of service control nodes and a plurality of terminals. Wherein each service control node can manage one or more terminals, and each charging sub-node can manage one or more service control nodes. The charging sub-network 1 comprises a charging sub-node 1, a charging sub-node 2, a charging sub-node 3 and a charging sub-node 4, wherein each charging sub-node stores an amount distribution account book and a charging sub-account book, and each charging sub-account book forms a charging sub-chain 1. The charging sub-network 2 comprises a charging sub-node 5, a charging sub-node 6, a charging sub-node 7 and a charging sub-node 8, each charging sub-node stores an amount distribution account book and a charging sub-account book, and each charging sub-account book forms a charging sub-chain 2. The charging sub-network 1, the charging sub-network 2 and the operator charging node 1 form a quota distribution network, a quota distribution account book is stored in the operator node 1, and a quota distribution account book of each charging sub-node in the charging sub-network 1, a quota distribution account book of each charging sub-node in the charging sub-network 2 and a quota distribution account book in the operator charging node 1 form a charging main chain. It should be noted that the form and number of each network element in the charging system in fig. 1b are only for illustration and are not to be construed as limitations of the embodiment of the present invention.
Referring to fig. 2, an interaction diagram of a distributed charging method based on a block chain according to an embodiment of the present invention is provided, where the embodiment of the present invention is applicable to the network architecture of fig. 1b, and the method includes:
s201, the service control node sends a service charging request to the charging sub-node, and the charging sub-node receives the service charging request from the service control node.
Specifically, when the terminal uses the service, the service control node managing the terminal selects any one of the charging sub-nodes in the corresponding charging sub-network for charging. For example: the service control node selects the charging sub-node with the minimum load in the charging sub-network as the terminal for charging, or the service control node selects the charging sub-node with the shortest network path in the charging sub-network as the terminal for charging, or the service control node selects the charging sub-node with the minimum time delay in the charging sub-network as the terminal for charging; or the service control node selects the charging sub-node by adopting other rules. The service charging request may carry a Subscriber Identity of the terminal and service usage statistics information, where the Subscriber Identity is used to indicate an Identity of the terminal, and the Subscriber Identity includes, but is not limited to, any one of an International Mobile Subscriber Identity (IMSI), a GUTI (global Unique Temporary UE Identity), and a TMSI (Temporary Mobile Subscriber Identity). The service usage statistical information indicates a measurement of a service used by the terminal, such as a call duration, a data flow, and the like. Optionally, the service charging request may further carry one or more of a request type, a service type, a certificate, and a signature, where the request type indicates that the service charging request is used for charging, and the service type indicates a type of a service used by the terminal, for example: voice call, time-frequency call or data flow, the duration represents the duration of the service used by the terminal equipment, the certificate represents the digital certificate of the terminal, and the signature represents the digital signature generated according to the service request message, so that the service charging request is prevented from being tampered.
The interaction process between the terminal 1, the service control point 1, the charging sub-network 1 and the operator charging node 1 in the charging system in fig. 1b is illustrated as follows: when the terminal device 1 uses a service, the service control node 1 selects a charging sub-node in the associated charging sub-network 1, and the service control node 1 sends a service charging request to the charging sub-node 1, where the format of the service charging request is shown in table 1 below:
type of request Charging
Type of service Voice communication
Duration of time 60s
Certificate X509 certificate content
Signature Message signing
TABLE 1
S202, the charging sub-node determines that the quota of the sub-account is not larger than a quota threshold value.
Specifically, the charging sub-node analyzes a service charging request from a service control point, the charging sub-node obtains a user identifier, and the charging sub-node queries a main account associated with the user identifier and a sub-account of the main account on the charging sub-node. The charging sub-node may query the sub-account associated with the user identifier on a pre-deployed index server, or may query the sub-account associated with the user identifier in a local credit allocation account book. The charging sub-node determines the amount of the inquired sub-account, and determines whether the amount of the sub-account is not greater than an amount threshold, where the amount threshold may be a pre-stored or pre-configured value, for example: and the quota threshold is 0, and the charging sub-node executes S204 when determining that the quota of the sub-account is less than or equal to 0.
Example of step S201: the charging sub-node 1 inquires a local quota allocation account book associated with a main account D according to the user identification of the terminal 1, the main account D corresponds to a sub-account D1 on the charging sub-node 1, the charging sub-node 1 determines that the quota of the sub-account D1 is 0, the pre-stored or pre-configured quota threshold value is 0, and the charging sub-node 1 determines that the quota of the sub-account D1 meets the condition that the quota threshold value is less than or equal to. Optionally, an amount record table may be stored in the amount distribution account book of the charging sub-node 1, where the amount record table is shown in table 2:
device Charging account Amount unit
Terminal
1 Sub-account D1 0
TABLE 2
Wherein, the account of the operator charging node 1 distributes the relevant information of the main account D recorded in the account book, and an account distribution table can be stored in the account book of the operator charging node 1, and the account distribution table is shown in table 3:
Figure BDA0001645974650000081
TABLE 3
S203, the charging sub-node sends an amount application request to the operator charging node, and the operator charging node receives the amount application request from the charging sub-node.
Specifically, the quota application request can carry a user identifier and a node identifier, the operator charging node analyzes the quota application request to obtain the user identifier and the node identifier, the operator charging node queries a main account associated with the user identifier, and determines a sub-account associated with the main account on a charging sub-node indicated by the node identifier. The operator charging node may query, according to the locally stored mapping information, a main account associated with the user identifier and a sub-account associated with the main account on the charging sub-node indicated by the node identifier, or query, on a pre-deployed index server, a main account associated with the user identifier and a sub-account associated with the main account on the charging sub-node indicated by the node identifier.
According to the example of S202, the operator node queries that the user id is associated with the primary account D, and the primary account D corresponds to the sub-account D1 on the charging sub-node 1 indicated by the node id.
S204, the operator charging node charges the quota for the sub-account, and generates quota allocation transaction according to the allocated quota.
Specifically, the sub-account is a sub-account associated with the main account on the charging sub-node, and the operator charging node allocates a certain quota from the main account to the sub-account of the charging sub-node according to a quota allocation rule. Optionally, the quota allocation rule includes: the operator charging node distributes a fixed quota from the main account to the sub-account of the charging sub-node or the operator charging node distributes a certain quota from the main account to the sub-account of the charging sub-node according to a preset proportion value. For example: the operator charging node allocates a quota 10 to a sub-account of the charging sub-node each time; or the current quota of the main account is 200, the operator charging node allocates 10% of quota to the sub-account of the charging sub-node each time, that is, the operator charging node allocates quota 20 to the sub-account of the charging sub-node this time.
The operator charging node generates a quota allocation transaction according to the quota allocated to the sub-account, wherein the quota allocation transaction comprises the identifier of the charging sub-node, the user identifier and the allocated quota. For example: the credit allocation transaction comprises the identity of the charging sub-node 1, the identity of the user of the terminal 1 and the allocated credit 10.
S205, after the agreement on the quota allocation transaction is reached, the operator charging node writes the quota allocation transaction into a quota allocation ledger.
Specifically, the consensus mechanism ensures that the credit allocation transactions stored on all the block chain nodes in the credit allocation network are the same, the consensus network of the embodiment of the present invention may be independent of the credit allocation network, or a plurality of nodes in the credit allocation network may form the consensus network, which is not limited by the present invention. The operator charging node sends the credit allocation transaction to the consensus network, after the consensus network achieves the consensus on the credit allocation transaction through the consensus algorithm, the consensus network broadcasts the credit allocation transaction to the credit allocation network, each block link node in the credit allocation network receives the credit allocation transaction, and verifies the credit allocation transaction, for example: and verifying the digital signature of the quota allocation transaction, and after the verification is passed, writing the quota allocation transaction into a local quota allocation account book by the node.
For example: the charging sub-node 1 generates a credit allocation transaction from the credit allocated for sub-account D1, the credit allocation transaction including, but not limited to, one or more of a transaction ID, a channel identification, a transaction type, an initiator certificate, an initiator signature, an allocation node, and a charging credit. The credit allocation transaction is shown in table 4:
transaction ID 00000001
Channel ChannelA
Type of transaction QUOTABORROW
Initiator certificate X509 certificate of operator charging node 1
Initiator signature Signature of charging sub-node 1
Distribution node Charging sub-node 1
Accounting quota 10
TABLE 4
S206, the operator charging node updates the quota of the main account according to the allocated quota.
The operator charging node is a block chain node in the quota distribution network, verifies the quota distribution transaction after receiving the quota distribution transaction from the consensus network, and writes the quota distribution transaction into a local quota distribution account book after the verification is passed.
Example of step S203: the operator charging node 1 determines that the terminal device 1 is associated with a main account D, and the main account D corresponds to a sub-account D1 on the charging sub-node 1, the amount allocated by the operator charging node 1 from the main account book D1 for the sub-account D1 is 10, then the operator charging node 1 updates the amount of the main account D, the updated amount of the main account D is 190, the amount allocation book of the operator charging node 1 includes an amount allocation table, and the amount allocation table written in the amount allocation book is shown in table 5:
Figure BDA0001645974650000091
TABLE 5
S207, the charging sub-node updates the sub-account quota according to the charging quota.
Specifically, the charging sub-node is also a block chain node in the quota distribution network, receives the quota distribution transaction from the consensus network, verifies the quota distribution transaction, and writes the quota distribution transaction into a local quota distribution account book after the verification is passed. And meanwhile, the charging sub-node obtains the quota distributed to the sub-account according to the related information in the quota distribution transaction, and updates the quota of the sub-account according to the distributed quota.
For example: the charging sub-node 1 receives the quota allocation transaction from the consensus network, verifies the digital signature of the quota allocation transaction, writes the quota allocation transaction into a local quota allocation account book after the verification is passed, the charging sub-node 1 analyzes the quota allocation transaction to obtain a quota allocated to the sub-account D1 as 10, the current quota of the sub-account D1 of the charging sub-node 1 is 0, and the charging sub-node 1 updates the quota of the sub-account D1 as 10 according to the allocated quota.
And S208, the charging sub-node charges the terminal according to the updated sub-account and the service use statistical information.
Specifically, the amount of the sub-account inquired in the local amount distribution account book by the charging sub-node is greater than the amount threshold, and the charging sub-node performs charging processing on the terminal according to the updated sub-account. And the charging child node determines the consumption amount according to the charging rule information and the service use statistical information. The charging rule information may be pre-stored or pre-configured, for example: the charging rule information is an intelligent contract stored in a charging sub-account book on the charging sub-node.
Optionally, the charging sub-node generates a charging transaction according to the consumption amount, and the charging transaction may further include an identifier of the sub-account and an identifier of the charging sub-node. The charging sub-node determines a charging sub-network where the charging sub-node is located, and selects one or more charging sub-nodes in the charging sub-network to perform endorsement (endorsing) for the charging transaction, optionally, the number of the selected charging sub-nodes is greater than or equal to half of the total number of the charging sub-nodes in the charging sub-network, and the endorsement process may refer to the existing endorsement process, which is not described herein again, and after the selected one or more charging sub-nodes verify that the charging transaction passes, the charging sub-nodes send the charging transaction to a consensus network, it needs to be noted that the consensus network at this time may be the same as the consensus network in S207, or may be a consensus network in which the charging sub-network is independently set, which is not limited in the embodiments of the present invention. After the consensus network adopts the consensus charging to achieve consensus on the charging transaction, the charging transaction is broadcasted to each charging sub-node in the charging sub-network.
According to the example of S207: the charging sub-network 1 comprises 4 charging sub-nodes: the method comprises the steps that a charging sub node 1 and a charging sub node 4 are arranged, the charging sub node 1 selects the charging sub node 1 and the charging sub node 2 to perform endorsement, the charging sub node 1 sends charging transactions to the charging sub node 2, the charging sub node 2 receives signatures carried in the charging transactions and verifies whether the signatures of the charging sub node 1 are correct or not, and runs intelligent contracts to verify whether consumption amount carried in the charging transactions is correct or not, if the verification is correct, the charging sub node 2 sends verification passing messages to the charging sub node 1, the verification passing messages carry the signatures of the charging sub node 2 to the charging transactions, and the charging sub node 1 receives the verification passing messages sent by at least two charging sub nodes in a charging sub network 1 and indicates that the charging transactions are verified to pass. The charging node 1 broadcasts the charging transaction, the signatures of the charging sub-node 1 and the charging sub-node 2 to the charging sub-network 1 through the consensus network, each block link node in the charging sub-network 1 verifies the signature of the charging transaction after receiving the charging transaction, and writes the charging transaction into the respective charging sub-account book after the verification is passed. After receiving the charging transaction, the charging sub-node 1 verifies the signature of the charging transaction, writes the charging transaction into the charging sub-account book of the charging sub-node after the verification is passed, and updates the amount of the sub-account D1 according to the consumption amount, for example: the consumption amount is 4, and the record table of the limit written in the charging sub account book of the charging sub node 1 is as follows:
device Charging account Amount unit
Terminal
1 Sub-account D1 6
TABLE 6
Optionally, the method in the embodiment of the present invention further includes:
when the charging sub-node meets the limit return condition, generating limit return transaction; wherein, the credit return transaction comprises returning credit, the identifier of the charging sub-node and the user identifier;
and after the consensus network in the quota distribution network agrees with the quota return transaction, the charging sub-node writes the quota return transaction into the quota distribution book.
Specifically, the credit return conditions include, but are not limited to: when the charged terminal ends the service or the sub-account is not updated, the preset time duration is exceeded, for example: when the terminal receives the call, or the amount of the sub-account is not updated for more than 1 hour. The charging sub-node determines the amount of the sub-account and returns the amount of the sub-account to the main account: the charging sub-node generates a line return transaction according to the line of the sub-account, the line return transaction comprises an identifier of an operator charging node, a user identifier and a return line, the charging sub-node sends the line return transaction to the consensus network, the consensus network broadcasts the line return transaction to each block link node in the line distribution network after achieving consensus on the line return transaction, each block link node in the line distribution network receives the line return transaction, verifies the line return transaction, writes the line return transaction into a local line distribution account after the verification is passed, and the operator charging node updates the line of the main account according to the return line. Optionally, the charging sub-node may return the whole amount of the sub-account to the main account, that is, the sub-account of the charging sub-node returns to zero after returning the amount.
According to the example of S207: after the service of the terminal 1 is finished, the charging sub-node 1 determines that the amount of the sub-account D1 is 6, the charging sub-node 1 determines that the returning amount is 6, the amount of the sub-account D1 is updated to 0, the charging sub-node 1 generates an amount returning transaction according to the returning amount, the charging sub-node 1 selects the charging sub-node 2 and the charging sub-node 3 in the charging sub-network 1 to endorse the amount returning transaction, after the verification is passed, the charging sub-node 1 submits the amount returning transaction to a consensus network, and after the consensus network achieves consensus on the amount returning transaction, the consensus network broadcasts the amount to a block chain node in the amount distribution network. The operator charging node 1 is also a block chain node in the quota distribution network, for the operator charging node, the operator charging node 1 receives the quota return transaction from the consensus network, verifies the signature of the quota return transaction, writes the quota return transaction into a local quota distribution account book by the operator charging node 1 after verification is passed, and updates the quota of the main account D to 196 according to the return quota by the operator charging node 1. The format of the credit return transaction is shown in the following table:
transaction ID 00000001
Channel ChannelA
Type of transaction QUOTARETURN
Initiator certificate X509 certificate of operator charging node 1
Initiator signature Signature of charging sub-node 1
Distribution node Charging sub-node 1
Returning limit 6
Endorsement signature Charging sub-node 2 signature + charging sub-node 3 signature
TABLE 7
The information recorded in the quota allocation accounts of the charging sub-node 1 and the operator charging node 1 is shown in the following table:
Figure BDA0001645974650000111
TABLE 8
According to the description of fig. 2, the embodiment of the present invention introduces a plurality of charging sub-nodes arranged at the edge between the terminal and the operator charging node, each charging sub-node provides charging service for the terminal in the network, thereby avoiding that the operator charging node directly provides charging service for a large number of terminals in the prior art, and reducing the processing bottleneck of the charging process; meanwhile, the charging sub-node is a block link point in the charging sub-network, the operator charging node is a block link point in the quota distribution network, the quota distribution network comprises the charging sub-network, and the quota distribution record is maintained through a quota distribution account book in the quota distribution network, so that the tampering of the quota of the main account and the sub-account can be effectively avoided, and the reliability of the charging process is improved.
Fig. 2 illustrates a block chain-based distributed charging method according to an embodiment of the present application in detail.
Fig. 3 provides a block chain-based distributed charging apparatus (hereinafter referred to as apparatus 3) according to an embodiment of the present application. The apparatus 3 includes an obtaining unit 301, a requesting unit 302, a writing unit 303, an updating unit 304, and a charging unit 305, and a specific implementation process of the apparatus 3 can be described with reference to fig. 2.
An obtaining unit 301, configured to obtain a service charging request; the service charging request carries a user identifier and service usage statistical information, the user identifier represents the identity of a terminal to be charged, and the device 3 is a block chain node in a charging subnet.
A request unit 302, configured to request, by an operator charging node associated with the subscriber identity, to allocate an quota when a quota of a sub-account associated with the subscriber identity on the charging sub-node is not greater than a quota threshold; the operator charging node is a block chain link point in a quota distribution network, and the quota distribution network comprises the charging sub-network.
A writing unit 303, configured to write the credit allocation transaction into a credit allocation ledger when a consensus network in the credit allocation network agrees on the credit allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator.
An updating unit 304, configured to update the quota of the sub-account according to the allocated quota.
A charging unit 305, configured to perform charging processing on the terminal according to the updated sub-account and the service usage statistical information.
Optionally, the charging unit 305 is specifically configured to:
generating a charging transaction according to the charging rule information and the service usage statistical information; wherein the billing transaction includes an amount of consumption;
after the consensus network in the charging sub-network agrees on the charging transaction, writing the charging transaction into a charging sub-account book;
and updating the limit of the sub-account according to the consumption amount.
Optionally, the charging rule information includes an intelligent contract pre-stored or pre-configured on each block link point of the charging subnet.
Optionally, the apparatus 3 further comprises:
the unit, under the condition that the condition of returning the quota is met, the charging sub-node generates the quota returning transaction; wherein, the credit return transaction comprises returning credit, the identifier of the charging sub-node and the user identifier;
the writing unit 303 is further configured to write the credit return transaction into the credit distribution ledger by the charging sub-node after a consensus network in the credit distribution network agrees with the credit return transaction.
Optionally, the credit return condition includes:
the service of the terminal is finished; or
And the amount of the sub-account is not updated when exceeding the preset time.
Optionally, the method further includes:
a query unit, configured to query, on an index server, an operator charging node associated with the user identifier, a primary account associated with the user identifier, and a sub-account associated with the primary account on the device 3; or
The operator charging node associated with the subscriber identity, the primary account associated with the subscriber identity and the sub-account associated with the primary account on the device 6 are queried in the credit allocation ledger.
The device 3 may be a charging sub-node, and the device 3 may also be a field-programmable gate array (FPGA), an application-specific integrated chip, a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips, which implement related functions.
The embodiment of the present application and the embodiment of the method in fig. 2 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the embodiment of the method in fig. 2, and will not be described again here.
Fig. 4 provides another distributed charging apparatus based on a block chain (hereinafter referred to as apparatus 4) according to an embodiment of the present application, where the apparatus 4 includes a receiving unit 401, a determining unit 402, an allocating unit 403, a writing unit 404, and an updating unit 405. The implementation of the apparatus 4 can be described with reference to fig. 2.
A receiving unit 401, configured to receive an quota applying request from a charging sub-node; wherein, the limit application request carries a user identifier and the node identifier; the device 4 allocates block link points in the network for the quota, which includes the charging sub-network.
A determining unit 402, configured to determine, according to the user identifier, an associated primary account and a quota of the primary account.
An allocating unit 403, configured to allocate an amount to a sub-account associated with the main account on a charging sub-node; the node identifier is used for indicating the charging sub-node, and the charging sub-node is a block chain link node in a charging sub-network.
A writing unit 404, configured to write a credit allocation transaction into a credit allocation ledger after a consensus network in the credit allocation network agrees on the credit allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the device 4.
And the updating unit 405 is configured to update the quota of the main account according to the quota allocated to the sub-account.
Optionally, the allocating unit 403 is specifically configured to:
allocating a quota for a sub-account associated with the main account on the charging sub-node according to a preset proportional value; or
And allocating a fixed quota for the sub-account associated with the main account on the charging sub-node.
Optionally, the receiving unit 401 is further configured to obtain a credit return transaction; wherein the credit return transaction comprises returning credit and the user identification.
The writing unit 404 is further configured to write the credit return transaction into the credit distribution ledger after a consensus network in the credit distribution network agrees with the credit return transaction.
The updating unit 405 is further configured to determine the primary account according to the user identifier, and update the credit line of the primary account according to the returned credit line.
The device 4 may be a billing node of an operator, and the device 4 may also be a field-programmable gate array (FPGA), an application-specific integrated chip (asic), a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips, which implement related functions.
The embodiment of the present application and the embodiment of the method in fig. 2 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the embodiment of the method in fig. 2, and will not be described again here.
Fig. 5 is a schematic structural diagram of an apparatus provided in the embodiment of the present application, which is hereinafter referred to as an apparatus 5, where the apparatus 5 may be integrated in the foregoing network device or terminal device, as shown in fig. 5, the apparatus includes: memory 502, processor 501, transmitter 504, and receiver 503.
The memory 502 may be a separate physical unit, which may be connected to the processor 501, the transmitter 504 and the receiver 503 by a bus. The memory 502, the processor 501, the transmitter 504, and the receiver 501 may also be integrated, implemented in hardware, etc.
The transmitter 504 and the receiver 503 may also be connected to an antenna, and the receiver 503 receives information transmitted by other devices through the antenna, and correspondingly, the transmitter 604 transmits information to other devices through the antenna.
The memory 502 is used for storing a program for implementing the above method embodiment, or various modules of the apparatus embodiment, and the processor 501 calls the program to perform the operation of the above method embodiment.
Alternatively, when part or all of the uplink data transmission method of the above embodiments is implemented by software, the uplink data transmission device may only include a processor. The memory for storing the program is located outside the beam configuration means and the processor is connected to the memory by means of circuits/wires for reading and executing the program stored in the memory.
The processor may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory may also comprise a combination of memories of the kind described above.
In the above embodiments, the transmitting unit or the transmitter performs the steps transmitted by the above respective method embodiments, the receiving unit or the receiver performs the steps received by the above respective method embodiments, and other steps are performed by other modules or processors. The transmitting module and the receiving module may constitute a transceiver module, and the receiver and the transmitter may constitute a transceiver.
The embodiment of the present application further provides a computer storage medium, which stores a computer program, where the computer program is used to execute the block chain-based distributed charging method provided in the foregoing embodiment.
The embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, causes the computer to execute the block chain-based distributed charging method provided in the foregoing embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (19)

1. A distributed charging method based on a block chain is characterized by comprising the following steps:
the charging sub-node acquires a service charging request; the service charging request carries a user identifier and service usage statistical information, the user identifier represents the identity of a terminal to be charged, and the charging sub-node is a block link point in a charging sub-network;
under the condition that the amount of the sub-account associated with the user identification on the charging sub-node is not larger than an amount threshold value, the charging sub-node requests an operator charging node associated with the user identification to distribute the amount of the money; the operator charging node is a block chain link point in a quota distribution network, and the quota distribution network comprises the charging sub-network;
under the condition that a consensus network in the quota distribution network agrees on quota distribution transaction, the charging sub-node writes the quota distribution transaction into a quota distribution book; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator;
the charging sub-node updates the sub-account quota according to the allocated quota;
and the charging sub-node performs charging processing on the terminal according to the updated sub-account and the service usage statistical information.
2. The method of claim 1, wherein the charging sub-node performs charging processing on the terminal according to the updated sub-account and the service usage statistical information, and the charging processing comprises:
the charging sub-node generates a charging transaction according to the charging rule information and the service usage statistical information; wherein the billing transaction includes an amount of consumption;
after the consensus network in the charging sub-network agrees on the charging transaction, the charging sub-node writes the charging transaction into a charging sub-account book;
and the charging sub-node updates the amount of the sub-account according to the consumption amount.
3. The method according to claim 2, wherein the charging rule information comprises intelligent contracts pre-stored or pre-configured on respective block link points of the charging sub-network.
4. The method of any one of claims 1 to 3, further comprising:
under the condition that the condition of returning the limit is met, the charging sub-node generates limit returning transaction; wherein, the credit return transaction comprises returning credit, the identifier of the charging sub-node and the user identifier;
and after the consensus network in the quota distribution network agrees with the quota return transaction, the charging sub-node writes the quota return transaction into the quota distribution book.
5. The method of claim 4, wherein the credit return condition comprises:
the service of the terminal is finished; or
And the amount of the sub-account is not updated when exceeding the preset time.
6. The method according to any of claims 1 to 5, wherein after the charging sub-node obtains the service charging request, the method further comprises:
the charging sub-node inquires an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account of the main account associated with the charging sub-node on an index server; or
And the charging sub-node inquires an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account associated with the main account on the charging sub-node in the quota allocation account book.
7. A distributed charging apparatus based on a blockchain, comprising:
an obtaining unit, configured to obtain a service charging request; the service charging request carries a user identifier and service usage statistical information, the user identifier represents the identity of a terminal to be charged, and the distributed charging device is a block chain node in a charging sub-network;
the request unit is used for requesting the allocation of the quota by the operator charging node associated with the user identifier under the condition that the quota of the sub-account associated with the user identifier on the charging sub-node is not larger than a quota threshold value; the operator charging node is a block chain link point in a quota distribution network, and the quota distribution network comprises the charging sub-network;
a write-in unit, configured to write the credit allocation transaction into a credit allocation ledger when a consensus network in the credit allocation network agrees on the credit allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator;
the updating unit is used for updating the quota of the sub-account according to the allocated quota;
and the charging unit is used for charging the terminal according to the updated sub-account and the service usage statistical information.
8. The apparatus according to claim 7, wherein the charging unit is specifically configured to:
generating a charging transaction according to the charging rule information and the service usage statistical information; wherein the billing transaction includes an amount of consumption;
after the consensus network in the charging sub-network agrees on the charging transaction, writing the charging transaction into a charging sub-account book;
and updating the limit of the sub-account according to the consumption amount.
9. The apparatus of claim 8, wherein the charging rule information comprises intelligent contracts pre-stored or pre-configured on respective block link points of the charging subnet.
10. The apparatus of any one of claims 7 to 9, further comprising:
the generating unit is used for generating the credit return transaction by the charging sub-node under the condition that the credit return condition is met; wherein, the credit return transaction comprises returning credit, the identifier of the charging sub-node and the user identifier;
the writing unit is further configured to write the credit return transaction into the credit distribution book by the charging sub-node after a consensus network in the credit distribution network agrees with the credit return transaction.
11. The apparatus of claim 10, wherein the credit return condition comprises:
the service of the terminal is finished; or
And the amount of the sub-account is not updated when exceeding the preset time.
12. The apparatus of any one of claims 7 to 11, further comprising:
the query unit is used for querying an operator charging node associated with the user identifier, a main account associated with the user identifier and a sub-account associated with the main account on the distributed charging device on an index server; or
And inquiring an operator charging node associated with the user identification, a main account associated with the user identification and a sub-account associated with the main account on the distributed charging device in the limit distribution account book.
13. A distributed charging method based on a block chain is characterized by comprising the following steps:
the operator charging node receives a quota application request from the charging sub-node; wherein, the limit application request carries a user identifier and a node identifier; the operator charging node is a block link point in a quota distribution network, and the quota distribution network comprises a charging subnet;
the operator charging node determines a related main account and the amount of the main account according to the user identification;
the operator charging node allocates a quota for a sub-account associated with the main account on a charging sub-node; the node identifier is used for indicating the charging sub-node, and the charging sub-node is a block link point in a charging sub-network;
after a consensus network in the quota distribution network agrees on quota distribution transaction, the operator charging node writes the quota distribution transaction into a quota distribution book; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator charging node;
and the operator charging node updates the quota of the main account according to the quota distributed for the sub-account.
14. The method of claim 13, wherein the operator billing node allocates an amount to a sub-account associated with the primary account on a billing sub-node, comprising:
the operator charging node allocates a quota for a sub-account associated with the main account on the charging sub-node according to a preset proportional value; or
And the operator charging node allocates a fixed quota for the sub-account associated with the main account on the charging sub-node.
15. The method of claim 13 or 14, further comprising:
the operator charging node acquires the credit return transaction; wherein the credit return transaction comprises returning credit and the user identification;
after the consensus network in the quota distribution network agrees with the quota return transaction, the operator charging node writes the quota return transaction into the quota distribution book;
and the operator charging node determines the main account according to the user identification, and updates the line of the main account according to the return line.
16. A distributed charging apparatus based on a blockchain, comprising:
the receiving unit is used for receiving the quota application request from the charging sub-node; wherein, the limit application request carries a user identifier and a node identifier; the distributed charging device is a block chain link point in a quota distribution network, and the quota distribution network comprises a charging subnet;
the determining unit is used for determining the associated main account and the limit of the main account according to the user identification;
the distribution unit is used for distributing the quota for the sub-account related to the main account on the charging sub-node; the node identifier is used for indicating the charging sub-node, and the charging sub-node is a block link point in a charging sub-network;
a write-in unit, configured to write the credit allocation transaction into a credit allocation ledger after a consensus network in the credit allocation network agrees on the credit allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the distributed charging device;
and the updating unit is used for updating the quota of the main account according to the quota distributed to the sub-account.
17. The apparatus according to claim 16, wherein the allocation unit is specifically configured to:
allocating a quota for a sub-account associated with the main account on the charging sub-node according to a preset proportional value; or
And allocating a fixed quota for the sub-account associated with the main account on the charging sub-node.
18. The apparatus of claim 16 or 17,
the receiving unit is also used for acquiring the credit return transaction; wherein the credit return transaction comprises returning credit and the user identification;
the writing unit is further configured to write the credit return transaction into the credit distribution ledger after a consensus network in the credit distribution network agrees with the credit return transaction;
the updating unit is also used for determining the main account according to the user identification and updating the line of the main account according to the return line.
19. A distributed charging system based on blockchains, comprising: the system comprises an operator charging node and a charging sub-node, wherein the operator charging node is a block chain node in a quota distribution network, the charging sub-node is a block chain node in a charging sub-network, and the charging sub-network is one of at least one charging sub-network included in the quota distribution network; wherein the content of the first and second substances,
the charging sub-node is used for acquiring a service charging request; the service charging request carries a user identifier and service usage statistical information, wherein the user identifier represents the identity of a terminal to be charged;
sending an quota application request to an operator charging node associated with the user identifier under the condition that the quota of the sub-account associated with the user identifier on the charging sub-node is not greater than a quota threshold; wherein, the request for applying for quota includes the user identification and the identification of the charging sub-node;
writing the quota allocation transaction into a quota allocation ledger under the condition that a consensus network in the quota allocation network agrees on a quota allocation transaction; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator;
updating the quota of the sub-account according to the allocated quota;
charging the terminal according to the updated sub-account and the service usage statistical information;
the operator charging node is configured to:
receiving a quota application request from the charging sub-node;
determining a related main account and the amount of the main account according to the user identification;
allocating an amount for a sub-account associated with the main account on a charging sub-node;
after the consensus network in the quota distribution network achieves consensus on quota distribution transaction, writing the quota distribution transaction into a quota distribution account book; wherein the credit allocation transaction comprises the credit allocated to the sub-account by the operator charging node;
and updating the quota of the main account according to the quota distributed to the sub-account.
CN201810402130.6A 2018-04-28 2018-04-28 Block chain-based distributed charging method, device and system Active CN110417561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810402130.6A CN110417561B (en) 2018-04-28 2018-04-28 Block chain-based distributed charging method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810402130.6A CN110417561B (en) 2018-04-28 2018-04-28 Block chain-based distributed charging method, device and system

Publications (2)

Publication Number Publication Date
CN110417561A CN110417561A (en) 2019-11-05
CN110417561B true CN110417561B (en) 2021-10-15

Family

ID=68357198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810402130.6A Active CN110417561B (en) 2018-04-28 2018-04-28 Block chain-based distributed charging method, device and system

Country Status (1)

Country Link
CN (1) CN110417561B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401866A (en) * 2020-03-13 2020-07-10 杭州复杂美科技有限公司 Method, apparatus and storage medium for pre-storing and deducting commission fee
CN111064586B (en) * 2020-03-16 2020-06-12 成都吉胜科技有限责任公司 Distributed parallel charging method
CN111835929B (en) * 2020-07-14 2022-02-25 中国联合网络通信集团有限公司 Telephone charge transaction method and system based on block chain
CN112184246A (en) * 2020-10-13 2021-01-05 深圳壹账通智能科技有限公司 Account book management method, device, equipment and storage medium
CN112184229A (en) * 2020-10-14 2021-01-05 深圳壹账通智能科技有限公司 Block chain-based sub-account transaction processing method, system and equipment
CN114567366B (en) * 2022-02-17 2024-02-23 北京电信规划设计院有限公司 Vehicle-mounted satellite communication resource sharing method based on block chain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447604A (en) * 2014-08-04 2016-03-30 阿里巴巴集团控股有限公司 Account processing method and device
CN107026897A (en) * 2017-02-20 2017-08-08 阿里巴巴集团控股有限公司 A kind of methods, devices and systems of data processing
CN107147735A (en) * 2017-05-12 2017-09-08 北京博晨技术有限公司 A kind of distributed account book system based on hierarchy
CN107464112A (en) * 2017-07-20 2017-12-12 捷德(中国)信息科技有限公司 Exchange management method and system based on block chain
CN107547762A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of charging method and charge system
WO2018012872A1 (en) * 2016-07-14 2018-01-18 주식회사 코인플러그 Method for providing recording and verification service for data received and transmitted by messenger service, and server using method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447604A (en) * 2014-08-04 2016-03-30 阿里巴巴集团控股有限公司 Account processing method and device
CN107547762A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of charging method and charge system
WO2018012872A1 (en) * 2016-07-14 2018-01-18 주식회사 코인플러그 Method for providing recording and verification service for data received and transmitted by messenger service, and server using method
CN107026897A (en) * 2017-02-20 2017-08-08 阿里巴巴集团控股有限公司 A kind of methods, devices and systems of data processing
CN107147735A (en) * 2017-05-12 2017-09-08 北京博晨技术有限公司 A kind of distributed account book system based on hierarchy
CN107464112A (en) * 2017-07-20 2017-12-12 捷德(中国)信息科技有限公司 Exchange management method and system based on block chain

Also Published As

Publication number Publication date
CN110417561A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110417561B (en) Block chain-based distributed charging method, device and system
CN112600841B (en) Credit record sharing method and device based on block chain and electronic equipment
CN113228600B (en) Method and apparatus for stimulating participation in a mist network
CN110557729B (en) Roaming charging method and device
US8095109B2 (en) Charging of GPRS traffic for roaming mobiles by performing traffic counting at the user terminal
WO2016188377A1 (en) Method for implementing traffic control, server and terminal
JP2005500770A (en) Transaction processing
JP7226858B2 (en) Method and device for providing roaming service using blockchain
CN109300038B (en) Resource flow transaction system
CN108768672B (en) Data processing method, device and storage medium
CN111104460A (en) Block chain consensus method, system, electronic equipment and storage medium
WO2019201319A1 (en) System and method for use of digital currency in a communication network
CN110191160A (en) A kind of concurrency control method and device
WO2015039450A1 (en) Data allocation method and device, server and storage medium
CN111405505A (en) Bill processing method, system and storage medium for roaming service
KR102145578B1 (en) Method and Apparatus for Providing Roaming Service using Block Chain
CN111835929B (en) Telephone charge transaction method and system based on block chain
CN112788555B (en) Cross-operator telephone charge transfer settlement method, device and computing equipment
CN112399388A (en) Method, device and system for realizing edge calculation
WO2019184632A1 (en) Rating method and apparatus
CN109428732B (en) Call bill processing method and device
CN115442167A (en) Block chain-based network traffic management method, device and system
CN112737796B (en) Cross-region user communication fee transfer method, device, equipment, medium and product
WO2017167240A1 (en) Method of purchasing service using primary or secondary card, device, and communication system
CN111542005B (en) Charging method, device, equipment and storage medium

Legal Events

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