[go: up one dir, main page]

CN109274507B - Charging control method, device and system - Google Patents

Charging control method, device and system Download PDF

Info

Publication number
CN109274507B
CN109274507B CN201710583075.0A CN201710583075A CN109274507B CN 109274507 B CN109274507 B CN 109274507B CN 201710583075 A CN201710583075 A CN 201710583075A CN 109274507 B CN109274507 B CN 109274507B
Authority
CN
China
Prior art keywords
charging
quota
action type
identifier
switch
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
CN201710583075.0A
Other languages
Chinese (zh)
Other versions
CN109274507A (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 CN201710583075.0A priority Critical patent/CN109274507B/en
Publication of CN109274507A publication Critical patent/CN109274507A/en
Application granted granted Critical
Publication of CN109274507B publication Critical patent/CN109274507B/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
    • 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
    • H04L12/1407Policy-and-charging control [PCC] architecture
    • 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/141Indication of costs

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例提供计费控制方法、设备及系统,可以通过扩展OpenFlow来实现电信级的计费需求,并且可以避免计费配额耗尽时数据包处理的滞后性。方法包括:在交换机接收来自终端的第一数据包之后,交换机将第一数据包对应的承载标识与流表项中的承载标识进行匹配;若匹配成功,交换机根据流表项中的计费标识查找计费表;交换机对该计费表中的计费配额对象进行计费统计,并将计费配额对象的计费统计结果写入计费表的计费配额对象的统计值中;交换机根据计费表中的第一计费配额阈值、第一动作类型和计费配额对象的统计值进行计费控制。

Figure 201710583075

The embodiments of the present application provide a charging control method, device and system, which can implement carrier-level charging requirements by extending OpenFlow, and can avoid the hysteresis of data packet processing when the charging quota is exhausted. The method includes: after the switch receives the first data packet from the terminal, the switch matches the bearer identification corresponding to the first data packet with the bearer identification in the flow table entry; if the matching is successful, the switch according to the charging identification in the flow table entry Find the charging table; the switch performs charging statistics on the charging quota object in the charging table, and writes the charging statistics result of the charging quota object into the statistical value of the charging quota object in the charging table; The first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table are used for charging control.

Figure 201710583075

Description

计费控制方法、设备及系统Charging control method, device and system

技术领域technical field

本申请涉及通信技术领域,尤其涉及计费控制方法、设备及系统。The present application relates to the field of communication technologies, and in particular, to a charging control method, device, and system.

背景技术Background technique

软件自定义网络(software defined network,SDN)是网络虚拟化的一种实现方式,其核心技术OpenFlow通过将网络设备的控制面与数据面分离开来,从而实现了网络流量的灵活控制,使得网络作为管道变得更加智能。Software Defined Network (SDN) is an implementation of network virtualization. Its core technology, OpenFlow, separates the control plane and data plane of network devices, thereby realizing flexible control of network traffic and making network Become smarter as a pipeline.

然而,一方面,目前OpenFlow支持的统计类型较少,对于电信网络一些典型的业务场景比如基于业务时长的计费,OpenFlow无法满足;另一方面,目前OpenFlow虽然支持基于阈值的消息上报机制,但是当计费配额耗尽时,用户面必须先通知控制面用户面统计量已经达到阈值,然后SDN控制器接收到消息后再刷新相关表项的动作来执行丢包或者将包转发到特定的欠费服务器等。显然,这种机制存在一定的滞后性。However, on the one hand, OpenFlow currently supports few types of statistics. For some typical service scenarios in telecom networks, such as charging based on service duration, OpenFlow cannot satisfy them; on the other hand, although OpenFlow currently supports a threshold-based message reporting mechanism, When the charging quota is exhausted, the user plane must first notify the control plane that the user plane statistics have reached the threshold, and then the SDN controller refreshes the relevant table entries after receiving the message to perform packet loss or forward the packet to a specific account. fee server etc. Obviously, there is a certain hysteresis in this mechanism.

因此,如何扩展OpenFlow来实现电信级的计费需求,并且可以避免计费配额耗尽时数据包处理的滞后性,是目前亟待解决的问题。Therefore, how to extend OpenFlow to meet carrier-level billing requirements and avoid the lag of data packet processing when the billing quota is exhausted is an urgent problem to be solved at present.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供计费控制方法、设备及系统,可以通过扩展OpenFlow来实现电信级的计费需求,并且可以避免计费配额耗尽时数据包处理的滞后性。The embodiments of the present application provide a charging control method, device, and system, which can implement carrier-level charging requirements by extending OpenFlow, and can avoid the hysteresis of data packet processing when the charging quota is exhausted.

为达到上述目的,本申请实施例提供如下技术方案:To achieve the above purpose, the embodiments of the present application provide the following technical solutions:

第一方面,提供一种计费控制方法,该方法包括:在交换机接收来自终端的第一数据包之后,该交换机将该第一数据包对应的承载标识与流表项中的承载标识进行匹配;若匹配成功,该交换机根据该流表项中的计费标识查找计费表,该计费表包括该计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值,其中,当该第一计费配额阈值不是根据最后一次有效新增计费配额确定时,该第一动作类型为空;当该第一计费配额阈值是根据最后一次有效新增计费配额确定时,该第一动作类型为欠费对应的动作类型;该交换机对该计费表中的计费配额对象进行计费统计,并将该计费配额对象的计费统计结果写入该计费表的计费配额对象的统计值中;该交换机根据该计费表中的该第一计费配额阈值、该第一动作类型和该计费配额对象的统计值进行计费控制。本申请实施例在计费表中直接指示了相应的动作,比如当计费表中的第一计费配额阈值是根据最后一次有效新增计费配额确定时,计费表中的第一动作类型为欠费对应的动作类型,因此可以避免目前OpenFlow仅支持基于阈值的消息上报机制所带来的处理滞后性。A first aspect provides a charging control method, the method comprising: after a switch receives a first data packet from a terminal, the switch matches a bearer identifier corresponding to the first data packet with a bearer identifier in a flow table entry ; If the match is successful, the switch looks up a charging table according to the charging identifier in the flow entry, and the charging table includes the charging identifier, the first charging quota threshold, the first action type and the statistics of the charging quota object value, wherein, when the first charging quota threshold is not determined according to the last effective new charging quota, the first action type is empty; when the first charging quota threshold is based on the last effective new charging quota When the quota is determined, the first action type is the action type corresponding to the arrears; the switch performs charging statistics on the charging quota objects in the charging table, and writes the charging statistics results of the charging quota objects into the In the statistical value of the charging quota object in the charging table; the switch performs charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table. This embodiment of the present application directly indicates corresponding actions in the charging table. For example, when the first charging quota threshold in the charging table is determined according to the last effective new charging quota, the first action in the charging table The type is the action type corresponding to the arrears, so it can avoid the processing lag caused by the current OpenFlow only supports the threshold-based message reporting mechanism.

在一种可能的设计中,该方法还包括:该交换机接收来自软件自定义网络SDN控制器的流表项创建消息,该流表项创建消息用于生成该流表项;该交换机根据该流表项创建消息生成流表项。由于流表项表创建信息是SDN控制器根据计费标识和承载标识生成的,因此该流表项可以指向该计费标识对应的计费表。In a possible design, the method further includes: the switch receives a flow entry creation message from the software-defined network SDN controller, where the flow entry creation message is used to generate the flow entry; the switch receives the flow entry according to the flow entry. Entry creation messages generate flow entries. Since the flow entry table creation information is generated by the SDN controller according to the charging identifier and the bearer identifier, the flow entry can point to the charging table corresponding to the charging identifier.

在一种可能的设计中,该方法还包括:该交换机接收来自SDN控制器的计费表创建消息,该计费表创建消息用于生成该计费表;该交换机根据该计费表创建消息生成该计费表。由于计费表创建信息是SDN控制器根据计费信息生成的,而计费信息可以是各种业务场景下的计费信息,因此本申请实施例提供的计费控制方法可以满足各种业务场景的电信计费需求。In a possible design, the method further includes: the switch receives a charging table creation message from the SDN controller, where the charging table creation message is used to generate the charging table; the switch creates the charging table message according to the charging table Generate the billing table. Since the charging table creation information is generated by the SDN controller according to the charging information, and the charging information may be charging information in various business scenarios, the charging control method provided by the embodiments of the present application can meet various business scenarios telecom billing needs.

在一种可能的设计中,该交换机根据该计费表中的该第一计费配额阈值、该第一动作类型和该计费配额对象的统计值进行计费控制,包括:当该第一计费配额阈值小于该终端签约的有效计费配额时,若该计费配额对象的统计值首次大于该第一计费配额阈值,该交换机向该SDN控制器发送计费统计信息,该计费统计信息包括该计费标识和该计费配额对象的统计值;该交换机接收来自该SDN控制器的计费表更新消息,该计费表更新消息包括该计费标识、第二计费配额阈值和第二动作类型,其中,当该第二计费配额阈值不是根据最后一次有效新增计费配额确定时,该第二动作类型为空;当该第二计费配额阈值是根据最后一次有效新增计费配额确定时,该第二动作类型为欠费对应的动作类型;该交换机根据该计费标识查找到该计费表之后,该交换机将该计费表中的该第一计费配额阈值更新为该第二计费配额阈值;以及,该交换机将该计费表中的该第一动作类型更新为该第二动作类型;该交换机根据该计费表中的该第二计费配额阈值、该第二动作类型和该计费配额对象的统计值进行计费控制。基于该方案,可以实现计费控制。In a possible design, the switch performs charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table, including: when the first charging quota When the charging quota threshold is less than the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is greater than the first charging quota threshold for the first time, the switch sends charging statistical information to the SDN controller, and the charging The statistical information includes the charging identifier and the statistical value of the charging quota object; the switch receives a charging table update message from the SDN controller, and the charging table update message includes the charging identifier and the second charging quota threshold and the second action type, wherein, when the second charging quota threshold is not determined according to the last valid new charging quota, the second action type is empty; when the second charging quota threshold is determined according to the last valid charging quota When the newly added charging quota is determined, the second action type is the action type corresponding to the arrears; after the switch finds the charging table according to the charging identifier, the switch determines the first charging in the charging table The quota threshold is updated to the second charging quota threshold; and, the switch updates the first action type in the charging table to the second action type; the switch is based on the second charging in the charging table The quota threshold, the second action type and the statistical value of the charging quota object perform charging control. Based on this solution, charging control can be realized.

在一种可能的设计中,该交换机根据该计费表中的第一计费配额阈值、第一动作类型和该计费配额对象的统计值进行计费控制,包括:当该第一计费配额阈值等于该终端签约的有效计费配额时,若该计费配额对象的统计值不小于该第一计费配额阈值,该交换机根据该欠费对应的动作类型管理接收到的数据包。基于该方案,可以实现计费控制。In a possible design, the switch performs charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table, including: when the first charging When the quota threshold is equal to the effective charging quota contracted by the terminal, if the statistical value of the charging quota object is not less than the first charging quota threshold, the switch manages the received data packets according to the action type corresponding to the arrears. Based on this solution, charging control can be realized.

在一种可能的设计中,该计费配额对象包括业务时长;该交换机根据该计费配额对象进行计费统计,包括:该交换机确定空闲时间是否大于预设值,该空闲时间为该交换机接收到该第一数据包的时间与该交换机接收到第二数据包的时间的间隔,该第二数据包为该第一数据包的上一个数据包;若该空闲时间大于该预设值,该交换机将该计费表中的计费配额对象的统计值确定为该业务时长的计费统计结果;若该空闲时间不大于该预设值,该交换机将该空闲时间和该计费表中的计费配额对象的统计值的和确定为该业务时长的计费统计结果。基于该方案,可以实现计费统计。In a possible design, the charging quota object includes the service duration; the switch performs charging statistics according to the charging quota object, including: the switch determines whether the idle time is greater than a preset value, and the idle time is received by the switch The interval between the time to the first data packet and the time when the switch receives the second data packet, the second data packet is the previous data packet of the first data packet; if the idle time is greater than the preset value, the The switch determines the statistical value of the charging quota object in the charging table as the charging statistical result of the service duration; if the idle time is not greater than the preset value, the switch combines the idle time with the value in the charging table. The sum of the statistical values of the charging quota objects is determined as the charging statistical result of the service duration. Based on this solution, billing statistics can be implemented.

第二方面,提供一种计费控制方法,该方法包括:软件自定义网络SDN控制器接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识,其中,该第一计费配额信息包括第一计费配额和第一动作类型,当该第一计费配额不是最后一次有效新增计费配额时,该第一动作类型为空;当该第一计费配额是最后一次有效新增计费配额时,该第一动作类型为欠费对应的动作类型;若该SDN控制器确定未存储该计费策略信息对应的计费标识,该SDN控制器根据该计费策略信息和该第一计费配额信息生成计费表创建消息,并向目标交换机发送该计费表创建消息,该计费表创建消息用于生成计费表,该计费表用于计费控制,该计费表包括该计费标识、第一计费配额阈值、该第一动作类型和该计费配额对象的统计值;该SDN控制器根据该承载标识和该计费标识生成流表项创建消息,并向该目标交换机发送该流表项创建消息,该流表项创建消息用于生成流表项,该流表项用于查找该计费表,其中,该流表项包括该承载标识和该计费标识;该SDN控制器存储该计费策略信息和该计费标识的对应关系。基于本申请实施例提供的计费控制方法,一方面,由于该计费控制方法中,SDN控制器可以根据计费信息生成计费表创建信息,这样目标交换机可以根据SDN控制器发送的计费表创建信息生成计费表,并根据计费表进行计费统计,因此可以满足各种业务场景的电信计费需求;另一方面,本申请实施例在计费表中直接指示了相应的动作,比如当计费表中的第一计费配额阈值是根据最后一次有效新增计费配额确定时,计费表中的第一动作类型为欠费对应的动作类型,因此可以避免目前OpenFlow仅支持基于阈值的消息上报机制所带来的处理滞后性。综上,本申请实施例提供的计费控制方法可以实现电信级的计费需求。In a second aspect, a charging control method is provided. The method includes: a software-defined network SDN controller receives charging policy information, first charging quota information, and bearer identification from a control plane entity, wherein the first accounting The charging quota information includes the first charging quota and the first action type. When the first charging quota is not the last effective charging quota added, the first action type is empty; when the first charging quota is the last When the charging quota is effectively added once, the first action type is the action type corresponding to the arrears; if the SDN controller determines that the charging identifier corresponding to the charging policy information is not stored, the SDN controller determines the charging policy according to the charging policy. information and the first charging quota information to generate a charging table creation message, and send the charging table creation message to the target switch, where the charging table creation message is used to generate a charging table, and the charging table is used for charging control , the charging table includes the charging identifier, the first charging quota threshold, the first action type and the statistical value of the charging quota object; the SDN controller generates a flow entry according to the bearer identifier and the charging identifier Create a message, and send the flow entry creation message to the target switch, where the flow entry creation message is used to generate a flow entry, and the flow entry is used to look up the charging table, wherein the flow entry includes the bearer identification and the charging identification; the SDN controller stores the corresponding relationship between the charging policy information and the charging identification. Based on the charging control method provided by the embodiment of the present application, on the one hand, in the charging control method, the SDN controller can generate charging table creation information according to the charging information, so that the target switch can generate charging table creation information according to the charging information sent by the SDN controller. The billing table is generated from the table creation information, and billing statistics are performed according to the billing table, so that the telecom billing requirements of various business scenarios can be met; on the other hand, the embodiment of the present application directly indicates corresponding actions in the billing table For example, when the first charging quota threshold in the charging table is determined according to the last effective new charging quota, the first action type in the charging table is the action type corresponding to the arrears. Supports the processing hysteresis brought by the threshold-based message reporting mechanism. To sum up, the charging control method provided by the embodiment of the present application can meet the charging requirements of the carrier level.

在一种可能的设计中,在该SDN控制器接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识之后,还包括:若该SDN控制器确定存储该计费策略信息对应的计费标识,该SDN控制器根据该承载标识和该计费标识生成流表项创建消息,并向该目标交换机发送该流表项创建消息,该流表项创建消息用于生成流表项,该流表项用于查找该计费表,其中,该流表项包括该承载标识和该计费标识。由于流表项表创建信息是SDN控制器根据计费标识和承载标识生成的,因此该流表项可以指向该计费标识对应的计费表。In a possible design, after the SDN controller receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity, the method further includes: if the SDN controller determines to store the charging policy information The corresponding charging identification, the SDN controller generates a flow entry creation message according to the bearer identification and the charging identification, and sends the flow entry creation message to the target switch, and the flow entry creation message is used to generate a flow table item, the flow entry is used to look up the charging table, wherein the flow entry includes the bearer identifier and the charging identifier. Since the flow entry table creation information is generated by the SDN controller according to the charging identifier and the bearer identifier, the flow entry can point to the charging table corresponding to the charging identifier.

在一种可能的设计中,该方法还包括:该SDN控制器接收来自该目标交换机的计费统计信息,该计费统计信息包括该计费标识和该计费配额对象的统计值;该SDN控制器确定与该计费标识对应的该计费策略信息,并向该控制面实体发送该计费策略信息;该SDN控制器接收来自该控制面实体的该计费策略信息和第二计费配额信息,其中,该第二计费配额信息包括第二计费配额和第二动作类型,当该第二计费配额不是最后一次有效新增计费配额时,该第二动作类型为空;当该第二计费配额是最后一次有效新增计费配额时,该第二动作类型为欠费对应的动作类型;该SDN控制器根据该第一计费配额阈值和该第二计费配额确定第二计费配额阈值;该SDN控制器确定与该计费策略信息对应的该计费标识;该SDN控制器向该目标交换机发送计费表更新消息,该计费表更新消息包括该计费标识、该第二计费配额阈值和该第二动作类型。基于该方案,可以更新计费表。In a possible design, the method further includes: the SDN controller receives charging statistical information from the target switch, where the charging statistical information includes the charging identifier and the statistical value of the charging quota object; the SDN The controller determines the charging policy information corresponding to the charging identifier, and sends the charging policy information to the control plane entity; the SDN controller receives the charging policy information and the second charging from the control plane entity Quota information, wherein the second charging quota information includes a second charging quota and a second action type, and when the second charging quota is not the last effective new charging quota, the second action type is empty; When the second charging quota is the last effective new charging quota, the second action type is the action type corresponding to the arrears; the SDN controller according to the first charging quota threshold and the second charging quota Determine a second charging quota threshold; the SDN controller determines the charging identifier corresponding to the charging policy information; the SDN controller sends a charging table update message to the target switch, and the charging table update message includes the charging table update message. fee identifier, the second charging quota threshold and the second action type. Based on this scheme, the charging table can be updated.

第三方面,提供了一种交换机,该交换机具有实现上述第一方面所述的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, a switch is provided, and the switch has the function of implementing the method described in the first aspect. This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.

第四方面,提供了一种交换机,包括:处理器、存储器、总线和通信接口;该存储器用于存储计算机执行指令,该处理器与该存储器通过该总线连接,当该交换机运行时,该处理器执行该存储器存储的该计算机执行指令,以使该交换机执行如上述第一方面中任一所述的计费控制方法。In a fourth aspect, a switch is provided, comprising: a processor, a memory, a bus and a communication interface; the memory is used to store computer execution instructions, the processor and the memory are connected through the bus, and when the switch operates, the processing The computer executes the computer-executed instructions stored in the memory, so that the switch executes the charging control method according to any one of the first aspects above.

第五方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面中任意一项的计费控制方法。In a fifth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, so that when the computer-readable storage medium runs on a computer, the computer can execute the charging control method according to any one of the above-mentioned first aspects. .

第六方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第一方面中任意一项的计费控制方法。In a sixth aspect, there is provided a computer program product containing instructions, which, when run on a computer, enable the computer to execute the charging control method according to any one of the above-mentioned first aspects.

第七方面,提供了一种芯片系统,该芯片系统包括处理器,用于根据流表项中的计费标识查找计费表。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存交换机必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。In a seventh aspect, a chip system is provided, the chip system includes a processor for searching a charging table according to a charging identifier in a flow table entry. In a possible design, the chip system further includes a memory for storing necessary program instructions and data of the switch. The chip system may be composed of chips, or may include chips and other discrete devices.

其中,第三方面至第七方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。Wherein, for the technical effects brought by any one of the design methods in the third aspect to the seventh aspect, reference may be made to the technical effects brought by different design methods in the first aspect, which will not be repeated here.

第八方面,提供了一种SDN控制器,该SDN控制器具有实现上述第二方面所述的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In an eighth aspect, an SDN controller is provided, and the SDN controller has the function of implementing the method described in the second aspect above. This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.

第九方面,提供了一种SDN控制器,包括:处理器、存储器、总线和通信接口;该存储器用于存储计算机执行指令,该处理器与该存储器通过该总线连接,当该SDN控制器运行时,该处理器执行该存储器存储的该计算机执行指令,以使该SDN控制器执行如上述第二方面中任一所述的计费控制方法。In a ninth aspect, an SDN controller is provided, comprising: a processor, a memory, a bus and a communication interface; the memory is used to store computer execution instructions, the processor and the memory are connected through the bus, and when the SDN controller runs At this time, the processor executes the computer-executable instruction stored in the memory, so that the SDN controller executes the charging control method according to any one of the above-mentioned second aspects.

第十方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第二方面中任意一项的计费控制方法。In a tenth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, so that when the computer-readable storage medium runs on a computer, the computer can execute the charging control method according to any one of the above-mentioned second aspects. .

第十一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第二方面中任意一项的计费控制方法。In an eleventh aspect, there is provided a computer program product containing instructions, which, when executed on a computer, enable the computer to execute the charging control method according to any one of the above-mentioned second aspects.

第十二方面,提供了一种芯片系统,该芯片系统包括处理器,用于支持SDN控制器实现上述方面中所涉及的功能,例如根据计费策略信息和第一计费配额信息生成计费表创建消息,并向目标交换机发送计费表创建消息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存SDN控制器必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。A twelfth aspect provides a chip system, the chip system includes a processor for supporting the SDN controller to implement the functions involved in the above aspects, for example, generating charging according to charging policy information and first charging quota information A table creation message is sent to the target switch. In a possible design, the chip system further includes a memory for storing necessary program instructions and data of the SDN controller. The chip system may be composed of chips, or may include chips and other discrete devices.

其中,第八方面至第十二方面中任一种设计方式所带来的技术效果可参见第二方面中不同设计方式所带来的技术效果,此处不再赘述。Wherein, for the technical effect brought by any one of the design methods in the eighth aspect to the twelfth aspect, reference may be made to the technical effect brought by the different design methods in the second aspect, which will not be repeated here.

第十三方面,提供了一种计费控制系统,该业务会话建立系统包括上述任一方面所述的交换机和上述任一方面所述的SDN控制器。A thirteenth aspect provides a charging control system, and the service session establishment system includes the switch described in any one of the above aspects and the SDN controller described in any one of the above aspects.

本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the present application will be more clearly understood in the description of the following embodiments.

附图说明Description of drawings

图1为本申请实施例提供的计费控制系统的架构示意图;FIG. 1 is a schematic structural diagram of a charging control system provided by an embodiment of the present application;

图2为本申请实施例提供的计费控制系统在4G网络架构中的应用示意图;FIG. 2 is a schematic diagram of the application of the charging control system provided by the embodiment of the present application in the 4G network architecture;

图3为本申请实施例提供的计费控制系统在5G网络架构中的应用示意图;FIG. 3 is a schematic diagram of the application of the charging control system provided by the embodiment of the present application in the 5G network architecture;

图4为本申请实施例提供的网络设备的硬件结构示意图;4 is a schematic diagram of a hardware structure of a network device provided by an embodiment of the present application;

图5为本申请实施例提供的计费控制方法的流程示意图一;FIG. 5 is a schematic flowchart 1 of a charging control method provided by an embodiment of the present application;

图6为本申请实施例提供的计费控制方法的流程示意图二;6 is a second schematic flowchart of a charging control method provided by an embodiment of the present application;

图7为本申请实施例提供的计费表和流表项的结构示意图;7 is a schematic structural diagram of a charging table and a flow table entry provided by an embodiment of the present application;

图8为本申请实施例提供的交换机的结构示意图一;FIG. 8 is a schematic structural diagram 1 of a switch according to an embodiment of the present application;

图9为本申请实施例提供的交换机的结构示意图二;FIG. 9 is a second schematic structural diagram of a switch according to an embodiment of the present application;

图10为本申请实施例提供的SDN控制器的结构示意图一;FIG. 10 is a schematic structural diagram 1 of an SDN controller provided by an embodiment of the present application;

图11为本申请实施例提供的SDN控制器的结构示意图二。FIG. 11 is a second schematic structural diagram of an SDN controller provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。比如,本申请实施例中的第一动作类型和第二动作类型可能是相同的动作类型,也可能是不同的动作类型,本申请实施例对此不作具体限定。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of this application, unless otherwise stated, "/" means or means, for example, A/B can mean A or B; "and/or" in this document is only an association to describe the associated object Relation, it means that there can be three kinds of relations, for example, A and/or B can mean that A exists alone, A and B exist at the same time, and B exists alone. Also, in the description of the present application, unless stated otherwise, "plurality" means two or more than two. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different. For example, the first action type and the second action type in this embodiment of the present application may be the same action type, or may be different action types, which are not specifically limited in this embodiment of the present application.

本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The network architecture and service scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. The evolution of the architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

如图1所示,为本申请实施例提供的计费控制系统10,该计费控制系统10包括控制面实体101、SDN控制器102和一个或多个交换机103。As shown in FIG. 1 , in the charging control system 10 provided by the embodiment of the present application, the charging control system 10 includes a control plane entity 101 , an SDN controller 102 and one or more switches 103 .

其中,SDN控制器102,用于接收来自控制面实体101的计费策略信息、第一计费配额信息和承载标识,其中,第一计费配额信息包括第一计费配额和第一动作类型,当第一计费配额不是最后一次有效新增计费配额时,第一动作类型为空;当第一计费配额是最后一次有效新增计费配额时,第一动作类型为欠费对应的动作类型。The SDN controller 102 is configured to receive the charging policy information, the first charging quota information and the bearer identifier from the control plane entity 101, where the first charging quota information includes the first charging quota and the first action type , when the first charging quota is not the last effective new charging quota, the first action type is empty; when the first charging quota is the last effective new charging quota, the first action type is corresponding to arrears action type.

SDN控制器102,还用于若确定未存储计费策略信息对应的计费标识,根据计费策略信息和第一计费配额信息生成计费表创建消息,并向目标交换机103发送计费表创建消息,该计费表创建消息用于生成计费表,该计费表用于计费控制,其中,该计费表包括计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值。The SDN controller 102 is further configured to generate a charging table creation message according to the charging policy information and the first charging quota information if it is determined that the charging identifier corresponding to the charging policy information is not stored, and send the charging table to the target switch 103 Create message, the charging table creation message is used to generate a charging table, and the charging table is used for charging control, wherein the charging table includes a charging identifier, a first charging quota threshold, a first action type, and a charging table. Statistical value of the fee quota object.

SDN控制器102,还用于根据承载标识和计费标识生成流表项创建消息,并向目标交换机103发送流表项创建消息,该流表项创建消息用于生成流表项,该流表项用于查找计费表,其中,该流表项包括承载标识和计费标识。The SDN controller 102 is further configured to generate a flow entry creation message according to the bearer identification and the charging identification, and send a flow entry creation message to the target switch 103, where the flow entry creation message is used to generate a flow entry, the flow entry The entry is used to look up the charging table, wherein the flow table entry includes the bearer identification and the charging identification.

SDN控制器102,还用于存储计费策略信息和计费标识的对应关系。The SDN controller 102 is further configured to store the corresponding relationship between the charging policy information and the charging identifier.

目标交换机103,用于接收来自SDN控制器102的流表项创建消息,并根据流表创建消息生成流表项。The target switch 103 is configured to receive a flow entry creation message from the SDN controller 102, and generate a flow entry according to the flow entry creation message.

目标交换机103,还用于接收来自SDN控制器102的计费表创建消息,并根据计费表创建消息生成计费表。The target switch 103 is further configured to receive a charging table creation message from the SDN controller 102, and generate a charging table according to the charging table creation message.

目标交换机103,还用于在接收来自终端的第一数据包之后,将该第一数据包对应的承载标识与流表项中的承载标识进行匹配,若匹配成功,根据流表项中的计费标识查找对应的计费表,进而对计费表中的计费配额对象进行计费统计,并将该计费配额对象的计费统计结果写入该计费表的计费配额对象的统计值中。The target switch 103 is further configured to, after receiving the first data packet from the terminal, match the bearer identification corresponding to the first data packet with the bearer identification in the flow table entry, and if the matching is successful, according to the calculation in the flow table entry. The corresponding charging table is searched by the charging identifier, and then charging statistics are performed on the charging quota objects in the charging table, and the charging statistics results of the charging quota objects are written into the statistics of the charging quota objects in the charging table. value.

目标交换机103,还用于根据该计费表中的第一计费配额阈值、第一动作类型和计费配额对象的统计值进行计费控制。The target switch 103 is further configured to perform charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table.

其中,本申请实施例中的目的交换机可以是图1所示的计费控制系统10中的任意一个交换机,是由SDN控制器102根据控制面网关101发送的交换机标识确定的,在此进行统一说明,以下不再赘述。The destination switch in this embodiment of the present application may be any switch in the charging control system 10 shown in FIG. 1 , which is determined by the SDN controller 102 according to the switch identifier sent by the control plane gateway 101 , and is unified here. Description, which will not be repeated below.

可选的,本申请实施例中的交换机可以是OpenFlow交换机,在此进行统一说明,以下不再赘述。Optionally, the switch in this embodiment of the present application may be an OpenFlow switch, which will be uniformly described here, and will not be repeated below.

可选的,图1中的控制面实体101和SDN控制器102可能直接通信,也可能通过其他网络设备的转发进行通信,本申请实施例对此不作具体限定。Optionally, the control plane entity 101 and the SDN controller 102 in FIG. 1 may communicate directly or communicate through forwarding by other network devices, which is not specifically limited in this embodiment of the present application.

可选的,图1中的交换机103和SDN控制器102可能直接通信,也可能通过其他网络设备的转发进行通信,本申请实施例对此不作具体限定。Optionally, the switch 103 and the SDN controller 102 in FIG. 1 may communicate directly, or may communicate through forwarding by other network devices, which is not specifically limited in this embodiment of the present application.

基于本申请实施例提供的计费控制系统,一方面,由于该计费控制系统中,SDN控制器可以根据计费信息生成计费表创建信息,目标交换机可以根据SDN控制器发送的计费表创建信息生成计费表,并根据计费表进行计费统计,因此可以满足各种业务场景的电信计费需求;另一方面,本申请实施例在计费表中直接指示了相应的动作,比如当计费表中的第一计费配额阈值是根据最后一次有效新增计费配额确定时,计费表中的第一动作类型为欠费对应的动作类型,因此可以避免目前OpenFlow仅支持基于阈值的消息上报机制所带来的处理滞后性。综上,本申请实施例提供的计费控制系统可以实现电信级的计费需求。Based on the charging control system provided by the embodiment of the present application, on the one hand, in the charging control system, the SDN controller can generate charging table creation information according to the charging information, and the target switch can generate charging table creation information according to the charging table sent by the SDN controller. Create information to generate a billing table, and perform billing statistics according to the billing table, so it can meet the telecom billing requirements of various business scenarios; on the other hand, the embodiment of the present application directly indicates corresponding actions in the billing table, For example, when the first charging quota threshold in the charging table is determined according to the last effective new charging quota, the first action type in the charging table is the action type corresponding to the arrears, so it can be avoided that the current OpenFlow only supports The processing lag caused by the threshold-based message reporting mechanism. To sum up, the charging control system provided by the embodiment of the present application can meet the charging requirements of the carrier level.

具体的,上述计费控制系统10可以应用于目前的第四代(英文:4rd-Generation,缩写:4G)网络,也可以应用于未来的第五代(英文:5rd-Generation,缩写:5G)网络以及未来其它的网络,本发明实施例对此不作具体限定。Specifically, the above charging control system 10 can be applied to the current fourth generation (English: 4rd-Generation, abbreviation: 4G) network, and can also be applied to the future fifth generation (English: 5rd-Generation, abbreviation: 5G) network The network and other future networks are not specifically limited in this embodiment of the present invention.

其中,若上述计费控制系统10应用于目前的4G网络,则如图2所示,控制面实体101所对应的网元或者实体可能为网关控制面功能(Gateway Control plane function,GW-C)实体;SDN控制器102所对应的网元或者实体可能为SDN控制器;交换机103可用于实现网关用户面功能(Gateway User plane function,GW-U)实体的功能。此外,如图2所示,该4G网络还可以包括终端、基站、移动性管理实体(mobility management entity,MME)、策略和计费规则功能(policy and Charging Rules Function,PCRF)、在线计费系统(OnlineCharging System,OCS)和离线计费系统(Offline Charging System,OFCS)等。Wherein, if the above charging control system 10 is applied to the current 4G network, as shown in FIG. 2 , the network element or entity corresponding to the control plane entity 101 may be a gateway control plane function (Gateway Control plane function, GW-C) entity; the network element or entity corresponding to the SDN controller 102 may be an SDN controller; the switch 103 may be used to implement the function of the gateway user plane function (Gateway User plane function, GW-U) entity. In addition, as shown in FIG. 2, the 4G network may also include terminals, base stations, mobility management entities (MME), policy and charging rules function (PCRF), online charging system (Online Charging System, OCS) and Offline Charging System (Offline Charging System, OFCS) and so on.

其中,若上述计费控制系统10应用于5G网络,则如图3所示,控制面实体101所对应的网元或者实体可能为会话管理功能(session management function,SMF)实体;SDN控制器102所对应的网元或者实体可能为SDN控制器;交换机103可用于实现用户面功能(userplane function,UPF)实体的功能。此外,如图3所示,该5G网络还可以包括终端、接入设备、接入与移动管理功能(access and mobility management function,AMF)实体、策略控制功能(policy control function,PCF)实体、OCS和OFCS等。Wherein, if the above charging control system 10 is applied to a 5G network, as shown in FIG. 3 , the network element or entity corresponding to the control plane entity 101 may be a session management function (SMF) entity; the SDN controller 102 The corresponding network element or entity may be an SDN controller; the switch 103 may be used to implement the function of a user plane function (userplane function, UPF) entity. In addition, as shown in FIG. 3 , the 5G network may further include a terminal, an access device, an access and mobility management function (AMF) entity, a policy control function (PCF) entity, an OCS and OFCS et al.

需要说明的是,图3中的接入设备、AMF实体、SMF实体、PCF实体、OCS和OFCS等仅是一个名字,名字对设备本身不构成限定。在5G网络以及未来其它的网络中,接入设备、AMF实体、SMF实体、PCF实体、OCS和OFCS也可以是其他的名字,本申请实施例对此不作具体限定。It should be noted that the access device, the AMF entity, the SMF entity, the PCF entity, the OCS, and the OFCS in FIG. 3 are only a name, and the name does not limit the device itself. In the 5G network and other future networks, the access device, the AMF entity, the SMF entity, the PCF entity, the OCS, and the OFCS may also have other names, which are not specifically limited in this embodiment of the present application.

其中,图2和图3中各个网元的具体功能可参考下述方法实施例,在此不再赘述。For the specific functions of each network element in FIG. 2 and FIG. 3 , reference may be made to the following method embodiments, which will not be repeated here.

可选的,本申请实施例中所涉及到的终端(terminal)可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备;还可以包括用户单元(subscriber unit)、蜂窝电话(cellular phone)、智能电话(smart phone)、无线数据卡、个人数字助理(personal digital assistant,PDA)电脑、平板型电脑、无线调制解调器(modem)、手持设备(handheld)、膝上型电脑(laptopcomputer)、无绳电话(cordless phone)或者无线本地环路(wireless local loop,WLL)台、机器类型通信(machine type communication,MTC)终端、用户设备(user equipment,UE),移动台(mobile station,MS),终端设备(terminal device)等。为方便描述,本申请中,上面提到的设备统称为终端。Optionally, the terminal (terminal) involved in the embodiments of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem; Including subscriber unit (subscriber unit), cellular phone (cellular phone), smart phone (smart phone), wireless data card, personal digital assistant (personal digital assistant, PDA) computer, tablet computer, wireless modem (modem), handheld devices (handheld), laptop computer (laptopcomputer), cordless phone (cordless phone) or wireless local loop (wireless local loop, WLL) station, machine type communication (machine type communication, MTC) terminal, user equipment (user equipment, UE), mobile station (mobile station, MS), terminal device (terminal device) and so on. For convenience of description, in this application, the devices mentioned above are collectively referred to as terminals.

可选的,本申请实施例中所涉及到的接入设备指的是接入核心网的设备,例如可以是基站,宽带网络业务网关(broadband network gateway,BNG),汇聚交换机,非3GPP接入设备等。基站可以包括各种形式的基站,例如:宏基站,微基站(也称为小站),中继站,接入点等。Optionally, the access device involved in this embodiment of the present application refers to a device that accesses the core network, and may be, for example, a base station, a broadband network gateway (BNG), an aggregation switch, or a non-3GPP access device. equipment, etc. The base station may include various forms of base stations, such as: a macro base station, a micro base station (also called a small station), a relay station, an access point, and the like.

可选的,图1中的SDN控制器102和交换机103,可以由一个实体设备实现,也可以由多个实体设备共同实现,还可以是一个实体设备内的一个逻辑功能模块,本申请实施例对此不作具体限定。Optionally, the SDN controller 102 and the switch 103 in FIG. 1 may be implemented by one entity device, or may be implemented jointly by multiple entity devices, and may also be a logical function module in one entity device, the embodiment of the present application. This is not specifically limited.

例如,如图4所示,图1中的SDN控制器102和交换机103均可以通过图4中的网络设备来实现。For example, as shown in FIG. 4 , both the SDN controller 102 and the switch 103 in FIG. 1 can be implemented by the network device in FIG. 4 .

图4所示为本申请实施例提供的网络设备的硬件结构示意图。网络设备400包括至少一个处理器401,通信总线402,存储器403以及至少一个通信接口404。FIG. 4 is a schematic diagram of a hardware structure of a network device according to an embodiment of the present application. The network device 400 includes at least one processor 401 , a communication bus 402 , a memory 403 and at least one communication interface 404 .

处理器401可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 401 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more processors for controlling the execution of the programs of the present application. integrated circuit.

通信总线402可包括一通路,在上述组件之间传送信息。Communication bus 402 may include a path to communicate information between the above-described components.

通信接口404,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local areanetworks,WLAN)等。The communication interface 404, using any transceiver-like device, is used to communicate with other devices or communication networks, such as Ethernet, radio access networks (RAN), wireless local area networks (WLAN), and the like.

