WO2009082938A1 - Procédé, système et appareil de contrôle d'affaire - Google Patents

Procédé, système et appareil de contrôle d'affaire Download PDF

Info

Publication number
WO2009082938A1
WO2009082938A1 PCT/CN2008/073585 CN2008073585W WO2009082938A1 WO 2009082938 A1 WO2009082938 A1 WO 2009082938A1 CN 2008073585 W CN2008073585 W CN 2008073585W WO 2009082938 A1 WO2009082938 A1 WO 2009082938A1
Authority
WO
WIPO (PCT)
Prior art keywords
operation instruction
transaction
data change
change operation
request message
Prior art date
Application number
PCT/CN2008/073585
Other languages
English (en)
French (fr)
Inventor
Hai XIANG
Zhiquan Yi
Ning DING
Jianfeng Lu
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Priority to EP08868480A priority Critical patent/EP2224661A1/en
Publication of WO2009082938A1 publication Critical patent/WO2009082938A1/zh
Priority to US12/633,368 priority patent/US20100088395A1/en

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/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Definitions

  • Embodiments of the present invention relate to the field of communications technologies, and in particular, to a transaction control method, system, and apparatus. Background technique
  • XCAP XML Configuration Access Protocol
  • IETF Internet Engineering Task Force
  • XCAP maps the nodes in the XML document to the HTTP (Hyper Text Transfer Protocol) URI (Universal Resource Identifier), enabling these components to be accessed directly over HTTP.
  • HTTP Hyper Text Transfer Protocol
  • URI Universal Resource Identifier
  • OM A XCAP standard signaling PUT, GET, DELETE are single document or node operations, one request is a database operation, that is, for a standard XCAP signaling, the database performs an operation and submits a result. Therefore, existing XCAP signaling does not require transaction control parameters, and XDMS (XML Document Management System) does not require transaction control. However, for XCAP batch signaling, there is no contract type for XDMS document operations. The result is: either treated as a database transaction or treated as multiple database transactions, uncertain for the terminal. Sex.
  • the problem to be solved by the embodiment of the present invention is to provide a transaction control method, system and device, which solves the problem that the terminal and the server cannot agree on the same transaction processing mechanism in the prior art, so that the server cannot know the request of the terminal.
  • Transaction type a technical defect that causes the operation actually performed by the server to be inconsistent with the requested operation of the terminal.
  • an embodiment of the present invention provides a transaction control method, including the following steps:
  • the server receives a request message of a terminal; the server parses the request message, and the operation instruction in the request message is When the data change operation instruction, the transaction type corresponding to the data change operation instruction is acquired according to the data change operation instruction; the server operates according to the obtained data change operation instruction and the transaction type.
  • the embodiment of the present invention further provides a transaction control system, including a server and at least one terminal, where the terminal is configured to send a request message to the server, and the server is configured to receive and parse the terminal to send a request message, when the operation instruction in the request message is a data change operation instruction, acquiring, according to the data change operation instruction, a transaction type requested by the terminal carried in the request message; and according to the obtained data Change the operation instruction and transaction type to operate.
  • a transaction control system including a server and at least one terminal, where the terminal is configured to send a request message to the server, and the server is configured to receive and parse the terminal to send a request message, when the operation instruction in the request message is a data change operation instruction, acquiring, according to the data change operation instruction, a transaction type requested by the terminal carried in the request message; and according to the obtained data Change the operation instruction and transaction type to operate.
  • the embodiment of the present invention further provides a server, including a request receiving module, a determining module, and a transaction processing module, where the request receiving module is configured to send by the receiving terminal.
  • the requesting module is configured to parse the request message received by the request receiving module, and notify the transaction processing module when the operation instruction in the request message is a data change operation instruction;
  • a module configured to: when the determining module determines that the operation instruction in the request message is a data change operation instruction, acquire a transaction type corresponding to the data change operation instruction according to the data change operation instruction; Data change operation instructions and transaction types operate.
  • the embodiment of the present invention further provides a terminal, including a request sending module, configured to send a request message to a server, where the request message carries a transaction type requested by the terminal.
  • the embodiment of the present invention enables the server to identify the type of transaction requested by the terminal and perform corresponding processing by adding a corresponding transaction type in the request message sent by the terminal.
  • This allows the server to perform transaction control on XCAP batch processing according to the specific application requirements of the terminal.
  • For batch data addition operations you can select multiple transaction types to filter out illegal data.
  • For some batch operations that need to maintain transaction consistency you can select a single transaction type, which enhances the practicability and flexibility of XCAP signaling. Enhanced end-user experience.
  • FIG. 1 is a flowchart of a transaction control method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a transaction control method according to another embodiment of the present invention.
  • FIG. 3 is a flowchart of a transaction control method according to still another embodiment of the present invention.
  • FIG. 4 is a flowchart of a transaction control method according to an embodiment of the present invention.
  • FIG. 5 is a structural diagram of a transaction control system according to an embodiment of the present invention.
  • the embodiment of the present invention adds a corresponding transaction type to the request message sent by the terminal, so that the server can identify the type of the transaction requested by the terminal and perform corresponding information.
  • Reason This allows the terminal to perform transaction control on XCAP batch processing according to the specific application requirements of the terminal.
  • For batch data addition operations you can select multiple transaction types to operate. One import operation is performed according to a database transaction, and the result of one operation is recorded. Thus, for data addition operations, each addition is not affected by other addition operations. Filter out illegal data. For the multi-transaction mode, if each operation instruction contains illegal data, the operation will not be successful, but only the current operation will be affected, and other normal data operations will not be affected.
  • a flowchart of a transaction control method according to an embodiment of the present invention includes the following steps:
  • Step S101 The server receives the request message of the terminal.
  • Step S102 the server parses the request message, and when the operation instruction in the request message is a data change operation instruction, acquires a transaction type corresponding to the data change operation instruction according to the data change operation instruction;
  • Step S103 the server operates according to the obtained data change operation instruction and the transaction type.
  • the server can perform transaction control on the XCAP batch processing according to the specific application requirements of the terminal.
  • batch data addition operations you can select multiple transaction types to filter out illegal data.
  • batch operations that need to maintain transaction consistency you can select a single transaction type, which enhances the practicability and flexibility of XCAP signaling. Enhanced end-user experience.
  • Step S201 The server receives the request message of the terminal.
  • Step S202 The server parses the request message, and when the operation instruction in the request message is a data change operation instruction, acquires a transaction type requested by the terminal carried in the request message according to the data change operation instruction;
  • Step S203 The server operates according to the obtained data change operation instruction and the transaction type.
  • the server can perform transaction control on the XCAP batch processing according to the specific application requirements of the terminal.
  • batch data addition operations you can select multiple transaction types to filter out illegal data.
  • batch operations that need to maintain transaction consistency you can select a single transaction type, which enhances the practicability and flexibility of XCAP signaling. Enhanced end-user experience.
  • a flow chart of a transaction control method according to still another embodiment of the present invention is different from the previous embodiment.
  • the embodiment is based on obtaining a corresponding data change operation instruction, and querying according to the data change operation instruction.
  • the transaction type corresponding to the data change operation instruction. This embodiment includes the following steps:
  • Step S301 The server receives the request message of the terminal.
  • Step S302 the server parses the request message, obtains a corresponding data change operation instruction, and queries a transaction type corresponding to the data change operation instruction according to the data change operation instruction;
  • Step S303 the server operates according to the obtained data change operation instruction and the transaction type.
  • the server can perform transaction control on the XCAP batch processing according to the specific application requirements of the terminal.
  • batch data addition operations you can select multiple transaction types to filter out illegal data.
  • batch operations that need to maintain transaction consistency you can select a single transaction type, which enhances the practicability and flexibility of XCAP signaling. Enhanced end-user experience.
  • the request message sent by the terminal to the server is a batch processing request message, and includes the following steps: Step S401: The terminal sends a batch request message to the server. And according to itself The specific application requires adding the transaction type of the terminal request in the batch request message.
  • a transaction type attribute (such as an affair type) is added to an outer label (such as a list label) of a message body of the batch request message, and the value of the transaction type attribute is used to reflect the terminal request.
  • the transaction type if the value of the attribute is SINGLE_AFFAIR, is considered to be a single transaction type. When the value of the attribute is MULTI_AFFAIR, it is considered to be a multi-transaction type.
  • a single transaction type means that the server executes all the operation instructions in the batch request message in a database transaction, and any database operation failure will reprocess the entire transaction.
  • the result of a single transaction type processing is: either all succeeds, or all fail, that is, once an operation instruction has an error, it is recognized The execution of the batch request message failed, and such an operation is very beneficial for maintaining a batch operation that is consistent with the transaction ⁇ 1".
  • the multi-transaction type is for each operation instruction in the batch request message of the server. Execute according to a database transaction. The server regards each database operation as a separate transaction, and records the result of the operation. Any database operation failure only rolls back the current transaction, and does not affect other database operation instructions of this batch request message.
  • the result of multiple transactions is: There may be partial successes in the reply message, but this is normal.
  • Step S402 the server receives and parses the batch request message sent by the terminal, and determines whether the operation instruction in the batch request message is a data change operation instruction.
  • the operation instruction is a data change operation instruction such as adding, deleting or modifying.
  • Step S403 If the operation instruction in the batch request message is a read operation instruction, the XML document is read. After the read operation is completed, the server returns a response message to the terminal, where the response message carries the operation result of the read operation by the server.
  • Step S404 If the operation instruction in the batch request message is a data change operation instruction such as adding, deleting, or modifying, further determining whether the terminal requests a single transaction type or a multi-transaction type.
  • a data change operation instruction such as adding, deleting, or modifying
  • Step S405 if the terminal requests a single transaction type, the server needs to complete all the document operations to be processed in the batch request in a database transaction, such as batch adding, modifying, deleting the document or the node in the document, any time. Database operation failures roll back the entire transaction, either all successfully, or all fail.
  • Step S406 if the terminal requests a multi-transaction type, the server treats each document operation in the batch request as a separate transaction, and when operating on multiple nodes of a document, constructs a SQL statement to execute, Make sure that the operation on one document is a single transaction, and the results of any database operation do not affect other data operations.
  • Step S407 after the server performs the execution of the batch processing request in step S405, step S406, the server returns a response message to the terminal, where the response message carries the operation result of the server to the batch request message, such as success or failure. .
  • a modification failure is indicated by 500 in the response message, and a modification is successful by 200.
  • the terminal sends an event type that is superior to the terminal, but the server side may also configure a batch processing of a certain service operation by using a configuration file, a DB (Data Base, a database), or the like.
  • the transaction type which is loaded when the server starts, and after receiving the batch request, performs data operations in the agreed transaction mode and returns a response.
  • the server receives the batch request message of the terminal; the server parses the batch request message to obtain a corresponding data change operation instruction, and queries the corresponding transaction type according to the data change operation instruction; the server changes according to the obtained data. Operation instructions and transaction types operate.
  • the XDMS stipulates the transaction type of the business operation in a configured manner, and the convention is essentially given by the service side, and the XDMS distinction is not changed. Things The transaction type performs the process of batch data processing, and therefore still belongs to the protection scope of the embodiment of the present invention.
  • FIG. 5 it is a structural diagram of a transaction control system according to an embodiment of the present invention.
  • the system includes a server 1 and at least one terminal 2.
  • the terminal 2 is configured to send a request message to the server 1, and the request message may be a batch request message.
  • the server 1 carries the transaction type requested by the terminal 2; the server 1 is configured to receive and parse the request message of the terminal 2, obtain a corresponding data change operation instruction and a transaction type, and perform the operation instruction and the transaction type according to the obtained data. operating.
  • the server 1 includes a request receiving module 11, a determining module 12, and a transaction processing module 13.
  • the request receiving module 11 is configured to receive the request message sent by the terminal 2, and the determining module 12 is configured to parse the request message received by the request receiving module 11. Determining whether the operation instruction in the request message is a data change operation instruction; the transaction processing module 13 is configured to: when the determination module 12 determines that the operation instruction in the request message is a data change operation instruction, acquire and operate according to the data change operation instruction The data change operation instruction corresponding transaction type; according to the obtained data change operation instruction and transaction type operation.
  • the transaction processing module 13 is specifically configured to acquire, according to the data change operation instruction, the transaction type of the terminal request corresponding to the data change operation instruction carried in the request message.
  • the transaction processing module 13 can also be specifically used to obtain a corresponding data change operation instruction, and query the transaction type corresponding to the data change operation instruction according to the data change operation instruction.
  • the server 1 further includes a non-transaction processing module 14 configured to read the extensible markup language XML document when the determining module 12 determines that the operation instruction in the request message is a non-data change operation instruction such as a read operation instruction. Operation and other corresponding operations.
  • the transaction processing module 13 includes a single transaction processing sub-module 131 and a multi-transaction processing sub-module 132.
  • the single transaction processing sub-module 131 is configured to execute a data change operation instruction in a database transaction when the transaction type is a single transaction type. All data operations in the multi-transaction sub-module 132 are used to perform, for each data operation in the data change operation instruction, when the transaction type is a multi-transaction type A database transaction is executed.
  • the server 1 further includes a response message sending module 15 for returning a response message to the terminal 2 after the transaction processing module 13 completes the operation, and the response message carries the operation result of the request message.
  • the terminal 2 includes a request sending module 21 and a response message receiving module 22, and the request sending module 21 is configured to send a request message to the server 1, the request message carries the type of transaction requested by the terminal 2, and the response message receiving module 22 is configured to receive The response message returned by the server 1 carries the operation result of the request message.
  • the embodiment of the present invention adds a corresponding transaction type to the request message sent by the terminal, so that the server can identify the transaction type requested by the terminal and perform corresponding processing.
  • This allows the server to perform transaction control on XCAP batch processing according to the specific application requirements of the terminal.
  • For batch data addition operations you can select multiple transaction types to filter out illegal data.
  • For some batch operations that need to maintain transaction consistency you can select a single transaction type, which enhances the practicability and flexibility of XCAP signaling. Enhanced end-user experience.
  • the present invention can be implemented by hardware, or can be implemented by means of software plus necessary general hardware platform, and the technical solution of the present invention. It can be embodied in the form of a software product that can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc.) that performs the methods described in various embodiments of the present invention.
  • a non-volatile storage medium which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a computer device may It is a personal computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Description

