CN100487646C - 基于python的批价引擎的实现方法 - Google Patents

基于python的批价引擎的实现方法 Download PDF

Info

Publication number
CN100487646C
CN100487646C CNB2007101378188A CN200710137818A CN100487646C CN 100487646 C CN100487646 C CN 100487646C CN B2007101378188 A CNB2007101378188 A CN B2007101378188A CN 200710137818 A CN200710137818 A CN 200710137818A CN 100487646 C CN100487646 C CN 100487646C
Authority
CN
China
Prior art keywords
python
wholesale price
script
individualized
attribute
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.)
Expired - Fee Related
Application number
CNB2007101378188A
Other languages
English (en)
Other versions
CN101140514A (zh
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.)
Whale Cloud Technology Co Ltd
Original Assignee
Nanjing Zhongxing Ruanchuang Sci & Tech LLC
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 Nanjing Zhongxing Ruanchuang Sci & Tech LLC filed Critical Nanjing Zhongxing Ruanchuang Sci & Tech LLC
Priority to CNB2007101378188A priority Critical patent/CN100487646C/zh
Publication of CN101140514A publication Critical patent/CN101140514A/zh
Application granted granted Critical
Publication of CN100487646C publication Critical patent/CN100487646C/zh
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

本发明针对现有的客户个性化需求个性化开发,重复劳动,资源不能共享等问题,提出并实现了基于Python脚本的批价引擎的实现方法,它能从原始话单与分拣后的属性中取出批价属性,并且在批价过程中也能取出用户的个性化的资费产品,来做为个性化批价的依据。具有灵活与多样的个性化资费配置,实时的资费修改并立即生效的快速响应的优点。

Description