存储器403可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electricallyerasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。Memory 403 may be read-only memory (ROM) or other type of static storage device that can store static information and instructions, random access memory (RAM) or other type of static storage device that can store information and instructions It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disk storage, optical disk storage ( including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being stored by a computer any other medium taken, but not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.

其中,存储器403用于存储执行本申请方案的应用程序代码,并由处理器401来控制执行。处理器401用于执行存储器403中存储的应用程序代码,从而实现本申请下述实施例提供的计费控制方法。Wherein, the memory 403 is used for storing the application code for executing the solution of the present application, and the execution is controlled by the processor 401 . The processor 401 is configured to execute the application program code stored in the memory 403, thereby implementing the charging control method provided by the following embodiments of the present application.

在具体实现中,作为一种实施例,处理器401可以包括一个或多个CPU,例如图4中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 4 .

在具体实现中,作为一种实施例,网络设备400可以包括多个处理器,例如图4中的处理器401和处理器408。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the network device 400 may include multiple processors, such as the processor 401 and the processor 408 in FIG. 4 . Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).

在具体实现中,作为一种实施例,网络设备400还可以包括输出设备405和输入设备406。输出设备405和处理器401通信,可以以多种方式来显示信息。例如,输出设备405可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备406和处理器401通信,可以以多种方式接受用户的输入。例如,输入设备406可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the network device 400 may further include an output device 405 and an input device 406 . The output device 405 is in communication with the processor 401 and can display information in a variety of ways. For example, the output device 405 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector (projector) Wait. Input device 406 is in communication with processor 401 and can accept user input in a variety of ways. For example, the input device 406 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.