一种事务控制方法、 系统和装置 本申请要求于 2007年 12 月 21 日提交中国专利局, 申请号为 200710301955.0, 发明名称为 "一种事务控制方法、 系统和装置" 的 中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明实施例涉及通信技术领域, 特别是涉及一种事务控制方 法、 系统和装置。 背景技术
XCAP ( XML Configuration Access Protocol, XML配置访问协议) 十办议是 IETF ( Internet Engineering Task Force, Internet 工程任务组 ) 制定的一个协议, 该协议允许客户端读、 写、 修改存放在服务器中的 XML ( extensible Markup Language, 可扩展的标记语言)格式的应用 配置数据。 XCAP将 XML文档中的节点映射到 HTTP ( Hyper Text Transfer Protocol , 超文本传输协议) 的 URI ( Universal Resource Identifier, 通用资源标志符) 中, 使得这些组件能够直接通过 HTTP 访问。
OM A XCAP标准信令 PUT、 GET, DELETE均为单个文档或节 点操作, 一次请求就是一个数据库操作, 也就是说对于一个标准的 XCAP信令,数据库执行一次操作,并提交一次结果。所以现有 XCAP 信令不需要事务控制参数, XDMS ( XML Document Management System, XML数据管理服务器 )也不需要事务控制。 然而对于 XCAP 批处理信令, 也没有对 XDMS文档操作的事务类型进行约定, 其结 果是: 要么被当作一个数据库事务处理,要么被当作多个数据库事务 处理, 对终端来讲具有不确定性。
在实现本发明实施例过程中, 发明人发现现有技术中至少存 在如下问题: 由于终端和服务端无法约定相同的事务处理机制, 因此会导致服务端在事务处理机制上不健全, 终端体验具有不确 定性。 例如终端想要请求服务端对终端的连续的多个请求进行多 事务处理, 然而现有技术中由于服务端无法得知该终端请求的是 多事务处理, 可能依然按照默认的单事务处理方式处理。 但是如 果服务端是按多事务处理的, 而终端希望按单事务处理而无法通 知服务端时, 就会出现写入了不该写入的数据; 反之, 如果请求 中有不正确的数据, 就会导致操作总是不能成功。
发明内容
本发明实施例要解决的问题是提供一种事务控制方法、 系统 和装置, 解决现有技术中由于终端和服务端无法约定相同的事务 处理机制, 而使服务端因为无法得知终端所请求的事务类型, 造 成服务端实际执行的操作和终端的所请求的操作不一致的技术缺 陷。
为达到上述目的, 本发明实施例一方面提出一种事务控制方 法, 包括以下步骤: 服务端接收终端的请求消息; 所述服务端解 析所述请求消息, 在所述请求消息中的操作指令为数据更改操作 指令时, 根据所述数据更改操作指令获取与所述数据更改操作指令 对应的事务类型;所述服务端根据得到的所述数据更改操作指令和 事务类型进行操作。
本发明实施例还提供了一种事务控制系统, 包括服务端和至 少一个终端, 所述终端, 用于向所述服务端发送请求消息; 所述 服务端, 用于接收并解析所述终端发送的请求消息, 在所述请求 消息中的操作指令为数据更改操作指令时, 根据所述数据更改操作 指令获取所述请求消息中携带的所述终端请求的事务类型;并根据 得到的所述数据更改操作指令和事务类型进行操作。
本发明实施例还提供了一种服务端, 包括请求接收模块、 判 断模块和事务处理模块, 所述请求接收模块, 用于接收终端发送 的请求消息; 所述判断模块, 用于解析所述请求接收模块接收到 的请求消息, 在所述请求消息中的操作指令为数据更改操作指令 时, 通知所述事务处理模块; 所述事务处理模块, 用于在所述判 断模块判断所述请求消息中的操作指令为数据更改操作指令时,根 据所述数据更改操作指令获取与所述数据更改操作指令对应的事务 类型; 根据得到的所述数据更改操作指令和事务类型进行操作。
本发明实施例还提供了一种终端, 包括请求发送模块, 用于 向服务端发送请求消息, 所述请求消息携带有所述终端请求的事 务类型。
与现有技术相比, 本发明实施例因为采用通过在终端发送的 请求消息中添加相应的事务类型, 使得服务端能够识别终端所请 求的事务类型并做相应的处理。 这样就使得服务端能够根据终端 具体的应用要求对 XCAP批量处理做事务控制。 对于批量数据添 加操作, 则可以选择多事务类型, 过滤掉非法的数据; 对于一些 需要保持事务一致性的批处理操作, 可以选择单事务类型, 从而 增强了 XCAP信令的实用性和灵活性, 增强了终端用户的体验。 附图说明
图 1为本发明实施例事务控制方法流程图
图 2为本发明另一实施例事务控制方法流程图;
图 3为本发明又一实施例事务控制方法流程图;
图 4为本发明一个实施例事务控制方法流程图;
图 5为本发明实施例事务控制系统结构图。
具体实施方式
下面结合附图和实施例, 对本发明的具体实施方式作进一步 详细描述:
本发明实施例通过在终端发送的请求消息中添加相应的事务 类型, 使得服务端能够识别终端所请求的事务类型并做相应的处 理。 这样就使得终端能够根据终端具体的应用要求对 XCAP批量 处理做事务控制。 对于批量数据添加操作, 可以选择多事务类型 进行操作, 一次导入操作就按照一个数据库事务执行, 记录一次 操作结果, 这样对于数据添加操作来说, 每次添加都不受其他添 加操作的影响, 能够过滤掉非法的数据。 对于多事务方式来说, 如果每个操作指令中含有非法数据, 将不能操作成功, 但只影响 当次操作, 其它正常的数据操作不受影响。 例如, 假定某个属性 是数值型, 只能取 0~9 , 可是传入的参数中含 a~z或其它字符, 这 就导致这条数据不能正常写入。 若采用单事务, 就会因为这条数 据不能正常写入导致其它操作也不能进行。 所以多事务可以在批 量导入数据时有效过滤非法数据。 而对于一些需要保持事务一致 性的批处理操作, 则可以选择单事务类型进行操作。
如图 1 所示, 为本发明实施例事务控制方法流程图, 包括以 下步骤:
步骤 S101 , 服务端接收终端的请求消息;
步骤 S102, 服务端解析请求消息, 在请求消息中的操作指令为 数据更改操作指令时,根据数据更改操作指令获取与数据更改操作指 令对应的事务类型;
步骤 S103 , 服务端根据得到的数据更改操作指令和事务类型进 行操作。
本发明实施例, 使得服务端能够根据终端具体的应用要求对 XCAP批量处理做事务控制。对于批量数据添加操作, 则可以选择 多事务类型, 过滤掉非法的数据; 对于一些需要保持事务一致性 的批处理操作, 可以选择单事务类型, 从而增强了 XCAP信令的 实用性和灵活性, 增强了终端用户的体验。
如图 2 所示, 为本发明另一实施例事务控制方法流程图, 该 实施例是在上一实施例的基础上, 根据数据更改操作指令获取请求 消息中携带的与数据更改操作指令对应的终端请求的事务类型。该实 施例包括以下步骤: 步骤 S201 , 服务端接收终端的请求消息;
步骤 S202, 服务端解析请求消息, 在请求消息中的操作指令为 数据更改操作指令时,根据数据更改操作指令获取请求消息中携带的 终端请求的事务类型;
步骤 S203 , 服务端根据得到的数据更改操作指令和事务类型进 行操作。
本发明实施例, 使得服务端能够根据终端具体的应用要求对 XCAP批量处理做事务控制。对于批量数据添加操作, 则可以选择 多事务类型, 过滤掉非法的数据; 对于一些需要保持事务一致性 的批处理操作, 可以选择单事务类型, 从而增强了 XCAP信令的 实用性和灵活性, 增强了终端用户的体验。
如图 3 所示, 为本发明又一实施例事务控制方法流程图, 与 上一实施例不同的是, 本实施例是根据得到相应的数据更改操作指 令,并根据所述数据更改操作指令查询与所述数据更改操作指令对应 的事务类型。 本实施例包括以下步骤:
步骤 S301 , 服务端接收终端的请求消息;
步骤 S302, 服务端解析请求消息, 得到相应的数据更改操作指 令,并根据数据更改操作指令查询与数据更改操作指令对应的事务类 型;
步骤 S303 , 服务端根据得到的数据更改操作指令和事务类型进 行操作。
本发明实施例, 使得服务端能够根据终端具体的应用要求对 XCAP批量处理做事务控制。对于批量数据添加操作, 则可以选择 多事务类型, 过滤掉非法的数据; 对于一些需要保持事务一致性 的批处理操作, 可以选择单事务类型, 从而增强了 XCAP信令的 实用性和灵活性, 增强了终端用户的体验。
如图 4 所示, 为本发明实施例事务控制方法流程图, 以终端 向服务端发送的请求消息为批处理请求消息为例, 包括以下步骤: 步骤 S401 , 终端向服务端发送批处理请求消息, 并根据自身 具体的应用要求在批处理请求消息中添加终端请求的事务类型。 作为本发明的一个具体实施例, 在批处理请求消息的消息体的外 层标签(如 list标签) 中增加事务类型属性(如 affair type ), 通过 所述事务类型属性的取值体现终端请求的事务类型, 如该属性取 值为 SINGLE_AFFAIR 时认为是单事务类型, 该属性取值为 MULTI_ AFFAIR时认为是多事务类型。
如:
<xs:element name="list">
<xs: complexTypo
<xs:sequence>
</xs:sequence>
<xs: attribute name="affairtype" type= " aff airType " use="required"/>
</xs: complexTypo
</xs:element> 其中, 对 aff airType的定义如下:
<xs:simpleType name: "aff air Type ">
<xs restriction base="xs:token">
<xs: enumeration value="SINGLE_AFFAIR"/>
<xs: enumeration value="MULTI_AFFAIR"/>
</xs:restriction>
</xs:simpleType> 其中, 单事务类型是指服务端在一个数据库事务中执行所述 批处理请求消息中的所有操作指令, 任何一次数据库操作失败都 将重新处理整个事务。 单事务类型处理的结果是: 要么全部成功, 要么全部失败, 也就是说一旦有一个操作指令出现错误, 则就认 为该批处理请求消息执行失败, 这样的操作对于保持事务一致 < 1"生 的批处理操作是非常有好处的。 多事务类型为服务端对所述批处 理请求消息中的每个操作指令都按照一个数据库事务执行。 服务 端对于每次数据库操作均视为独立的事务, 并记录操作结果, 任 何一次数据库操作失败只回滚当前事务, 不影响本次批处理请求 消息的其它数据库操作指令。 多事务处理的结果是: 应答消息中 可能会出现部分成功部分失败的情况, 但这是正常的。
为了便于理解上述实施例, 以下就以添加修改为例, 假定指 定按"多事务类型 "执行, 具体的请求消息如下:
<list xmlns="..." affairtype ="MULTI_ AFFAIR ">
<auid name="org.openmobilealliance. user-profile" >
<file name="index.xml"> </file>
</auid>
<auid name="resource-lists" >
<file name="friend.xml">
...
</file>
</auid>
</list> 需要说明的是, 在上述实施例中通过在批处理请求消 , 的消 息体的外层标签中增加事务类型属性仅为本发明实施例较优的实 现方式, 还可通过批处理请求消息的类似标签中增加相应的属性、 或者通过添加新的参数来实现批处理请求消息携带事务类型的目 的。 因此关于如何将事务类型添加到批处理请求消息中的类似变 化也均应为本发明实施例保护范围所涵盖。
步骤 S402, 服务端接收并解析终端发送的批处理请求消息, 并判断该批处理请求消息中的操作指令是否为数据更改操作指 令。 作为本发明实施例的优选方案, 在读操作中因为不存在事务 一致性等问题, 因此无需对读操作指令按照事务处理流程进行处 理, 因此只有在操作指令为添加、 删除或修改等数据更改操作指 令时, 才对终端的批处理请求进行事务操作。
步骤 S403 , 如果该批处理请求消息中的操作指令为读操作指 令, 则对 XML文档进行读操作。 该读操作处理完毕后, 由服务端 向终端返回应答消息, 该应答消息中携带有服务端对该读操作的 操作结果。
步骤 S404, 如果该批处理请求消息中的操作指令为添加、 删 除或修改等数据更改操作指令, 则进一步判断该终端请求的是单 事务类型, 还是多事务类型。
步骤 S405 , 如果该终端请求的是单事务类型, 则服务端需要 在一个数据库事务中完成批处理请求中所有要处理的文档操作, 如批量增加、 修改、 删除文档或文档中的节点, 任何一次数据库 操作失败均回滚整个事务, 或者全成功, 或者全失败。
步骤 S406, 如果该终端请求的是多事务类型, 则服务端将批 处理请求中的每个文档操作视为一个独立的事务, 对一个文档的 多个节点操作时, 则构造一个 SQL语句执行, 确保对一个文档的 操作是单事务, 任何一次数据库操作的结果均不影响其它数据操 作。
步骤 S407 , 在步骤 S405、 步骤 S406服务端对批处理请求执 行完毕之后, 服务端向终端返回应答消息, 该应答消息中携带有 服务端对所述批处理请求消息的操作结果, 如成功或失败。 作为 本发明的一个具体实施例, 在步骤 S407的实施例中, 在应答消息 中通过 500表示修改失败, 通过 200表示修改成功。 <list xmlns="… ">
<auid name="org.openmobilealliance. user-profile ">
<file name="index.xml">
<result>500</result>
<etag>reeeedd</etag>
</file>
</auid>
<auid name="resource-lists">
<file name="friend.xml">
<result>200</result>
<etag>reeeedd</etag>
</file>
</auid>
</list> 当然在上述实施例中通过终端发送事件类型为较优的实施方 式, 但是也可在服务端侧通过配置文件、 DB ( Data Base , 数据库) 等方式配置某种业务操作的批处理事务类型, 在服务端启动时载 入, 在收到批处理请求后, 按约定的事务处理方式执行数据操作 并返回应答。 具体为服务端接收终端的批处理请求消息; 服务端 解析批处理请求消息得到相应的数据更改操作指令, 并根据所述 数据更改操作指令查询对应的事务类型; 服务端根据得到的所述 数据更改操作指令和事务类型进行操作。
这种方式虽然不用从终端发起的批处理请求中携带事务类 型, 但 XDMS通过配置的方式对业务操作的事务类型做了约定, 这种约定本质上还是业务侧给出, 而且并没有改变 XDMS区分事 务类型进行批量数据处理的流程, 所以仍然属于本发明实施例的 保护范畴。
如图 5 所示, 为本发明实施例事务控制系统结构图, 该系统 包括服务端 1和至少一个终端 2,终端 2用于向服务端 1发送请求 消息, 该请求消息可以为批处理请求消息, 其中携带有终端 2 请 求的事务类型; 服务端 1用于接收并解析终端 2的请求消息, 得 到相应的数据更改操作指令和事务类型, 并根据得到的所述数据 更改操作指令和事务类型进行操作。
其中, 服务端 1包括请求接收模块 11、 判断模块 12和事务处 理模块 13 , 请求接收模块 11用于接收终端 2发送的请求消息; 判 断模块 12用于解析请求接收模块 11接收到的请求消息,判断该请 求消息中的操作指令是否为数据更改操作指令; 事务处理模块 13 用于在判断模块 12判断该请求消息中的操作指令为数据更改操作 指令时,根据所述数据更改操作指令获取与所述数据更改操作指令对 应的事务类型;根据得到的所述数据更改操作指令和事务类型进行 操作。
事务处理模块 13具体用于根据数据更改操作指令获取请求消息 中携带的与数据更改操作指令对应的终端请求的事务类型。
事务处理模块 13 还可以具体用于得到相应的数据更改操作指 令,并根据数据更改操作指令查询与数据更改操作指令对应的事务类 型。
其中, 服务端 1还包括非事务处理模块 14, 用于在判断模块 12 判断所述请求消息中的操作指令为非数据更改操作指令如读操 作指令时,对可扩展的标记语言 XML文档进行读操作等对应操作。
其中, 事务处理模块 13包括单事务处理子模块 131和多事务 处理子模块 132,单事务处理子模块 131用于在所述事务类型为单 事务类型时, 在一个数据库事务中执行数据更改操作指令中的所 有数据操作; 多事务处理子模块 132 用于在所述事务类型为多事 务类型时, 对所述数据更改操作指令中的每次数据库操作都按照 一个数据库事务执行。
其中, 服务端 1还包括应答消息发送模块 15 , 用于在事务处 理模块 13操作完成后向终端 2返回应答消息, 该应答消息中携带 有请求消息的操作结果。
其中, 终端 2包括请求发送模块 21和响应消息接收模块 22, 请求发送模块 21用于向服务端 1发送请求消息, 请求消息携带有 的终端 2请求的事务类型; 响应消息接收模块 22用于接收服务端 1返回的应答消息, 该应答消息中携带有请求消息的操作结果。
本发明实施例通过在终端发送的请求消息中添加相应的事务 类型, 使得服务端能够识别终端所请求的事务类型并做相应的处 理。 这样就使得服务端能够根据终端具体的应用要求对 XCAP批 量处理做事务控制。 对于批量数据添加操作, 则可以选择多事务 类型, 过滤掉非法的数据; 对于一些需要保持事务一致性的批处 理操作, 可以选择单事务类型, 从而增强了 XCAP信令的实用性 和灵活性, 增强了终端用户的体验。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解 到本发明可以通过硬件实现,也可以可借助软件加必要的通用硬件平 台的方式来实现基于这样的理解,本发明的技术方案可以以软件产品 的形式体现出来, 该软件产品可以存储在一个非易失性存储介质(可 以是 CD-ROM, U盘, 移动硬盘等) 中, 包括若干指令用以使得一 台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行 本发明各个实施例所述的方法。
总之, 以上所述仅为本发明的较佳实施例而已, 并非用于限定本 发明的保护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权利要求
1、 一种事务控制方法, 其特征在于, 包括以下步骤:
服务端接收终端的请求消息;
所述服务端解析所述请求消息,在所述请求消息中的操作指令为 数据更改操作指令时,根据所述数据更改操作指令获取与所述数据更 改操作指令对应的事务类型;
所述服务端根据得到的所述数据更改操作指令和事务类型进行 操作。
2、 如权利要求 1所述事务控制方法, 其特征在于, 所述根据所 述数据更改操作指令获取与所述数据更改操作指令对应的事务类型, 具体为:
根据所述数据更改操作指令获取所述请求消息中携带的与所述 数据更改操作指令对应的所述终端请求的事务类型。
3、 如权利要求 1或 2所述事务控制方法, 其特征在于, 所述数 据更改操作指令包括添加操作指令、 删除操作指令或修改操作指令。
4、 如权利要求 2所述事务控制方法, 其特征在于, 所述获取所 述请求消息中携带的所述终端请求的事务类型具体为:
获取所述请求消息的消息体外层标签携带的事务类型属性,通过 所述事务类型属性的取值获取所述终端请求的事务类型。
5、 如权利要求 1或 4所述事务控制方法, 其特征在于, 所述事 务类型包括单事务类型和多事务类型,
所述单事务类型为所述服务端在一个数据库事务中执行所述请 求消息中的所有操作指令;
所述多事务类型为所述服务端对所述请求消息中的每个操作指 令都按照一个数据库事务执行。
6、 如权利要求 1所述事务控制方法, 其特征在于, 所述方法还 包括以下步骤:
所述服务端向所述终端返回应答消息,所述应答消息中携带有所 述根据得到的所述数据更改操作指令和事务类型进行操作后的结果。
7、 如权利要求 1所述事务控制方法, 其特征在于, 所述根据所 述数据更改操作指令获取与所述数据更改操作指令对应的事务类型, 具体为:
得到相应的数据更改操作指令,并根据所述数据更改操作指令查 询与所述数据更改操作指令对应的事务类型。
8、 一种事务控制系统, 其特征在于, 包括服务端和至少一个终 端 ,
所述终端, 用于向所述服务端发送请求消息;
所述服务端, 用于接收并解析所述终端发送的请求消息, 在所述 请求消息中的操作指令为数据更改操作指令时,根据所述数据更改操 作指令获取所述请求消息中携带的所述终端请求的事务类型;并根据 得到的所述数据更改操作指令和事务类型进行操作。
9、 一种服务端, 其特征在于, 包括请求接收模块、 判断模块和 事务处理模块,
所述请求接收模块, 用于接收终端发送的请求消息;
所述判断模块, 用于解析所述请求接收模块接收到的请求消息, 在所述请求消息中的操作指令为数据更改操作指令时,通知所述事务 处理模块;
所述事务处理模块,用于在所述判断模块判断所述请求消息中的 操作指令为数据更改操作指令时,根据所述数据更改操作指令获取与 所述数据更改操作指令对应的事务类型;根据得到的所述数据更改操 作指令和事务类型进行操作。
10、 如权利要求 9所述的服务端, 其特征在于, 所述事务处理模 块具体用于根据所述数据更改操作指令获取所述请求消息中携带的 与所述数据更改操作指令对应的所述终端请求的事务类型。
11、 如权利要求 9所述服务端, 其特征在于, 所述事务处理模块 具体用于得到相应的数据更改操作指令,并根据所述数据更改操作指 令查询与所述数据更改操作指令对应的事务类型。
12、 如权利要求 9所述服务端, 其特征在于, 还包括非事务处理 模块,用于在所述判断模块判断所述请求消息中的操作指令为非数据 更改操作指令时, 对可扩展的标记语言 XML文档进行读操作。
13、 如权利要求 9所述服务端, 其特征在于, 所述事务处理模块 包括单事务处理子模块和多事务处理子模块,
所述单事务处理子模块, 用于在获取的事务类型为单事务类型 时, 在一个数据库事务中执行数据更改操作指令中的所有数据库操 作;
所述多事务处理子模块, 用于在获取的事务类型为多事务类型 时,对所述数据更改操作指令中的每次数据库操作都按照一个数据库 事务执行。
14、 如权利要求 9所述服务端, 其特征在于, 还包括应答消息发 送模块,用于在所述事务处理模块操作完成后向所述终端返回应答消 息, 所述应答消息中携带有所述事务处理模块的操作结果。
15、 一种终端, 其特征在于, 包括请求发送模块, 用于向服务端 发送请求消息, 所述请求消息携带有所述终端请求的事务类型。
16、 如权利要求 15所述的终端, 其特征在于, 还包括响应消息 接收模块, 用于接收服务端返回的应答消息, 所述应答消息中携带 有所述请求消息的操作结果。
PCT/CN2008/073585 2007-12-21 2008-12-18 Procédé, système et appareil de contrôle d'affaire WO2009082938A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP08868480A EP2224661A1 (en) 2007-12-21 2008-12-18 A method, system and apparatus of affair control
US12/633,368 US20100088395A1 (en) 2007-12-21 2009-12-08 Method, system and apparatus for controlling affairs

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710301955.0 2007-12-21
CN200710301955.0A CN101212481A (zh) 2007-12-21 2007-12-21 一种事务控制方法、系统和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/633,368 Continuation US20100088395A1 (en) 2007-12-21 2009-12-08 Method, system and apparatus for controlling affairs