基于PYTHON的批价引擎的实现方法
技术领域
本发明涉及一种电信批价计费方法,尤其是一种结合了PYTHON和C++技术的批价引擎的实现方法,具体地说是一种基于PYTHON的批价引擎的实现方法。
背景技术
在电信市场竞争不断加剧的环境下,电信运营商怎样盈利?怎样适应客户个性化的需求?怎样占领市场?又怎样在竞争中处于有利位置?这些无疑是电信运营商思考和决策的重要问题。在目前可以毫不夸张地说在电信运营行业内谁的计费系统比较完善,谁就在电信市场占了先机。
电信计费系统是电信运营商的核心竞争力之一愈来愈被同行认同。电信计费系统核心竞争力的主要体现是:
1.它是电信产品的费用计算和费用及时回收的系统;
2.电信产品的特点决定了电信服务质量主要需要计费系统来维护;
3.市场竞争的主要策略(价格和产品差异化策略)需要计费系统来实现;
目前市场上的计费批价模块,一般都是采用了时段、阶梯、累积量组合的方式来配置资费,也能满足绝大多数的客户的资费要求,但对于复杂的资费,比如:一个资费中要求一次通话超过20分钟本次通话打8折,目前一般的批价引擎做不到,或者只能根据客户的要求硬编码,从表象上达到客户的个性化的要求。
传统批价引的缺点有:
1.资费配置简单,只能对某特定场景的简单的参数设置。
2.不能真正支持客户的个性化的需求。
3.不能满足配置管理员的真实需求与实时响应要求。
发明内容
本发明的目的是针对目前批价计费引擎功能单一,只能支持简单批价模式的现状,提供一种结合Python脚本的全新的公式化的计费策略描述,在统一的批价引擎中通过参数配置完成,方便地实时支持新业务的各类资费政策,无需针对特定的新业务进行单独专门开发的基于PYTHON的批价引擎的实现方法。
本发明的技术方案是:
一种基于PYTHON的批价引擎的实现方法,其特征是首先在C++中扩展和嵌入PYTHON函数,形成一个封闭的PYTHON操作类;其次通过C++中的SWIG将C++特性包装到上述封闭的PYTHON的扩展模块中;第三,将上述包装到PYTHON的扩展模块中C++属性送入用户设置的脚本中;第四,根据批价规则配置PYTHON脚本;第五步,本批价引擎中执行已设置好的PYTHON脚本;最后将通过PYTHON计费所得的结构信息返回C++程序加以显示。
具体地说,在批价引擎中增加Python脚本的嵌入是指:
A、在C++扩展和嵌入Python,封闭一个Python操作类;
B、通过SWIG包装大量C++特性到Python的扩展模块中。
批价引擎中的C++特性包括:
a.批价属性:是指批价过程中的原始话单的一些属性与话单分拣处理后的一些属性。
b.批价方法:是指取用户属性(如日累积等属性)与批价中间数据的一些函数方法。
C、在传统批价引擎中新增Python脚本的执行与批价,并将批价结果返回。
其实现过程包括:
A.封装一个Python的处理类,主要有二个方法:
class TPyScript
{     .......
      void SetSource(const char*sSrc);//设置脚本
      bool Execute(TRateLink*pLink);  //执行脚本
     ..............
};
B.通过SWIG包装大量C++特性到Python的扩展模块中。
enum EVENT_ATTR
{
   EVENT_BEGIN_TIME=3,//事件起始时间
   DURATION        =4,//通话时长
   ..............
};
class TRatableEvent
{
   ..............
   virtual TEventAttr*GetAttr(const int iAttrld);//返回指定属性编码的属性值
   virtual void SetAttr(const int iAttrId,const long iValue);//设置整形类属性
   virtual void SetAttr(const int iAttrld,const char*sValue);//设置字符串型属性
   .............
   //根据属性码得到属性属性值,一般取的是订户属性值
   virtual const char*GetAttrValueByAttrCode(const char*sAttrCode);
   ..............
};
C.在用户设置好脚本之后,将B中转换好的特性import到当前Python脚本中来。
D.根据批价规则配置Python脚本。
E.在批价引擎中执行Python脚本,通过A中封闭类的接口进行处理,也即是处理Python脚本的入口。
F.通过预先封装好的转换特性,将Python脚本计费出的结果信息返回C++程序。
本发明具有以下优点:
一、可以提供多样与灵活的资费配置。不需要程序对于特定需求而进行特定处理。
二、对于Python脚本中的属性与方法可以在C++中增加与补充,充分发挥C++面向对象的优势。
三、在Python脚本中可以充分利用转化后的C++特性来获取批价用的一些原始数据与方法。
四、对于配置管理员,在配置时,可以直接编写Python脚本,针对不同的客户属性做出相应的处理,实现真正的客户化个性化资费。
附图说明
图1是本发明的批价引擎的实现过程示意图。
具体实施方式
下面结构附图和实施例对本发明作进一步的说明。
如图1示。
一种基于PYTHON的批价引擎的实现方法,它包括以下步骤:
A、封装一个Python的处理类,主要有二个方法:
class TPyScript
{    .......
     void SetSource(const char*sSrc);//设置脚本
     bool Execute(TRateLink*pLink);//执行脚本
     ..............
};
B、通过SWIG包装大量C++特性到Python的扩展模块中。
enum EVENT_ATTR
{
   EVENT_BEGIN_TIME=3,//事件起始时间
   DURATION        =4,//通话时长
   ..............
};
class TRatableEvent
{
   ..............
   virtual TEventAttr*GetAttr(const int iAttrld);//返回指定属性编码的属性值
   virtual void SetAttr(const int iAttrld,const long iValue);//设置整形类属性
   virtual void SetAttr(const int iAttrld,const char*sValue);//设置字符串型属性
   .............
   //根据属性码得到属性属性值,一般取的是订户属性值
   virtual const char*GetAttrValueByAttrCode(const char*sAttrCode);
   ..............
};
C、在用户设置好脚本之后,将B中转换好的特性import到当前Python脚本中来。
D、在批价引擎中执行Python脚本,通过A中封闭类的接口进行处理,也即是处理Python脚本的入口。
E、在脚本执行过程中,如果是Python自身的属性与方法,那正常执行,如果找不到相应的属性与方法,会在导入的C++特性中去查找,也正是体现脚本实现批价多样性的地方。因为这个属性与方法已不止是时长,流量,时间等属性,还包含了用户的个性化资费(产品)的所有信息。
F、通过预先封装好的转换特性,将Python脚本计费出的结果信息返回C++程序。将Python脚本计费出的结果信息通过已封装好的转化了的C++特征再将程序句柄返回C++程序。
采用本发明所述思想与方法,与现有技术相比,取得了实质的进步,达到了客户个性化批价的效果,节省了为特定需求编写特定代码的繁琐开发与测试,提高了产品的质量与方便的软件维护等等。

Claims (1)