上述的网络设备400可以是一个通用网络设备或者是一个专用网络设备。在具体实现中,网络设备400可以是台式机、便携式电脑、网络服务器、掌上电脑(personaldigital assistant,PDA)、移动手机、平板电脑、无线终端设备、嵌入式设备或有图4中类似结构的设备。本申请实施例不限定网络设备400的类型。The above-mentioned network device 400 may be a general network device or a dedicated network device. In a specific implementation, the network device 400 may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a device with a similar structure in FIG. 4 . . This embodiment of the present application does not limit the type of the network device 400 .

下面将结合图1至图4对本申请实施例提供的计费控制方法进行具体阐述。The charging control method provided by the embodiment of the present application will be described in detail below with reference to FIG. 1 to FIG. 4 .

首先,结合图1所示的计费控制系统10,本申请实施例提供的业务控制方法的流程示意图如图5所示,涉及到控制面实体101、SDN控制器102和目的交换机103之间的交互,包括如下步骤:First, with reference to the charging control system 10 shown in FIG. 1 , a schematic flowchart of the service control method provided by the embodiment of the present application is shown in FIG. Interaction, including the following steps:

S501、控制面实体向SDN控制器发送计费策略信息、第一计费配额信息和承载标识,以使得SDN控制器接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识。S501. The control plane entity sends the charging policy information, the first charging quota information and the bearer identifier to the SDN controller, so that the SDN controller receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity .

其中,第一计费配额信息包括第一计费配额和第一动作类型,当第一计费配额不是最后一次有效新增计费配额时,第一动作类型为空;当第一计费配额是最后一次有效新增计费配额时,第一动作类型为欠费对应的动作类型。Wherein, the first charging quota information includes a first charging quota and a first action type. When the first charging quota is not the last effective new charging quota, the first action type is empty; It is the last time when the billing quota is effectively added, and the first action type is the action type corresponding to the arrears.

S502、若SDN控制器确定未存储计费策略信息对应的计费标识,SDN控制器根据计费策略信息和第一计费配额信息生成计费表创建消息。S502. If the SDN controller determines that the charging identifier corresponding to the charging policy information is not stored, the SDN controller generates a charging table creation message according to the charging policy information and the first charging quota information.

其中,本申请实施例中的计费表创建消息包括计费标识、第一计费配额阈值和第一动作类型。第一计费配额阈值是根据第一计费配额信息中的第一计费配额确定的。The charging table creation message in this embodiment of the present application includes a charging identifier, a first charging quota threshold, and a first action type. The first charging quota threshold is determined according to the first charging quota in the first charging quota information.

S503、SDN控制器向目标交换机发送计费表创建消息,以使得目标交换机接收来自SDN控制器的计费表创建消息。该计费表创建消息用于生成计费表,该计费表用于计费控制,其中,该计费表包括计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值。S503. The SDN controller sends a charging table creation message to the target switch, so that the target switch receives the charging table creation message from the SDN controller. The charging table creation message is used to generate a charging table, and the charging table is used for charging control, wherein the charging table includes a charging identifier, a first charging quota threshold, a first action type, and a charging quota object statistic value.

S504、SDN控制器根据承载标识和计费标识生成流表项创建消息。S504. The SDN controller generates a flow entry creation message according to the bearer identifier and the charging identifier.

S505、SDN控制器向目标交换机发送流表项创建消息,以使得目标交换机接收来自SDN控制器的流表项创建消息。该流表项创建消息用于生成流表项,该流表项用于查找计费表,其中,该流表项包括承载标识和计费标识。S505. The SDN controller sends a flow entry creation message to the target switch, so that the target switch receives the flow entry creation message from the SDN controller. The flow entry creation message is used to generate a flow entry, and the flow entry is used to look up a charging table, wherein the flow entry includes a bearer identifier and a charging identifier.

S506、SDN控制器存储计费标识和计费策略信息的对应关系。S506. The SDN controller stores the corresponding relationship between the charging identifier and the charging policy information.

S507、目标交换机根据流表项创建消息生成流表项。S507. The target switch generates a flow entry according to the flow entry creation message.

S508、目标交换机根据计费表创建消息生成计费表。S508. The target switch generates a charging table according to the charging table creation message.

至此,计费表和流表项创建完成,进而,目标交换机可以根据流表项和计费表进行计费控制,具体如下:So far, the creation of the charging table and the flow table entry is completed, and the target switch can perform charging control according to the flow table entry and the charging table, as follows:

S509、目标交换机在接收来自终端的第一数据包之后,将该第一数据包对应的承载标识与流表项中的承载标识进行匹配。S509. After receiving the first data packet from the terminal, the target switch matches the bearer identifier corresponding to the first data packet with the bearer identifier in the flow entry.

S510、若匹配成功,目标交换机根据流表项中的计费标识查找对应的计费表。S510. If the match is successful, the target switch searches for the corresponding charging table according to the charging identifier in the flow table entry.

S511、目标交换机对计费表中的计费配额对象进行计费统计,并将该计费配额对象的计费统计结果写入该计费表的计费配额对象的统计值中。S511. The target switch performs charging statistics on the charging quota object in the charging table, and writes the charging statistics result of the charging quota object into the statistical value of the charging quota object in the charging table.

S512、目标交换机根据该计费表中的第一计费配额阈值、第一动作类型和计费配额对象的统计值进行计费控制。S512: The target switch performs charging control according to the first charging quota threshold, the first action type, and the statistical value of the charging quota object in the charging table.

其中,步骤S501-S512的相关实现将在下述实施例中详细阐述,在此不再赘述。The related implementation of steps S501-S512 will be described in detail in the following embodiments, and will not be repeated here.

基于本申请实施例提供的计费控制方法,一方面,由于该计费控制方法中,SDN控制器可以根据计费信息生成计费表创建信息,目标交换机可以根据SDN控制器发送的计费表创建信息生成计费表,并根据计费表进行计费统计,因此可以满足各种业务场景的电信计费需求;另一方面,本申请实施例在计费表中直接指示了相应的动作,比如当计费表中的第一计费配额阈值是根据最后一次有效新增计费配额确定时,计费表中的第一动作类型为欠费对应的动作类型,因此可以避免目前OpenFlow仅支持基于阈值的消息上报机制所带来的处理滞后性。综上,本申请实施例提供的计费控制方法可以实现电信级的计费需求。Based on the charging control method provided by the embodiment of the present application, on the one hand, in the charging control method, the SDN controller can generate charging table creation information according to the charging information, and the target switch can generate charging table creation information according to the charging table sent by the SDN controller. Create information to generate a billing table, and perform billing statistics according to the billing table, so it can meet the telecom billing requirements of various business scenarios; on the other hand, the embodiment of the present application directly indicates corresponding actions in the billing table, For example, when the first charging quota threshold in the charging table is determined according to the last effective new charging quota, the first action type in the charging table is the action type corresponding to the arrears, so it can be avoided that the current OpenFlow only supports The processing lag caused by the threshold-based message reporting mechanism. To sum up, the charging control method provided by the embodiment of the present application can meet the charging requirements of the carrier level.

其中,上述步骤S501-S512中SDN控制器的动作可以由图4所示的通信设备400中的处理器401调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。The actions of the SDN controller in the above steps S501-S512 may be executed by the processor 401 in the communication device 400 shown in FIG. 4 calling the application code stored in the memory 403, which is not limited in this embodiment of the present application.

其中,上述步骤S501-S512中目标交换机的动作可以由图4所示的通信设备400中的处理器401调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。The actions of the target switch in the above steps S501-S512 may be executed by the processor 401 in the communication device 400 shown in FIG. 4 calling the application code stored in the memory 403, which is not limited in this embodiment of the present application.