Publications (1)

Publication Number Publication Date
WO2009082938A1 true WO2009082938A1 (fr) 2009-07-09

Family

ID=39612146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/073585 WO2009082938A1 (fr) 2007-12-21 2008-12-18 Procédé, système et appareil de contrôle d'affaire

Country Status (4)

Country Link
US (1) US20100088395A1 (zh)
EP (1) EP2224661A1 (zh)
CN (1) CN101212481A (zh)
WO (1) WO2009082938A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212481A (zh) * 2007-12-21 2008-07-02 华为技术有限公司 一种事务控制方法、系统和装置
CN102136976B (zh) * 2011-02-24 2014-12-31 华为技术有限公司 一种机器事务控制方法、装置和系统
CN103577408A (zh) * 2012-07-19 2014-02-12 中兴通讯股份有限公司 数据库访问方法和装置
CN106503007B (zh) * 2015-09-08 2019-07-23 阿里巴巴集团控股有限公司 数据库操作方法及装置
CN111858641A (zh) * 2020-07-30 2020-10-30 中国工商银行股份有限公司 事务处理方法、装置、电子设备和可读存储介质
CN113760845A (zh) * 2020-08-17 2021-12-07 北京沃东天骏信息技术有限公司 一种日志处理方法、系统、装置、客户端及存储介质
CN112882801B (zh) * 2021-01-28 2022-09-02 杭州衣科信息技术股份有限公司 一种基于mq的分布式事务实现方法
CN115879098B (zh) * 2023-02-20 2023-05-05 北京麟卓信息科技有限公司 一种基于原子事务操作的安卓应用安装优化方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1845457A1 (en) * 2006-04-12 2007-10-17 Tietoenator Oyj Document management architecture
CN101079789A (zh) * 2006-05-27 2007-11-28 华为技术有限公司 一种xml文档管理方法及系统
CN101080041A (zh) * 2007-03-13 2007-11-28 中兴通讯股份有限公司 一种通讯系统中建立通讯业务连接的方法
CN101212481A (zh) * 2007-12-21 2008-07-02 华为技术有限公司 一种事务控制方法、系统和装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007090332A1 (en) * 2006-02-10 2007-08-16 Huawei Technologies Co. , Ltd. A method and system for managing xml document

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1845457A1 (en) * 2006-04-12 2007-10-17 Tietoenator Oyj Document management architecture
CN101079789A (zh) * 2006-05-27 2007-11-28 华为技术有限公司 一种xml文档管理方法及系统
CN101080041A (zh) * 2007-03-13 2007-11-28 中兴通讯股份有限公司 一种通讯系统中建立通讯业务连接的方法
CN101212481A (zh) * 2007-12-21 2008-07-02 华为技术有限公司 一种事务控制方法、系统和装置