1、一种基于PYTHON的批价引擎的实现方法,其特征是首先在C++中扩展和嵌入PYTHON函数,形成一个封闭的PYTHON扩展模块;其次通过C++中的SWIG将批价属性和批价方法的C++特性包装到上述封闭的PYTHON扩展模块中;第三,将上述包装到封闭的PYTHON扩展模块中的C++特性送入用户设置的当前PYTHON脚本中;第四,根据批价规则配置PYTHON脚本;第五,本批价引擎中执行已设置好的PYTHON脚本;最后将通过PYTHON脚本计费所得的结果信息返回C++程序加以显示。
CNB2007101378188A 2007-04-17 2007-07-20 基于python的批价引擎的实现方法 Expired - Fee Related CN100487646C (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101378188A CN100487646C (zh) 2007-04-17 2007-07-20 基于python的批价引擎的实现方法

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN200710020895.5 2007-04-17
CN200710020895 2007-04-17
CNB2007101378188A CN100487646C (zh) 2007-04-17 2007-07-20 基于python的批价引擎的实现方法

Publications (2)

Publication Number Publication Date
CN101140514A CN101140514A (zh) 2008-03-12
CN100487646C true CN100487646C (zh) 2009-05-13

Family

ID=39192475

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101378188A Expired - Fee Related CN100487646C (zh) 2007-04-17 2007-07-20 基于python的批价引擎的实现方法

Country Status (1)

Country Link
CN (1) CN100487646C (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141917A (zh) * 2011-04-02 2011-08-03 南京天溯自动化控制系统有限公司 基于IronPython脚本语言的多业务联动实现方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103971261A (zh) * 2013-02-05 2014-08-06 腾讯科技(深圳)有限公司 批价处理方法、装置、订单处理方法及电子商务系统
CN106815003A (zh) * 2015-12-01 2017-06-09 北京触控科技有限公司 一种计算机语言的交互系统及交互方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于Python的混合语言编程及其实现. 罗霄,任勇,山秀明.计算机应用与软件,第21卷第12期. 2004
基于Python的混合语言编程及其实现. 罗霄,任勇,山秀明.计算机应用与软件,第21卷第12期. 2004 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141917A (zh) * 2011-04-02 2011-08-03 南京天溯自动化控制系统有限公司 基于IronPython脚本语言的多业务联动实现方法

Also Published As

Publication number Publication date
CN101140514A (zh) 2008-03-12

Similar Documents

Publication Publication Date Title
CN102929961B (zh) 基于构建快速数据分级通道的数据处理方法及其装置
CN109271142A (zh) 基于模板组件的开发云平台
CN106406846A (zh) 显示界面的创建方法及装置
CN1292127A (zh) 使用petri网的原理和技术来编写电话呼叫中心的脚本
CN107392982A (zh) 在线设计方法、装置及系统
CN100487646C (zh) 基于python的批价引擎的实现方法
CN109032590A (zh) 一种可视化开发环境的配置方法、装置、终端及存储介质
CN109614685A (zh) 基于bim模型的施工交底方法、装置、设备及移动终端
CN107844530A (zh) 一种数据处理方法、装置、服务器及计算机可读存储介质
CN107729483A (zh) 一种分类显示方法、装置、终端及计算机可读存储介质
CN108229779A (zh) 一种面向产线的智能动态服务组合方法和系统
CN107085597A (zh) 一种基于云架构的bim模型存储及浏览环境搭建方法
CN114124951B (zh) 多云环境下构建行业云业务实例的方法及系统
CN102075896B (zh) 一种资费预演方法和系统
CN105824626A (zh) 一种数据池对外共享服务方法
CN1916899A (zh) 一种数字家庭音乐控制器
CN107729485A (zh) 一种数据管理方法、装置、终端及计算机可读存储介质
CN100433624C (zh) 一种通信业务计费的实现方法
CN105812594A (zh) 一种预测式自动外拨系统
CN107045538B (zh) 一种基于kettle的web端交换管理方法
CN106293658A (zh) 一种界面组件生成方法及其设备
CN103944766B (zh) 具有QoS关联关系的服务选择方法
CN110516220A (zh) 一种报表数据录入方法、系统及相关设备
CN109388770A (zh) Web页面生成方法及装置
CN106156927A (zh) 一种基于智能移动终端的外贸管理系统及管理方法

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: NANJING ZTESOFT TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: NANJING ZHONGXING RUANCHUANG SCI. + TECH. LLC

Effective date: 20110504

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20110504

Address after: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee after: NANJING ZTESOFT TECHNOLOGY Co.,Ltd.

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: Nanjing ZTEsoft Technology Co.,Ltd.

C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee after: ZTESOFT TECHNOLOGY Co.,Ltd.

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: NANJING ZTESOFT TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 210012 room 627, Ning Shuang Road, Yuhuatai District, Nanjing, Jiangsu, 627

Patentee after: WHALE CLOUD TECHNOLOGY Co.,Ltd.

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: ZTESOFT TECHNOLOGY Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090513