其次,以图1所示的计费控制系统10应用于图2所示的4G网络为例,对图5所示的计费控制方法进行展开说明。Next, taking the charging control system 10 shown in FIG. 1 applied to the 4G network shown in FIG. 2 as an example, the charging control method shown in FIG. 5 will be described.

如图6所示,为本申请实施例提供的一种计费控制方法的流程示意图,涉及到GW-C实体、SDN控制器、目标交换机、PCRF和OCS之间的交互,包括如下步骤:As shown in FIG. 6 , a schematic flowchart of a charging control method provided in an embodiment of the present application involves the interaction between the GW-C entity, the SDN controller, the target switch, the PCRF, and the OCS, including the following steps:

S601、在承载建立的过程中,PCRF向GW-C实体发送计费策略信息,以使得GW-C实体接收来自PCRF实体的计费策略信息。S601. During the bearer establishment process, the PCRF sends charging policy information to the GW-C entity, so that the GW-C entity receives the charging policy information from the PCRF entity.

可选的,本申请实施例中的计费策略信息包括终端的网络之间互连的协议(internet protocol,IP)地址、在线计费信息或离线计费信息,计费组标识,计费配额对象等等,本申请实施例对此不作具体限定。Optionally, the charging policy information in this embodiment of the present application includes an internet protocol (IP) address for interconnection between networks of terminals, online charging information or offline charging information, a charging group identifier, and a charging quota. objects, etc., which are not specifically limited in this embodiment of the present application.

可选的,本申请实施例中的计费配额对象包括流量或者业务时长,即基于流量计费还是基于业务时长计费,本申请实施例对此不作具体限定。Optionally, the charging quota object in this embodiment of the present application includes traffic or service duration, that is, charging based on traffic or charging based on service duration, which is not specifically limited in this embodiment of the present application.

S602、在承载建立的过程中,OCS向GW-C实体发送计费配额信息1,以使得GW-C实体接收来自OCS的计费配额信息1。S602. During the bearer establishment process, the OCS sends the charging quota information 1 to the GW-C entity, so that the GW-C entity receives the charging quota information 1 from the OCS.

可选的,本申请实施例中的计费配额信息1包括计费配额。Optionally, the charging quota information 1 in the embodiment of the present application includes charging quota.

可选的,本申请实施例中的计费配额信息1还可以包括指示计费配额是否耗尽的信息,比如,当计费配额耗尽时,该计费配额信息1还可以包括计费配额耗尽标识,本申请实施例对此不作具体限定。Optionally, the charging quota information 1 in this embodiment of the present application may further include information indicating whether the charging quota is exhausted, for example, when the charging quota is exhausted, the charging quota information 1 may further include the charging quota The exhaustion flag is not specifically limited in this embodiment of the present application.

S603、GW-C实体向SDN控制器发送计费策略信息、计费配额信息2、承载标识和目标交换机的标识,以使得SDN控制器接收来自GW-C实体的计费策略信息、计费配额信息2、承载标识和目标交换机的标识。S603, the GW-C entity sends the charging policy information, the charging quota information 2, the bearer identifier and the identifier of the target switch to the SDN controller, so that the SDN controller receives the charging policy information and charging quota from the GW-C entity Information 2. The bearer identification and the identification of the target switch.

其中,本申请实施例中的计费配额信息2包括计费配额信息1中的计费配额。The charging quota information 2 in the embodiment of the present application includes the charging quota in the charging quota information 1 .

可选的,若步骤S602中的计费配额信息1还包括指示计费配额是否耗尽的信息,则本申请实施例中的计费配额信息2中还包括与该指示计费配额是否耗尽的信息相对应的动作类型。比如,若计费配额信息1还可以包括计费配额耗尽标识,则相应的,该计费配额信息2还包括欠费对应的动作类型。该欠费对应的动作类型例如可以是丢包或者重新路由到欠费服务器等,本申请实施例对此不作具体限定。或者,比如,若计费配额信息1还包括指示计费配额未耗尽的信息,则计费配额信息2中还包括空动作类型,即不执行欠费对应的操作。Optionally, if the charging quota information 1 in step S602 further includes information indicating whether the charging quota is exhausted, the charging quota information 2 in this embodiment of the present application also includes information related to whether the charging quota is exhausted. The information corresponding to the action type. For example, if the charging quota information 1 may further include a charging quota exhaustion identifier, correspondingly, the charging quota information 2 further includes an action type corresponding to the arrears. The action type corresponding to the arrears may be, for example, packet loss or rerouting to the arrears server, which is not specifically limited in this embodiment of the present application. Or, for example, if the charging quota information 1 further includes information indicating that the charging quota is not exhausted, the charging quota information 2 also includes an empty action type, that is, the operation corresponding to the arrears is not performed.

当然,在计费配额未耗尽时,计费配额信息1中还可以不包含指示计费配额是否耗尽的信息,而是仅在计费配额耗尽时,计费配额信息1中包括指示计费配额耗尽的信息,计费配额信息2中包括欠费对应的动作类型,本申请实施例对此不作具体限定。Of course, when the charging quota is not exhausted, the charging quota information 1 may not include information indicating whether the charging quota is exhausted, but only when the charging quota is exhausted, the charging quota information 1 includes the indication For the information about the exhaustion of the charging quota, the charging quota information 2 includes the action type corresponding to the arrears, which is not specifically limited in this embodiment of the present application.

可选的,本申请实施例中,GW-C实体可以根据承载所要求的功能集合以及交换机的负载情况,选择一个目标交换机,进而,GW-C实体可以将计费策略信息、计费配额信息2、承载标识和目标交换机的标识发送给SDN控制器,本申请实施例对此不作具体限定。其中,GW-C实体和SDN控制器之间的接口采用Restful应用程序编程接口(ApplicationProgramming Interface,API)。Optionally, in the embodiment of the present application, the GW-C entity may select a target switch according to the function set required for the bearer and the load condition of the switch, and then the GW-C entity may store the charging policy information and charging quota information. 2. The bearer identifier and the identifier of the target switch are sent to the SDN controller, which is not specifically limited in this embodiment of the present application. The interface between the GW-C entity and the SDN controller adopts a Restful application programming interface (Application Programming Interface, API).

S604、若SDN控制器确定未存储计费策略信息对应的计费标识,SDN控制器根据计费策略信息和计费配额信息3生成计费表创建消息。该计费表创建消息用于生成计费表,该计费表用于计费控制,其中,该计费表包括计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值。S604. If the SDN controller determines that the charging identifier corresponding to the charging policy information is not stored, the SDN controller generates a charging table creation message according to the charging policy information and the charging quota information 3. The charging table creation message is used to generate a charging table, and the charging table is used for charging control, wherein the charging table includes a charging identifier, a first charging quota threshold, a first action type, and a charging quota object statistic value.

其中,本申请实施例中的计费配额信息3包括第一计费配额阈值和第一动作类型。该第一计费配额阈值即为计费配额信息2中的计费配额。The charging quota information 3 in this embodiment of the present application includes a first charging quota threshold and a first action type. The first charging quota threshold is the charging quota in the charging quota information 2 .

其中,计费表创建消息中包括计费标识、第一计费配额阈值和第一动作类型。计费标识是根据计费策略信息中与计费标识对应的信息生成的,比如,可以是根据计费组标识生成的;第一计费配额阈值和第一动作类型是根据计费配额信息3生成的。The charging table creation message includes a charging identifier, a first charging quota threshold and a first action type. The charging identifier is generated according to the information corresponding to the charging identifier in the charging policy information, for example, it may be generated based on the charging group identifier; the first charging quota threshold and the first action type are based on the charging quota information 3 Generated.

其中,本申请实施例中的第一计费配额和第一动作类型相对应,当该第一计费配额阈值不是根据最后一次有效新增计费配额确定时,该第一动作类型为空;当该第一计费配额阈值是根据最后一次有效新增计费配额确定时,该第一动作类型为欠费对应的动作类型。Wherein, the first charging quota in the embodiment of the present application corresponds to the first action type, and when the first charging quota threshold is not determined according to the last effective new charging quota, the first action type is empty; When the first charging quota threshold is determined according to the last effective new charging quota, the first action type is the action type corresponding to the arrears.

S605、SDN控制器向目标交换机发送计费表创建消息,以使得目标交换机接收来自SDN控制器的计费表创建消息。S605. The SDN controller sends a charging table creation message to the target switch, so that the target switch receives the charging table creation message from the SDN controller.

可选的,若SDN控制器确定存储了计费策略信息对应的计费标识,可以不用执行步骤S604和步骤S605。Optionally, if the SDN controller determines that the charging identifier corresponding to the charging policy information is stored, steps S604 and S605 may not be performed.

S606、SDN控制器根据承载标识和计费标识生成流表项创建消息。S606. The SDN controller generates a flow entry creation message according to the bearer identifier and the charging identifier.

S607、SDN控制器向目标交换机发送流表项创建消息,以使得目标交换机接收来自SDN控制器的流表项创建消息。该流表项创建消息用于生成流表项,该流表项用于查找计费表,其中,该流表项包括承载标识和计费标识。S607. The SDN controller sends a flow entry creation message to the target switch, so that the target switch receives the flow entry creation message from the SDN controller. The flow entry creation message is used to generate a flow entry, and the flow entry is used to look up a charging table, wherein the flow entry includes a bearer identifier and a charging identifier.

由于流表项中包括计费标识,因此根据该流表项可以查找到计费表。如图7所示,为本申请实施例提供的流表项和计费表的一个可能结构示意图。其中,流表项包括匹配域字段、优先级字段、统计值字段、指令字段等。本申请实施例中,在流表项的指令字段中写入计费标识,也就是说将该流表项指向该计费标识对应的计费表。计费表包括计费标识字段、计费配额阈值字段、动作类型字段和统计值字段。其中,本申请实施例中的动作类型可以包括空或者欠费对应的动作类型,欠费对应的动作类型例如可以是丢包或者重新路由到欠费服务器等,本申请实施例对此不作具体限定。其中,本申请实施例中的统计值字段中包括计费配额对象的统计值字段,比如业务时长的统计字段。当然,计费表的统计值字段中还可以包括其他参量的统计值字段,比如流量的统计值字段、输入字节数的统计值字段、输出字节数的统计字段等,以用于SDN控制器查看这些参量的统计值并执行相关操作,本申请实施例对此不作具体限定。Since the flow table entry includes the charging identifier, the charging table can be found according to the flow table entry. As shown in FIG. 7 , it is a schematic structural diagram of a possible structure of the flow table entry and the charging table provided by the embodiment of the present application. The flow entry includes a matching field field, a priority field, a statistical value field, an instruction field, and the like. In the embodiment of the present application, the charging identifier is written in the instruction field of the flow entry, that is, the flow entry points to the charging table corresponding to the charging identifier. The charging table includes a charging identification field, a charging quota threshold field, an action type field and a statistical value field. The action type in this embodiment of the present application may include an action type corresponding to empty or arrears, and the action type corresponding to arrears may be, for example, packet loss or rerouting to arrears server, etc., which is not specifically limited in this embodiment of the present application . The statistical value field in the embodiment of the present application includes a statistical value field of a charging quota object, such as a statistical value field of service duration. Of course, the statistic value field of the billing table may also include statistic value fields of other parameters, such as the statistic value field of traffic, the statistic value field of the number of input bytes, the statistic value field of the number of output bytes, etc., for SDN control The controller checks the statistical values of these parameters and performs related operations, which are not specifically limited in this embodiment of the present application.

可选的,本申请实施例中,SDN控制器可以通过OpenFlow Multipart消息查询计费表的统计信息(stats)和配置信息(desc)。其中,OpenFlow Multipart消息中包括计费标识,依靠OpenFlow Multipart消息头中的类型来区分是查询统计信息还是配置信息,详见OpenFlow Multipart消息头的描述,在此不再赘述。Optionally, in this embodiment of the present application, the SDN controller may query the statistical information (stats) and configuration information (desc) of the charging table through an OpenFlow Multipart message. Among them, the OpenFlow Multipart message includes the charging identifier, and the type in the OpenFlow Multipart message header is used to distinguish whether to query the statistical information or the configuration information. For details, see the description of the OpenFlow Multipart message header, which will not be repeated here.

S608、SDN控制器存储计费标识和计费策略信息的对应关系。S608: The SDN controller stores the corresponding relationship between the charging identifier and the charging policy information.

这样,在后续更新计费表时,可以根据该对应关系获取计费表对应的计费标识。In this way, when the charging table is updated subsequently, the charging identifier corresponding to the charging table can be obtained according to the corresponding relationship.

可选的,本申请实施例中,SDN控制器还存储流表项和承载标识以及目标交换机的标识的对应关系,以使得后续SDN控制器接收到承载修改信息时,可以通过查询该对应关系识别到对应的流表项和交换机。Optionally, in this embodiment of the present application, the SDN controller further stores the correspondence between the flow entry, the bearer identifier, and the identifier of the target switch, so that when the subsequent SDN controller receives the bearer modification information, it can identify the corresponding relation by querying the corresponding relation. to the corresponding flow entry and switch.

可选的,本申请实施例中,SDN控制器还存储计费标识和目标交换机的标识的对应关系,这样在后续更新计费表时,可以根据该对应关系将计费表更新信息发送给目标交换机。Optionally, in this embodiment of the present application, the SDN controller also stores the corresponding relationship between the charging identifier and the identifier of the target switch, so that when the charging table is updated subsequently, the charging table update information can be sent to the target according to the corresponding relationship. switch.

S609、目标交换机根据流表项创建消息生成流表项。S609. The target switch generates a flow entry according to the flow entry creation message.

S610、目标交换机根据计费表创建消息生成计费表。S610. The target switch generates a charging table according to the charging table creation message.

其中,流表项和计费表的相关结构可参考图7,在此不再赘述。The related structure of the flow table entry and the charging table may refer to FIG. 7 , which will not be repeated here.

至此,计费表和流表项创建完成,进而,目标交换机可以根据流表项和计费表进行计费控制,具体如下:So far, the creation of the charging table and the flow table entry is completed, and the target switch can perform charging control according to the flow table entry and the charging table, as follows:

S611、目标交换机在接收来自终端的第一数据包之后,将该第一数据包对应的承载标识与流表项中的承载标识进行匹配。S611. After receiving the first data packet from the terminal, the target switch matches the bearer identifier corresponding to the first data packet with the bearer identifier in the flow entry.

具体的,当目标交换机接收到第一数据包之后,可以通过承载匹配等方式获取第一数据包所在承载的承载标识,进而可以将第一数据包对应的承载标识与目标交换机中的流表项的承载标识进行匹配。Specifically, after receiving the first data packet, the target switch can obtain the bearer identifier of the bearer where the first data packet is carried by means of bearer matching, etc., and then can compare the bearer identifier corresponding to the first data packet with the flow entry in the target switch. to match the bearer ID.

S612、若匹配成功,目标交换机根据流表项中的计费标识查找对应的计费表。S612. If the matching is successful, the target switch searches for the corresponding charging table according to the charging identifier in the flow table entry.

S613、目标交换机对计费表中的计费配额对象进行计费统计,并将该计费配额对象的计费统计结果写入该计费表的计费配额对象的统计值中。S613: The target switch performs charging statistics on the charging quota object in the charging table, and writes the charging statistics result of the charging quota object into the statistical value of the charging quota object in the charging table.

可选的,计费配额对象包括业务时长。相应的,目标交换机对计费表中的计费配额对象进行计费统计,具体可以包括:目标交换机确定空闲时间是否大于预设值,该空闲时间为目标交换机接收到第一数据包的时间与目标交换机接收到第二数据包的时间的间隔,该第二数据包为该第一数据包的上一个数据包;若空闲时间大于预设值,目标交换机将计费表中的计费配额对象的统计值确定为业务时长的计费统计结果;若空闲时间不大于预设值,目标交换机将空闲时间和计费表中的计费配额对象的统计值的和确定为业务时长的计费统计结果。Optionally, the charging quota object includes the service duration. Correspondingly, the target switch performs accounting statistics on the charging quota objects in the charging table, which may specifically include: determining whether the idle time is greater than a preset value by the target switch, where the idle time is the difference between the time when the target switch receives the first data packet and the The time interval when the target switch receives the second data packet, the second data packet is the previous data packet of the first data packet; if the idle time is greater than the preset value, the target switch will use the charging quota object in the charging table If the idle time is not greater than the preset value, the target switch determines the sum of the idle time and the statistical value of the charging quota object in the charging table as the charging statistics of the service duration. result.