Also Published As

Publication number Publication date
EP2224661A1 (en) 2010-09-01
CN101212481A (zh) 2008-07-02
US20100088395A1 (en) 2010-04-08

Similar Documents

Publication Publication Date Title
WO2009082938A1 (fr) Procédé, système et appareil de contrôle d&#39;affaire
US8844030B2 (en) Anti-virus protection system and method thereof
US9165031B2 (en) Retrieving stored data using a web service
US8321503B2 (en) Context-specific network resource addressing model for distributed services
WO2005124554A2 (en) Two-stage network device configuration process
US8589569B2 (en) Method and apparatus for invoking a plug-in on a server
CN107103011B (zh) 终端数据搜索的实现方法和装置
CN114503535A (zh) 经由服务代理调用网络服务
US10262024B1 (en) Providing consistent access to data objects transcending storage limitations in a non-relational data store
US8352442B2 (en) Determination of an updated data source from disparate data sources
US11841842B2 (en) Method and system for using external content type object types
WO2008049348A1 (fr) Procédé et système, client, serveur de gestion de document xml
US20190227985A1 (en) Method and system for using dynamic content types
JP4271967B2 (ja) 分散ファイルシステム及び分散ファイルシステムの運用方法
US20140365430A1 (en) Information processing apparatus, system, and control method
US11394748B2 (en) Authentication method for anonymous account and server
US8725765B2 (en) Hierarchical registry federation
US11205049B2 (en) Method for managing semantic information on M2M/IoT platform
CN107526530B (zh) 数据处理方法和设备
US11386072B1 (en) Automatic consistency for database write forwarding
US11886439B1 (en) Asynchronous change data capture for direct external transmission
US20210144217A1 (en) Service communication proxy apparatus and method
JP2015197810A (ja) サーバー装置、情報処理方法及びプログラム
US11663058B1 (en) Preemptive filtering of events of an event bus with a deterministic filter
US20230247081A1 (en) Declarative rendering of hypertext transfer protocol headers

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2008868480

Country of ref document: EP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08868480

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE