WO2011160462A1 - Charging server and method for processing online service log - Google Patents
Charging server and method for processing online service log Download PDFInfo
- Publication number
- WO2011160462A1 WO2011160462A1 PCT/CN2011/071200 CN2011071200W WO2011160462A1 WO 2011160462 A1 WO2011160462 A1 WO 2011160462A1 CN 2011071200 W CN2011071200 W CN 2011071200W WO 2011160462 A1 WO2011160462 A1 WO 2011160462A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- user
- bill
- address
- cdr
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims abstract description 108
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000004044 response Effects 0.000 claims description 33
- 230000008569 process Effects 0.000 claims description 14
- 238000013507 mapping Methods 0.000 claims 1
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M15/00—Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
- H04M15/44—Augmented, consolidated or itemized billing statement or bill presentation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/14—Charging, metering or billing arrangements for data wireline or wireless communications
- H04L12/1428—Invoice generation, e.g. customization, lay-out, database processing, algorithms for calculating the bill or formatting invoices as WWW pages
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M15/00—Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
- H04M15/70—Administration or customization aspects; Counter-checking correct charges
Definitions
- the present invention relates to the field of communications, and in particular, to a charging server and method for processing an online service log.
- the Wireless Application Protocol (WAP) gateway implements JAVA online and streaming media online services by processing request and response message packets through the WAP gateway firewall when processing the online application of the socket-based JAVA online and streaming media.
- the log files of JAVA online, streaming media, etc. are generated through message interaction between the WAP gateway firewall, the WAP gateway remote user dial-up authentication system (RADIUS) server, and the accounting server.
- the accounting server receives the socket online service log message sent by the WAP gateway firewall, and extracts the user IP address and other related message fields from the message packet, and sends the IP address to the WAP gateway RADIUS server to query the user information corresponding to the IP according to the agreed format.
- the message fields are combined into a bill format message, and the bill process is sent to the billing server, and the bill process is responsible for generating the file to the specified directory, and the operator's computing platform obtains the log message. Perform statistical analysis alone.
- the billing server With the increase of communication traffic, higher requirements are placed on the performance of the accounting server.
- Increasing socket online business volume requires the billing server to process the syslog of the firewall faster, and the particularity of the online service of the socket, the user's IP information in the firewall syslog, and no user number, so the billing server can be After receiving the firewall message, the user IP address can be quickly parsed, and the RADIUS server can be queried for the user number information corresponding to the IP to generate a valid CDR. If the firewall syslog generated by multiple accesses of the same user for a period of time is queried, the RADIUS server will increase the load on the RADIUS server.
- the problem to be solved by the present invention is to provide an accounting server and method for processing an online service log, which can reduce access to the RADIUS server and improve the efficiency of processing log messages.
- the present invention provides a method for processing an online service log, including:
- the billing server stores the user number of the processed user.
- the billing server receives the firewall message, it queries the user number of the user, and generates a bill message according to the user number and the firewall log message.
- the charging server records the user number of the processed user, and the charging server establishes and stores a correspondence between the user IP and the user number;
- the accounting server searches for the user number of the user according to the corresponding relationship between the user IP address and the user number.
- the method further includes: the billing server allocates a bill identifier for the firewall log message, and if the query user number fails, stores the parsed bill message structure, and sends a query message to the RADIUS server to query the user number; the query message The user IP address and the bill identifier are carried.
- the method further includes: after receiving the response message returned by the RADIUS server, if the query succeeds, the billing message structure is read according to the bill identifier in the response message, and the user number in the response message is Forming a bill message together with the single message structure;
- the stored bill message structure is read according to the bill identifier in the response message, and the user number is set to 0 to generate a bill message together with the bill message structure.
- the accounting server establishes and stores a correspondence between the user IP address and the user number after receiving the response message of the successful query returned by the RADIUS server.
- the method further includes: if the charging server receives the offline notification from the RADIUS server, the user searches for the IP address-user number corresponding relationship according to the user number in the notification, and deletes the correspondence, thereby deleting the IP address. - The correspondence between the processing unit numbers.
- the method further includes: if the IP address-user number correspondence stored by the accounting server is out of time, deleting the timeout IP address-user number correspondence relationship, and further deleting the correspondence relationship between the IP address and the processing unit number.
- the invention also provides an accounting server for processing an online service log, comprising a message receiving module, a storage module and a bill message processing module;
- the storage module is configured to: store a user number of the processed user;
- the message receiving module is configured to: receive a firewall log message and send the message to the bill message processing module;
- the bill message processing module is configured to: after receiving the firewall log message, query the user number of the user, and generate a bill message according to the user number and the firewall message.
- the storage module is configured to: establish and store a correspondence between the user IP address and the user number; the message receiving module is further configured to: query the correspondence between the user IP address and the user number stored in the storage module according to the user IP address The user number of the user.
- the bill message processing module includes one or more bill message processing units
- the storage module is further configured to: store a correspondence between a user IP address and a processing unit that processes the user message;
- the message receiving module is further configured to: after receiving the firewall log message, searching for the correspondence between the IP address and the processing unit in the storage module according to the IP address in the message, and storing the firewall message to the corresponding bill
- the cache queue corresponding to the message processing unit if not, selects an idle bill message processing unit to process the firewall log message, and stores the firewall log message to the selected bill message processing unit.
- the message processing unit is configured to: read a firewall log message in the corresponding cache queue, parse and verify whether the message is valid, and discard the message if invalid, and if the firewall message passes, assign a unique message to the message.
- CDR identification, and the information of the CDR field, the CDR identifier and the time stamp obtained after parsing is written into the CDR message structure; and, according to the parsed user IP address, whether the CDR processing unit stores the corresponding IP address.
- the address-user number correspondence is to splicing the queried user number and the fields in the CDR message structure into a single CDR message, and sending the CDR message to the CDR file generation module; if no IP address is stored -
- the user number correspondence relationship stores the parsed CDR message structure in the CDR message HASH table corresponding to the CDR message processing unit, and sends the user IP address and the CDR ID to the RADIUS server to query the user number.
- the message receiving module After receiving the response message returned by the RADIUS server, the message receiving module queries the corresponding CDR message processing unit according to the user IP address, and if the query is successful, sends a response to the successful CDR message processing unit, which carries the user IP address, CDR ID and user number, if query If the failure occurs, the response to the query failure message is sent to the corresponding CDR message processing unit, where the user IP address and the CDR identifier are carried;
- the CDR message processing unit is further configured to: after receiving the response of the query success, read the corresponding CDR message structure from the CDR message HASH table according to the CDR identifier, and configure each of the user number and the CDR message structure After the field is spliced into a CDR message, the CDR message is sent to the CDR file generating module. After receiving the response to the Query failure, the CDR message structure is read from the CDR message HASH table according to the CDR ID. The user number is set to 0 and the fields in the bill message structure are concatenated into a single bill message and sent to the bill file generating module.
- the storage module establishes and stores a correspondence between the user IP address and the user number after receiving the response message of the query successfully returned by the RADIUS server.
- the present invention provides an accounting server and method for processing an online service log.
- the technical solution of the present invention can reduce the frequency of access to the RADIUS server and the speed of generating the bill.
- FIG. 1 is a schematic diagram of a WAP-based socket online service log processing system according to an embodiment of the present invention
- FIG. 2 is a processing flow of a WAP-based socket online service log processing system according to an embodiment of the present invention.
- the embodiment provides a WAP-based socket online service log accounting server, as shown in FIG. 1 , which includes a message receiving module, a storage module, a bill message processing module, and a bill file generating module.
- a storage module configured to store a user number of the processed user and a correspondence between the user IP address and a processing unit that processes the user message; the storage module establishes and stores the user IP address after receiving the response message of the query successfully returned by the RADIUS server. Correspondence with the user number.
- the storage module can also store the user number in other ways, and the established correspondence can also be It is the correspondence between the user number and other user information except the user IP address.
- the message receiving module is configured to receive a firewall log message sent by the WAP gateway firewall, and search for a correspondence between the IP address and the processing unit in the storage module according to the IP address in the message, and store the firewall log message to the corresponding message.
- the cache queue corresponding to the single message processing unit if not, selects an idle bill message processing unit to process the firewall log message, and stores the firewall log message to the selected bill message processing unit.
- the IP address-processing unit correspondence record records the CDR message processing unit of the user firewall log message, and the correspondence may be an IP address-processing unit HASH table.
- the message receiving module is further configured to receive a response message returned by the RADIUS server, where the response message includes a user IP address, a bill identifier, a user number, and a query result status indicating whether the query is successful. If the status of the query result indicates that the query is successful, the corresponding information of the IP address-processing unit is queried according to the IP address of the user, and the corresponding message processing unit is sent, and then the response to the successful message is sent to the corresponding message processing unit, where the user IP address is carried. If the query result status indicates that the query fails, the query sends a query failure response to the corresponding bill message processing unit, where the user IP address and the bill identifier are carried;
- the message receiving module is further configured to: after receiving the offline notification sent by the RADIUS server, search for the IP address-user number corresponding relationship according to the user number in the notification, and delete the corresponding relationship; and further delete the IP address-processing unit number.
- Correspondence relationship ie HASH table of IP-address processing unit number).
- the bill message processing module includes one or more bill message processing units
- the CDR message processing unit is configured to read the firewall log message in the corresponding cache queue, parse and verify whether the message is valid, and discard the message if invalid, and if the firewall message passes, assign a unique CDR to the message. Identifying, and writing the information of the CDR field, the CDR identifier, and the timestamp obtained in the CDR message structure; and querying whether the CDR message processing unit stores the corresponding IP address according to the parsed user IP address.
- the user number correspondence structure stores the parsed CDR message structure in the CDR message HASH table corresponding to the CDR message processing unit, and sends the user IP address and the CDR ID to the RADIUS server to query the user number.
- the bill message processing unit is further configured to: after receiving the response of the query success, read the corresponding bill message structure from the bill message HASH table according to the bill identifier, and concatenate the user number and the fields in the bill message structure into a bill message, after which the bill message is sent to the bill file generating module; and after receiving the response to the query failure, the corresponding bill message structure is read from the bill message HASH table according to the bill identifier, and the user number is After being set to 0 and the fields in the bill message structure are spliced into a single message, the message is sent to the bill file generating module.
- the bill message processing unit is further configured to delete the IP address-user number correspondence of the timeout when the IP address-user number correspondence timeout expires; and further delete the correspondence between the IP address and the processing unit number (ie, the IP address-processing unit number) HASH table).
- the bill message processing unit is further configured to: when the bill message structure body is timed out, the timeout bill message structure is taken out, the corresponding user number is set to 0, and the bill message is formed together with the bill message structure body, and then sent to the bill file. Generate modules.
- the CDR file generating module is configured to check whether the CDR message cache queue is full after receiving the CDR message, and if the CDR message queue is full, the CDR message in the buffer queue is written into the CDR file, and if not, the CDR will be received. The message is written to the cache queue.
- a cache queue is set for each message processing module, which reduces the time overhead caused by multiple message processing modules sharing the same message cache, and improves the efficiency of the message receiving module for distributing firewall log messages.
- This embodiment provides a method for processing a socket-based online service log based on WAP. As shown in FIG. 2, the following processing procedure is included:
- Step S1 The accounting server receives the firewall log message sent by the WAP gateway firewall.
- Step S2 The accounting server parses and verifies the firewall log message. If the verification is invalid, the message is discarded.
- the message is assigned a CDR identifier, and the information of the CDR field, the CDR identifier and the time stamp obtained after parsing is written into the CDR message structure;
- Step S3 The accounting server queries whether the corresponding relationship between the IP address and the user number is stored according to the parsed user IP address, if yes, step S4 is performed; otherwise, step S5 is performed;
- Step S4 The accounting server obtains the user number from the correspondence between the IP address and the user number, and the root Generating a bill message according to the user number and the bill message structure;
- Step S5 The accounting server stores the CDR message structure, and sends an Query message to the RADIUS server, where the user IP address and the CDR ID are carried.
- Step S6 The RADIUS server receives the query message, queries the user number according to the user IP address, and returns a response message to the accounting server, including the user IP address, the bill identifier, the user number, and the query result status.
- the query result status indicates the user number. Whether the query is successful;
- Step S7 The accounting server receives the response message returned by the RADIUS server, if the query is successful, step S8 is performed, otherwise step S9 is performed;
- Step S8 The accounting server locally establishes a correspondence between the user IP address and the user number, and reads the stored bill message structure according to the bill identifier, inserts the user number to generate a bill message; and then executes step S10;
- Step S9 The accounting server reads the stored bill message structure according to the bill identifier, and sets the corresponding user number to 0 together with the bill.
- the message structure forms a bill message; then step S10 is performed;
- Step S10 The accounting server checks whether the CDR message cache is full. When it is full, the CDR message is written to the CDR file. If the message cache is idle, the generated CDR message is written into the cache.
- the firewall log messages may be cached first to form a cache queue, and the firewall logs in the cache queue may be processed in the order of receiving the messages.
- Message The message can be parsed and verified when the message in the cache queue is processed.
- the billing server can set multiple message processing units to process firewall log messages at the same time.
- the accounting server also records the correspondence between the user IP address and the processing unit that processes the user message.
- the correspondence may be, but is not limited to, the user IP address-processing. Unit number HASH table;
- the accounting server queries the IP address-processing unit number HASH table according to the user IP address to learn the processing unit that processes the user firewall log message, and stores the firewall log message.
- Each message processing unit corresponds to a cache queue for saving Firewall log messages distributed to this processing unit.
- the accounting server does not query the HASH table of the IP address-processing unit number according to the IP address, select an idle processing unit to process the message, preferably, the processing with the least number of cached messages according to the principle of load balancing Select a processing unit from the unit.
- Each message processing unit corresponds to a CDR message HASH table. If the message processing unit fails to query the IP address-user number HASH table, the CDR message is temporarily saved in the CDR message HASH table corresponding to the unit number.
- the accounting server When receiving the offline notification from the RADIUS server, the accounting server searches for the IP address-user number corresponding relationship according to the user number in the notification and deletes the corresponding relationship; IP address - the correspondence between the processing unit numbers (ie, the IP address - the HASH table of the processing unit number).
- the timeout IP address-user number correspondence is deleted; and then the correspondence between the IP address and the processing unit number is deleted (that is, the HASH table of the IP address-processing unit number) .
- the timeout message structure is taken out, the corresponding user number is set to 0, and a bill message is formed together with the bill message structure.
- the user by storing the IP address-processing module number correspondence relationship and the IP address-user number correspondence relationship, the user stores the user information and the assigned processing module number in the local storage module of the accounting server after using the socket online service for the first time.
- the firewall message generated by the subsequent access to the same user can quickly locate the module number of the last time the user message is processed, and allocate the message to the message cache corresponding to the module, thereby reducing the repeated query of the same user's access to the RADIUS server. .
- This two-level HASH query mechanism can reduce the frequency of access to the RADIUS server and the speed of bill generation.
- the present invention provides an accounting server and method for processing an online service log.
- the technical solution of the present invention can reduce the frequency of access to the RADIUS server and the speed of bill generation.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
A charging server and a method for processing the online service log are provided by the present invention. The method includes: a charging server stores the user number of the processed user; when receiving a firewall log message, the charging server inquires the user number of the user, and generates a bill message according to the user number and the firewall log message. The technical solution of the present invention can reduce the access to the RADIUS server, improve the efficiency of processing the log message, and increase the speed of generating the bill.
Description
一种处理在线业务日志的计费服务器及方法 Billing server and method for processing online service log
技术领域 Technical field
本发明涉及通讯领域, 具体涉及一种处理在线业务日志的计费服务器及 方法。 The present invention relates to the field of communications, and in particular, to a charging server and method for processing an online service log.
背景技术 Background technique
无线应用协议 (Wireless Application Protocol, WAP)网关在处理基于 socket 方式的 JAVA在线和流媒体在线应用时, 通过 WAP网关防火墙转发请求和 响应消息包, 实现 JAVA在线和流媒体在线等业务。 JAVA在线、 流媒体等 业务的日志文件的生成是通过 WAP网关防火墙, WAP网关远程用户拨号认 证系统(RADIUS )服务器, 计费服务器之间的消息交互来完成。 计费服务 器接收 WAP网关防火墙发送来的 socket在线业务日志消息, 从该消息包中 解出用户 IP地址和其他相关消息字段, 将 IP地址按照约定格式发送给 WAP 网关 RADIUS服务器查询 IP对应的用户信息,接收 WAP网关 RADIUS服务 器的返回消息后将这些消息字段组合成话单格式消息, 发送给计费服务器的 话单进程, 话单进程负责生成文件到指定的目录, 运营商的计算平台获取这 些日志话单进行统计分析。 The Wireless Application Protocol (WAP) gateway implements JAVA online and streaming media online services by processing request and response message packets through the WAP gateway firewall when processing the online application of the socket-based JAVA online and streaming media. The log files of JAVA online, streaming media, etc. are generated through message interaction between the WAP gateway firewall, the WAP gateway remote user dial-up authentication system (RADIUS) server, and the accounting server. The accounting server receives the socket online service log message sent by the WAP gateway firewall, and extracts the user IP address and other related message fields from the message packet, and sends the IP address to the WAP gateway RADIUS server to query the user information corresponding to the IP according to the agreed format. After receiving the return message of the WAP gateway RADIUS server, the message fields are combined into a bill format message, and the bill process is sent to the billing server, and the bill process is responsible for generating the file to the specified directory, and the operator's computing platform obtains the log message. Perform statistical analysis alone.
随着通信业务量的增多, 对计费服务器性能提出了更高的要求。 日益增 长的 socket在线类业务量要求计费服务器能更快的处理防火墙的 syslog, 而 socket在线业务的特殊性, 防火墙 syslog中有用户的 IP信息, 而没有用户号 码, 所以要求计费服务器能在接收到防火墙消息后能快速的解析出用户 IP, 并向 RADIUS服务器查询 IP对应的用户号码信息, 以生成有效的话单。对同 一个用户一段时间内的多次访问产生的防火墙 syslog都查询 RADIUS服务器 必将造成 RADIUS服务器负荷增加, 可能导致查询用户信息失败, 甚至可能 引起 RADIUS服务器的挂死, 导致整个业务的崩溃。 另外频繁访问 RADIUS 服务器, 等待服务器的响应也使话单服务器的处理性能受到极大的影响。 发明内容
本发明要解决的问题是提供一种处理在线业务日志的计费服务器及方 法, 可减少对 RADIUS服务器的访问, 提高日志消息处理效率。 With the increase of communication traffic, higher requirements are placed on the performance of the accounting server. Increasing socket online business volume requires the billing server to process the syslog of the firewall faster, and the particularity of the online service of the socket, the user's IP information in the firewall syslog, and no user number, so the billing server can be After receiving the firewall message, the user IP address can be quickly parsed, and the RADIUS server can be queried for the user number information corresponding to the IP to generate a valid CDR. If the firewall syslog generated by multiple accesses of the same user for a period of time is queried, the RADIUS server will increase the load on the RADIUS server. This may result in failure of querying the user information, and may even cause the RADIUS server to hang, causing the entire service to crash. In addition, frequent access to the RADIUS server and waiting for the response from the server also greatly affects the processing performance of the CDR server. Summary of the invention The problem to be solved by the present invention is to provide an accounting server and method for processing an online service log, which can reduce access to the RADIUS server and improve the efficiency of processing log messages.
本发明提供一种处理在线业务日志的方法, 包括: The present invention provides a method for processing an online service log, including:
计费服务器存储已处理用户的用户号, 当所述计费服务器收到防火墙曰 志消息后查询该用户的用户号, 根据所述用户号及防火墙日志消息生成话单 消息。 The billing server stores the user number of the processed user. When the billing server receives the firewall message, it queries the user number of the user, and generates a bill message according to the user number and the firewall log message.
所述计费服务器记录已处理用户的用户号是指 , 所述计费服务器建立并 存储用户 IP与用户号的对应关系; The charging server records the user number of the processed user, and the charging server establishes and stores a correspondence between the user IP and the user number;
所述收到防火墙日志消息后查询该用户的用户号是指, 计费服务器根据 用户 IP地址查询用户 IP地址与用户号的对应关系获知所述用户的用户号。 After the firewall log message is received, the user number of the user is queried. The accounting server searches for the user number of the user according to the corresponding relationship between the user IP address and the user number.
上述方法还包括: 所述计费服务器为防火墙日志消息分配一话单标识, 若查询用户号失败则存储解析的话单消息结构体, 并向 RADIUS服务器发送 查询消息以查询用户号; 所述查询消息中携带用户 IP地址和所述话单标识。 The method further includes: the billing server allocates a bill identifier for the firewall log message, and if the query user number fails, stores the parsed bill message structure, and sends a query message to the RADIUS server to query the user number; the query message The user IP address and the bill identifier are carried.
上述方法还包括: 所述计费服务器收到 RADIUS服务器返回的应答消息 后, 若查询成功则根据应答消息中的话单标识读取存储的话单消息结构体, 并将响应消息中的用户号连同所述话单消息结构体一起生成话单消息; The method further includes: after receiving the response message returned by the RADIUS server, if the query succeeds, the billing message structure is read according to the bill identifier in the response message, and the user number in the response message is Forming a bill message together with the single message structure;
若查询失败则根据应答消息中的话单标识读取存储的话单消息结构体, 并将用户号置为 0后连同所述话单消息结构体一起生成话单消息。 If the query fails, the stored bill message structure is read according to the bill identifier in the response message, and the user number is set to 0 to generate a bill message together with the bill message structure.
所述计费服务器是在收到 RADIUS服务器返回的查询成功的应答消息后 建立并存储用户 IP地址与用户号的对应关系的。 The accounting server establishes and stores a correspondence between the user IP address and the user number after receiving the response message of the successful query returned by the RADIUS server.
上述方法还包括: 所述计费服务器若收到 RADIUS服务器发来的用户下 线通知 ,才艮据该通知中的用户号查找 IP地址-用户号对应关系并删除该对应关 系, 进而删除 IP地址 -处理单元号的对应关系。 The method further includes: if the charging server receives the offline notification from the RADIUS server, the user searches for the IP address-user number corresponding relationship according to the user number in the notification, and deletes the correspondence, thereby deleting the IP address. - The correspondence between the processing unit numbers.
上述方法还包括: 若所述计费服务器存储的 IP地址 -用户号对应关系超 时则删除该超时的 IP地址-用户号对应关系, 进而删除 IP地址-处理单元号的 对应关系。 The method further includes: if the IP address-user number correspondence stored by the accounting server is out of time, deleting the timeout IP address-user number correspondence relationship, and further deleting the correspondence relationship between the IP address and the processing unit number.
本发明还提供一种处理在线业务日志的计费服务器, 包括消息接收模块、 存储模块及话单消息处理模块;
所述存储模块设置为: 存储已处理用户的用户号; The invention also provides an accounting server for processing an online service log, comprising a message receiving module, a storage module and a bill message processing module; The storage module is configured to: store a user number of the processed user;
所述消息接收模块设置为: 接收防火墙日志消息并发送至话单消息处理 模块; The message receiving module is configured to: receive a firewall log message and send the message to the bill message processing module;
所述话单消息处理模块设置为: 收到防火墙日志消息后查询该用户的用 户号, 并根据所述用户号及防火墙曰志消息生成话单消息。 The bill message processing module is configured to: after receiving the firewall log message, query the user number of the user, and generate a bill message according to the user number and the firewall message.
所述存储模块是设置为: 建立并存储用户 IP地址与用户号的对应关系; 所述消息接收模块还设置为: 根据用户 IP地址查询存储模块中存储的用 户 IP地址与用户号的对应关系获知所述用户的用户号。 The storage module is configured to: establish and store a correspondence between the user IP address and the user number; the message receiving module is further configured to: query the correspondence between the user IP address and the user number stored in the storage module according to the user IP address The user number of the user.
所述话单消息处理模块包括一个或多个话单消息处理单元; The bill message processing module includes one or more bill message processing units;
所述存储模块还设置为: 存储用户 IP地址与处理该用户消息的处理单元 的对应关系; The storage module is further configured to: store a correspondence between a user IP address and a processing unit that processes the user message;
所述消息接收模块还设置为: 接收防火墙日志消息后, 根据消息中的 IP 地址查找存储模块中是否存储有 IP地址-处理单元的对应关系 ,是则将该防火 墙曰志消息存储至对应话单消息处理单元对应的緩存队列, 没有则选择一个 有空闲的话单消息处理单元处理该防火墙日志消息, 并将该防火墙日志消息 存储至选择的话单消息处理单元。 The message receiving module is further configured to: after receiving the firewall log message, searching for the correspondence between the IP address and the processing unit in the storage module according to the IP address in the message, and storing the firewall message to the corresponding bill The cache queue corresponding to the message processing unit, if not, selects an idle bill message processing unit to process the firewall log message, and stores the firewall log message to the selected bill message processing unit.
所述话单消息处理单元设置为:读取对应緩存队列中的防火墙日志消息, 解析并校验该消息是否有效, 无效则丟弃该消息, 如果防火墙消息校验通过, 则为消息分配一个唯一的话单标识, 并将解析后得到的话单字段, 话单标识 以及时间戳的信息写入话单消息结构体; 以及, 根据解析的用户 IP地址查询 该话单消息处理单元是否存储有对应的 IP地址-用户号对应关系 ,是则将查询 到的用户号以及话单消息结构体中各字段拼接成一条话单消息, 并将此话单 消息发送给话单文件生成模块;若未存储 IP地址-用户号对应关系则将解析的 话单消息结构体存储至该话单消息处理单元对应的话单消息 HASH表中, 并 将用户 IP地址和话单标识发送给 RADIUS服务器以查询用户号。 The message processing unit is configured to: read a firewall log message in the corresponding cache queue, parse and verify whether the message is valid, and discard the message if invalid, and if the firewall message passes, assign a unique message to the message. CDR identification, and the information of the CDR field, the CDR identifier and the time stamp obtained after parsing is written into the CDR message structure; and, according to the parsed user IP address, whether the CDR processing unit stores the corresponding IP address. The address-user number correspondence is to splicing the queried user number and the fields in the CDR message structure into a single CDR message, and sending the CDR message to the CDR file generation module; if no IP address is stored - The user number correspondence relationship stores the parsed CDR message structure in the CDR message HASH table corresponding to the CDR message processing unit, and sends the user IP address and the CDR ID to the RADIUS server to query the user number.
所述消息接收模块收到 RADIUS服务器返回的应答消息后, 根据用户 IP 地址查询对应的话单消息处理单元, 若查询成功则向对应的话单消息处理单 元发送查询成功的响应, 其中携带用户 IP地址、 话单标识及用户号, 若查询
失败则向对应的话单消息处理单元发送查询失败的响应, 其中携带用户 IP地 址及话单标识; After receiving the response message returned by the RADIUS server, the message receiving module queries the corresponding CDR message processing unit according to the user IP address, and if the query is successful, sends a response to the successful CDR message processing unit, which carries the user IP address, CDR ID and user number, if query If the failure occurs, the response to the query failure message is sent to the corresponding CDR message processing unit, where the user IP address and the CDR identifier are carried;
所述话单消息处理单元还设置为: 收到查询成功的响应后, 根据话单标 识从话单消息 HASH表中读取对应的话单消息结构体, 并将用户号以及话单 消息结构中各字段拼接成一条话单消息, 之后将话单消息发送给话单文件生 成模块; 收到查询失败的响应后, 根据话单标识从话单消息 HASH表中读取 对应的话单消息结构体, 将用户号置为 0与话单消息结构中各字段拼接成一 条话单消息后发送给话单文件生成模块。 The CDR message processing unit is further configured to: after receiving the response of the query success, read the corresponding CDR message structure from the CDR message HASH table according to the CDR identifier, and configure each of the user number and the CDR message structure After the field is spliced into a CDR message, the CDR message is sent to the CDR file generating module. After receiving the response to the Query failure, the CDR message structure is read from the CDR message HASH table according to the CDR ID. The user number is set to 0 and the fields in the bill message structure are concatenated into a single bill message and sent to the bill file generating module.
所述存储模块是在收到 RADIUS服务器返回的查询成功的应答消息后建 立并存储用户 IP地址与用户号的对应关系的。 The storage module establishes and stores a correspondence between the user IP address and the user number after receiving the response message of the query successfully returned by the RADIUS server.
综上所述, 本发明提供一种处理在线业务日志的计费服务器及方法, 釆 用本发明的技术方案, 既可以减少对 RADIUS服务器的访问频率, 也可以提 高话单生成的速度。 附图概述 In summary, the present invention provides an accounting server and method for processing an online service log. The technical solution of the present invention can reduce the frequency of access to the RADIUS server and the speed of generating the bill. BRIEF abstract
图 1是本发明实施例基于 WAP的 socket在线业务日志处理系统原理图; 图 2是本发明实施例基于 WAP的 socket在线业务日志处理系统的处理 流程。 本发明的较佳实施方式 1 is a schematic diagram of a WAP-based socket online service log processing system according to an embodiment of the present invention; FIG. 2 is a processing flow of a WAP-based socket online service log processing system according to an embodiment of the present invention. Preferred embodiment of the invention
为了解决上述技术问题, 本发明通过以下技术方案实现: In order to solve the above technical problem, the present invention is achieved by the following technical solutions:
本实施例提供一种处理基于 WAP的 socket在线业务日志计费服务器, 如图 1所示, 包括消息接收模块、 存储模块、 话单消息处理模块及话单文件 生成模块; The embodiment provides a WAP-based socket online service log accounting server, as shown in FIG. 1 , which includes a message receiving module, a storage module, a bill message processing module, and a bill file generating module.
存储模块, 用于存储已处理用户的用户号以及用户 IP地址与处理该用户 消息的处理单元的对应关系; 存储模块是在收到 RADIUS服务器返回的查询 成功的应答消息后建立并存储用户 IP地址与用户号的对应关系的。 a storage module, configured to store a user number of the processed user and a correspondence between the user IP address and a processing unit that processes the user message; the storage module establishes and stores the user IP address after receiving the response message of the query successfully returned by the RADIUS server. Correspondence with the user number.
此处, 存储模块也可通过其他方式存储用户号, 建立的对应关系也可以
是用户号与除用户 IP地址外的其他用户信息间的对应关系。 Here, the storage module can also store the user number in other ways, and the established correspondence can also be It is the correspondence between the user number and other user information except the user IP address.
消息接收模块, 用于接收 WAP 网关防火墙发来的防火墙日志消息, 根 据消息中的 IP地址查找存储模块中是否存储有 IP地址-处理单元的对应关系, 是则将该防火墙日志消息存储至对应话单消息处理单元对应的緩存队列, 没 有则选择一个有空闲的话单消息处理单元处理该防火墙日志消息, 并将该防 火墙日志消息存储至选择的话单消息处理单元。 The message receiving module is configured to receive a firewall log message sent by the WAP gateway firewall, and search for a correspondence between the IP address and the processing unit in the storage module according to the IP address in the message, and store the firewall log message to the corresponding message. The cache queue corresponding to the single message processing unit, if not, selects an idle bill message processing unit to process the firewall log message, and stores the firewall log message to the selected bill message processing unit.
IP地址-处理单元的对应关系记录处理用户防火墙日志消息的话单消息 处理单元, 该对应关系可以是 IP地址-处理单元 HASH表。 The IP address-processing unit correspondence record records the CDR message processing unit of the user firewall log message, and the correspondence may be an IP address-processing unit HASH table.
消息接收模块, 还用于接收 RADIUS服务器返回的应答消息, 该应答消 息包含用户 IP地址、话单标识、用户号及表明查询是否成功的查询结果状态。 若查询结果状态显示查询成功则才艮据用户 IP地址查询 IP地址-处理单元的对 应关系获知对应的话单消息处理单元, 之后向对应的话单消息处理单元发送 查询成功的响应, 其中携带用户 IP地址、 话单标识及用户号; 若查询结果状 态显示查询失败则向对应的话单消息处理单元发送查询失败的响应, 其中携 带用户 IP地址及话单标识; The message receiving module is further configured to receive a response message returned by the RADIUS server, where the response message includes a user IP address, a bill identifier, a user number, and a query result status indicating whether the query is successful. If the status of the query result indicates that the query is successful, the corresponding information of the IP address-processing unit is queried according to the IP address of the user, and the corresponding message processing unit is sent, and then the response to the successful message is sent to the corresponding message processing unit, where the user IP address is carried. If the query result status indicates that the query fails, the query sends a query failure response to the corresponding bill message processing unit, where the user IP address and the bill identifier are carried;
消息接收模块, 还用于收到 RADIUS服务器发来的用户下线通知后, 根 据该通知中的用户号查找 IP地址-用户号对应关系并删除该对应关系;进而删 除 IP地址 -处理单元号的对应关系 (即 IP-地址处理单元号的 HASH表) 。 The message receiving module is further configured to: after receiving the offline notification sent by the RADIUS server, search for the IP address-user number corresponding relationship according to the user number in the notification, and delete the corresponding relationship; and further delete the IP address-processing unit number. Correspondence relationship (ie HASH table of IP-address processing unit number).
话单消息处理模块包括一个或多个话单消息处理单元; The bill message processing module includes one or more bill message processing units;
话单消息处理单元, 用于读取对应緩存队列中的防火墙日志消息, 解析 并校验该消息是否有效, 无效则丟弃该消息, 如果防火墙消息校验通过, 则 为消息分配一个唯一的话单标识, 并将解析后得到的话单字段, 话单标识以 及时间戳的信息写入话单消息结构体; 还用于根据解析的用户 IP地址查询该 话单消息处理单元是否存储有对应的 IP地址-用户号对应关系 ,是则将查询到 的用户号以及话单消息结构体中各字段拼接成一条话单消息, 并将此话单消 息发送给话单文件生成模块;若未存储 IP地址-用户号对应关系则将解析的话 单消息结构体存储至该话单消息处理单元对应的话单消息 HASH表中, 并将 用户 IP地址和话单标识发送给 RADIUS服务器以查询用户号。
话单消息处理单元还用于收到查询成功的响应后, 根据话单标识从话单 消息 HASH表中读取对应的话单消息结构体, 并将用户号以及话单消息结构 中各字段拼接成一条话单消息, 之后将话单消息发送给话单文件生成模块; 以及收到查询失败的响应后, 根据话单标识从话单消息 HASH表中读取对应 的话单消息结构体, 将用户号置为 0与话单消息结构中各字段拼接成一条话 单消息后发送给话单文件生成模块。 The CDR message processing unit is configured to read the firewall log message in the corresponding cache queue, parse and verify whether the message is valid, and discard the message if invalid, and if the firewall message passes, assign a unique CDR to the message. Identifying, and writing the information of the CDR field, the CDR identifier, and the timestamp obtained in the CDR message structure; and querying whether the CDR message processing unit stores the corresponding IP address according to the parsed user IP address. - the corresponding relationship of the user number, the user number and the fields in the bill message structure are concatenated into a single bill message, and the bill message is sent to the bill file generating module; if the IP address is not stored - The user number correspondence structure stores the parsed CDR message structure in the CDR message HASH table corresponding to the CDR message processing unit, and sends the user IP address and the CDR ID to the RADIUS server to query the user number. The bill message processing unit is further configured to: after receiving the response of the query success, read the corresponding bill message structure from the bill message HASH table according to the bill identifier, and concatenate the user number and the fields in the bill message structure into a bill message, after which the bill message is sent to the bill file generating module; and after receiving the response to the query failure, the corresponding bill message structure is read from the bill message HASH table according to the bill identifier, and the user number is After being set to 0 and the fields in the bill message structure are spliced into a single message, the message is sent to the bill file generating module.
话单消息处理单元还用于存储的 IP地址-用户号对应关系超时则删除该 超时的 IP地址 -用户号对应关系;进而删除 IP地址-处理单元号的对应关系(即 IP地址-处理单元号的 HASH表) 。 The bill message processing unit is further configured to delete the IP address-user number correspondence of the timeout when the IP address-user number correspondence timeout expires; and further delete the correspondence between the IP address and the processing unit number (ie, the IP address-processing unit number) HASH table).
话单消息处理单元还用于存储的话单消息结构体超时, 则取出超时话单 消息结构体, 将对应用户号置为 0, 并连同话单消息结构体形成话单消息后 发送给话单文件生成模块。 The bill message processing unit is further configured to: when the bill message structure body is timed out, the timeout bill message structure is taken out, the corresponding user number is set to 0, and the bill message is formed together with the bill message structure body, and then sent to the bill file. Generate modules.
话单文件生成模块, 用于收到话单消息后检查话单消息緩存队列是否已 满, 已满则将緩存队列中的各话单消息写入话单文件, 若未满则将接收的话 单消息写入緩存队列。 The CDR file generating module is configured to check whether the CDR message cache queue is full after receiving the CDR message, and if the CDR message queue is full, the CDR message in the buffer queue is written into the CDR file, and if not, the CDR will be received. The message is written to the cache queue.
本实施例中, 对每个消息处理模块设置緩存队列, 减少多个消息处理模 块互斥共享同一个消息緩存带来的时间开销, 同时提高了消息接收模块的分 发防火墙日志消息的效率。 In this embodiment, a cache queue is set for each message processing module, which reduces the time overhead caused by multiple message processing modules sharing the same message cache, and improves the efficiency of the message receiving module for distributing firewall log messages.
本实施例提供一种基于 WAP的 socket在线业务日志处理方法, 如图 2 所示, 包括以下处理过程: This embodiment provides a method for processing a socket-based online service log based on WAP. As shown in FIG. 2, the following processing procedure is included:
步骤 S1 : 计费服务器收到 WAP网关防火墙发来的防火墙日志消息; 步骤 S2: 计费服务器解析并校验该防火墙日志消息, 若校验无效则丟弃 该消息, 若校验通过, 则为该消息分配一话单标识, 并将解析后得到的话单 字段, 话单标识以及时间戳的信息写入话单消息结构体; Step S1: The accounting server receives the firewall log message sent by the WAP gateway firewall. Step S2: The accounting server parses and verifies the firewall log message. If the verification is invalid, the message is discarded. The message is assigned a CDR identifier, and the information of the CDR field, the CDR identifier and the time stamp obtained after parsing is written into the CDR message structure;
步骤 S3: 计费服务器根据解析出的用户 IP地址查询本地是否存储有 IP 地址与用户号的对应关系, 是则执行步骤 S4, 否则执行步骤 S5; Step S3: The accounting server queries whether the corresponding relationship between the IP address and the user number is stored according to the parsed user IP address, if yes, step S4 is performed; otherwise, step S5 is performed;
步骤 S4:计费服务器从 IP地址与用户号的对应关系中获取该用户号,根
据用户号连同话单消息结构体生成话单消息; Step S4: The accounting server obtains the user number from the correspondence between the IP address and the user number, and the root Generating a bill message according to the user number and the bill message structure;
步骤 S5: 计费服务器存储该话单消息结构体, 并向 RADIUS服务器发送 查询消息, 其中携带用户 IP地址和话单标识; Step S5: The accounting server stores the CDR message structure, and sends an Query message to the RADIUS server, where the user IP address and the CDR ID are carried.
步骤 S6: RADIUS服务器收到查询消息,根据用户 IP地址查询其用户号, 并向计费服务器返回应答消息, 包含用户 IP地址、 话单标识、 用户号及查询 结果状态; 查询结果状态表明用户号查询是否成功; Step S6: The RADIUS server receives the query message, queries the user number according to the user IP address, and returns a response message to the accounting server, including the user IP address, the bill identifier, the user number, and the query result status. The query result status indicates the user number. Whether the query is successful;
步骤 S7: 计费服务器收到 RADIUS服务器返回的应答消息, 若查询成功 则执行步骤 S8, 否则执行步骤 S9; Step S7: The accounting server receives the response message returned by the RADIUS server, if the query is successful, step S8 is performed, otherwise step S9 is performed;
步骤 S8:计费服务器在本地建立用户 IP地址及用户号的对应关系,并根 据话单标识读取存储的话单消息结构体, 插入用户号生成话单消息; 然后执 行步骤 S10; Step S8: The accounting server locally establishes a correspondence between the user IP address and the user number, and reads the stored bill message structure according to the bill identifier, inserts the user number to generate a bill message; and then executes step S10;
用户 IP及用户号的对应关系可以是用户 IP地址-用户号的 HASH表; 步骤 S9: 计费服务器根据话单标识读取存储的话单消息结构体, 将对应 用户号置为 0并连同话单消息结构体形成话单消息; 然后执行步骤 S10; The correspondence between the user IP address and the user number may be a HASH table of the user IP address-user number. Step S9: The accounting server reads the stored bill message structure according to the bill identifier, and sets the corresponding user number to 0 together with the bill. The message structure forms a bill message; then step S10 is performed;
步骤 S10: 计费服务器检查话单消息緩存是否已满, 已满则将已緩存的 话单消息写入话单文件, 如果消息緩存有空闲, 则将该生成的话单消息写入 緩存。 Step S10: The accounting server checks whether the CDR message cache is full. When it is full, the CDR message is written to the CDR file. If the message cache is idle, the generated CDR message is written into the cache.
上述步骤 S2中,若计费服务器接收的防火墙日志消息较多而不能即时处 理接收的防火墙日志消息, 可以先緩存防火墙日志消息形成緩存队列, 并按 接收消息的先后顺序处理緩存队列中的防火墙日志消息; 可以是在对緩存队 列中的消息进行处理时才对消息进行解析及校验。 In the foregoing step S2, if the accounting server receives a large number of firewall log messages and cannot directly process the received firewall log messages, the firewall log messages may be cached first to form a cache queue, and the firewall logs in the cache queue may be processed in the order of receiving the messages. Message; The message can be parsed and verified when the message in the cache queue is processed.
计费服务器可设置多个消息处理单元同时处理防火墙日志消息。 The billing server can set multiple message processing units to process firewall log messages at the same time.
同一用户在线期间的所有防火墙日志消息由同一消息处理单元进行处 理,计费服务器还记录用户 IP地址与处理该用户消息的处理单元的对应关系, 该对应关系可以但不限于是用户 IP地址 -处理单元号 HASH表; 计费服务器 收到防火墙曰志消息后,先才艮据用户 IP地址查询该 IP地址 -处理单元号 HASH 表获知处理该用户防火墙日志消息的处理单元, 并将防火墙日志消息存储至 对应处理单元的緩存队列。 每个消息处理单元对应一个緩存队列, 用于保存
分发给本处理单元的防火墙日志消息。 All firewall log messages during the same user's online period are processed by the same message processing unit. The accounting server also records the correspondence between the user IP address and the processing unit that processes the user message. The correspondence may be, but is not limited to, the user IP address-processing. Unit number HASH table; After receiving the firewall message, the accounting server queries the IP address-processing unit number HASH table according to the user IP address to learn the processing unit that processes the user firewall log message, and stores the firewall log message. To the cache queue of the corresponding processing unit. Each message processing unit corresponds to a cache queue for saving Firewall log messages distributed to this processing unit.
若计费服务器根据 IP地址未查询到该 IP地址-处理单元号的 HASH表, 则选择一有空闲的处理单元处理该消息, 较佳地, 可按负载均衡的原则从緩 存消息数最少的处理单元中选择一处理单元。 If the accounting server does not query the HASH table of the IP address-processing unit number according to the IP address, select an idle processing unit to process the message, preferably, the processing with the least number of cached messages according to the principle of load balancing Select a processing unit from the unit.
每个消息处理单元对应一个话单消息 HASH表,消息处理单元查询 IP地 址-用户号 HASH表失败, 则将话单消息暂时保存在单元号对应的话单消息 HASH表。 Each message processing unit corresponds to a CDR message HASH table. If the message processing unit fails to query the IP address-user number HASH table, the CDR message is temporarily saved in the CDR message HASH table corresponding to the unit number.
计费服务器在对用户计费的过程中, 若收到 RADIUS服务器发来的用户 下线通知 ,才艮据该通知中的用户号查找 IP地址-用户号对应关系并删除该对应 关系; 进而删除 IP地址-处理单元号的对应关系 (即 IP地址-处理单元号的 HASH表) 。 When receiving the offline notification from the RADIUS server, the accounting server searches for the IP address-user number corresponding relationship according to the user number in the notification and deletes the corresponding relationship; IP address - the correspondence between the processing unit numbers (ie, the IP address - the HASH table of the processing unit number).
若计费服务器存储的 IP地址-用户号对应关系超时则删除该超时的 IP地 址 -用户号对应关系; 进而删除 IP地址-处理单元号的对应关系 (即 IP地址- 处理单元号的 HASH表) 。 If the IP address-user number correspondence time stored by the accounting server expires, the timeout IP address-user number correspondence is deleted; and then the correspondence between the IP address and the processing unit number is deleted (that is, the HASH table of the IP address-processing unit number) .
若计费服务器存储的话单消息结构体超时,则取出超时话单消息结构体, 将对应用户号置为 0, 并连同话单消息结构体形成话单消息。 If the bill message structure is timed out, the timeout message structure is taken out, the corresponding user number is set to 0, and a bill message is formed together with the bill message structure.
本发明中,通过保存 IP地址-处理模块号对应关系以及 IP地址-用户号对 应关系, 用户第一次使用 socket在线业务后在计费服务器的本地存储模块会 保存用户信息以及分配的处理模块号, 对同一用户的后续访问产生的防火墙 消息, 可以快速定位出上次处理该用户消息的模块号, 分配消息到该模块对 应的消息緩存,因此减少了同一个用户的访问对 RADIUS服务器的重复查询。 这种两级 HASH查询机制既可以减少对 RADIUS服务器的访问频率, 也可以 提高话单生成的速度。 In the present invention, by storing the IP address-processing module number correspondence relationship and the IP address-user number correspondence relationship, the user stores the user information and the assigned processing module number in the local storage module of the accounting server after using the socket online service for the first time. The firewall message generated by the subsequent access to the same user can quickly locate the module number of the last time the user message is processed, and allocate the message to the message cache corresponding to the module, thereby reducing the repeated query of the same user's access to the RADIUS server. . This two-level HASH query mechanism can reduce the frequency of access to the RADIUS server and the speed of bill generation.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各模块 /单元可以釆用
硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。 One of ordinary skill in the art will appreciate that all or a portion of the above steps may be performed by a program to instruct the associated hardware, such as a read only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment can be used The form of hardware implementation can also be implemented in the form of software function modules. The invention is not limited to any specific form of combination of hardware and software.
以上的描述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在 本发明的精神和原则之内, 所做的任何修改, 等同替换, 改进等, 均应包含 在本发明的保护范围之内。 The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are included in the spirit and scope of the present invention, should be included in the present invention. Within the scope of protection.
工业实用性 本发明提供一种处理在线业务日志的计费服务器及方法, 釆用本发明的 技术方案, 既可以减少对 RADIUS服务器的访问频率, 也可以提高话单生成 的速度。
Industrial Applicability The present invention provides an accounting server and method for processing an online service log. The technical solution of the present invention can reduce the frequency of access to the RADIUS server and the speed of bill generation.
Claims
1、 一种处理在线业务日志的方法, 其包括: A method for processing an online service log, comprising:
计费服务器存储已处理用户的用户号, 当所述计费服务器收到防火墙曰 志消息后查询该用户的用户号, 根据所述用户号及防火墙日志消息生成话单 消息。 The billing server stores the user number of the processed user. When the billing server receives the firewall message, it queries the user number of the user, and generates a bill message according to the user number and the firewall log message.
2、 如权利要求 1所述的方法, 其中, 2. The method of claim 1 wherein
所述计费服务器记录已处理用户的用户号是指 , 所述计费服务器建立并 存储用户 IP地址与用户号的对应关系; The charging server records the user number of the processed user, and the charging server establishes and stores a correspondence between the user IP address and the user number;
所述收到防火墙日志消息后查询该用户的用户号是指, 计费服务器根据 用户 IP地址查询用户 IP地址与用户号的对应关系获知所述用户的用户号。 After the firewall log message is received, the user number of the user is queried. The accounting server searches for the user number of the user according to the corresponding relationship between the user IP address and the user number.
3、 如权利要求 1或 2所述的方法, 所述方法还包括: 3. The method of claim 1 or 2, the method further comprising:
所述计费服务器为防火墙日志消息分配一话单标识, 若查询用户号失败 则存储解析的话单消息结构体, 并向远程用户拨号认证系统(RADIUS )服 务器发送查询消息以查询用户号; 所述查询消息中携带用户 IP地址和所述话 单标识。 The billing server allocates a bill identifier for the firewall log message, and if the query user number fails, stores the parsed bill message structure, and sends a query message to the remote user dialing authentication system (RADIUS) server to query the user number; The query message carries the user IP address and the bill identifier.
4、 如权利要求 3所述的方法, 所述方法还包括: 4. The method of claim 3, the method further comprising:
所述计费服务器收到 RADIUS服务器返回的应答消息后, 若查询成功则 根据应答消息中的话单标识读取存储的话单消息结构体, 并将响应消息中的 用户号连同所述话单消息结构体一起生成话单消息; After receiving the response message returned by the RADIUS server, the accounting server reads the stored bill message structure according to the bill identifier in the response message, and associates the user number in the response message with the bill message structure. Generate a bill message together;
若查询失败则根据应答消息中的话单标识读取存储的话单消息结构体, 并将用户号置为 0后连同所述话单消息结构体一起生成话单消息。 If the query fails, the stored bill message structure is read according to the bill identifier in the response message, and the user number is set to 0 to generate a bill message together with the bill message structure.
5、 如权利要求 2所述的方法, 其中, 5. The method of claim 2, wherein
所述计费服务器是在收到 RADIUS服务器返回的查询成功的应答消息后 建立并存储用户 IP地址与用户号的对应关系的。 The accounting server establishes and stores a correspondence between the user IP address and the user number after receiving the response message of the successful query returned by the RADIUS server.
6、 如权利要求 1或 2所述的方法, 所述方法还包括: 6. The method of claim 1 or 2, the method further comprising:
所述计费服务器若收到 RADIUS服务器发来的用户下线通知, 根据该通 知中的用户号查找 IP地址-用户号对应关系并删除该对应关系, 进而删除 IP 地址 -处理单元号的对应关系。 If the receiving server receives the offline notification from the RADIUS server, the accounting server searches for the IP address-user number corresponding relationship according to the user number in the notification, deletes the corresponding relationship, and then deletes the IP address. Address - The correspondence between the processing unit numbers.
7、 如权利要求 1或 2所述的方法, 所述方法还包括: 7. The method of claim 1 or 2, the method further comprising:
若所述计费服务器存储的 IP地址-用户号对应关系超时则删除该超时的 IP地址-用户号对应关系, 进而删除 IP地址 -处理单元号的对应关系。 If the IP address-user number corresponding to the accounting server expires, the timeout IP address-user number correspondence is deleted, and the correspondence between the IP address and the processing unit number is deleted.
8、 一种处理在线业务日志的计费服务器, 其包括消息接收模块、 存储模 块及话单消息处理模块; 8. An accounting server for processing an online service log, comprising a message receiving module, a storage module, and a bill message processing module;
所述存储模块设置为: 存储已处理用户的用户号; The storage module is configured to: store a user number of the processed user;
所述消息接收模块设置为: 接收防火墙日志消息并发送至话单消息处理 模块; The message receiving module is configured to: receive a firewall log message and send the message to the bill message processing module;
所述话单消息处理模块设置为: 收到防火墙日志消息后查询该用户的用 户号, 并根据所述用户号及防火墙曰志消息生成话单消息。 The bill message processing module is configured to: after receiving the firewall log message, query the user number of the user, and generate a bill message according to the user number and the firewall message.
9、 如权利要求 8所述的计费服务器, 其中, 9. The billing server according to claim 8, wherein
所述存储模块是设置为: 建立并存储用户 IP地址与用户号的对应关系; 所述消息接收模块还设置为: 根据用户 IP地址查询存储模块中存储的用 户 IP地址与用户号的对应关系获知所述用户的用户号。 The storage module is configured to: establish and store a correspondence between the user IP address and the user number; the message receiving module is further configured to: query the correspondence between the user IP address and the user number stored in the storage module according to the user IP address The user number of the user.
10、 如权利要求 8或 9所述的计费服务器, 其中, 10. The billing server according to claim 8 or 9, wherein
所述话单消息处理模块包括一个或多个话单消息处理单元; The bill message processing module includes one or more bill message processing units;
所述存储模块还设置为: 存储用户 IP地址与处理该用户消息的处理单元 的对应关系; The storage module is further configured to: store a correspondence between a user IP address and a processing unit that processes the user message;
所述消息接收模块还设置为: 接收防火墙日志消息后, 根据消息中的 IP 地址查找存储模块中是否存储有 IP地址-处理单元的对应关系 ,是则将该防火 墙曰志消息存储至对应话单消息处理单元对应的緩存队列, 没有则选择一个 有空闲的话单消息处理单元处理该防火墙日志消息, 并将该防火墙日志消息 存储至选择的话单消息处理单元。 The message receiving module is further configured to: after receiving the firewall log message, searching for the correspondence between the IP address and the processing unit in the storage module according to the IP address in the message, and storing the firewall message to the corresponding bill The cache queue corresponding to the message processing unit, if not, selects an idle bill message processing unit to process the firewall log message, and stores the firewall log message to the selected bill message processing unit.
11、 如权利要求 10所述的计费服务器, 其中, 所述话单消息处理单元设 置为: The billing server according to claim 10, wherein the bill message processing unit is configured to:
读取对应緩存队列中的防火墙日志消息, 解析并校验该消息是否有效, 无效则丟弃该消息, 如果防火墙消息校验通过, 则为消息分配一个唯一的话 单标识, 并将解析后得到的话单字段, 话单标识以及时间戳的信息写入话单 消息结构体; 以及, 根据解析的用户 IP地址查询该话单消息处理单元是否存 储有对应的 IP地址-用户号对应关系,是则将查询到的用户号以及话单消息结 构体中各字段拼接成一条话单消息, 并将此话单消息发送给话单文件生成模 块;若未存储 IP地址-用户号对应关系则将解析的话单消息结构体存储至该话 单消息处理单元对应的话单消息 HASH表中,并将用户 IP地址和话单标识发 送给 RADIUS服务器以查询用户号。 Read the firewall log message in the corresponding cache queue, parse and verify that the message is valid. If the message is invalid, the message is assigned a unique CDR ID, and the CDR status, CDR ID, and timestamp information obtained after parsing are written into the CDR message structure; Querying, according to the parsed user IP address, whether the CDR message processing unit stores the corresponding IP address-user number correspondence relationship, and then splicing the queried user number and the fields in the CDR message structure into one CDR message. And sending the CDR message to the CDR file generating module; if the IP address-user number mapping relationship is not stored, the CDR message structure that is parsed is stored in the CDR message HASH table corresponding to the CDR message processing unit, and Send the user IP address and bill ID to the RADIUS server to query the user ID.
12、 如权利要求 11所述的计费服务器, 其中, 所述消息接收模块还设置 为: 12. The charging server according to claim 11, wherein the message receiving module is further configured to:
收到 RADIUS服务器返回的应答消息后,根据用户 IP地址查询对应的话 单消息处理单元, 若查询成功则向对应的话单消息处理单元发送查询成功的 响应, 其中携带用户 IP地址、 话单标识及用户号, 若查询失败则向对应的话 单消息处理单元发送查询失败的响应, 其中携带用户 IP地址及话单标识; 所述话单消息处理单元还设置为: 收到查询成功的响应后, 根据话单标 识从话单消息 HASH表中读取对应的话单消息结构体, 并将用户号以及话单 消息结构中各字段拼接成一条话单消息, 之后将话单消息发送给话单文件生 成模块; 收到查询失败的响应后, 根据话单标识从话单消息 HASH表中读取 对应的话单消息结构体, 将用户号置为 0与话单消息结构中各字段拼接成一 条话单消息后发送给话单文件生成模块。 After receiving the response message returned by the RADIUS server, the corresponding CDR message processing unit is queried according to the user IP address. If the query succeeds, the response to the CDR message processing unit is sent to the corresponding CDR message processing unit, which carries the user IP address, the CDR identifier, and the user. If the query fails, the response to the query failure message is sent to the corresponding CDR message processing unit, where the user IP address and the CDR identifier are carried; the CDR message processing unit is further configured to: after receiving the response of the query successfully, according to the message The single identifier reads the corresponding CDR message structure from the CDR message HASH table, and splices the fields in the user number and the CDR message structure into a CDR message, and then sends the CDR message to the CDR file generation module; After receiving the response of the query failure, the corresponding bill message structure is read from the bill message HASH table according to the bill identifier, and the user number is set to 0 and the fields in the bill message structure are concatenated into a bill message and then sent. Generate a module for the bill file.
13、 如权利要求 12所述的计费服务器, 其中, 所述存储模块是设置为以 如下方式建立并存储用户 IP地址与用户号的对应关系:在收到 RADIUS服务 器返回的查询成功的应答消息后建立并存储用户 IP地址与用户号的对应关 系。 The charging server according to claim 12, wherein the storage module is configured to establish and store a correspondence between a user IP address and a user number in the following manner: receiving a response message that the query returned by the RADIUS server succeeds Then, the correspondence between the user IP address and the user number is established and stored.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010219172.X | 2010-06-25 | ||
CN201010219172.XA CN101883111B (en) | 2010-06-25 | 2010-06-25 | Accounting server for processing online business log and method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011160462A1 true WO2011160462A1 (en) | 2011-12-29 |
Family
ID=43054997
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2011/071200 WO2011160462A1 (en) | 2010-06-25 | 2011-02-23 | Charging server and method for processing online service log |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN101883111B (en) |
WO (1) | WO2011160462A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111988372A (en) * | 2020-07-31 | 2020-11-24 | 银盛通信有限公司 | Method and device for decoding and transmitting mobile telephone bill |
CN112328661A (en) * | 2020-11-04 | 2021-02-05 | 北京思特奇信息技术股份有限公司 | Method and system for monitoring call ticket processing performance and electronic equipment |
CN112988208A (en) * | 2019-12-18 | 2021-06-18 | 腾讯科技(深圳)有限公司 | Data updating method, device, equipment and storage medium |
CN114785625A (en) * | 2022-03-03 | 2022-07-22 | 阿里巴巴(中国)有限公司 | Call bill charging processing method, device and system |
CN115150763A (en) * | 2021-03-30 | 2022-10-04 | 中国移动通信集团江苏有限公司 | A method and device for bill charging |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101883111B (en) * | 2010-06-25 | 2015-06-10 | 中兴通讯股份有限公司 | Accounting server for processing online business log and method thereof |
CN105227685A (en) * | 2014-06-13 | 2016-01-06 | 中兴通讯股份有限公司 | The correlating method of user profile and data flow, master control set, radius server |
CN107832345A (en) * | 2017-10-16 | 2018-03-23 | 千寻位置网络有限公司 | The method of base station data unique numberization mark |
CN110855596B (en) * | 2018-08-20 | 2022-03-04 | 中兴通讯股份有限公司 | Communication connection method and device, communication equipment and computer readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1502199A (en) * | 2001-03-09 | 2004-06-02 | ����ɭ�绰�ɷ�����˾ | Method and device for mapping IP address to MSISDN number in service network |
WO2007074959A1 (en) * | 2005-12-26 | 2007-07-05 | Kt Corporation | System for providing share of contents based on packet network in voice comunication based on circuit network |
CN101083538A (en) * | 2006-05-30 | 2007-12-05 | 卓望数码技术(深圳)有限公司 | Real-time counting method for value added business of IP network environment |
CN101286858A (en) * | 2007-04-12 | 2008-10-15 | 中兴通讯股份有限公司 | Method and system for charging of WAP gateway for mobile terminal |
CN101399853A (en) * | 2007-09-24 | 2009-04-01 | 中国移动通信集团公司 | Customer identification server, data service processing system and method |
CN101883111A (en) * | 2010-06-25 | 2010-11-10 | 中兴通讯股份有限公司 | A billing server and method for processing online business logs |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1801817A (en) * | 2005-12-21 | 2006-07-12 | 阿里巴巴公司 | Method and system for producing journal file |
-
2010
- 2010-06-25 CN CN201010219172.XA patent/CN101883111B/en not_active Expired - Fee Related
-
2011
- 2011-02-23 WO PCT/CN2011/071200 patent/WO2011160462A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1502199A (en) * | 2001-03-09 | 2004-06-02 | ����ɭ�绰�ɷ�����˾ | Method and device for mapping IP address to MSISDN number in service network |
WO2007074959A1 (en) * | 2005-12-26 | 2007-07-05 | Kt Corporation | System for providing share of contents based on packet network in voice comunication based on circuit network |
CN101083538A (en) * | 2006-05-30 | 2007-12-05 | 卓望数码技术(深圳)有限公司 | Real-time counting method for value added business of IP network environment |
CN101286858A (en) * | 2007-04-12 | 2008-10-15 | 中兴通讯股份有限公司 | Method and system for charging of WAP gateway for mobile terminal |
CN101399853A (en) * | 2007-09-24 | 2009-04-01 | 中国移动通信集团公司 | Customer identification server, data service processing system and method |
CN101883111A (en) * | 2010-06-25 | 2010-11-10 | 中兴通讯股份有限公司 | A billing server and method for processing online business logs |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112988208A (en) * | 2019-12-18 | 2021-06-18 | 腾讯科技(深圳)有限公司 | Data updating method, device, equipment and storage medium |
CN112988208B (en) * | 2019-12-18 | 2023-06-30 | 腾讯科技(深圳)有限公司 | Data updating method, device, equipment and storage medium |
CN111988372A (en) * | 2020-07-31 | 2020-11-24 | 银盛通信有限公司 | Method and device for decoding and transmitting mobile telephone bill |
CN112328661A (en) * | 2020-11-04 | 2021-02-05 | 北京思特奇信息技术股份有限公司 | Method and system for monitoring call ticket processing performance and electronic equipment |
CN112328661B (en) * | 2020-11-04 | 2024-04-02 | 北京思特奇信息技术股份有限公司 | Method, system and electronic equipment for monitoring ticket processing performance |
CN115150763A (en) * | 2021-03-30 | 2022-10-04 | 中国移动通信集团江苏有限公司 | A method and device for bill charging |
CN115150763B (en) * | 2021-03-30 | 2024-05-07 | 中国移动通信集团江苏有限公司 | Bill charging method and device |
CN114785625A (en) * | 2022-03-03 | 2022-07-22 | 阿里巴巴(中国)有限公司 | Call bill charging processing method, device and system |
CN114785625B (en) * | 2022-03-03 | 2023-09-26 | 阿里巴巴(中国)有限公司 | Method, device and system for processing bill charging |
Also Published As
Publication number | Publication date |
---|---|
CN101883111B (en) | 2015-06-10 |
CN101883111A (en) | 2010-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011160462A1 (en) | Charging server and method for processing online service log | |
CN100550739C (en) | A kind of method, system and routing device of initiating authentication request for user terminal | |
WO2006072222A1 (en) | A method for implementing the data synchronization of the server and the client side in the mechanism of the domain name system | |
US11671363B2 (en) | Method and apparatus for cross-service-zone communication, and data center network | |
WO2009052668A1 (en) | A nat-pt device and a load-sharing method for nat-pt device | |
WO2004032421A1 (en) | A method for adding devices to management system | |
CN102025793A (en) | Domain name resolution method and system and DNS in IP network | |
WO2014101777A1 (en) | Flow table matching method and device, and switch | |
WO2021139311A1 (en) | Routing forwarding method and apparatus, routing device and readable storage medium | |
US9661055B2 (en) | Method and system for redirecting a client | |
WO2009039719A1 (en) | A user identifier server, a system and method for processing the data service | |
CN110224929A (en) | The data packet forwarding method of link aggregation interface based on DPDK | |
WO2011140910A1 (en) | Service process unit and method, and service control gateway and load equalization method | |
CN105828310A (en) | Data service billing method, equipment and system | |
CN107135266A (en) | HTTP Proxy framework safety data transmission method | |
WO2009000214A1 (en) | Method and device for configuring configuration data of user access network | |
CN114338063B (en) | Message queue system, business processing method and computer-readable storage medium | |
WO2014205660A1 (en) | Method, apparatus and routing device for forwarding data packet | |
CN102137102B (en) | Realizing method of service supporting platform for supporting multiclass information publishing modes | |
CN116963027A (en) | Network distribution method and device for dual-mode Internet of things equipment | |
WO2013075513A1 (en) | Short message buffering method and system | |
CN103973827A (en) | Domain name resolution method and device | |
WO2025055198A1 (en) | Message processing method and apparatus, and device and storage medium | |
WO2009062453A1 (en) | Method and apparatus for providing user information | |
WO2001067678A1 (en) | An information switch |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 11797493 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 11797493 Country of ref document: EP Kind code of ref document: A1 |