可选的,当第一计费配额阈值小于终端签约的有效计费配额时,执行以下步骤S614-S622;Optionally, when the first charging quota threshold is less than the effective charging quota subscribed by the terminal, the following steps S614-S622 are performed;

当第一计费配额阈值等于终端签约的有效计费配额时,执行以下步骤S623。When the first charging quota threshold is equal to the effective charging quota subscribed by the terminal, the following step S623 is performed.

S614、当第一计费配额阈值小于终端签约的有效计费配额时,若计费配额对象的统计值首次大于第一计费配额阈值,目标交换机向SDN控制器发送计费统计信息,以使得SDN控制器接收来自目标交换机的计费统计信息。该计费统计信息包括计费标识和计费配额对象的统计值,该计费统计信息用于请求第二配额阈值和第二动作类型。S614. When the first charging quota threshold is less than the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is greater than the first charging quota threshold for the first time, the target switch sends the charging statistical information to the SDN controller, so that the The SDN controller receives billing statistics from the target switch. The charging statistical information includes a charging identifier and a statistical value of a charging quota object, and the charging statistical information is used to request a second quota threshold and a second action type.

可选的,本申请实施例中的计费统计信息可以通过ofp_charging_stats消息上报给SDN控制器,其中,该ofp_charging_stats消息包括计费统计信息和该计费统计信息的类型,该计费统计信息的类型用于表征该计费统计信息为目标交换机上报的统计信息。Optionally, the charging statistical information in this embodiment of the present application may be reported to the SDN controller through an ofp_charging_stats message, where the ofp_charging_stats message includes the charging statistical information and the type of the charging statistical information, and the type of the charging statistical information Indicates that the accounting statistics are statistics reported by the target switch.

S615、SDN控制器向GW-C实体发送计费策略信息中与计费标识对应的信息,以使得GW-C实体接收来自SDN控制器的计费策略信息中与计费标识对应的信息。S615: The SDN controller sends the information corresponding to the charging identifier in the charging policy information to the GW-C entity, so that the GW-C entity receives the information corresponding to the charging identifier in the charging policy information from the SDN controller.

其中,SDN控制器在接收到来自目标交换机的计费统计信息之后,可以根据预先存储的计费标识和计费策略信息的对应关系,获得计费标识对应的计费策略信息,进而可以在确定计费策略信息中与计费标识对应的信息之后,通过Restful API向GW-C实体发送计费策略信息中与计费标识对应的信息。Wherein, after receiving the charging statistical information from the target switch, the SDN controller can obtain the charging policy information corresponding to the charging identifier according to the pre-stored correspondence between the charging identifier and the charging policy information, and then can determine the charging policy information corresponding to the charging identifier. After the information corresponding to the charging identifier in the charging policy information, the information corresponding to the charging identifier in the charging policy information is sent to the GW-C entity through the Restful API.

可选的,SDN控制器还可以向GW-C实体发送计费配额对象的统计值,本申请实施例对此不作具体限定。Optionally, the SDN controller may also send the statistical value of the charging quota object to the GW-C entity, which is not specifically limited in this embodiment of the present application.

S616、GW-C实体向OCS发送计费策略信息中与计费标识对应的信息,以使得OCS接收来自GW-C实体的计费策略信息中与计费标识对应的信息。S616: The GW-C entity sends the information corresponding to the charging identifier in the charging policy information to the OCS, so that the OCS receives the information corresponding to the charging identifier in the charging policy information from the GW-C entity.

可选的,GW-C实体还可以向OCS发送计费配额对象的统计值,本申请实施例对此不作具体限定。Optionally, the GW-C entity may also send the statistical value of the charging quota object to the OCS, which is not specifically limited in this embodiment of the present application.

S617、OCS向GW-C实体发送计费策略信息中与计费标识对应的信息和计费配额信息4,以使得GW-C实体接收来自OCS的计费策略信息中与计费标识对应的信息和计费配额信息4。S617: The OCS sends the information corresponding to the charging identifier and the charging quota information 4 in the charging policy information to the GW-C entity, so that the GW-C entity receives the information corresponding to the charging identifier in the charging policy information from the OCS and billing quota information 4.

可选的,本申请实施例中的计费配额信息4包括新增的计费配额。Optionally, the charging quota information 4 in the embodiment of the present application includes the newly added charging quota.

可选的,本申请实施例中的计费配额信息4还可以包括指示计费配额是否耗尽的信息,比如,当计费配额耗尽时,该计费配额信息4还可以包括计费配额耗尽标识,本申请实施例对此不作具体限定。Optionally, the charging quota information 4 in this embodiment of the present application may further include information indicating whether the charging quota is exhausted, for example, when the charging quota is exhausted, the charging quota information 4 may further include the charging quota The exhaustion flag is not specifically limited in this embodiment of the present application.

S618、GW-C实体向SDN控制器发送计费策略信息中与计费标识对应的信息和计费配额信息5,以使得SDN控制器接收来自GW-C实体的计费策略信息中与计费标识对应的信息和计费配额信息5。S618: The GW-C entity sends the charging policy information corresponding to the charging identifier and charging quota information 5 to the SDN controller, so that the SDN controller receives the charging policy information from the GW-C entity and the charging Identify the corresponding information and charging quota information 5 .

其中,本申请实施例中的计费配额信息5包括计费配额信息4中新增的计费配额。The charging quota information 5 in the embodiment of the present application includes the newly added charging quota in the charging quota information 4 .

可选的,若步骤S617中的计费配额信息4还包括指示计费配额是否耗尽的信息,则本申请实施例中的计费配额信息5中还包括与该指示计费配额是否耗尽的信息相对应的动作类型。比如,若计费配额信息4还可以包括计费配额耗尽标识,则相应的,该计费配额信息5还包括欠费对应的动作类型。该欠费对应的动作类型例如可以是丢包或者重新路由到欠费服务器等,本申请实施例对此不作具体限定。或者,比如,若计费配额信息4还包括指示计费配额未耗尽的信息,则计费配额信息5中还包括空动作类型,即不执行欠费对应的操作。Optionally, if the charging quota information 4 in step S617 further includes information indicating whether the charging quota is exhausted, the charging quota information 5 in this embodiment of the present application also includes information related to whether the charging quota is exhausted. The information corresponding to the action type. For example, if the charging quota information 4 may further include a charging quota exhaustion identifier, correspondingly, the charging quota information 5 also includes an action type corresponding to the arrears. The action type corresponding to the arrears may be, for example, packet loss or rerouting to the arrears server, which is not specifically limited in this embodiment of the present application. Or, for example, if the charging quota information 4 further includes information indicating that the charging quota is not exhausted, the charging quota information 5 also includes an empty action type, that is, the operation corresponding to the arrears is not performed.

当然,在计费配额未耗尽时,计费配额信息4中还可以不包含指示计费配额是否耗尽的信息,而是仅在计费配额耗尽时,计费配额信息4中包括指示计费配额耗尽的信息,计费配额信息5中包括欠费对应的动作类型,本申请实施例对此不作具体限定。Of course, when the charging quota is not exhausted, the charging quota information 4 may not include information indicating whether the charging quota is exhausted, but only when the charging quota is exhausted, the charging quota information 4 includes the indication For the information about the exhaustion of the charging quota, the charging quota information 5 includes the action type corresponding to the arrears, which is not specifically limited in this embodiment of the present application.

S619、SDN控制器根据计费策略信息中与计费标识对应的信息和计费配额信息6生成计费表更新消息。S619: The SDN controller generates a charging table update message according to the information corresponding to the charging identifier and the charging quota information 6 in the charging policy information.

其中,本申请实施例中的计费配额信息6包括第二计费配额阈值和第二动作类型。该第二计费配额阈值是根据计费配额信息5中新增的计费配额确定的,即:The charging quota information 6 in this embodiment of the present application includes a second charging quota threshold and a second action type. The second charging quota threshold is determined according to the newly added charging quota in the charging quota information 5, that is:

第二计费配额阈值=第一计费配额阈值+新增的配额阈值。The second charging quota threshold = the first charging quota threshold + the newly added quota threshold.

其中,本申请实施例中的第二计费配额和第二动作类型相对应,当该第二计费配额阈值不是根据最后一次有效新增计费配额确定时,该第二动作类型为空;当该第二计费配额阈值是根据最后一次有效新增计费配额确定时,该第二动作类型为欠费对应的动作类型。Wherein, the second charging quota in the embodiment of the present application corresponds to the second action type, and when the second charging quota threshold is not determined according to the last effective new charging quota, the second action type is empty; When the second charging quota threshold is determined according to the last effective new charging quota, the second action type is the action type corresponding to the arrears.

其中,本申请实施例中,SDN控制器可以根据计费策略信息和计费标识的对应关系确定计费策略信息对应的计费标识,进而可以根据计费标识和计费配额信息6生成计费表更新消息。In the embodiment of the present application, the SDN controller may determine the charging identifier corresponding to the charging policy information according to the corresponding relationship between the charging policy information and the charging identifier, and then may generate the charging identifier according to the charging identifier and the charging quota information 6 Table update message.

S620、SDN控制器向目标交换机发送计费表更新消息,以使得目标交换机接收来自SDN控制器的计费表更新消息,该计费表更新消息包括计费标识、第二计费配额阈值和第二动作类型。S620. The SDN controller sends a charging table update message to the target switch, so that the target switch receives the charging table update message from the SDN controller, where the charging table update message includes the charging identifier, the second charging quota threshold and the first charging table update message. Two action types.

其中,SDN控制器可以根据存储的计费标识和目标交换机的标识的对应关系,确定计费标识对应的目标交换机,进而可以将计费表更新信息发送给目标交换机。The SDN controller can determine the target switch corresponding to the charging identifier according to the stored correspondence between the charging identifier and the identifier of the target switch, and then can send the charging table update information to the target switch.

S621、目标交换机根据计费标识查找到计费表之后,将计费表中的第一计费配额阈值更新为第二计费配额阈值;以及,将计费表中的第一动作类型更新为第二动作类型;S621. After the target switch finds the charging table according to the charging identifier, updates the first charging quota threshold in the charging table to the second charging quota threshold; and updates the first action type in the charging table to second action type;

S622、目标交换机根据计费表中的第二计费配额阈值、第二动作类型和计费配额对象的统计值进行计费控制。S622: The target switch performs charging control according to the second charging quota threshold, the second action type, and the statistical value of the charging quota object in the charging table.

具体的,目标交换机根据计费表中的第二计费配额阈值、第二动作类型和计费配额对象的统计值进行计费控制的具体实现可参考步骤S614-S622,在此不再赘述。Specifically, the specific implementation of charging control performed by the target switch according to the second charging quota threshold, the second action type and the statistical value of the charging quota object in the charging table may refer to steps S614-S622, which will not be repeated here.

S623、当第一计费配额阈值等于终端签约的有效计费配额时,若计费配额对象的统计值不小于第一计费配额阈值,目标交换机根据欠费对应的动作类型管理接收到的数据包。S623. When the first charging quota threshold is equal to the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is not less than the first charging quota threshold, the target switch manages the received data according to the action type corresponding to the arrears Bag.

比如,若该欠费对应的动作类型为丢包,则目标交换机可以将接收到的数据包丢包;For example, if the action type corresponding to the arrears is packet loss, the target switch can discard the received data packets;

或者,若该欠费对应的动作类型为重新路由到欠费服务器,则目标交换机可以将接收到的数据包重新路由到欠费服务器。Or, if the action type corresponding to the arrears is rerouting to the arrears server, the target switch can reroute the received data packets to the arrears server.

基于本申请实施例提供的计费控制方法,一方面,由于该计费控制方法中,SDN控制器可以根据计费信息生成计费表创建信息,目标交换机可以根据SDN控制器发送的计费表创建信息生成计费表,并根据计费表进行计费统计,因此可以满足各种业务场景的电信计费需求;另一方面,本申请实施例在计费表中直接指示了相应的动作,比如当计费表中的第一计费配额阈值是根据最后一次有效新增计费配额确定时,计费表中的第一动作类型为欠费对应的动作类型,因此可以避免目前OpenFlow仅支持基于阈值的消息上报机制所带来的处理滞后性。综上,本申请实施例提供的计费控制方法可以实现电信级的计费需求。Based on the charging control method provided by the embodiment of the present application, on the one hand, in the charging control method, the SDN controller can generate charging table creation information according to the charging information, and the target switch can generate charging table creation information according to the charging table sent by the SDN controller. Create information to generate a billing table, and perform billing statistics according to the billing table, so it can meet the telecom billing requirements of various business scenarios; on the other hand, the embodiment of the present application directly indicates corresponding actions in the billing table, For example, when the first charging quota threshold in the charging table is determined according to the last effective new charging quota, the first action type in the charging table is the action type corresponding to the arrears, so it can be avoided that the current OpenFlow only supports The processing lag caused by the threshold-based message reporting mechanism. To sum up, the charging control method provided by the embodiment of the present application can meet the charging requirements of the carrier level.

其中,上述步骤S601-S623中SDN控制器的动作可以由图4所示的通信设备400中的处理器401调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。The actions of the SDN controller in the above steps S601-S623 may be performed by the processor 401 in the communication device 400 shown in FIG. 4 calling the application code stored in the memory 403, which is not limited in this embodiment of the present application.

其中,上述步骤S601-S623中目标交换机的动作可以由图4所示的通信设备400中的处理器401调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。The actions of the target switch in the above steps S601-S623 may be executed by the processor 401 in the communication device 400 shown in FIG. 4 calling the application code stored in the memory 403, which is not limited in this embodiment of the present application.

图6所示的实施例以计费控制系统10应用于图2所示的4G网络为例对图5所示的计费控制方法进行展开说明,当然,如上所述,计费控制系统10也可以应用于图3所示的5G网络,对应的计费控制方法可参考图6所示的实施例,仅需将图6所示的实施例中的GW-C实体替换为5G网络中的SMF实体,PCRF实体替换为5G网络中的PCF实体即可,在此不再赘述。In the embodiment shown in FIG. 6 , the charging control method shown in FIG. 5 is described by taking the charging control system 10 applied to the 4G network shown in FIG. 2 as an example. Of course, as mentioned above, the charging control system 10 also It can be applied to the 5G network shown in FIG. 3, and the corresponding charging control method can refer to the embodiment shown in FIG. 6, only the GW-C entity in the embodiment shown in FIG. 6 needs to be replaced with the SMF in the 5G network Entity, the PCRF entity can be replaced with the PCF entity in the 5G network, and details are not repeated here.

上述主要从各个网元之间交互的角度对本申请实施例提供的方案进行了介绍。可以理解的是,上述目标交换机和SDN控制器为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions provided by the embodiments of the present application from the perspective of interaction between various network elements. It can be understood that, in order to realize the above-mentioned functions, the above-mentioned target switch and SDN controller include corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that the present application can be implemented in hardware or a combination of hardware and computer software with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

本申请实施例可以根据上述方法示例对会话管理功能实体和控制设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, the session management functional entity and the control device may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. middle. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.

比如,在采用对应各个功能划分各个功能模块的情况下,图8示出了上述实施例中所涉及的交换机80的一种可能的结构示意图。该交换机80包括:接收模块801、匹配模块802、查找模块803、统计模块804和控制模块805。接收模块801,用于接收来自终端的第一数据包。匹配模块802,用于将第一数据包对应的承载标识与流表项中的承载标识进行匹配。查找模块803,用于若匹配模块802匹配成功,根据流表项中的计费标识查找计费表,该计费表包括计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值,其中,当第一计费配额阈值不是根据最后一次有效新增计费配额确定时,第一动作类型为空;当第一计费配额阈值是根据最后一次有效新增计费配额确定时,第一动作类型为欠费对应的动作类型。统计模块804,用于对计费表中的计费配额对象进行计费统计,并将计费配额对象的计费统计结果写入计费表的计费配额对象的统计值中。控制模块805,用于根据计费表中的第一计费配额阈值、第一动作类型和计费配额对象的统计值进行计费控制。For example, in the case where each functional module is divided corresponding to each function, FIG. 8 shows a possible schematic structural diagram of the switch 80 involved in the above embodiment. The switch 80 includes: a receiving module 801 , a matching module 802 , a search module 803 , a statistics module 804 and a control module 805 . The receiving module 801 is configured to receive the first data packet from the terminal. The matching module 802 is configured to match the bearer identification corresponding to the first data packet with the bearer identification in the flow entry. The search module 803 is configured to search for a charging table according to the charging identifier in the flow table entry if the matching module 802 is successfully matched, where the charging table includes the charging identifier, the first charging quota threshold, the first action type and the charging Statistical value of quota objects, wherein, when the first charging quota threshold is not determined according to the last valid addition of the charging quota, the first action type is empty; when the first charging quota threshold is determined according to the last valid addition of the charging quota When the fee quota is determined, the first action type is the action type corresponding to the arrears. The statistics module 804 is configured to perform charging statistics on the charging quota objects in the charging table, and write the charging statistics results of the charging quota objects into the statistical values of the charging quota objects in the charging table. The control module 805 is configured to perform charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table.

可选的,如图8所示,本申请实施例提供的交换机80还包括:生成模块806。接收模块801,还用于接收来自SDN控制器的流表项创建消息,该流表项创建消息用于生成流表项。生成模块806,用于根据流表项创建消息生成流表项。Optionally, as shown in FIG. 8 , the switch 80 provided in this embodiment of the present application further includes: a generating module 806 . The receiving module 801 is further configured to receive a flow entry creation message from the SDN controller, where the flow entry creation message is used to generate a flow entry. The generating module 806 is configured to generate a flow entry according to the flow entry creation message.

可选的,接收模块801,用于接收来自SDN控制器的计费表创建消息,该计费表创建消息用于生成计费表。生成模块806,用于根据计费表创建消息生成计费表。Optionally, the receiving module 801 is configured to receive a charging table creation message from the SDN controller, where the charging table creation message is used to generate a charging table. The generating module 806 is configured to generate a charging table according to the charging table creation message.

可选的,控制模块805具体用于:当第一计费配额阈值小于终端签约的有效计费配额时,若计费配额对象的统计值首次大于第一计费配额阈值,向SDN控制器发送计费统计信息,计费统计信息包括计费标识和计费配额对象的统计值;接收来自SDN控制器的计费表更新消息,计费表更新消息包括计费标识、第二计费配额阈值和第二动作类型,其中,当第二计费配额阈值不是根据最后一次有效新增计费配额确定时,第二动作类型为空;当第二计费配额阈值是根据最后一次有效新增计费配额确定时,第二动作类型为欠费对应的动作类型;根据计费标识查找到计费表之后,将计费表中的第一计费配额阈值更新为第二计费配额阈值;以及,将计费表中的第一动作类型更新为第二动作类型;根据计费表中的第二计费配额阈值、第二动作类型和计费配额对象的统计值进行计费控制。Optionally, the control module 805 is specifically configured to: when the first charging quota threshold is less than the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is greater than the first charging quota threshold for the first time, send the data to the SDN controller. Charging statistical information, the charging statistical information includes the charging identifier and the statistical value of the charging quota object; the charging table update message from the SDN controller is received, and the charging table update message includes the charging identifier and the second charging quota threshold and the second action type, wherein, when the second charging quota threshold is not determined according to the last valid addition of the charging quota, the second action type is empty; when the second charging quota threshold is determined according to the last valid addition of the charging quota When the charging quota is determined, the second action type is the action type corresponding to the arrears; after finding the charging table according to the charging identifier, update the first charging quota threshold in the charging table to the second charging quota threshold; and , the first action type in the charging table is updated to the second action type; charging control is performed according to the second charging quota threshold, the second action type and the statistical value of the charging quota object in the charging table.

可选的,控制模块805具体用于:当第一计费配额阈值等于终端签约的有效计费配额时,若计费配额对象的统计值不小于第一计费配额阈值,根据欠费对应的动作类型管理接收到的数据包。Optionally, the control module 805 is specifically configured to: when the first charging quota threshold is equal to the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is not less than the first charging quota threshold, according to the corresponding amount of arrears. Action types manage received packets.

可选的,计费配额对象包括业务时长。统计模块804具体用于:确定空闲时间是否大于预设值,空闲时间为接收模块801接收到第一数据包的时间与接收模块801接收到第二数据包的时间的间隔,第二数据包为第一数据包的上一个数据包;若空闲时间大于预设值,将计费表中的计费配额对象的统计值确定为业务时长的计费统计结果;若空闲时间不大于预设值,将空闲时间和计费表中的计费配额对象的统计值的和确定为业务时长的计费统计结果。Optionally, the charging quota object includes the service duration. The statistics module 804 is specifically used to: determine whether the idle time is greater than the preset value, the idle time is the interval between the time when the receiving module 801 receives the first data packet and the time when the receiving module 801 receives the second data packet, and the second data packet is The previous data packet of the first data packet; if the idle time is greater than the preset value, the statistical value of the charging quota object in the charging table is determined as the charging statistical result of the service duration; if the idle time is not greater than the preset value, The sum of the idle time and the statistical value of the charging quota object in the charging table is determined as the charging statistical result of the service duration.

以采用集成的方式划分各个功能模块的情况下,图9示出了上述实施例中所涉及的交换机90的一种可能的结构示意图,该交换机90包括:处理模块902和通信模块901。其中,该通信模块901可用于执行图8中接收模块801所能执行的操作;该处理模块902可用于执行图8中匹配模块802、查找模块803、统计模块804、控制模块805和生成模块806所能执行的操作,具体可参考图8所示的实施例,本申请实施例在此不再赘述。In the case where each functional module is divided in an integrated manner, FIG. 9 shows a possible schematic structural diagram of the switch 90 involved in the above embodiment. The switch 90 includes a processing module 902 and a communication module 901 . Wherein, the communication module 901 can be used to perform the operations that can be performed by the receiving module 801 in FIG. 8; the processing module 902 can be used to perform the matching module 802, the search module 803, the statistics module 804, the control module 805 and the generation module 806 in FIG. 8 For specific operations that can be performed, reference may be made to the embodiment shown in FIG. 8 , and details are not described herein again in this embodiment of the present application.

其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant contents of the steps involved in the above method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.

在本实施例中,该交换机以对应各个功能划分各个功能模块的形式来呈现,或者,该交换机以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定应用集成电路(Application-Specific Integrated Circuit,ASIC),电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到交换机80或者交换机90可以采用图4所示的形式。比如,图8中的接收模块801、匹配模块802、查找模块803、统计模块804、控制模块805和生成模块806可以通过图4的处理器401和存储器403来实现。具体的,接收模块801、匹配模块802、查找模块803、统计模块804、控制模块805和生成模块806可以通过由处理器401来调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。或者,比如,图9中的处理模块902和通信模块901可以通过图4的处理器401和存储器403来实现。具体的,处理模块902和通信模块901可以通过由处理器401来调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。In this embodiment, the switch is presented in a form of dividing each functional module corresponding to each function, or the switch is presented in a form of dividing each functional module in an integrated manner. "Module" herein may refer to an Application-Specific Integrated Circuit (ASIC), a circuit, a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or others that may provide the above-described functions device. In a simple embodiment, those skilled in the art can imagine that the switch 80 or the switch 90 may take the form shown in FIG. 4 . For example, the receiving module 801 , the matching module 802 , the searching module 803 , the statistics module 804 , the control module 805 and the generating module 806 in FIG. 8 may be implemented by the processor 401 and the memory 403 in FIG. 4 . Specifically, the receiving module 801 , the matching module 802 , the searching module 803 , the statistics module 804 , the control module 805 and the generating module 806 can be executed by the processor 401 calling the application code stored in the memory 403 . This does not impose any restrictions. Or, for example, the processing module 902 and the communication module 901 in FIG. 9 may be implemented by the processor 401 and the memory 403 in FIG. 4 . Specifically, the processing module 902 and the communication module 901 may be executed by calling the application program code stored in the memory 403 by the processor 401, which is not limited in this embodiment of the present application.

由于本申请实施例提供的交换机可用于执行上述计费控制方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the switch provided in the embodiment of the present application can be used to execute the above charging control method, the technical effect that can be obtained may refer to the above method embodiment, which is not repeated here.

或者,比如,在采用对应各个功能划分各个功能模块的情况下,图10示出了上述实施例中所涉及的SDN控制器100的一种可能的结构示意图。该SDN控制器100包括:接收模块1001、确定模块1002、生成模块1003、发送模块1004和存储模块1005。接收模块1001,用于接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识,其中,第一计费配额信息包括第一计费配额和第一动作类型,当第一计费配额不是最后一次有效新增计费配额时,第一动作类型为空;当第一计费配额是最后一次有效新增计费配额时,第一动作类型为欠费对应的动作类型。确定模块1002,用于确定未存储计费策略信息对应的计费标识。生成模块1003,用于据计费策略信息和第一计费配额信息生成计费表创建消息。发送模块1004,用于向目标交换机发送计费表创建消息,计费表创建消息用于生成计费表,计费表用于计费控制,计费表包括计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值。生成模块1003,用于根据承载标识和计费标识生成流表项创建消息。发送模块1004,用于向目标交换机发送流表项创建消息,流表项创建消息用于生成流表项,流表项用于查找计费表,其中,流表项包括承载标识和计费标识。存储模块1005,用于存储计费策略信息和计费标识的对应关系。Or, for example, in the case where each functional module is divided according to each function, FIG. 10 shows a possible schematic structural diagram of the SDN controller 100 involved in the foregoing embodiment. The SDN controller 100 includes: a receiving module 1001 , a determining module 1002 , a generating module 1003 , a sending module 1004 and a storage module 1005 . A receiving module 1001, configured to receive charging policy information, first charging quota information and bearer identification from a control plane entity, wherein the first charging quota information includes a first charging quota and a first action type, when the first charging quota information When the charging quota is not the last effective new charging quota, the first action type is empty; when the first charging quota is the last effective charging quota added, the first action type is the action type corresponding to the arrears. The determining module 1002 is configured to determine the charging identifier corresponding to the unstored charging policy information. The generating module 1003 is configured to generate a charging table creation message according to the charging policy information and the first charging quota information. The sending module 1004 is configured to send a charging table creation message to the target switch, where the charging table creation message is used to generate a charging table, the charging table is used for charging control, and the charging table includes a charging identifier and a first charging quota Threshold, first action type, and statistics of billing quota objects. The generating module 1003 is configured to generate a flow entry creation message according to the bearer identifier and the charging identifier. The sending module 1004 is configured to send a flow entry creation message to the target switch, the flow entry creation message is used to generate a flow entry, and the flow entry is used to look up a charging table, wherein the flow entry includes a bearer identifier and a charging identifier . The storage module 1005 is used for storing the corresponding relationship between the charging policy information and the charging identifier.

可选的,确定模块1002,还在接收模块1001接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识之后,确定存储计费策略信息对应的计费标识。生成模块1003,还用于根据承载标识和计费标识生成流表项创建消息。发送模块1004,还用于向目标交换机发送流表项创建消息,流表项创建消息用于生成流表项,流表项用于查找计费表,其中,流表项包括承载标识和计费标识。Optionally, the determining module 1002 further determines the charging identifier corresponding to the storage charging policy information after the receiving module 1001 receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity. The generating module 1003 is further configured to generate a flow entry creation message according to the bearer identifier and the charging identifier. The sending module 1004 is further configured to send a flow entry creation message to the target switch, the flow entry creation message is used to generate a flow entry, and the flow entry is used to look up the charging table, wherein the flow entry includes the bearer identifier and the charging logo.

可选的,接收模块1001,还用于接收来自目标交换机的计费统计信息,计费统计信息包括计费标识和计费配额对象的统计值。确定模块1002,还用于确定与计费标识对应的计费策略信息。发送模块1004,还用于向控制面实体发送计费策略信息。接收模块1001,还用于接收来自控制面实体的计费策略信息和第二计费配额信息,其中,第二计费配额信息包括第二计费配额和第二动作类型,当第二计费配额不是最后一次有效新增计费配额时,第二动作类型为空;当第二计费配额是最后一次有效新增计费配额时,第二动作类型为欠费对应的动作类型。确定模块1002,还用于根据第一计费配额阈值和第二计费配额确定第二计费配额阈值。确定模块1002,还用于确定与计费策略信息对应的计费标识。发送模块1004,还用于向目标交换机发送计费表更新消息,计费表更新消息包括计费标识、第二计费配额阈值和第二动作类型。Optionally, the receiving module 1001 is further configured to receive charging statistical information from the target switch, where the charging statistical information includes a charging identifier and a statistical value of a charging quota object. The determining module 1002 is further configured to determine charging policy information corresponding to the charging identifier. The sending module 1004 is further configured to send charging policy information to the control plane entity. The receiving module 1001 is further configured to receive the charging policy information and the second charging quota information from the control plane entity, wherein the second charging quota information includes the second charging quota and the second action type. When the quota is not the last effective new charging quota, the second action type is empty; when the second charging quota is the last effective new charging quota, the second action type is the action type corresponding to the arrears. The determining module 1002 is further configured to determine the second charging quota threshold according to the first charging quota threshold and the second charging quota. The determining module 1002 is further configured to determine a charging identifier corresponding to the charging policy information. The sending module 1004 is further configured to send a charging table update message to the target switch, where the charging table update message includes a charging identifier, a second charging quota threshold and a second action type.

以采用集成的方式划分各个功能模块的情况下,图11示出了上述实施例中所涉及的SDN控制器110的一种可能的结构示意图,该会话管理功能实体110包括:通信模块1101、处理模块1102和存储模块1103。其中,该通信模块1101可用于执行图10中接收模块1001和发送模块1004所能执行的操作,该处理模块1102可用于执行图10中确定模块1002和生成模块1003所能执行的操作,该存储模块1103可用于执行图10中存储模块1005所能执行的操作具体可参考图10所示的实施例,本申请实施例在此不再赘述。In the case where each functional module is divided in an integrated manner, FIG. 11 shows a possible schematic structural diagram of the SDN controller 110 involved in the above embodiment. The session management functional entity 110 includes: a communication module 1101, a processing module 1102 and storage module 1103. Wherein, the communication module 1101 can be used to perform the operations that can be performed by the receiving module 1001 and the sending module 1004 in FIG. 10 , the processing module 1102 can be used to perform the operations that can be performed by the determining module 1002 and the generating module 1003 in FIG. 10 , the storage The module 1103 may be configured to perform operations that the storage module 1005 in FIG. 10 can perform. For details, reference may be made to the embodiment shown in FIG. 10 , and details are not described herein again in this embodiment of the present application.

其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant contents of the steps involved in the above method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.

在本实施例中,该SDN控制器以对应各个功能划分各个功能模块的形式来呈现,或者,该SDN控制器以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定应用集成电路(Application-Specific Integrated Circuit,ASIC),电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到SDN控制器100或者SDN控制器110可以采用图4所示的形式。比如,图10中的接收模块1001、确定模块1002、生成模块1003、发送模块1004和存储模块1005可以通过图4的处理器401和存储器403来实现。具体的接收模块1001、确定模块1002、生成模块1003、发送模块1004和存储模块1005可以通过由处理器401来调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。或者,比如,图11中的通信模块1101、处理模块1102和存储模块1103可以通过图4的处理器401和存储器403来实现。具体的,通信模块1101、处理模块1102和存储模块1103可以通过由处理器401来调用存储器403中存储的应用程序代码来执行,本申请实施例对此不作任何限制。In this embodiment, the SDN controller is presented in the form of dividing each functional module corresponding to each function, or the SDN controller is presented in the form of dividing each functional module in an integrated manner. "Module" herein may refer to an Application-Specific Integrated Circuit (ASIC), a circuit, a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or others that may provide the above-described functions device. In a simple embodiment, those skilled in the art can imagine that the SDN controller 100 or the SDN controller 110 may take the form shown in FIG. 4 . For example, the receiving module 1001 , the determining module 1002 , the generating module 1003 , the sending module 1004 and the storage module 1005 in FIG. 10 may be implemented by the processor 401 and the memory 403 in FIG. 4 . The specific receiving module 1001 , determining module 1002 , generating module 1003 , sending module 1004 and storage module 1005 may be executed by the processor 401 calling the application code stored in the memory 403 , which is not limited in this embodiment of the present application. Or, for example, the communication module 1101 , the processing module 1102 and the storage module 1103 in FIG. 11 may be implemented by the processor 401 and the memory 403 in FIG. 4 . Specifically, the communication module 1101 , the processing module 1102 and the storage module 1103 may be executed by the processor 401 calling the application code stored in the memory 403 , which is not limited in this embodiment of the present application.

