WO2007112649A1 - Système, dispositif et procédé d'accès à une base de données fondés sur un protocole d'initialisation de session - Google Patents

Système, dispositif et procédé d'accès à une base de données fondés sur un protocole d'initialisation de session Download PDF

Info

Publication number
WO2007112649A1
WO2007112649A1 PCT/CN2007/000621 CN2007000621W WO2007112649A1 WO 2007112649 A1 WO2007112649 A1 WO 2007112649A1 CN 2007000621 W CN2007000621 W CN 2007000621W WO 2007112649 A1 WO2007112649 A1 WO 2007112649A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
sip
application server
message
result
Prior art date
Application number
PCT/CN2007/000621
Other languages
English (en)
French (fr)
Inventor
Prakasha Mr
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.
Publication of WO2007112649A1 publication Critical patent/WO2007112649A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Definitions

  • the present invention relates to a Session Initiation Protocol (SIP) application technology, and in particular to a database access system and method based on a SIP protocol.
  • SIP Session Initiation Protocol
  • SIP Internet Protocol
  • IP Internet Engineering Group
  • SIP is part of the IETF standard process and is based on protocols such as Simple Mail Transfer Protocol (SMTP) and Hypertext Transfer Protocol (HTTP).
  • SIP is described as being used to generate, modify, and terminate sessions between one or more participants, including Internet multimedia conferencing, Internet (or any) network) telephone calls, and multimedia distribution.
  • SIP also supports other new services under IP networks: instant messaging, voice conferencing, and unified messaging.
  • SIP has become the call control protocol for third-generation communication services.
  • SIP is simple, easy to expand, and easy to implement, it has gradually become an important protocol in the next generation intelligent network (NGIN, Next Generation Intelligent Network) and third generation network (3G) multimedia subsystem domains, and More and more SIP-enabled client software and intelligent multimedia terminals, as well as servers and softswitch devices implemented with the SIP protocol.
  • NGIN Next Generation Intelligent Network
  • 3G third generation network
  • the SIP service is an application implemented according to the SIP protocol, such as Voice over Internet Protocol (VoIP) service, Presence service, Instant message (IM) service, and the like.
  • VoIP Voice over Internet Protocol
  • Presence Presence service
  • IM Instant message service
  • FIG. 1 shows the structure of a SIP-based network.
  • the SIP User Agent connects to the SIP Application Server through a SIP proxy.
  • SIP AS SIP Application Server
  • the functional entity of the SIP-based service is the most important component of the communication network using SIP as the multimedia session control protocol.
  • the SIP application server has the role of a Back-to-Back User Agent (B2BUA), which acquires information from the SIP application server to route calls. Since the SIP application server is a central entity that provides value-added services, the database of stored users and business data is very large, and the corresponding database management has a relatively large impact on the SIP business logic. Therefore, it is best to use a distributed database structure to separate SIP business logic from database management.
  • B2BUA Back-to-Back User Agent
  • JDBC network Java database connection
  • ODBC Open DataBase Connectivity
  • Embodiments of the present invention provide a database access system, apparatus, and method based on a SIP protocol, and implement a distributed database access mechanism by using SIP messages.
  • a database access system based on the SIP protocol comprising a SIP application server, a database, and a database access interface device, wherein the database access interface device comprises an application server interface unit and a database interface unit;
  • the database end interface unit sends the database query command to the database in the first SIP message sent from the application server interface unit, and sends the database query result sent by the database to the application server through the second SIP message.
  • the application server interface unit includes: a request encapsulation unit and a result parsing unit;
  • the database end interface unit includes: a request parsing unit and a result encapsulating unit;
  • the requesting encapsulating unit encapsulates the database query command sent by the SIP application server in the first SIP message to the request parsing unit;
  • the request parsing unit parses the database query command from the first SEP message sent by the request encapsulating unit, and sends the database query command to the database;
  • the result encapsulating unit encapsulates the database query result sent by the database in the second SIP message and sends the result to the result parsing unit;
  • the result parsing unit parses the database query result from the second SIP message sent by the result encapsulating unit, and sends the database query result to the SIP application server.
  • a database access interface device based on SIP protocol comprising an application server interface unit and a database end interface unit;
  • the database end interface unit parses the database query command from the first SIP message sent by the application server interface unit and sends the query to the database, and sends the database query result sent by the database to the application server interface through the second SIP message. unit.
  • the application server interface unit includes: a request encapsulation unit and a result parsing unit;
  • the database end interface unit includes: a request parsing unit and a result encapsulating unit;
  • the requesting encapsulating unit encapsulates the database query command sent by the SIP application server in the first SIP message to the request parsing unit;
  • the request parsing unit parses the database query command from the first SIP message sent by the request encapsulating unit, and sends the database query command to the database;
  • the database query result sent by the database is encapsulated in a second SIP message and sent to the result parsing unit;
  • the result parsing unit parses the database query result from the second SIP message sent by the result encapsulating unit, and sends the database query result to the SIP application server.
  • the application server interface unit is located in the same physical entity as the SIP application server; the database interface unit is located in the same physical entity as the database.
  • a database access method based on SIP protocol including:
  • the database query result is parsed from the second SIP message and sent to the SIP application server.
  • the sending the data query command to the database by using the first SIP message includes: encapsulating the database query command sent by the SIP application server in the message body of the first SIP message, and sending the first SIP message to the database end;
  • the method of parsing the database query command from the first SIP message and sending it to the database comprises: parsing the database query command from the message body of the first SIP message, and sending the database query command to the database.
  • the sending the database query result to the SIP application server by using the second SIP message includes: encapsulating the database query result generated by the database execution of the database query command in the message body of the second SIP message, and sending the second SIP message to the SIP application Server
  • the parsing the database query result from the second SIP message and sending the result to the SIP application server comprises: parsing the database query result from the message body of the second SIP message, and sending the database query result to the SIP application server.
  • the method further includes: adding an event package for using the first and second SIP messages for database access on the SIP application server and the database respectively.
  • the first SEP message is a SUBSCRIBE message; the second SIP message is a NOTIFY message.
  • a database access interface device is set up between the SIP application server and the database, and the database access interface device sends the database query command sent by the SIP application server to the database through the first SIP message, and executes the database The database query result generated after the database query command is returned to the SIP application server by using the second SIP message.
  • FIG. 1 is a schematic structural diagram of a SIP protocol.
  • Figure 1 is a block diagram showing the structure of a SIP-based database access system in accordance with a preferred embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of a database access device in accordance with a preferred embodiment of the present invention.
  • FIG. 4 is a flow chart of a SIP-based access database method in accordance with a preferred embodiment of the present invention. Mode for carrying out the invention
  • the SIP application server and the database are connected through the data access interface device to implement database access by using the SIP message.
  • the database access interface devices are respectively arranged on the application server side and the database side, and SIP messages are used between the application server side and the database side to perform database query requests and return results.
  • FIG. 2 is a structural diagram of a database access system based on a SIP protocol in accordance with a preferred embodiment of the present invention.
  • the system includes a SIP application server, a database and a database access interface device, and the SIP application server is connected to the database through a database access interface device.
  • database access can be realized by using SIP messages.
  • FIG. 3 is a block diagram showing the structure of a database access device in accordance with a preferred embodiment of the present invention. As shown in FIG. 3, the database access interface device is divided into a database end interface unit and an application server end interface unit.
  • the application server interface unit is located on the SIP application server side or the SIP application server, and the application server interface unit includes a request encapsulation unit and a result parsing unit; the database end interface unit is located in a database side or a database, and the database end interface unit includes a request parsing unit and Result package unit.
  • the signal flow is as follows: When receiving the database query command sent by the SIP application server, the request encapsulation unit encapsulates the database query command in the query request message and sends it to the request parsing unit; the request parsing unit receives the query request message, and parses The database query command carried in the message is sent to the database; the result encapsulation unit encapsulates the database query result in the result feedback message and sends the result to the result parsing when receiving the database query result sent by the database The result parsing unit receives the result feedback message, parses out the database query result carried in the message, and sends the database query result to the SIP application server.
  • the query request message and the result feedback message are SIP messages.
  • the database query command and the database query result are SQL statements, and the SQL statement is carried in a message body of the query request message and the result feedback message.
  • the type of the query request message is a SIP-defined SUBSCRIBE message
  • the result feedback message is of a SIP-defined NOTIFY message.
  • an embodiment of the present invention further provides a database access method.
  • 4 is a flow chart of a SIP protocol based database access method in accordance with a preferred embodiment of the present invention.
  • the database access interface device is configured accordingly to enable it to generate and parse SUBSCRIBE and NOTIFY messages. As can be seen from FIG. 4, this embodiment includes the following steps:
  • Step 401 Setting a database access interface device, specifically, setting a request encapsulation unit to enable generation of a SUBSCRIBE message including a SQL command; setting a request parsing unit to enable The SQL command can be parsed from the SUBSCRIBE message; the result encapsulation unit is set to generate a NOTIFY message containing the SQL result; and the result parsing unit is set to parse the SQL result from the NOTIFY message.
  • the above functions can be implemented by adding event packets for database access using SUBSCRIBE and NOTIFY messages on the request encapsulation unit, the request parsing unit, the result encapsulation unit, and the result parsing unit.
  • Step 402 When the request encapsulating unit of the application server receives the SQL command sent by the SIP application server, the SQL command is encapsulated in the SUBSCRIBE message and sent to the request parsing unit of the database.
  • SUBSCRIBE message An example of a SUBSCRIBE message is as follows:
  • the message body carries three SQL commands. These three orders are
  • the second article the value of the userid field of the record whose value of the userid field in the basetable_example form is 567890 is updated to 1234;
  • Article 3 Execute execute_ example(23, 25, 67). Specifically, a stored procedure is executed, and the parameters are in parentheses.
  • Step 403 The request parsing unit of the database side receives the SUBSCRIBE message, parses out the three SQL commands carried in the message body of the SUBSCRIBE message, and sends the three SQL commands to the database.
  • Step 404 After the database executes the above three SQL commands and generates three SQL results, the result is sent to the database end result encapsulation unit.
  • Step 405 The database encapsulation unit encapsulates the generated SQL result in a NOTIFY message and sends the result to the result parsing unit of the application server.
  • NOTIFY message An example of a NOTIFY message is as follows:
  • SQL Result- 3 Success As seen from the above example of the NOTIFY message, the message body carries three SQL results, corresponding to the three SQL commands carried in the SUBSCRIBE message.
  • the execution succeeds.
  • the value of the balance field of the record whose value of the userid field is 3456789 is found from the basetabie_example form is 20000, and the value of the bonus field is 500. If multiple records are returned, the next record is on the next line;
  • the second article '. execution error the error code is 234;
  • Step 406 The result parsing unit of the application server receives the NOTIFY message, parses out the three SQL results carried in the message body of the NOTIFY message, and sends the three SQL results to the SIP application server.
  • embodiments of the present invention are not limited to performing database access using SUBSCRIBE and NOTIFY messages, but also include performing database access using any other suitable SIP defined message, and defining new SIP messages to perform data access.
  • SIP Session Initiation Protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Description