由于本申请实施例提供的SDN控制器可用于执行上述计费控制方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the SDN controller provided by the embodiment of the present application can be used to execute the above charging control method, the technical effect obtained by the SDN controller may refer to the above method embodiment, which will not be repeated here.

可选的,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持交换机实现上述方面中所涉及的功能,例如根据流表项中的计费标识查找计费表。在一种可能的设计中,该芯片系统还包括存储器。该存储器,用于保存交换机必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。Optionally, an embodiment of the present application provides a chip system, where the chip system includes a processor, and is configured to support a switch to implement the functions involved in the above aspects, such as searching for a charging table according to a charging identifier in a flow table entry. In one possible design, the system-on-a-chip also includes memory. This memory is used to save the necessary program instructions and data of the switch. The chip system may be composed of chips, or may include chips and other discrete devices, which are not specifically limited in this embodiment of the present application.

可选的,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持SDN控制器实现上述方面中所涉及的功能,例如根据计费策略信息和第一计费配额信息生成计费表创建消息,并向目标交换机发送计费表创建消息。在一种可能的设计中,该芯片系统还包括存储器。该存储器,用于保存SDN控制器必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。Optionally, an embodiment of the present application provides a chip system, where the chip system includes a processor to support the SDN controller to implement the functions involved in the above aspects, for example, according to the charging policy information and the first charging quota information. Generate an accounting table creation message, and send the accounting table creation message to the target switch. In one possible design, the system-on-a-chip also includes memory. The memory is used to save the necessary program instructions and data of the SDN controller. The chip system may be composed of chips, or may include chips and other discrete devices, which are not specifically limited in this embodiment of the present application.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center The transmission is carried out to another website site, computer, server or data center by wire (eg coaxial cable, optical fiber, Digital Subscriber Line, DSL) or wireless (eg infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or data storage devices including one or more servers, data centers, etc. that can be integrated with the medium. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.

尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the application is described herein in conjunction with the various embodiments, those skilled in the art will understand and understand from a review of the drawings, the disclosure, and the appended claims in practicing the claimed application. Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that these measures cannot be combined to advantage.

尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made therein without departing from the spirit and scope of the application. Accordingly, this specification and drawings are merely exemplary illustrations of the application as defined by the appended claims, and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of this application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (21)

1.一种计费控制方法,其特征在于,所述方法包括:1. A charging control method, wherein the method comprises: 在交换机接收来自终端的第一数据包之后,所述交换机将所述第一数据包对应的承载标识与流表项中的承载标识进行匹配;After the switch receives the first data packet from the terminal, the switch matches the bearer identification corresponding to the first data packet with the bearer identification in the flow table entry; 若匹配成功,所述交换机根据所述流表项中的计费标识查找计费表,所述计费表包括所述计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值,其中,当所述第一计费配额阈值不是根据最后一次有效新增计费配额确定时,所述第一动作类型为空;当所述第一计费配额阈值是根据最后一次有效新增计费配额确定时,所述第一动作类型为欠费对应的动作类型;If the match is successful, the switch looks up a charging table according to the charging identifier in the flow entry, and the charging table includes the charging identifier, the first charging quota threshold, the first action type and the charging quota The statistical value of the object, wherein, when the first charging quota threshold is not determined according to the last effective new charging quota, the first action type is empty; when the first charging quota threshold is determined according to the last effective charging quota When an effective new charging quota is determined, the first action type is the action type corresponding to the arrears; 所述交换机对所述计费表中的所述计费配额对象进行计费统计,并将所述计费配额对象的计费统计结果写入所述计费表的计费配额对象的统计值中;The switch performs charging statistics on the charging quota object in the charging table, and writes the charging statistics result of the charging quota object into the statistical value of the charging quota object in the charging table middle; 所述交换机根据所述计费表中的所述第一计费配额阈值、所述第一动作类型和所述计费配额对象的统计值进行计费控制。The switch performs charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 所述交换机接收来自软件自定义网络SDN控制器的流表项创建消息,所述流表项创建消息用于生成所述流表项;The switch receives a flow entry creation message from the software-defined network SDN controller, where the flow entry creation message is used to generate the flow entry; 所述交换机根据所述流表项创建消息生成所述流表项。The switch generates the flow entry according to the flow entry creation message. 3.根据权利要求1所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1, wherein the method further comprises: 所述交换机接收来自SDN控制器的计费表创建消息,所述计费表创建消息用于生成所述计费表;The switch receives a charging table creation message from the SDN controller, where the charging table creation message is used to generate the charging table; 所述交换机根据所述计费表创建消息生成所述计费表。The switch generates the charging table according to the charging table creation message. 4.根据权利要求1-3任一项所述的方法,其特征在于,所述交换机根据所述计费表中的所述第一计费配额阈值、所述第一动作类型和所述计费配额对象的统计值进行计费控制,包括:4. The method according to any one of claims 1-3, characterized in that, the switch uses the first charging quota threshold in the charging table, the first action type, and the accounting The statistical value of the fee quota object is used for charging control, including: 当所述第一计费配额阈值小于所述终端签约的有效计费配额时,若所述计费配额对象的统计值首次大于所述第一计费配额阈值,所述交换机向SDN控制器发送计费统计信息,所述计费统计信息包括所述计费标识和所述计费配额对象的统计值;When the first charging quota threshold is less than the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is greater than the first charging quota threshold for the first time, the switch sends a message to the SDN controller. Charging statistical information, the charging statistical information includes the charging identifier and the statistical value of the charging quota object; 所述交换机接收来自所述SDN控制器的计费表更新消息,所述计费表更新消息包括所述计费标识、第二计费配额阈值和第二动作类型,其中,当所述第二计费配额阈值不是根据最后一次有效新增计费配额确定时,所述第二动作类型为空;当所述第二计费配额阈值是根据最后一次有效新增计费配额确定时,所述第二动作类型为欠费对应的动作类型;The switch receives a charging table update message from the SDN controller, where the charging table update message includes the charging identifier, the second charging quota threshold and the second action type, wherein when the second charging table update message is When the charging quota threshold is not determined according to the last effective newly added charging quota, the second action type is empty; when the second charging quota threshold is determined according to the last effective newly added charging quota, the second action type is empty; The second action type is the action type corresponding to the arrears; 所述交换机根据所述计费标识查找到所述计费表之后,所述交换机将所述计费表中的所述第一计费配额阈值更新为所述第二计费配额阈值;以及,所述交换机将所述计费表中的所述第一动作类型更新为所述第二动作类型;After the switch finds the charging table according to the charging identifier, the switch updates the first charging quota threshold in the charging table to the second charging quota threshold; and, The switch updates the first action type in the charging table to the second action type; 所述交换机根据所述计费表中的所述第二计费配额阈值、所述第二动作类型和所述计费配额对象的统计值进行计费控制。The switch performs charging control according to the second charging quota threshold, the second action type and the statistical value of the charging quota object in the charging table. 5.根据权利要求1-3任一项所述的方法,其特征在于,所述交换机根据所述计费表中的第一计费配额阈值、第一动作类型和所述计费配额对象的统计值进行计费控制,包括:5. The method according to any one of claims 1-3, characterized in that, the switch performs the method according to the first charging quota threshold, the first action type, and the charging quota object in the charging table. Statistical values for billing control, including: 当所述第一计费配额阈值等于所述终端签约的有效计费配额时,若所述计费配额对象的统计值不小于所述第一计费配额阈值,所述交换机根据所述欠费对应的动作类型管理接收到的数据包。When the first charging quota threshold is equal to the effective charging quota subscribed by the terminal, and if the statistical value of the charging quota object is not less than the first charging quota threshold The corresponding action type manages the received packets. 6.根据权利要求1-3任一项所述的方法,其特征在于,所述计费配额对象包括业务时长;6. The method according to any one of claims 1-3, wherein the charging quota object comprises a service duration; 所述交换机根据所述计费配额对象进行计费统计,包括:The switch performs charging statistics according to the charging quota object, including: 所述交换机确定空闲时间是否大于预设值,所述空闲时间为所述交换机接收到所述第一数据包的时间与所述交换机接收到第二数据包的时间的间隔,所述第二数据包为所述第一数据包的上一个数据包;The switch determines whether the idle time is greater than a preset value, and the idle time is the interval between the time when the switch receives the first data packet and the time when the switch receives the second data packet. The packet is the previous data packet of the first data packet; 若所述空闲时间大于所述预设值,所述交换机将所述计费表中的计费配额对象的统计值确定为所述业务时长的计费统计结果;If the idle time is greater than the preset value, the switch determines the statistical value of the charging quota object in the charging table as the charging statistical result of the service duration; 若所述空闲时间不大于所述预设值,所述交换机将所述空闲时间和所述计费表中的计费配额对象的统计值的和确定为所述业务时长的计费统计结果。If the idle time is not greater than the preset value, the switch determines the sum of the idle time and the statistical value of the charging quota object in the charging table as the charging statistical result of the service duration. 7.一种计费控制方法,其特征在于,所述方法包括:7. A charging control method, characterized in that the method comprises: 软件自定义网络SDN控制器接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识,其中,所述第一计费配额信息包括第一计费配额和第一动作类型,当所述第一计费配额不是最后一次有效新增计费配额时,所述第一动作类型为空;当所述第一计费配额是最后一次有效新增计费配额时,所述第一动作类型为欠费对应的动作类型;The software-defined network SDN controller receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity, wherein the first charging quota information includes the first charging quota and the first action type, When the first charging quota is not the last effective new charging quota, the first action type is empty; when the first charging quota is the last effective charging quota added, the first action type is empty; An action type is the action type corresponding to the arrears; 若所述SDN控制器确定未存储所述计费策略信息对应的计费标识,所述SDN控制器根据所述计费策略信息和所述第一计费配额信息生成计费表创建消息,并向目标交换机发送所述计费表创建消息,所述计费表创建消息用于生成计费表,所述计费表用于计费控制,所述计费表包括所述计费标识、第一计费配额阈值、所述第一动作类型和计费配额对象的统计值;If the SDN controller determines that the charging identifier corresponding to the charging policy information is not stored, the SDN controller generates a charging table creation message according to the charging policy information and the first charging quota information, and Send the charging table creation message to the target switch, where the charging table creation message is used to generate a charging table, the charging table is used for charging control, and the charging table includes the charging identifier, the first a charging quota threshold, the first action type and the statistical value of the charging quota object; 所述SDN控制器根据所述承载标识和所述计费标识生成流表项创建消息,并向所述目标交换机发送所述流表项创建消息,所述流表项创建消息用于生成流表项,所述流表项用于查找所述计费表,其中,所述流表项包括所述承载标识和所述计费标识;The SDN controller generates a flow entry creation message according to the bearer identifier and the charging identifier, and sends the flow entry creation message to the target switch, where the flow entry creation message is used to generate a flow table item, the flow entry is used to look up the charging table, wherein the flow entry includes the bearer identifier and the charging identifier; 所述SDN控制器存储所述计费策略信息和所述计费标识的对应关系。The SDN controller stores the corresponding relationship between the charging policy information and the charging identifier. 8.根据权利要求7所述的方法,其特征在于,在所述SDN控制器接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识之后,还包括:8. The method according to claim 7, wherein after the SDN controller receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity, the method further comprises: 若所述SDN控制器确定存储所述计费策略信息对应的计费标识,所述SDN控制器根据所述承载标识和所述计费标识生成流表项创建消息,并向所述目标交换机发送所述流表项创建消息,所述流表项创建消息用于生成流表项,所述流表项用于查找所述计费表,其中,所述流表项包括所述承载标识和所述计费标识。If the SDN controller determines to store the charging identifier corresponding to the charging policy information, the SDN controller generates a flow entry creation message according to the bearer identifier and the charging identifier, and sends a message to the target switch. The flow entry creation message is used to generate a flow entry, and the flow entry is used to look up the charging table, wherein the flow entry includes the bearer identifier and all the billing identifier. 9.根据权利要求7或8所述的方法,其特征在于,所述方法还包括:9. The method according to claim 7 or 8, wherein the method further comprises: 所述SDN控制器接收来自所述目标交换机的计费统计信息,所述计费统计信息包括所述计费标识和所述计费配额对象的统计值;receiving, by the SDN controller, charging statistical information from the target switch, where the charging statistical information includes the charging identifier and the statistical value of the charging quota object; 所述SDN控制器确定与所述计费标识对应的所述计费策略信息,并向所述控制面实体发送所述计费策略信息;The SDN controller determines the charging policy information corresponding to the charging identifier, and sends the charging policy information to the control plane entity; 所述SDN控制器接收来自所述控制面实体的所述计费策略信息和第二计费配额信息,其中,所述第二计费配额信息包括第二计费配额和第二动作类型,当所述第二计费配额不是最后一次有效新增计费配额时,所述第二动作类型为空;当所述第二计费配额是最后一次有效新增计费配额时,所述第二动作类型为欠费对应的动作类型;The SDN controller receives the charging policy information and the second charging quota information from the control plane entity, wherein the second charging quota information includes the second charging quota and the second action type, when When the second charging quota is not the last effective new charging quota, the second action type is empty; when the second charging quota is the last effective new charging quota, the second action type is empty. The action type is the action type corresponding to the arrears; 所述SDN控制器根据所述第一计费配额阈值和所述第二计费配额确定第二计费配额阈值;The SDN controller determines a second charging quota threshold according to the first charging quota threshold and the second charging quota; 所述SDN控制器确定与所述计费策略信息对应的所述计费标识;determining, by the SDN controller, the charging identifier corresponding to the charging policy information; 所述SDN控制器向所述目标交换机发送计费表更新消息,所述计费表更新消息包括所述计费标识、所述第二计费配额阈值和所述第二动作类型。The SDN controller sends a charging table update message to the target switch, where the charging table update message includes the charging identifier, the second charging quota threshold and the second action type. 10.一种交换机,其特征在于,所述交换机包括:接收模块、匹配模块、查找模块、统计模块和控制模块;10. A switch, characterized in that the switch comprises: a receiving module, a matching module, a search module, a statistics module and a control module; 所述接收模块,用于接收来自终端的第一数据包;the receiving module, configured to receive the first data packet from the terminal; 所述匹配模块,用于将所述第一数据包对应的承载标识与流表项中的承载标识进行匹配;the matching module, configured to match the bearer identification corresponding to the first data packet with the bearer identification in the flow entry; 所述查找模块,用于若所述匹配模块匹配成功,根据所述流表项中的计费标识查找计费表,所述计费表包括所述计费标识、第一计费配额阈值、第一动作类型和计费配额对象的统计值,其中,当所述第一计费配额阈值不是根据最后一次有效新增计费配额确定时,所述第一动作类型为空;当所述第一计费配额阈值是根据最后一次有效新增计费配额确定时,所述第一动作类型为欠费对应的动作类型;The search module is configured to search for a charging table according to the charging identifier in the flow entry if the matching module is successfully matched, where the charging table includes the charging identifier, the first charging quota threshold, The first action type and the statistical value of the charging quota object, wherein, when the first charging quota threshold is not determined according to the last effective new charging quota, the first action type is empty; A charging quota threshold is determined according to the last effective new charging quota, and the first action type is the action type corresponding to the arrears; 所述统计模块,用于对所述计费表中的所述计费配额对象进行计费统计,并将所述计费配额对象的计费统计结果写入所述计费表的计费配额对象的统计值中;The statistics module is configured to perform charging statistics on the charging quota objects in the charging table, and write the charging statistics results of the charging quota objects into the charging quota of the charging table in the statistical value of the object; 所述控制模块,用于根据所述计费表中的所述第一计费配额阈值、所述第一动作类型和所述计费配额对象的统计值进行计费控制。The control module is configured to perform charging control according to the first charging quota threshold, the first action type and the statistical value of the charging quota object in the charging table. 11.根据权利要求10所述的交换机,其特征在于,所述交换机还包括:生成模块;11. The switch according to claim 10, wherein the switch further comprises: a generating module; 所述接收模块,还用于接收来自软件自定义网络SDN控制器的流表项创建消息,所述流表项创建消息用于生成所述流表项;The receiving module is further configured to receive a flow entry creation message from a software-defined network SDN controller, where the flow entry creation message is used to generate the flow entry; 所述生成模块,用于根据所述流表项创建消息生成所述流表项。The generating module is configured to generate the flow entry according to the flow entry creation message. 12.根据权利要求10所述的交换机,其特征在于,所述交换机还包括:生成模块;12. The switch according to claim 10, wherein the switch further comprises: a generating module; 所述接收模块,用于接收来自SDN控制器的计费表创建消息,所述计费表创建消息用于生成所述计费表;The receiving module is configured to receive a charging table creation message from the SDN controller, where the charging table creation message is used to generate the charging table; 所述生成模块,用于根据所述计费表创建消息生成所述计费表。The generating module is configured to generate the charging table according to the charging table creation message. 13.根据权利要求10-12任一项所述的交换机,其特征在于,所述控制模块具体用于:13. The switch according to any one of claims 10-12, wherein the control module is specifically configured to: 当所述第一计费配额阈值小于所述终端签约的有效计费配额时,若所述计费配额对象的统计值首次大于所述第一计费配额阈值,向SDN控制器发送计费统计信息,所述计费统计信息包括所述计费标识和所述计费配额对象的统计值;When the first charging quota threshold is less than the effective charging quota subscribed by the terminal, if the statistical value of the charging quota object is greater than the first charging quota threshold for the first time, the charging statistics are sent to the SDN controller information, the charging statistical information includes the charging identifier and the statistical value of the charging quota object; 接收来自所述SDN控制器的计费表更新消息,所述计费表更新消息包括所述计费标识、第二计费配额阈值和第二动作类型,其中,当所述第二计费配额阈值不是根据最后一次有效新增计费配额确定时,所述第二动作类型为空;当所述第二计费配额阈值是根据最后一次有效新增计费配额确定时,所述第二动作类型为欠费对应的动作类型;Receive a charging table update message from the SDN controller, where the charging table update message includes the charging identifier, a second charging quota threshold and a second action type, wherein when the second charging quota When the threshold value is not determined according to the last effective new charging quota, the second action type is empty; when the second charging quota threshold is determined according to the last effective new charging quota, the second action Type is the action type corresponding to the arrears; 根据所述计费标识查找到所述计费表之后,将所述计费表中的所述第一计费配额阈值更新为所述第二计费配额阈值;以及,将所述计费表中的所述第一动作类型更新为所述第二动作类型;After finding the charging table according to the charging identifier, update the first charging quota threshold in the charging table to the second charging quota threshold; and update the charging table The first action type in is updated to the second action type; 根据所述计费表中的所述第二计费配额阈值、所述第二动作类型和所述计费配额对象的统计值进行计费控制。Charging control is performed according to the second charging quota threshold, the second action type and the statistical value of the charging quota object in the charging table. 14.根据权利要求10-12任一项所述的交换机,其特征在于,所述控制模块具体用于:14. The switch according to any one of claims 10-12, wherein the control module is specifically configured to: 当所述第一计费配额阈值等于所述终端签约的有效计费配额时,若所述计费配额对象的统计值不小于所述第一计费配额阈值,根据所述欠费对应的动作类型管理接收到的数据包。When the first charging quota threshold is equal to the effective charging quota contracted by the terminal, and if the statistical value of the charging quota object is not less than the first charging quota threshold, the action corresponding to the arrears Type manages received packets. 15.根据权利要求10-12任一项所述的交换机,其特征在于,所述计费配额对象包括业务时长;所述统计模块具体用于:15. The switch according to any one of claims 10-12, wherein the charging quota object includes a service duration; and the statistics module is specifically used for: 确定空闲时间是否大于预设值,所述空闲时间为所述接收模块接收到所述第一数据包的时间与所述接收模块接收到第二数据包的时间的间隔,所述第二数据包为所述第一数据包的上一个数据包;Determine whether the idle time is greater than a preset value, the idle time is the interval between the time when the receiving module receives the first data packet and the time when the receiving module receives the second data packet, the second data packet is the last data packet of the first data packet; 若所述空闲时间大于所述预设值,将所述计费表中的计费配额对象的统计值确定为所述业务时长的计费统计结果;If the idle time is greater than the preset value, determining the statistical value of the charging quota object in the charging table as the charging statistical result of the service duration; 若所述空闲时间不大于所述预设值,将所述空闲时间和所述计费表中的计费配额对象的统计值的和确定为所述业务时长的计费统计结果。If the idle time is not greater than the preset value, the sum of the idle time and the statistical value of the charging quota object in the charging table is determined as the charging statistical result of the service duration. 16.一种软件自定义网络SDN控制器,其特征在于,所述SDN控制器包括:接收模块、确定模块、生成模块、发送模块和存储模块;16. A software-defined network SDN controller, characterized in that the SDN controller comprises: a receiving module, a determining module, a generating module, a sending module, and a storage module; 所述接收模块,用于接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识,其中,所述第一计费配额信息包括第一计费配额和第一动作类型,当所述第一计费配额不是最后一次有效新增计费配额时,所述第一动作类型为空;当所述第一计费配额是最后一次有效新增计费配额时,所述第一动作类型为欠费对应的动作类型;The receiving module is configured to receive the charging policy information, the first charging quota information and the bearer identifier from the control plane entity, wherein the first charging quota information includes the first charging quota and the first action type, When the first charging quota is not the last effective new charging quota, the first action type is empty; when the first charging quota is the last effective charging quota added, the first action type is empty; An action type is the action type corresponding to the arrears; 所述确定模块,用于确定未存储所述计费策略信息对应的计费标识;The determining module is configured to determine that the charging identifier corresponding to the charging policy information is not stored; 所述生成模块,用于据所述计费策略信息和所述第一计费配额信息生成计费表创建消息;the generating module, configured to generate a charging table creation message according to the charging policy information and the first charging quota information; 所述发送模块,用于向目标交换机发送所述计费表创建消息,所述计费表创建消息用于生成计费表,所述计费表用于计费控制,所述计费表包括所述计费标识、第一计费配额阈值、所述第一动作类型和计费配额对象的统计值;The sending module is configured to send the charging table creation message to the target switch, where the charging table creation message is used to generate a charging table, and the charging table is used for charging control, and the charging table includes the charging identifier, the first charging quota threshold, the first action type, and the statistical value of the charging quota object; 所述生成模块,用于根据所述承载标识和所述计费标识生成流表项创建消息;the generating module, configured to generate a flow entry creation message according to the bearer identifier and the charging identifier; 所述发送模块,用于向所述目标交换机发送所述流表项创建消息,所述流表项创建消息用于生成流表项,所述流表项用于查找所述计费表,其中,所述流表项包括所述承载标识和所述计费标识;The sending module is configured to send the flow entry creation message to the target switch, where the flow entry creation message is used to generate a flow entry, and the flow entry is used to look up the charging table, wherein , the flow entry includes the bearer identifier and the charging identifier; 所述存储模块,用于存储所述计费策略信息和所述计费标识的对应关系。The storage module is configured to store the corresponding relationship between the charging policy information and the charging identifier. 17.根据权利要求16所述的SDN控制器,其特征在于,17. The SDN controller of claim 16, wherein: 所述确定模块,还在所述接收模块接收来自控制面实体的计费策略信息、第一计费配额信息和承载标识之后,确定存储所述计费策略信息对应的计费标识;The determining module further determines to store the charging identifier corresponding to the charging policy information after the receiving module receives the charging policy information, the first charging quota information and the bearer identifier from the control plane entity; 所述生成模块,还用于根据所述承载标识和所述计费标识生成流表项创建消息;The generating module is further configured to generate a flow entry creation message according to the bearer identifier and the charging identifier; 所述发送模块,还用于向所述目标交换机发送所述流表项创建消息,所述流表项创建消息用于生成流表项,所述流表项用于查找所述计费表,其中,所述流表项包括所述承载标识和所述计费标识。The sending module is further configured to send the flow entry creation message to the target switch, where the flow entry creation message is used to generate a flow entry, and the flow entry is used to look up the charging table, Wherein, the flow entry includes the bearer identifier and the charging identifier. 18.根据权利要求16或17所述的SDN控制器,其特征在于,18. The SDN controller according to claim 16 or 17, wherein, 所述接收模块,还用于接收来自所述目标交换机的计费统计信息,所述计费统计信息包括所述计费标识和所述计费配额对象的统计值;The receiving module is further configured to receive charging statistical information from the target switch, where the charging statistical information includes the charging identifier and the statistical value of the charging quota object; 所述确定模块,还用于确定与所述计费标识对应的所述计费策略信息;The determining module is further configured to determine the charging policy information corresponding to the charging identifier; 所述发送模块,还用于向所述控制面实体发送所述计费策略信息;The sending module is further configured to send the charging policy information to the control plane entity; 所述接收模块,还用于接收来自所述控制面实体的所述计费策略信息和第二计费配额信息,其中,所述第二计费配额信息包括第二计费配额和第二动作类型,当所述第二计费配额不是最后一次有效新增计费配额时,所述第二动作类型为空;当所述第二计费配额是最后一次有效新增计费配额时,所述第二动作类型为欠费对应的动作类型;The receiving module is further configured to receive the charging policy information and second charging quota information from the control plane entity, where the second charging quota information includes a second charging quota and a second action type, when the second charging quota is not the last effective new charging quota, the second action type is empty; when the second charging quota is the last effective new charging quota, the The second action type is the action type corresponding to the arrears; 所述确定模块,还用于根据所述第一计费配额阈值和所述第二计费配额确定第二计费配额阈值;The determining module is further configured to determine a second charging quota threshold according to the first charging quota threshold and the second charging quota; 所述确定模块,还用于确定与所述计费策略信息对应的所述计费标识;The determining module is further configured to determine the charging identifier corresponding to the charging policy information; 所述发送模块,还用于向所述目标交换机发送计费表更新消息,所述计费表更新消息包括所述计费标识、所述第二计费配额阈值和所述第二动作类型。The sending module is further configured to send a charging table update message to the target switch, where the charging table update message includes the charging identifier, the second charging quota threshold and the second action type. 19.一种交换机,其特征在于,包括:处理器、存储器、总线和通信接口;19. A switch, comprising: a processor, a memory, a bus and a communication interface; 所述存储器用于存储计算机执行指令,所述处理器与所述存储器通过所述总线连接,当所述交换机运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述交换机执行如权利要求1-6中任意一项所述的计费控制方法。The memory is used to store computer-executed instructions, the processor and the memory are connected through the bus, and when the switch operates, the processor executes the computer-executed instructions stored in the memory, so that all the The switch executes the charging control method according to any one of claims 1-6. 20.一种软件自定义网络SDN控制器,其特征在于,包括:处理器、存储器、总线和通信接口;20. A software-defined network SDN controller, comprising: a processor, a memory, a bus, and a communication interface; 所述存储器用于存储计算机执行指令,所述处理器与所述存储器通过所述总线连接,当所述SDN控制器运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述SDN控制器执行如权利要求7-9中任意一项所述的计费控制方法。The memory is used to store computer-executed instructions, the processor and the memory are connected through the bus, and when the SDN controller is running, the processor executes the computer-executed instructions stored in the memory to The SDN controller is made to execute the charging control method according to any one of claims 7-9. 21.一种计费控制系统,其特征在于,所述计费控制系统包括如权利要求10-15任一项所述的交换机,以及如权利要求16-18任一项所述的SDN控制器;21. A charging control system, characterized in that the charging control system comprises the switch according to any one of claims 10-15, and the SDN controller according to any one of claims 16-18 ; 或者,所述计费控制系统包括如权利要求19所述的交换机,以及如权利要求20所述的SDN控制器。Alternatively, the charging control system includes the switch as claimed in claim 19 , and the SDN controller as claimed in claim 20 .
CN201710583075.0A 2017-07-17 2017-07-17 Charging control method, device and system Active CN109274507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710583075.0A CN109274507B (en) 2017-07-17 2017-07-17 Charging control method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710583075.0A CN109274507B (en) 2017-07-17 2017-07-17 Charging control method, device and system

Publications (2)

Publication Number Publication Date
CN109274507A CN109274507A (en) 2019-01-25
CN109274507B true CN109274507B (en) 2020-07-14

Family

ID=65147908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710583075.0A Active CN109274507B (en) 2017-07-17 2017-07-17 Charging control method, device and system

Country Status (1)

Country Link
CN (1) CN109274507B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092740B (en) * 2019-12-30 2022-05-31 北京天威诚信电子商务服务有限公司 Online charging method and system
CN112235196B (en) * 2020-09-03 2022-01-18 广州数物科技有限公司 Soft and hard cooperative UPF equipment and control method thereof
CN112235211B (en) * 2020-09-03 2022-01-21 广州数物科技有限公司 UPF system based on cooperation of switch and UPF equipment and control method thereof
CN113541975A (en) * 2020-12-21 2021-10-22 南方电网数字电网研究院有限公司 A method and system for billing management based on external gateway protocol

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209309B (en) * 2010-03-30 2013-10-09 华为技术有限公司 Flow charging method, device and a flow charging system
WO2014040240A1 (en) * 2012-09-12 2014-03-20 华为技术有限公司 On-line charging method, device and network system
CN104104520A (en) * 2013-04-10 2014-10-15 华为技术有限公司 Charging method and system based on OPenFlow protocol
US9451095B2 (en) * 2014-06-17 2016-09-20 Alcatel Lucent Charging in a software defined network
CN105515793A (en) * 2014-09-23 2016-04-20 中国电信股份有限公司 On-line charging processing method and system, Openflow controller and Openflow switch
CN106817687A (en) * 2015-12-01 2017-06-09 中兴通讯股份有限公司 Strategy and charging control fast adjustment method, apparatus and system

Also Published As

Publication number Publication date
CN109274507A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN110933711B (en) Policy control method, device and system
JP6821061B2 (en) Policy control methods, network elements, and systems
US11558346B2 (en) Address management method and system, and device
CN109275160B (en) Data distribution method, device and system
CN109936843B (en) Subscription updating method, device and system
CN109274507B (en) Charging control method, device and system
CN108574970B (en) Father node selection method, network node and system
WO2020103693A1 (en) Resource information sending method, device, and system
CN115486046B (en) Data packet processing method and equipment based on open virtual soft switch (OVS)
CN112152926A (en) A method and apparatus for managing network slices of applications
WO2020164290A1 (en) Policy control method, apparatus, and system
CN109429214B (en) Method, device and system for establishing service session
US10897699B2 (en) Subscription update method, device, and system
WO2020147440A1 (en) Data usage reporting method, apparatus and system
CN110149603A (en) A kind of policy control method, equipment and system
WO2021057378A1 (en) Vnf instantiation method, nfvo, vim, vnfm and system
CN113365238B (en) Charging method and device
CN113038455B (en) Switching method, device and system
CN110324152A (en) Strategy and charging control rule acquisition methods, apparatus and system
WO2019165855A1 (en) Message transmission method and device
CN113542043A (en) Data sampling method, device, device and medium for network equipment
CN111740903B (en) A data transmission method and device
CN110650529A (en) Method, device and system for deregistration
CN110445623B (en) Charging method, device and system
CN105376706B (en) A method and device for subscribing to device location information

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