基于^ "发起协议的数据库访问系统、 装置及方法 技术领域
本发明涉及会话发起协议 ( SIP, Session Initiation Protocol )应用技术, 特 别是涉及一种基于 SIP协议的数据库访问系统及方法。 发明背景
SIP是由 Internet工程组( IETF )提出的一种网际协议 ( Internet Protocol, IP ) 电话信令协议。 它的初始目的是为了解决 IP网络中的信令控制, 以及同 SIP代 理(SIP proxy ) 的通信, 从而构成下一代的增值业务平台, 对电信、 艮行、 金 融等行业提供更好的增值业务。
SIP是 IETF标准进程的一部分, 它是在诸如简单邮件传送协议(SMTP ) 和超文本传送协议 ( HTTP )等协议的基础上建立起来的。 SIP被描述为用来生 成、 修改和终结一个或多个参与者之间的会话, 这些会话包括因特网多媒体会 议、 因特网 (或任何] 网络)电话呼叫和多媒体发布。 SIP还支持 IP网络下的 其它新型业务: 如即时消息、语音会议和统一消息等。 另外, SIP已经成为第三 代通信服务的呼叫控制协议。
因此, 由于 SIP具有简单、 易于扩展、 便于实现等诸多优点, 它逐步成为 下一代智能网絡( NGIN, Next Generation Intelligent Network )和第三代网络( 3G ) 多媒体子系统域中的重要协议, 并且出现了越来越多的支持 SIP的客户端软件 和智能多媒体终端, 以及用 SIP协议实现的服务器和软交换设备。
SIP业务是根据 SIP协议来实现的应用, 例如 IP电话( Voice over Internet Protocol, VoIP )业务、 出席 (Presence ) 业务、 即时消息(IM ) 业务, 等等。
图 1示出了基于 SIP协议的网络的结构。从图 1中可以看出, SIP用户代理 通过 SIP代理连接至 SIP应用服务器。
SIP应用服务器( SIP AS, SIP Application Server )是控制和执行存储于其上、 基于 SIP协议的业务的功能实体, 是使用 SIP作为多媒体会话控制协议的通信 网络的最重要的部件。 SIP应用服务器具有背靠背用户代理服务器(B2BUA, Back-to-Back User Agent ) 的作用, SIP代理从 SIP应用服务器获取信息以路由 呼叫。 由于 SIP应用服务器是提供增值服务的中心实体, 因此, 其包含的存储 用户和业务数据的数据库非常庞大, 相应的数据库管理对 SIP业务逻辑影响比 较大。 因此, 最好采用分布式的数据库结构使 SIP业务逻辑与数据库管理分离。
现有技术一 ^殳采用诸如网络 Java 数据库连接 ( JDBC , Java DataBase Connectivity )和开放数据库连接( ODBC, Open DataBase Connectivity )等技术 实现分布式数据库访问结构, 但是这些方法在很大程度上依赖所使用的编程语 言, 并且业界没有使用 JDBC和 ODBC实现分布式数据库访问的统一标准, 不 同的 SIP应用在访问分布式数据库时有不同的实现标准, 导致不同应用之间的 数据很难融合。 发明内容
本发明实施例提供一种基于 SIP协议的数据库访问系统、 装置和方法, 利 用 SIP消息实现分布式数据库访问机制。
本发明实施例技术方案实现如下:
一种基于 SIP协议的数据库访问系统, 包括 SIP应用服务器, 数据库, 数 据库访问接口装置, 所述数据库访问接口装置包括应用服务器端接口单元和数 据库端接口单元; 其中
应用服务器端接口单元, 将 SIP应用服务器发来的数据库查询命令通过第 一 SIP消息发送至数据库端接口单元, 以及, 从数据库端接口单元发来的第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器;
数据库端接口单元, 从应用服务器端接口单元发来的第一 SIP消息中.解析 出数据库查询命令后发送至数据库, 以及, 将数据库发来的数据库查询结果通 过第二 SIP消息发送至应用服务器端接口单元。 所迷应用服务器端接口单元包括: 请求封装单元和结果解析单元; 所述数 据库端接口单元包括: 请求解析单元和结果封装单元; 其中
请求封装单元, 将 SIP应用服务器发来的数据库查询命令封装在第一 SIP 消息发送至请求解析单元;
请求解析单元, 从请求封装单元发来的第一 SEP消息中解析出数据库查询 命令, 并将数据库查询命令发送至数据库;
结果封装单元, 将数据库发来的数据库查询结果封装在第二 SIP消息发送 至结果解析单元;
结果解析单元, 从结果封装单元发来的第二 SIP消息中解析出数据库查询 结果, 并将数据库查询结果发送至 SIP应用服务器。
一种基于 SIP协议的数据库访问接口装置, 包括应用服务器端接口单元和 数据库端接口单元; 其中
应用服务器端接口单元, 将 SIP应用服务器发来的数据库查询命令通过第 一 SIP消息发送至数据库端接口单元, 以及, 从数据库端接口单元发来的第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器;
数据库端接口单元, 从应用服务器端接口单元发来的第一 SIP消息中解析 出数据库查询命令后发送至数据库, 以及, 将数据库发来的数据库查询结果通 过第二 SIP消息发送至应用服务器端接口单元。
所述应用服务器端接口单元包括: 请求封装单元和结果解析单元; 所述数 据库端接口单元包括: 请求解析单元和结果封装单元; 其中
请求封装单元, 将 SIP应用服务器发来的数据库查询命令封装在第一 SIP 消息发送至请求解析单元;
请求解析单元, 从请求封装单元发来的第一 SIP消息中解析出数据库查询 命令, 并将数据库查询命令发送至数据库;
结果封装单元, 将数据库发来的数据库查询结果封装在第二 SIP消息发送 至结果解析单元; 结果解析单元, 从结果封装单元发来的笫二 SIP消息中解析出数据库查询 结果, 并将数据库查询结杲发送至 SIP应用服务器。
所述应用服务器端接口单元与 SIP应用服务器位于同一物理实体; 所述数 据库端接口单元与数据库位于同一物理实体。
一种基于 SIP协议的数据库访问方法, 包括:
将 SIP应用服务器的数据库查询命令通过第一 SIP消息发送至数据库端; 从第一 SIP消息中解析出数据库查询命令后发送至数据库;
将数据库执行所述数据库查询命令生成的数据库查询结果通过第二 SIP消 息发送至 SIP应用服务器端;
从第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器。
所迷将数据查询命令通过第一 SIP消息发送至数据库端包括: 将 SIP应用 服务器发来的数据库查询命令封装在第一 SIP消息的消息体中, 发送第一 SIP 消息至数据库端;
所迷从第一 SIP消息中解析出数据库查询命令后发送至数据库包括: 从第 一 SIP消息的消息体中解析出数据库查询命令,发送数据库查询命令至数据库。
所迷将数据库查询结果通过第二 SIP消息发送至 SIP应用服务器包括: 将 数据库执行所述数据库查询命令生成的数据库查询结果封装在第二 SIP消息的 消息体中, 发送第二 SIP消息至 SIP应用服务器;
所述从第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器包 括: 从第二 SIP消息的消息体中解析出数据库查询结果, 发送数据库查询结果 至 SIP应用服务器。
将 SIP应用服务器的数据库查询命令通过第一 SIP消息发送至数据库端之 前,进一步包括: 在 SIP应用服务器上和数据库上分别增加利用第一和第二 SIP 消息进行数据库访问的事件包。
所迷第一 SEP消息为 SUBSCRIBE消息; 所述第二 SIP消息为 NOTIFY消 息。 从以上技术方案可以看出, 在 SIP应用服务器和数据库之间设置数据库访 问接口装置, 该数据库访问接口装置将 SIP应用服务器发来的数据库查询命令 通过第一 SIP消息发送至数据库, 并将数据库执行所述数据库查询命令后生成 的数据库查询结果通过第二 SIP消息返回 SIP应用服务器。 从而实现了利用现 有的 SIP消息进行远程数据库访问, 避免采用现有的 JDBC和 ODBC等技术访 问分布式数据库技术所导致的对编程语言依赖以及不同应用之间的数据难以融 合的问题。 附图简要说明
图 1是一种 SIP协议的结构示意图。
图 是本发明一优选实施例的基于 SIP协议的数据库访问系统的结构示意 图。
图 3是本发明一优选实施例的数据库访问装置的结构示意图。
图 4是本发明一优选实施例的基于 SIP协议的访问数据库方法流程图。 实施本发明的方式
为了使本发明实施例的技术方案及优点更加清楚明白, 以下结合附图对本 发明实施例进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅仅用 以解释本发明, 并不用于限定本发明。
本发明实施例中, SIP应用服务器与数据库通过数据访问接口装置连接, 以 利用 SIP消息实现数据库访问。 数据库访问接口装置分别布置于应用服务器端 和数据库端, 在应用服务器端和数据库端之间采用 SIP消息进行数据库的查询 请求和返回结果。
图 2是本发明一优选实施例的基于 SIP协议的数据库访问系统结构图。 如 图 2所示, 该系统包含 SIP应用服务器, 数据库和数据库访问接口装置, SIP 应用服务器通过数据库访问接口装置与数据库连接。 通过所述数据库访问接口 装置, 可以利用 SIP消息实现数据库访问。 图 3 示出了本发明一优选实施例的数据库访问装置的结构示意图。 如图 3 所示, 数据库访问接口装置分为数据库端接口单元和应用服务器端接口单元。 应用服务器端接口单元位于 SIP应用服务器侧或 SIP应用服务器上, 应用服务 器端接口单元包括请求封装单元、 结果解析单元; 数据库端接口单元位于数据 库侧或数据库中 , 数据库端接口单元包括请求解析单元和结果封装单元。
其信号流程如下: 请求封装单元在接收到 SIP应用服务器发来的数据库查 询命令时, 将数据库查询命令封装在查询请求消息中, 发送至请求解析单元; 请求解析单元接收到该查询请求消息,解析出该消息中携带的数据库查询命令, 并将该数据库查询命令发送至数据库; 结果封装单元在接收到数据库发来的数 据库查询结果时, 将数据库查询结果封装在结果反馈消息中, 发送至结果解析 单元; 结果解析单元接收到该结果反馈消息, 解析出该消息中携带的数据库查 询结果, 并将该数据库查询结果发送至 SIP应用服务器。
所述的查询请求消息和结果反馈消息为 SIP消息。
优选地,所述数据库查询命令和数据库查询结果为 SQL语句,该 SQL语句 携带在查询请求消息和结果反馈消息的消息体中。
优选地, 所述查询请求消息的类型为 SIP定义的 SUBSCRIBE消息, 所述 结果反馈消息的类型为 SIP定义的 NOTIFY消息。
由此可见, 由于数据库查询和结果反馈均由 SIP消息 7 载, 可以实现利用 SIP 消息实现数据库访问的目的, 无需具体的数据库编程语言实现数据库的访 问。
基于上述系统, 本发明实施例还提供了一种数据库访问方法。 图 4是本发 明一优选实施例的基于 SIP协议的数据库访问方法的流程图。 在本优选实施例 中, 对数据库访问接口装置进行了相应设置, 以使其能够生成并解析 SUBSCRIBE和 NOTIFY消息。 从图 4可见, 本实施例包含如下步骤:
步骤 401 : 设置数据库访问接口装置, 具体说来就是, 设置请求封装单元, 使其能够生成包含 SQL命令的 SUBSCRIBE消息; 设置请求解析单元, 使其能 够从 SUBSCRIBE消息中解析出 SQL命令; 设置结果封装单元, 使其能够生成 包含 SQL结果的 NOTIFY消息;设置结果解析单元,使其能够从 NOTIFY消息 中解析出 SQL结果。
优选地, 可以通过在请求封装单元、 请求解析单元、 结果封装单元和结果 解析单元上增加利用 SUBSCRIBE和 NOTIFY消息进行数据库访问的事件包来 实现上述功能。
步骤 402:应用服务器端的请求封装单元接收到 SIP应用服务器发来的 SQL 命令时, 将该 SQL命令封装在 SUBSCRIBE消息中, 发送至数据库端的请求解 析单元。
SUBSCRIBE消息的一个示例如下:
消息头:
SUBSCRIBE sip: dbresource-example@example.com SIP/2.0
Via: SIP/2.0/TCP proxy.example.com;branch=z9hG4bKnashds7
To: <sip: dbresource-example@example.com>
From: <sip: user@example.com>;tag=xfg9
Call-ID: 201 O@proxy.example.com
CSeq: 17766 SUBSCRIBE
Max-Forwards: 70
Event: remote-db
Content-Type: application/4g-sql
Expires: 600
Content-Length: ... 消息体:
Maximum Rows Returned: 1000
Return SQL Error Code: True
SQL-1 : Select balance, bonus from basetable— example where userid = 3456789; SQL-2: update basetable— example set userid = 1234 where userid = 567890; SQL-3: execute execute_example(23 , 25, 67).
从上述 SUBSCRIBE消息的示例可见, 消息体携带了三条 SQL命令。 这三 条命令分別是
第一条: 从 basetable— example表单中查询 userid字段的值为 3456789的记 录的余额 ( balance )和积分(bonus );
第二条: 将 basetable— example表单中 userid字段的值为 567890的记录的 userid字段的值更新为 1234;
第三条: 执行 execute— example(23, 25,67)。 具体为执行一个存储过程, 括号 里是参数。
步骤 403: 数据库端的请求解析单元接收所述 SUBSCRIBE 消息, 从该 SUBSCRIBE消息的消息体中解析出携带的三条 SQL命令,将该三条 SQL命令 发送至数据库。
步骤 404: 在数据库执行完上述三条 SQL命令并生成三条 SQL结果之后, 发送至数据库端的结果封装单元。
步骤 405: 数据库端的结杲封装单元将所生成的 SQL结果封装在 NOTIFY 消息中, 发送至应用服务器端的结果解析单元。
NOTIFY消息的一个示例如下:
消息头:
NOTIFY sip: user@example.com SIP/2.0
Via: SIP/2.0/TCP proxy.example.com;branch=z9hG4b na998sk
From: <sip: dbresource-example@example.com>;tag=ffd2
To: <sip:user@example.com>;tag=xfg9
Call-ID: 2010@proxy.example.com
Event: remote-db
Subscription-State: active expires=599
Max-Forwards: 70 CSeq: 8775 NOTIFY
Content-Type: application/4g-sql
Content-Length: ... 消息体: ·
SQL Result- 1: Success
20000|500
SQL Result-2: Error
234
SQL Result- 3: Success 从上述 NOTIFY消息的示例可见, 消息体携带了三条 SQL结果, 分別对应 上述 SUBSCRIBE消息中携带的三条 SQL命令。
这三条 SQL结果分别是:
第一条: 执行成功, 从 basetabie— example表单中查找到 userid字段的值为 3456789的记录的 balance字段的值为 20000, bonus字段的值为 500; 如果返回 多条记录, 下一条记录在下一行;
第二条'. 执行错误, 错误代码为 234;
第三条: 执行成功。
从以上 SQL结果可见, 在返回错误信息时, 还可同时返回错误代码。
步骤 406: 应用 良务器端的结果解析单元接收所述 NOTIFY 消息, 从该 NOTIFY消息的消息体中解析出携带的三条 SQL结果,将该三条 SQL结果发送 至 SIP应用服务器。
应该理解, 本发明实施例不局限于使用 SUBSCRIBE和 NOTIFY消息来执 行数据库访问,还包括使用其他任意合适的 SIP定义的消息来执行数据库访问, 以及定义新的 SIP消息来执行数据访问。 在使用其他 SIP消息执行数据库访问 时, 仅需对数据库访问接口装置进行相应设置, 以使其能够生成并解析相应类 型的 SIP消息即可, 在此不予赘述。
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发 明的精神和原则之内所作的任何修改、 等同替换和改进等, 均应包含在本发明 的保护范围之内。

Claims

权利要求书
1、 一种基于会话发起协议 SIP协议的数据库访问系统, 包括 SIP应用服务 器和数据库, 其特征在于, 进一步包括数据库访问接口装置, 所述数据库访问 接口装置包括应用服务器端接口单元和数据库端接口单元;
应用服务器端接口单元, 将 SIP应用服务器发来的数据库查询命令通过第 一 SIP消息发送至数据库端接口单元, 以及, 从数据库端接口单元发来的第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器;
数据库端接口单元, 从应用服务器端接口单元发来的第一 SIP消息中解析 出数据库查询命令后发送至数据库, 以及, 将数据库发来的数据库查询结果通 过第二 SIP消息发送至应用服务器端接口单元。
2、 根据权利要求 1所述的系统, 其特征在于, 所述应用服务器端接口单元 包括: 请求封装单元和结果解析单元; 所述数据库端接口单元包括: 请求解析 单元和结果封装单元; 其中
请求封装单元, 将 SIP应用服务器发来的数据库查询命令封装在第一 SIP 消息中发送至请求解析单元;
请求解析单元, 从请求封装单元发来的第一 SIP消息中解析出数据库查询 命令, 并将数据库查询命令发送至数据库;
结果封装单元, 将数据库发来的数据库查询结果封装在第二 SIP消息中发 送至结果解析单元;
结果解析单元, 从结果封装单元发来的第二 SJ 消息中解析出数据库查询 结果, 并将数据库查询结果发送至 SIP应用服务器。
3、 根据权利要求 1所述的系统, 其特征在于, 所述应用服务器端接口单元 与 SIP应用服务器位于同一物理实体; 所迷数据库端接口单元与数据库位于同 一物理实体。
4、 根据权利要求 1至 3中任一项所述的系统, 其特征在于, 所述第一 SIP 消息为预订 SUBSCRIBE消息; 所述第二 SIP消息为通知 NOTIFY消息。
5、 一种基于 SIP协议的数据库访问接口装置, 其特征在于, 包括应用服务 器端接口单元和 :据库端接口单元; 其中
应用服务器端接口单元, 将 SIP应用服务器发来的数据库查询命令通过第 一 SIP消息发送至数据库端接口单元, 以及, 从数据库端接口单元发来的第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器;
数据库端接口单元, 从应用服务器端接口单元发来的第一 SIP消息中解析 出数据库查询命令后发送至数据库, 以及, 将数据库发来的数据库查询结果通 过第二 SIP消息发送至应用服务器端接口单元。
6、 根据权利要求 5所述的装置, 其特征在于, 所述应用服务器端接口单元 包括: 请求封装单元和结果解析单元; 所述数据库端接口单元包括: 请求解析 单元和结果封装单元; 其中
请求封装单元, 将 SIP应用服务器发来的数据库查询命令封装在第一 SIP 消息发送至请求解析单元;
请求解析单元, 从请求封装单元发来的第一 SIP消息中解析出数据库查询 命令, 并将数据库查询命令发送至数据库;
结果封装单元, 将数据库发来的数据库查询结果封装在第二 SIP消息发送 至结果解析单元;
结果解析单元, 从结果封装单元发来的第二 SIP消息中解析出数据库查询 结果, 并将数据库查询结果发送至 SIP应用服务器。
7、 根据权利要求 5所述的装置, 其特征在于, 所述应用服务器端接口单元 与 SIP应用服务器位于同一物理实体; 所述数据库端接口单元与数据库位于同 一物理实体。
8、 根据权利要求 5至 7中任一项所述的装置, 其特征在于, 所述第一 SIP 消息为 SUBSCRIBE消息; 所述第二 SIP消息为 NOTIFY消息。
9、 一种基于 SIP协议的数据库访问方法, 其特征在于, 包括: 将 SIP应用服务器的数据库查询命令通过第一 SIP消息发送至数据库端; 从第一 SIP消息中解析出数据库查询命令后发送至数据库;
将数据库执行所述数据库查询命令生成的数据库查询结果通过第二 SIP消 息发送至 SIP应用服务器端;
从第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器。
10、 根据权利要求 9所述的方法, 其特征在于, 所述将数据查询命令通过 第一 SIP消息发送至数据库端包括: 将 SIP应用服务器发来的数据库查询命令 封装在第一 SIP消息的消息体中, 发送第一 SIP消息至数据库端;
所迷从第一 SIP消息中解析出数据库查询命令后发送至数据库包括: 从第 一 SIP消息的消息体中解析出数据库查询命令,发送数据库查询命令至数据库。
11、 根据权利要求 9所述的方法, 其特征在于, 所述将数据库查询结果通 过第二 SIP消息发送至 SIP应用服务器包括: 将数据库执行所述数据库查询命 令生成的数据库查询结果封装在第二 SIP消息的消息体中, 发送第二 SIP消息 至 SIP应用服务器;
所述从第二 SIP消息中解析出数据库查询结果后发送至 SIP应用服务器包 括: 从第二 SIP消息的消息体中解析出数据库查询结果, 发送数据库查询结果 至 SIP应用服务器。
12、 根据权利要求 9所述的方法, 其特征在于, 将 SIP应用服务器的数据 库查询命令通过第一 SIP消息发送至数据库端之前, 进一步包括: 在 SIP应用 服务器上和数据库上分別增加利用第一和第二 SIP消息进行数据库访问的事件 包。
13、 根据权利要求 9至 12 中任一项所述的方法, 其特征在于, 所述第一 SIP消息为 SUBSCRIBE消息; 所述第二 SIP消息为 NOTIFY消息。
PCT/CN2007/000621 2006-04-05 2007-02-27 Système, dispositif et procédé d'accès à une base de données fondés sur un protocole d'initialisation de session WO2007112649A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200610066393 CN101047704A (zh) 2006-04-05 2006-04-05 基于会话发起协议网络的数据库访问系统、装置及方法
CN200610066393.1 2006-04-05

Publications (1)

Publication Number Publication Date
WO2007112649A1 true WO2007112649A1 (fr) 2007-10-11

Family

ID=38563091

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2007/000621 WO2007112649A1 (fr) 2006-04-05 2007-02-27 Système, dispositif et procédé d'accès à une base de données fondés sur un protocole d'initialisation de session

Country Status (2)

Country Link
CN (1) CN101047704A (zh)
WO (1) WO2007112649A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237449B (zh) * 2008-02-01 2012-08-22 中国建设银行股份有限公司 一种访问ims数据库的方法及系统
CN101515931B (zh) * 2009-03-24 2012-09-19 北京理工大学 一种基于代理方式的数据库安全增强方法
CN102130910B (zh) 2011-02-28 2015-04-29 华为技术有限公司 Tcp代理插入和卸载方法及业务网关设备
CN103577465A (zh) * 2012-08-02 2014-02-12 亿赞普(北京)科技有限公司 系统数据处理系统及方法
CN106372162A (zh) * 2016-08-31 2017-02-01 天津南大通用数据技术股份有限公司 一种数据库集群应用的扩展方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004254010A (ja) * 2003-02-19 2004-09-09 Nippon Telegr & Teleph Corp <Ntt> Sip通信制御装置
CN1543167A (zh) * 2002-12-02 2004-11-03 ���ǵ�����ʽ���� 利用会话发起协议的终端注册方法
EP1583312A1 (en) * 2004-04-02 2005-10-05 France Telecom Apparatuses and method for controlling access to an IP multimedia system from an application server
US6961334B1 (en) * 2001-03-29 2005-11-01 Sonus Networks, Inc. Intelligence engine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6961334B1 (en) * 2001-03-29 2005-11-01 Sonus Networks, Inc. Intelligence engine
CN1543167A (zh) * 2002-12-02 2004-11-03 ���ǵ�����ʽ���� 利用会话发起协议的终端注册方法
JP2004254010A (ja) * 2003-02-19 2004-09-09 Nippon Telegr & Teleph Corp <Ntt> Sip通信制御装置
EP1583312A1 (en) * 2004-04-02 2005-10-05 France Telecom Apparatuses and method for controlling access to an IP multimedia system from an application server

Also Published As

Publication number Publication date
CN101047704A (zh) 2007-10-03

Similar Documents

Publication Publication Date Title
US7680060B2 (en) Transferring state information in a network
US8396972B2 (en) Session control apparatus, software applied to session control apparatus, communication control method, and network system
US8700716B2 (en) Systems and methods for initiating announcements in a SIP telecommunications network
US7809846B2 (en) Resilient application layer overlay framework for converged communication over Internet protocol networks
US9083648B2 (en) Method and system for performing remote network management on a voice home gateway terminal
JP2014241641A (ja) セッション開始プロトコルアダプタ
US20090164591A1 (en) Method and Server for Invoking Application Servers in a Sip Network
CN106817341B (zh) 一种面向移动互联网的sip协议节流传输系统及方法
WO2010012605A1 (en) Method and system for selective call forwarding based on media attributes in telecommunication network
US8503429B2 (en) Processing requests and generating responses in session initiation protocol (SIP)
US20090190736A1 (en) Communications
WO2007098714A1 (fr) Dispositif et procédé de contrôle de session
WO2007112649A1 (fr) Système, dispositif et procédé d&#39;accès à une base de données fondés sur un protocole d&#39;initialisation de session
US20030126257A1 (en) Method for recording events in an IP network
WO2010102588A1 (zh) 一种多媒体会议控制方法和系统
WO2014114088A1 (zh) 一种ngn下实现宽带业务功能的方法及业务平台
WO2012113331A1 (zh) 一种ims网络中的业务触发方法、系统、计算机程序和存储介质
JP2005101922A (ja) ネットワークシステム、プロトコル変換装置及び方法
US9712392B2 (en) SIP endpoint configuration in VoIP networks
WO2007068194A1 (fr) Procede permettant d&#39;effectuer une actualisation de lots dans un mecanisme d&#39;abonnement, abonne et terminal de notificateur
CN101317420A (zh) 过滤会话发起协议消息的系统、装置和方法
US9549005B2 (en) Auxiliary SIP services
US9503553B2 (en) Device for controlling the implementation of functions in a service device belonging to an internet communication network core
KR100859706B1 (ko) 스테이트풀 sip 프락시 서버에서의 호 관리 방법 및시스템
US8223949B2 (en) Method, apparatus and software for providing communications between a packet switched network and a public switched telephone network

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: 07711018

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: 07711018

Country of ref document: EP

Kind code of ref document: A1