WO2010069207A1 - Canceling synchronization method and device thereof - Google Patents

Canceling synchronization method and device thereof Download PDF

Info

Publication number
WO2010069207A1
WO2010069207A1 PCT/CN2009/074655 CN2009074655W WO2010069207A1 WO 2010069207 A1 WO2010069207 A1 WO 2010069207A1 CN 2009074655 W CN2009074655 W CN 2009074655W WO 2010069207 A1 WO2010069207 A1 WO 2010069207A1
Authority
WO
WIPO (PCT)
Prior art keywords
peer
cancel
notification
cancellation
canceling
Prior art date
Application number
PCT/CN2009/074655
Other languages
French (fr)
Chinese (zh)
Inventor
易永健
李克鹏
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2010069207A1 publication Critical patent/WO2010069207A1/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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • 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

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for canceling a peer. Background technique
  • SyncML Synchronization Markup Language
  • Any terminal device can access any network data anytime, anywhere.
  • a typical application of SyncML is the data peer between mobile devices and network services.
  • SyncML can also be used for peer-to-peer data peers, such as between two PCs.
  • each step may contain multiple messages (MSG), and each message represents a mutual interaction between the peers (such as client->server, or server->client) ).
  • MSG multiple messages
  • each message represents a mutual interaction between the peers (such as client->server, or server->client) ).
  • An embodiment of the present invention provides a method for canceling a peer, including:
  • An embodiment of the present invention provides a method for canceling a peer, including:
  • the peer is cancelled according to the cancel peer control information.
  • An embodiment of the present invention provides a peer device, including:
  • a notification generating unit configured to generate a cancel peer notification when the peer needs to be canceled
  • a notification sending unit configured to send the cancel peer notice to the peer, so that the peer is in accordance with the cancellation ⁇ Notify cancel the same.
  • An embodiment of the present invention provides a peer device, including:
  • a notification receiving unit configured to receive a cancel peer notification sent by a peer of the peer
  • a parsing unit configured to parse the cancel peer notification, and identify cancellation peer control information included in the cancel peer notification
  • the cancellation unit is used to cancel the peer according to the cancellation of the peer control information.
  • the method and device for canceling the peer are provided by the embodiment of the present invention, and the peer of the peer is notified by sending the cancellation cancellation notice, so that the peer of the peer can cancel the peer and release the peer in time after receiving the notification.
  • Related resources thereby saving system resources.
  • 1 is a flow chart of a method for canceling a peer in an embodiment of the present invention
  • 2 is a flow chart of a method for canceling a peer in another embodiment of the present invention
  • FIG. 3 is a schematic structural view of a homophone device in an embodiment of the present invention.
  • FIG. 4 is a schematic structural view of a homophone device according to another embodiment of the present invention.
  • FIG. 5 is a flow chart of a method for canceling a peer in a specific embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a method for canceling a peer in an embodiment of the present invention, including:
  • Peer can be between the client (such as a mobile phone, a personal computer, etc.) and the server, or it can be between two servers.
  • canceling the peer it means that when the peer party receives the request to cancel the peer, or when a special situation occurs, such as when the memory is full or an error occurs, the cancellation of the peer is performed, and the cancellation of the peer is performed, and Generate a cancel peer notification.
  • the generated cancellation notice can use the code retained in the peer markup language SyncML; or, use the control parameter added in the transport protocol to cancel the peer.
  • the control parameters can be located in any of the transport protocol header, request parameters, and message body.
  • the code generated in the SyncML using the peer markup language is used to cancel the canceled peer notice.
  • 226-250 is reserved code.
  • the cancellation of the peer notification may be adopted 226-
  • the alarm code in 250 means to cancel this peer.
  • the alarm code can be included in the message body of the transport protocol. Take HTTP (Hypertext Transfer Protocol) as an example.
  • HTTP Hypertext Transfer Protocol
  • the message message can be as follows:
  • the special alarm code 226 in ⁇ Data>226 ⁇ /Data> indicates that the same party is notified to cancel the synchronization.
  • the above transport protocol can also be other available bearer protocols, such as OBEX (object Exchange protocol, Object Exchange) and WSP (Wireless Session Protocol)
  • the cancellation of the peer notification may also use the reserved code indication to cancel the peer in the Status of the peer command. In this way, after receiving the Status, the receiver can know that the other party wants to cancel the peer, and the two parties end the peer operation.
  • message packets are as follows:
  • a code 519 means cancel peers -->
  • status code 519 indicates that peers are canceled during the peer process.
  • the receiver can perform the operation of canceling the peer by extracting the status code 519 and parsing its meaning.
  • control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
  • the transport protocol can be HTTP, OBEX, WSP, etc. Take the HTTP bearer mode as an example. For example, when you need to cancel the peer, add the control parameter "X-DS-Abort-Sync" to the HTTP header, and set the X-DS-Abort-Sync value to True, indicating that the other party canceled the same class. When you do not need to cancel the peer, do not carry this parameter in the HTTP header or set the X-DS-Abort-Sync value to False.
  • the message body can have various forms. The examples are as follows:
  • control parameter ⁇ 1) 0118 1 ⁇ /> to notify the other party to cancel the peer.
  • control parameters can be determined by the peers and can be expressed in multiple ways.
  • the peer notice is sent to the peer party, and the action can be performed before and after the sender performs the action of canceling the peer.
  • the cancellation of the peer notification is sent to the peer of the peer, so that the other party can cancel the peer in time after receiving the notification.
  • the peer can also accept the cancel peer response sent by the other party after sending the cancel cancellation notice.
  • the cancellation of the peer response indicates that the other party has successfully canceled the peer.
  • the specific form and content of the cancel peer response message are shown in the embodiment shown in FIG. 2, and are not described herein.
  • both peers may simultaneously have multiple databases, or perform some non-identical operations, such as exchanging device information of both parties and authenticating information of both parties.
  • canceling a peer may simply end the peer operation and does not mean ending the peer session and disconnecting the peer.
  • the sender of the canceled peer can actively disconnect the peer, or disconnect the peer according to the instructions of the peer.
  • the indication of disconnecting the peer connection may be included in the cancellation of the peer notification; it may also be sent separately, and may be sent separately after receiving the response message, or may be sent before the response message is received.
  • the sender can disconnect the peer immediately, or wait until the other party responds before disconnecting the peer.
  • the specific operation can be to close the peer port.
  • a code can be used to indicate the two meanings, or a new command can be added to indicate the disconnection of the peer.
  • the special alarm code 226 in ⁇ Data>226 ⁇ /Data> is used to cancel the peer, it also means to disconnect the peer; similarly, the status code 519, or ⁇ 1) 0118 1 ⁇ /> command can also be used. Indicates that the peer is canceled, which also means disconnecting the peer.
  • a command may be added to the cancellation of the peer notification to indicate the disconnection of the peer connection, or the notification of disconnecting the peer connection may be separately sent to indicate.
  • the message message is as follows:
  • the above code may be included in the cancellation of the same notification, or it may be included in ⁇ 8 1 ⁇ 8 0 (1 > as a separate message.
  • control parameter ⁇ CloseSession>, to indicate that the peer connection is broken. It can be included in the notification to cancel the peer, or it can be sent separately.
  • Receivers who receive this command can choose to reply or not reply to this message.
  • you select a reply you will reply ⁇ Status> with a return code of 200 (OK), indicating that you agree to disconnect the peer.
  • the receiver performs the operation of disconnecting the peer connection according to this command, which may be to close the peer port.
  • the anchor values of both peers do not need to be updated, and the original anchor value is maintained.
  • the peer anchor value is mainly used to record the position in the peer process and is used for the resume of the breakpoint.
  • the indication of the disconnection of the peer is sent to the other party, and the peer connection is disconnected after the transmission, and the peer-related resources are released in time.
  • FIG. 2 is a flowchart of a method for canceling a peer in another embodiment of the present invention, including:
  • Peer can be between the client (such as a mobile phone, a personal computer, etc.) and the server, or it can be between two servers.
  • client such as a mobile phone, a personal computer, etc.
  • server or it can be between two servers.
  • the cancellation of the cancellation notice sent by the other party is received.
  • the cancellation of the peer notification may use the code retained in the peer markup language SyncML or the control parameter added in the transport protocol to indicate cancellation of the peer.
  • Cancellation of peer information indicates that canceling the peer information is canceling the peer control information, that is, canceling the peer control information may include: canceling the same in the peer notification to indicate the cancellation of the same peer markup language SyncML Or; a control parameter added to the transmission protocol that cancels the peer notification to indicate cancellation of the peer.
  • the specific operation of canceling the peer can be to stop the operation of the peer only.
  • the two parties can still maintain the peer connection, and the peer port is not closed, but the peer operation is no longer performed.
  • the peer cancellation operation is performed by parsing the cancel peer notification sent by the peer, and the consistency between the peers in canceling the peer is achieved, so that the peer-related resources are released in time.
  • the canceling peer response may be sent to the sender canceling the peer notification, and the cancel peer response notification may be sent as a message.
  • the control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
  • SyncML's existing Special Alert code 226-250 is reserved.
  • the cancellation of the peer response may indicate that the peer has been successfully cancelled by using any of the alarm codes 226-250, but the code used in the embodiment of FIG. 1 is required to notify the other party to cancel the peer. the difference.
  • the alarm code can be included in the message body of the transport protocol. Take the Hypertext Transfer Protocol (HTTP) as an example.
  • HTTP Hypertext Transfer Protocol
  • the message message can be as follows:
  • the ⁇ 0 1 >200 ⁇ /0 1 > in the example message one and the code 200 in the example message 2 indicate that the peer has been successfully cancelled.
  • the above transport protocols may also be other available bearer protocols, such as OBEX and WSP.
  • control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
  • the transport protocol can be HTTP, OBEX, WSP, etc. Take the HTTP bearer as an example. If the control parameter "X-Abort-Sync-Result: 200" is added to the HTTP header, it means that the peer has been successfully canceled.
  • control parameters in the HTTP message body such as ⁇ 1)0118 1 ⁇ 0 /> to indicate that the peer has been successfully canceled.
  • the sender canceling the peer operation and recording the cancellation of the peer notification may also be recorded. Specifically, it is recorded in the log, and it is possible to record the cancellation of the same operation as the other party cancels the peer.
  • the server can record the cancel peer operation in the log after canceling the peer operation according to the notification, which can be recorded as: "The client cancels the peer";
  • the cancellation of the same operation can be recorded in the log as: "Server cancels the peer".
  • the receiver that cancels the peer notification can also actively disconnect the peer or disconnect the peer according to the instructions of the peer.
  • the cancel peer response may include an indication to disconnect the peer connection, or the receiver canceling the peer notification separately sends a notification indicating that the other party disconnects the peer.
  • the receiver that cancels the peer notification can use the ⁇ 11> command in the cancel peer response to indicate the disconnection of the peer connection, or the ⁇ AbortSyncOK/> command definition has successfully canceled the peer and indicates the disconnection ⁇ Connect.
  • An example of using the ⁇ Alert> command can be seen in the description of the embodiment as shown in FIG.
  • the receiver uses ⁇ 81 8> to send back an error response, such as a return code of 520, indicating that the session is abnormal and disconnects the peer.
  • the receiver can perform the disconnection of the peer connection after sending the response, specifically by closing the peer port.
  • the receiver that cancels the peer notification is sent to the opposite party by sending an indication of disconnecting the peer, and disconnects the peer after the transmission, and releases the network resource in time.
  • FIG. 3 is a schematic structural diagram of a homophone device according to an embodiment of the present invention, including:
  • the notification generating unit 301 is configured to generate a cancel peer notification when the peer needs to be canceled; specifically, when the peer device receives the request to cancel the peer, or when a special situation occurs, such as when the memory is full or an error occurs When the peer needs to be canceled, the notification generation unit generates a cancellation cancellation notice.
  • the generated canceled peer notification can use the code reserved in the peer markup language SyncML to indicate cancellation of the peer; or, by adding control parameters to the transport protocol, cancel the peer. See the example in 101 for details.
  • the notification sending unit 302 is configured to send the canceled peer notification to the peer of the peer, so that the peer of the peer cancels the peer according to the canceled peer notification.
  • the peer device in this embodiment sends a cancel cancellation notice to the peer of the peer when the peer needs to be canceled, so that the other party can cancel the peer in time after receiving the notification.
  • the peer device may further include a response receiving unit 303 for receiving a cancel peer response sent by the peer.
  • a response receiving unit 303 for receiving a cancel peer response sent by the peer.
  • the notification generating unit 301 may simultaneously include an indication of disconnecting the peer connection in the cancellation of the peer notification when the cancel cancellation notification is generated, and the indication may be used to indicate the cancellation of the retention code or control of the peer.
  • the parameter is used to indicate that the cancellation of the same code or control parameter indicates that the cancellation of the peer and the disconnection of the peer are two layers; it can also be used with a reserved code or control that is different from the reserved code or control parameter that indicates cancellation of the peer.
  • the parameter indicates that the cancellation of the same notification includes a reserved code or control parameter indicating cancellation of the peer, and a reserved code or control parameter indicating that the peer connection is disconnected.
  • the indication to disconnect the peer connection may be sent using a separate notification message.
  • the notification generating unit 301 is further configured to generate a notification for instructing the other party to disconnect the peer connection, and the disconnected peer connection notification is independent of the cancellation of the peer notification.
  • the notification sending unit 302 is further configured to send the notification indicating that the other party disconnects the peer connection. That is, the notification to disconnect the peer can be sent independently of the cancellation of the peer notification.
  • the peer device can also include a disconnect unit 304 for disconnecting the peer.
  • disconnecting the peer connection means disconnecting the peer's data after stopping the transmission of the peer data.
  • the specific operation may be to close the peer port, so as to release the network resources related to the peer in time.
  • FIG. 4 is a schematic structural diagram of a peer device according to another embodiment of the present invention, which specifically includes: a notification receiving unit 401, configured to receive a cancel peer notification sent by a peer of a peer; the cancellation peer is notified by the peer Send, can be sent as a message, can use the special alert code retained in the peer markup language SyncML; or, through the transport protocol header or transport protocol Adding a control parameter to the request parameter or the transport protocol message body means canceling the peer. See the specific implementation
  • the parsing unit 402 is configured to parse the cancellation peer notification, and identify cancellation peer control information included in the cancellation peer notification;
  • the parsing unit identifies that the cancel peer control information included in the cancellation peer notification is specifically: identifying a code retained in the peer markup language SyncML included in the cancel peer notice; or identifying the cancellation included in the cancel peer notice Control parameters added in the transport protocol.
  • the cancellation unit 403 is used to cancel the peer according to the cancellation of the peer control information.
  • the cancel peer unit 403 can read the meaning of the cancel peer control information identified by the parsing unit 402, and perform the operation of canceling the peer according to the control information.
  • reception parsing unit 402 performs an instruction to cancel the peer operation according to the execution of canceling the transmission of the peer control information, and performs an operation of canceling the current peer according to the instruction. To cancel the peer's specific operation, you can close this peer session and release the resources of this peer.
  • the peer device provided by the embodiment of the present invention performs the cancellation of the peer operation by parsing the cancel peer notification sent by the peer, thereby realizing the consistency between the peers when canceling the peer, so as to release the peer-related resources in time. .
  • the peer device may further include a response generating unit 404, and the response generating unit 404 is configured to generate a cancel peer response, and the cancel peer response may use the code retained in the peer markup language SyncML; or, by Adding a control parameter to the transport protocol indicates that the peer has been successfully cancelled.
  • the response transmitting unit 405 transmits a cancel peer response to the peer.
  • the indication of disconnecting the peer connection may be included in the cancel peer notification, and the indication may be represented by a reserved code or a control parameter indicating that the peer has been successfully canceled, that is, Indicates that the retention code or control parameter of the peer has been successfully canceled and indicates that the peer has been successfully canceled and the other party is disconnected from the peer connection. It is also possible to use a reservation that is different from the reserved code or control parameter indicating that the peer has been successfully canceled.
  • the code or control parameter is used to indicate that the cancellation of the same notification includes a reserved code or control parameter indicating that the peer has been successfully canceled, and a reserved code or control parameter indicating that the peer connection is disconnected.
  • the response generating unit 404 may be further configured to generate a notification indicating that the other party disconnects the peer connection, and the instructing the other party to disconnect the peer connection notification is independent of the cancel peer notification. See the description in the embodiment of Fig. 2.
  • the response sending unit 405 is further configured to send the notification indicating that the other party disconnects the peer connection. That is, the notification indicating that the other party disconnects the peer connection is independent of the cancellation of the peer notification transmission.
  • the peer device can also include a disconnect unit 406 for disconnecting the peer.
  • the disconnection of the peer connection means that after the transmission of the peer data is stopped, the peer connection is disconnected, and the peer port is closed, so that the resources related to the peer are released in time.
  • the peer device shown in Fig. 4 may further include a recording unit 407 for recording the cancellation of the same operation.
  • the recording unit is specifically used to record the cancellation of the same operation as the other party cancels the peer. Specifically, it is recorded in the log, and it may be that the cancellation of the same operation is recorded as the other party cancels the peer. For example, if the client sends a cancel notification to the server, the server can record the cancel peer operation in the log after canceling the peer operation according to the notification, which can be recorded as: "The client cancels the peer"; Similarly, after the client cancels the cancellation according to the canceled peer notification sent by the server, the cancellation of the same operation can be recorded in the log as: "Server cancels the peer".
  • FIG. 5 is a flow chart of an embodiment of a method for canceling a peer in accordance with the present invention. Includes:
  • One party A of the peer detects that it is necessary to cancel the peer and perform the cancellation of the peer operation.
  • A can be either a client or a server. It may be that the client detects that the user cancels the peer or the device itself needs to cancel the peer. For details on how to cancel the peer notification message, see the example in 101.
  • A generates a cancellation cancellation notice.
  • B can be either a server or a client.
  • B After receiving the cancellation cancellation notice, B parses the cancellation cancellation notification, and extracts control information indicating cancellation of the cancellation.
  • B performs the cancel peer operation according to the control information, and records the operation as “A cancels the same”.
  • Cancelling peer actions includes closing peer sessions and releasing related resources.
  • B sends a cancel peer response to A.
  • Cancelling a peer response indicates that the peer has been successfully cancelled.
  • the specific form of the response message is described in detail in the embodiment shown in FIG. 2, and details are not described herein again.
  • A sends a disconnected peer connection notification to B.
  • A disconnects the peer, specifically to close the peer port.
  • the above execution order may also be other sequences, for example, A may perform the cancellation of the peer operation after sending the cancel peer notification or receiving the cancel peer response.
  • the party cancels the notification to the peer of the peer, and the other party returns to cancel the peer response according to the peer notification, and then the peer response is realized.
  • Both parties cancel the consistency and interactivity of peer-to-peer operations in order to release relevant resources in a timely manner and improve the accuracy of peer behavior analysis. It is avoided that one party cancels the same class, and the other party does not know that the act of canceling the peer is mistakenly treated as a peer timeout.
  • the embodiment of the present invention does not need to introduce independent functional components, and can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technique of the embodiment of the present invention
  • the portion of the invention that contributes in nature or contributes to the prior art may be embodied in the form of a software product stored in a storage medium, including instructions for performing the methods described in various embodiments of the present invention. .
  • the storage medium referred to herein, such as the ROM/RAM and the magnetic assembly is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Landscapes

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

Abstract

A canceling synchronization method and a device thereof are provided by the present invention. The method includes that: a canceling synchronization notification is generated when the synchronization needs to be canceled (101); and the canceling synchronization notification is sent to the other side of the synchronization, so that the other side of the synchronization can cancel the synchronization according to the canceling synchronization notification (102). The cancel of the synchronization is indicated by a reserved code in the Synchronization Markup Language used in the canceling synchronization notification, or by a control parameter added in the transmission protocol. Thus, the consistency and timeliness of the canceling synchronization operations of the both sides of the synchronization is realized.

Description

一种取消同歩的方法及装置  Method and device for canceling peers
本申请要求了 2008年 12月 16日提交的, 申请号为 200810241224.6, 发明名称为 "一种取消同歩的方法及装置" 的中国申请优先权, 其全部内 容通过引用结合在本申请中。 技术领域  The present application claims priority to Chinese Application No. 20081024122, filed on Dec. 16, 2008, the entire disclosure of which is incorporated herein by reference. Technical field
本发明涉及通信领域, 特别涉及一种取消同歩的方法及装置。 背景技术  The present invention relates to the field of communications, and in particular, to a method and apparatus for canceling a peer. Background technique
现有技术中, SyncML ( Synchronization Markup Language 同歩标记语 言) 的目的在于, 使终端用户、 设备开发商、 基础构件开发商、 数据提供 商、 使用软件开发商以及服务提供商协同工作, 真正实现使用任何终端设备 均可随时随地访问任何网络数据。 SyncML 的典型应用是移动设备和网络服 务之间的数据同歩。 除此之外, SyncML还可用于对等的数据同歩, 如两台 PC之间。  In the prior art, SyncML (Synchronization Markup Language) aims to enable end users, device developers, infrastructure developers, data providers, software developers, and service providers to work together to achieve true use. Any terminal device can access any network data anytime, anywhere. A typical application of SyncML is the data peer between mobile devices and network services. In addition, SyncML can also be used for peer-to-peer data peers, such as between two PCs.
在一次数据同歩过程中, 每一个歩骤都可能包含多个消息 (MSG) , 而每个消息都表示一次同歩双方之间的交互 (如客户端- >服务器, 或者服务 器- >客户端) 。 以服务器和客户端之间的交互为例, 服务器在接收到来自客 户端的第一个消息后会在服务器端生成本次同歩会话 (保存用户本次同歩的 帐号、 方式、 同歩数据等相关信息) , 并在客户端返回最后一个消息时关闭 本次同歩会话 (同时释放相关资源, 记录同歩结果日志) 。  In a data peer process, each step may contain multiple messages (MSG), and each message represents a mutual interaction between the peers (such as client->server, or server->client) ). Taking the interaction between the server and the client as an example, after receiving the first message from the client, the server will generate the peer session on the server side (save the account, mode, peer data, etc. of the user this time). Related information), and close the peer session when the client returns the last message (while releasing related resources, recording the same result log).
但是, 发明人在发明过程中发现, 在实际应用过程中, 用户常常会在同 歩过程中主动取消数据同歩操作, 导致客户端与服务器之间的正常消息交互 中断。 此时, 服务器会继续等待客户端返回消息, 会将客户端取消同歩的行 为错误地当成了同歩超时, 不能及时取消同歩。 发明内容 本发明实施例提供的方案是当同歩被取消时, 取消方可以通知同歩的对 方, 以便对方能够根据该通知取消同歩。 However, the inventor found in the process of the invention that in the actual application process, the user often actively cancels the data peer operation in the peer process, resulting in interruption of the normal message interaction between the client and the server. At this point, the server will continue to wait for the client to return a message, which will mistake the client's cancellation behavior as a peer timeout and cannot cancel the peer in time. Summary of the invention The solution provided by the embodiment of the present invention is that when the peer is cancelled, the canceling party can notify the peer of the peer, so that the other party can cancel the peer according to the notification.
本发明实施例一方面提供了一种取消同歩的方法, 包括:  An embodiment of the present invention provides a method for canceling a peer, including:
当需要取消同歩时, 生成取消同歩通知;  When canceling the peer, a cancel cancellation notice is generated;
发送所述取消同歩通知给所述同歩的对方, 以便所述同歩的对方根据所 述取消同歩通知取消所述同歩。  Sending the canceled peer notification to the peer of the peer, so that the peer of the peer cancels the peer according to the cancel cancellation notice.
本发明实施例一方面提供了一种取消同歩的方法, 包括:  An embodiment of the present invention provides a method for canceling a peer, including:
接收同歩对方发送的取消同歩通知;  Receiving a cancellation notice sent by the other party;
解析所述取消同歩通知, 并识别所述取消同歩通知中包含的取消同歩控 制信息;  Parsing the cancel peer notification, and identifying cancellation peer control information included in the cancel peer notice;
根据所述取消同歩控制信息取消所述同歩。  The peer is cancelled according to the cancel peer control information.
本发明实施例一方面提供了一种同歩装置, 包括:  An embodiment of the present invention provides a peer device, including:
通知生成单元, 用于当需要取消同歩时, 生成取消同歩通知; 通知发送单元, 用于发送所述取消同歩通知给同歩的对方, 以便所述同 歩的对方根据所述取消同歩通知取消所述同歩。  a notification generating unit, configured to generate a cancel peer notification when the peer needs to be canceled, and a notification sending unit, configured to send the cancel peer notice to the peer, so that the peer is in accordance with the cancellation歩Notify cancel the same.
本发明实施例一方面提供了一种同歩装置, 包括:  An embodiment of the present invention provides a peer device, including:
通知接收单元, 用于接收同歩的对方发送的取消同歩通知;  a notification receiving unit, configured to receive a cancel peer notification sent by a peer of the peer;
解析单元, 用于解析所述取消同歩通知, 并识别所述取消同歩通知包含 的取消同歩控制信息;  a parsing unit, configured to parse the cancel peer notification, and identify cancellation peer control information included in the cancel peer notification;
取消同歩单元, 用于根据所述取消同歩控制信息取消所述同歩。  The cancellation unit is used to cancel the peer according to the cancellation of the peer control information.
本发明实施例提供的一种取消同歩的方法及装置, 通过发送取消同歩通 知给同歩的对方, 使同歩的对方可以在收到通知后, 及时取消本次同歩, 释 放同歩相关的资源, 从而节约系统资源。 附图说明  The method and device for canceling the peer are provided by the embodiment of the present invention, and the peer of the peer is notified by sending the cancellation cancellation notice, so that the peer of the peer can cancel the peer and release the peer in time after receiving the notification. Related resources, thereby saving system resources. DRAWINGS
图 1为本发明一个实施例中取消同歩的方法的流程图; 图 2为本发明另一个实施例中取消同歩的方法的流程图; 1 is a flow chart of a method for canceling a peer in an embodiment of the present invention; 2 is a flow chart of a method for canceling a peer in another embodiment of the present invention;
图 3为本发明一个实施例中的同歩装置结构示意图;  3 is a schematic structural view of a homophone device in an embodiment of the present invention;
图 4为本发明另一个实施例中的同歩装置结构示意图;  4 is a schematic structural view of a homophone device according to another embodiment of the present invention;
图 5为本发明一个具体实施例中取消同歩方法的流程图。 具体实施方式  FIG. 5 is a flow chart of a method for canceling a peer in a specific embodiment of the present invention. detailed description
为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图及 实施例, 对本发明进行进一歩详细说明。 应当理解, 此处所描述的具体实施 例仅用以解释本发明, 并不用于限定本发明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
图 1为本发明一个实施例中取消同歩的方法的流程图, 包括:  FIG. 1 is a flowchart of a method for canceling a peer in an embodiment of the present invention, including:
101当需要取消同歩时, 生成取消同歩通知;  101 When the need to cancel the peer, the cancel cancellation notice is generated;
同歩可以是在客户端 (如手机、 个人电脑等) 与服务器之间进行, 也可 以是在两台服务器之间进行。 需要取消同歩时, 是指当同歩的一方接收到取 消同歩的请求后, 或者在发生特殊情况, 如内存满或发生错误时, 需要取消 同歩时, 执行取消同歩的操作, 并生成取消同歩通知。  Peer can be between the client (such as a mobile phone, a personal computer, etc.) and the server, or it can be between two servers. When canceling the peer, it means that when the peer party receives the request to cancel the peer, or when a special situation occurs, such as when the memory is full or an error occurs, the cancellation of the peer is performed, and the cancellation of the peer is performed, and Generate a cancel peer notification.
该生成的取消同歩通知中可以使用同歩标记语言 SyncML 中保留的代 码; 或, 使用在传输协议中增加的控制参数表示取消同歩。 控制参数可以位 于传输协议消息头、 请求参数、 消息体中的任一者之中。  The generated cancellation notice can use the code retained in the peer markup language SyncML; or, use the control parameter added in the transport protocol to cancel the peer. The control parameters can be located in any of the transport protocol header, request parameters, and message body.
一种情况是, 生成使用同歩标记语言 SyncML中保留的代码表示取消同 歩的取消同歩通知中。 在 SyncML现有特殊警报代码 (Special Alert code) 中, 226-250为保留代码。 本发明实施例中, 取消同歩通知可以采用 226- In one case, the code generated in the SyncML using the peer markup language is used to cancel the canceled peer notice. In SyncML's existing Special Alert code, 226-250 is reserved code. In the embodiment of the present invention, the cancellation of the peer notification may be adopted 226-
250 中的任一警报代码表示取消本次同歩, 该警报代码可以包含在传输协议 的消息体中, 以 HTTP (超文本传输协议 Hypertext Transfer Protocol)为例, 消息报文可以如下: Any of the alarm codes in 250 means to cancel this peer. The alarm code can be included in the message body of the transport protocol. Take HTTP (Hypertext Transfer Protocol) as an example. The message message can be as follows:
<SyncML>  <SyncML>
<SyncHdr> <VerDTD>l .2</VerDTD> <SyncHdr> <VerDTD>l .2</VerDTD>
<VerProto>SyncML/l .2</VerProto>  <VerProto>SyncML/l .2</VerProto>
<SessionID>K/SessionID>  <SessionID>K/SessionID>
<MsgID>3</MsgID>  <MsgID>3</MsgID>
<Target>  <Target>
<LocURI>http://www.syncml.org/sync-server</LocURI>  <LocURI>http://www.syncml.org/sync-server</LocURI>
</Target>  </Target>
<Source>  <Source>
<LocURI>IMEI:493005100592800</LocURI>  <LocURI>IMEI:493005100592800</LocURI>
</Source>  </Source>
</SyncHdr>  </SyncHdr>
<SyncBody>  <SyncBody>
<Alert>  <Alert>
<CmdID>K/CmdID>  <CmdID>K/CmdID>
<Data>226</Data> <!一此代码 226表示取消同步—>  <Data>226</Data> <! One such code 226 means to cancel the synchronization ->
<Item>  <Item>
<Target>  <Target>
<LocURI>http:〃 www. syncml.org/ sync-server</LocURI>  <LocURI>http:〃 www.syncml.org/ sync-server</LocURI>
</Target>  </Target>
<Source>  <Source>
<LocURI>IMEI:493005100592800</LocURI>  <LocURI>IMEI:493005100592800</LocURI>
</Source>  </Source>
</Item>  </Item>
</Alert>  </Alert>
</SyncBody>  </SyncBody>
</SyncML>  </SyncML>
其中, <Data>226</Data>中的特殊警报代码 226表示通知同歩对方取消 同步本次同步。 上述传输协议也可以是其它可用承载协议, 如 OBEX (对象 交换协议, Object Exchange ) 和 WSP (无线会话协议, Wireless Session Protocol)等 The special alarm code 226 in <Data>226</Data> indicates that the same party is notified to cancel the synchronization. The above transport protocol can also be other available bearer protocols, such as OBEX (object Exchange protocol, Object Exchange) and WSP (Wireless Session Protocol)
另外, 取消同歩通知中也可以是在同歩命令的 Status中使用保留代码指 示取消同歩。 这样, 接收方收到 Status后就可以得知对方希望取消同歩, 从 而双方结束同歩操作。 消息报文举例如下:  In addition, the cancellation of the peer notification may also use the reserved code indication to cancel the peer in the Status of the peer command. In this way, after receiving the Status, the receiver can know that the other party wants to cancel the peer, and the two parties end the peer operation. Examples of message packets are as follows:
<SyncML>  <SyncML>
<SyncHdr>  <SyncHdr>
<VerDTD>l .2</VerDTD>  <VerDTD>l .2</VerDTD>
<VerProto>SyncML/l .2</VerProto>  <VerProto>SyncML/l .2</VerProto>
<SessionID>K/SessionID>  <SessionID>K/SessionID>
<MsgID>2</MsgID>  <MsgID>2</MsgID>
<Target>  <Target>
<LocURI>IMEI:493005100592800</LocURI>  <LocURI>IMEI:493005100592800</LocURI>
</Target>  </Target>
<Source>  <Source>
<LocURI>http:〃 www. syncml.org/ sync-server</LocURI>  <LocURI>http:〃 www.syncml.org/ sync-server</LocURI>
</Source>  </Source>
</SyncHdr>  </SyncHdr>
<SyncBody>  <SyncBody>
<Status>  <Status>
<CmdID>K/CmdID>  <CmdID>K/CmdID>
<MsgRef 2</MsgRef  <MsgRef 2</MsgRef
<CmdRe^O</CmdRef  <CmdRe^O</CmdRef
<Cmd>SyncHdr</Cmd>  <Cmd>SyncHdr</Cmd>
<TargetRef^http ://www. syncml.org/ sync-server</TargetRef^> <SourceReMMEI:493005100592800</SourceRef  <TargetRef^http ://www. syncml.org/ sync-server</TargetRef^> <SourceReMMEI: 493005100592800</SourceRef
<Data>519</Data> <!一代码 519表示取消同歩-- >  <Data>519</Data> <! A code 519 means cancel peers -->
</Status> </SyncBody> </Status> </SyncBody>
</SyncML>上例中, 状态码 519表示在同歩过程中取消同歩。 接收方接 受到该取消同歩通知后, 可以通过提取状态码 519并解析其含义来执行取消 同歩的操作。  </SyncML> In the above example, status code 519 indicates that peers are canceled during the peer process. After receiving the cancellation notice, the receiver can perform the operation of canceling the peer by extracting the status code 519 and parsing its meaning.
另一种方式是, 生成使用在传输协议中增加的控制参数表示取消同歩的 取消同歩通知。 控制参数可以位于传输协议消息头、 请求参数、 消息体中的 任一者之中。  Alternatively, the generation of a cancellation notification using the added control parameter in the transport protocol indicates cancellation of the peer. The control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
传输协议可以是 HTTP, OBEX和 WSP等。 以 HTTP承载方式为例, 如当需要取消同歩时, 在 HTTP消息头增加控制参数时, 如增加控制参数 "X-DS-Abort-Sync" , 并将 X-DS-Abort-Sync值设为 True, 表示通知同歩 对方取消同歩。 不需要取消同歩时, 在 HTTP消息头不携带此参数或者将 X-DS-Abort-Sync值设为 False。  The transport protocol can be HTTP, OBEX, WSP, etc. Take the HTTP bearer mode as an example. For example, when you need to cancel the peer, add the control parameter "X-DS-Abort-Sync" to the HTTP header, and set the X-DS-Abort-Sync value to True, indicating that the other party canceled the same class. When you do not need to cancel the peer, do not carry this parameter in the HTTP header or set the X-DS-Abort-Sync value to False.
也可以在 HTTP请求参数中增加控制参数, 如:  You can also add control parameters to the HTTP request parameters, such as:
POST  POST
http:〃 my.ds.com/sync?sid=MS0yMTEuMTM4LjE4NC4yMDE&Abort-Sync=y 其中, Abort-Sync=y为增加的控制参数, 表示通知对方取消同歩。 Http:〃 my.ds.com/sync?sid=MS0yMTEuMTM4LjE4NC4yMDE&Abort-Sync=y where Abort-Sync=y is the added control parameter, indicating that the other party is canceled.
另外, 还可以在 HTTP消息体中增加控制参数来通知对方取消同歩, 此 时消息体可以有多种形式, 示例如下:  In addition, you can also add control parameters to the HTTP message body to notify the other party to cancel the peer. At this time, the message body can have various forms. The examples are as follows:
示例消息一:  Example message one:
<SyncML>  <SyncML>
<AbortSync/>  <AbortSync/>
</SyncML>  </SyncML>
示例消息二:  Example message two:
<SyncML>  <SyncML>
<SyncHdr>  <SyncHdr>
</SyncHdr>  </SyncHdr>
<SyncBody> <AbortSync/> <SyncBody> <AbortSync/>
</SyncBody>  </SyncBody>
</SyncML>  </SyncML>
示例消息三:  Example message three:
<SyncML>  <SyncML>
<SyncHdr>  <SyncHdr>
<AbortSync/>  <AbortSync/>
</SyncHdr>  </SyncHdr>
<SyncBody>  <SyncBody>
</SyncBody>  </SyncBody>
</SyncML>  </SyncML>
示例消息四:  Example message four:
<AbortSync/>  <AbortSync/>
上述示例消息中使用控制参数< 1)0118 1^/>表示通知对方取消同歩。 当然, 控制参数可以由同歩各方协商确定, 可以有多种表现方式。 The above example message uses the control parameter < 1) 0118 1^/> to notify the other party to cancel the peer. Of course, the control parameters can be determined by the peers and can be expressed in multiple ways.
102发送取消同歩通知给所述同歩的对方, 以便所述同歩的对方根据所 述取消同歩通知取消所述同歩。 102 sends a cancel cancellation notice to the peer of the peer, so that the peer of the peer cancels the peer according to the cancel cancellation notice.
同歩一方生成同歩消息后, 将该同歩通知发送给同歩的对方, 该动作可 以在发送方执行取消同歩的动作之前和之后进行。  After the peer party generates the peer message, the peer notice is sent to the peer party, and the action can be performed before and after the sender performs the action of canceling the peer.
本实施例中通过在需要取消同歩时, 发送取消同歩通知给同歩的对方, 这样, 对方就可以在收到通知后, 及时取消本次同歩。  In this embodiment, when the cancellation of the peer is required, the cancellation of the peer notification is sent to the peer of the peer, so that the other party can cancel the peer in time after receiving the notification.
在图 1所示的实施例中, 同歩的一方还可以在发送取消同歩通知后, 接 受对方发送的取消同歩响应。 该取消同歩响应表示对方已经成功取消了同 歩, 取消同歩响应消息的具体形式和内容参见图 2所示的实施例, 在此不赘 述。  In the embodiment shown in Fig. 1, the peer can also accept the cancel peer response sent by the other party after sending the cancel cancellation notice. The cancellation of the peer response indicates that the other party has successfully canceled the peer. The specific form and content of the cancel peer response message are shown in the embodiment shown in FIG. 2, and are not described herein.
另外, 在同歩会话中, 同歩双方可能会同时同歩多个数据库, 或者进行 一些非同歩操作, 比如交换双方的设备信息、 交换双方的认证信息等, 在这 种情况下, 取消同歩可能只是结束同歩操作, 并不意味着结束同歩会话和断 开同歩连接。 此时, 需要双方指明或约定, 在取消同歩后是否会结束同歩会 话, 断开双方之间的连接。 因此, 在取消同歩后还可以进一歩进行断开同歩 连接操作。 In addition, in a peer-to-peer session, both peers may simultaneously have multiple databases, or perform some non-identical operations, such as exchanging device information of both parties and authenticating information of both parties. In this case, canceling a peer may simply end the peer operation and does not mean ending the peer session and disconnecting the peer. At this point, it is necessary for both parties to indicate or agree whether to terminate the peer relationship after canceling the peer and disconnect the two parties. Therefore, after canceling the peer, you can also perform the disconnection of the peer connection.
在进行断开同歩连接的操作时, 取消同歩的发送方可以主动断开同歩连 接, 也可以根据同歩对方的指示来断开同歩连接。  When disconnecting the peer connection, the sender of the canceled peer can actively disconnect the peer, or disconnect the peer according to the instructions of the peer.
当取消同歩的发送方主动断开同歩连接时, 还需要指示对方在取消同歩 后断开同歩连接。 该断开同歩连接的指示可以包含在取消同歩通知之中发 送; 也可以单独发送, 单独发送时可以是在收到响应消息后发送, 也可以是 收到响应消息之前发送。  When the sender of the canceled peer actively disconnects the peer, it is also necessary to instruct the other party to disconnect the peer after canceling the peer. The indication of disconnecting the peer connection may be included in the cancellation of the peer notification; it may also be sent separately, and may be sent separately after receiving the response message, or may be sent before the response message is received.
发送后, 发送方可以马上断开同歩连接, 也可以等到对方响应后再断开 同歩连接。 具体操作可以是关闭同歩端口。  After sending, the sender can disconnect the peer immediately, or wait until the other party responds before disconnecting the peer. The specific operation can be to close the peer port.
当断开同歩连接的指示包含在取消同歩通知之中时, 可以是用一个代码 表示两种意思, 也可以再增加一个命令来指示断开同歩连接。  When the indication to disconnect the peer is included in the cancellation of the peer notification, either a code can be used to indicate the two meanings, or a new command can be added to indicate the disconnection of the peer.
如用 <Data>226</Data>中的特殊警报代码 226即表示取消同歩, 也表示 断开同歩连接; 同样, 也可以使用状态码 519, 或< 1)0118 1^/>命令既表示 取消同歩, 也表示断开同歩连接。  If the special alarm code 226 in <Data>226</Data> is used to cancel the peer, it also means to disconnect the peer; similarly, the status code 519, or <1) 0118 1^/> command can also be used. Indicates that the peer is canceled, which also means disconnecting the peer.
当上述代码或者命令仅表示取消同歩时, 可以在取消同歩通知中增加一 个命令来指示断开同歩连接, 或者单独发送断开同歩连接的通知来指示。  When the above code or command only indicates that the peer is canceled, a command may be added to the cancellation of the peer notification to indicate the disconnection of the peer connection, or the notification of disconnecting the peer connection may be separately sent to indicate.
如可以是用 <Alert>命令来指示断开同歩连接, 消息报文举例如下: If the <Alert> command can be used to indicate the disconnection of the peer, the message message is as follows:
<Alert> <Alert>
<CmdID>K/CmdID>  <CmdID>K/CmdID>
<Data>21 K/Data><!一此代码 211表明是断开同歩连接 -- >  <Data>21 K/Data><! One of the codes 211 indicates that the peer connection is broken -->
<Item>  <Item>
<Target>  <Target>
<LocURI>http:〃 www. syncml.org/ sync-server</LocURI> </Target> <LocURI>http:〃 www.syncml.org/ sync-server</LocURI> </Target>
<Source>  <Source>
<LocURI>IMEI:493005100592800</LocURI>  <LocURI>IMEI:493005100592800</LocURI>
</Source>  </Source>
</Item>  </Item>
</Alert>  </Alert>
以上代码可以是包含在取消同歩的通知之中的, 也可以是包括在 <8 1^80(1 >之中作为一个单独消息发送。 The above code may be included in the cancellation of the same notification, or it may be included in <8 1^8 0 (1 > as a separate message.
当然, 也可以使用控制参数, <CloseSession >来表示断开同歩连接。 可以包含在取消同歩的通知之中, 也可以单独发送。  Of course, you can also use the control parameter, <CloseSession>, to indicate that the peer connection is broken. It can be included in the notification to cancel the peer, or it can be sent separately.
接收到此命令的接收方可以选择回复或不回复此消息。 选择回复时, 即 回复 <Status>, 返回码为 200 (OK) , 表示同意断开同歩连接。 接收方根据 此命令执行断开同歩连接的操作, 具体可以是关闭同歩端口。  Receivers who receive this command can choose to reply or not reply to this message. When you select a reply, you will reply <Status> with a return code of 200 (OK), indicating that you agree to disconnect the peer. The receiver performs the operation of disconnecting the peer connection according to this command, which may be to close the peer port.
在取消同歩的情况下, 同歩双方的锚值不需要更新, 保持原来的锚值。 同歩锚值主要是用于记录同歩过程中的位置, 用于断点续传。 在取消同歩的 情况下, 双方很难准确地得知同歩中断的位置。 因此, 在这种情况下, 本次 取消的同歩过程实际上不是完整的, 没有办法实现断点续传, 本次同歩视为 无效。 下次同歩时, 需要重新进行协商, 重新从上次完成的地方开始同歩。  In the case of canceling the peer, the anchor values of both peers do not need to be updated, and the original anchor value is maintained. The peer anchor value is mainly used to record the position in the peer process and is used for the resume of the breakpoint. In the case of cancellation of peers, it is difficult for both parties to accurately know where the peers are interrupted. Therefore, in this case, the cancellation process of this cancellation is actually not complete, there is no way to achieve the resume of the breakpoint, and this peer is considered invalid. The next time you are a peer, you will need to re-negotiate and start your peers again from the last completed place.
本实施例中通过发送断开同歩连接的指示给对方, 并在发送后断开同歩 连接, 及时释放了同歩相关资源。  In this embodiment, the indication of the disconnection of the peer is sent to the other party, and the peer connection is disconnected after the transmission, and the peer-related resources are released in time.
图 2为本发明另一个实施例中的取消同歩的方法的流程图, 包括: 2 is a flowchart of a method for canceling a peer in another embodiment of the present invention, including:
201接收同歩的对方发送的取消同歩通知。 201 receives the cancellation of the same party notification sent by the peer.
同歩可以是在客户端 (如手机、 个人电脑等) 与服务器之间进行, 也可 以是在两台服务器之间进行。 在进行同歩的过程中, 当对方需要取消同歩 时, 接收由对方发送的取消同歩通知。  Peer can be between the client (such as a mobile phone, a personal computer, etc.) and the server, or it can be between two servers. In the process of peering, when the other party needs to cancel the peer, the cancellation of the cancellation notice sent by the other party is received.
202解析所述取消同歩通知, 并识别所述取消同歩通知包含的取消同歩 控制信息。 其中, 取消同歩通知可以使用同歩标记语言 SyncML中保留的代码或传 输协议中增加的控制参数来表示取消同歩, 具体例子参见如图 1所示的实施 例。 取消同歩通知中表示取消同歩的信息即为取消同歩控制信息, 也就是 说, 取消同歩控制信息可以包括: 取消同歩通知中用于表示取消同歩的同歩 标记语言 SyncML中保留的代码; 或, 取消同歩通知的传输协议中增加的用 于表示取消同歩的控制参数。 在解析同歩通知时, 需要从解析出的报文中识 别这些信息。 202 parses the cancel peer notification and identifies cancellation peer control information included in the cancel peer notification. The cancellation of the peer notification may use the code retained in the peer markup language SyncML or the control parameter added in the transport protocol to indicate cancellation of the peer. For a specific example, refer to the embodiment shown in FIG. 1. Cancellation of peer information indicates that canceling the peer information is canceling the peer control information, that is, canceling the peer control information may include: canceling the same in the peer notification to indicate the cancellation of the same peer markup language SyncML Or; a control parameter added to the transmission protocol that cancels the peer notification to indicate cancellation of the peer. When parsing the peer notification, it is necessary to identify the information from the parsed message.
203根据所述取消同歩控制信息取消同歩。  203 cancels the peer according to the canceling the peer control information.
取消同歩的具体操作可以是仅停止同歩的操作, 双方还可以保持着同歩 连接, 进行同歩的端口并不关闭, 只是不再执行该同歩操作。  The specific operation of canceling the peer can be to stop the operation of the peer only. The two parties can still maintain the peer connection, and the peer port is not closed, but the peer operation is no longer performed.
本实施例中, 通过解析同歩对方发送的取消同歩通知来执行取消同歩操 作, 实现了同歩双方在取消同歩时的一致性, 以便于及时释放同歩相关资 源。  In this embodiment, the peer cancellation operation is performed by parsing the cancel peer notification sent by the peer, and the consistency between the peers in canceling the peer is achieved, so that the peer-related resources are released in time.
图 2所示的取消同歩的方法中, 还可以在执行取消同歩操作后, 给取消 同歩通知的发送方发送取消同歩响应, 该取消同歩响应通知可以是以消息形 式发送, 可以使用同歩标记语言 SyncML中保留的代码; 或, 使用在传输协 议中增加的控制参数表示已成功取消同歩。 控制参数可以位于传输协议消息 头、 请求参数、 消息体中的任一者之中。  In the method for canceling the peer shown in FIG. 2, after canceling the peer operation, the canceling peer response may be sent to the sender canceling the peer notification, and the cancel peer response notification may be sent as a message. Use the code retained in the peer markup language SyncML; or, use the control parameters added in the transport protocol to indicate that the peer has been successfully canceled. The control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
在 SyncML现有特殊警报代码 ( Special Alert code ) 中, 226-250为保留 代码。 本发明实施例中, 取消同歩响应可以采用 226-250中的任一警报代码 表示已成功取消本次同歩, 但是需与图 1的实施例中使用的表示通知对方取 消同歩的代码相区别。 该警报代码可以包含在传输协议的消息体中, 以超文 本传输协议 (HTTP)为例, 消息报文可以如下:  In SyncML's existing Special Alert code, 226-250 is reserved. In the embodiment of the present invention, the cancellation of the peer response may indicate that the peer has been successfully cancelled by using any of the alarm codes 226-250, but the code used in the embodiment of FIG. 1 is required to notify the other party to cancel the peer. the difference. The alarm code can be included in the message body of the transport protocol. Take the Hypertext Transfer Protocol (HTTP) as an example. The message message can be as follows:
示例消息一:  Example message one:
<SyncML>  <SyncML>
<SyncHdr> <VerDTD>l .2</VerDTD> <SyncHdr> <VerDTD>l .2</VerDTD>
<VerProto>SyncML/l .2</VerProto>  <VerProto>SyncML/l .2</VerProto>
<SessionID>K/SessionID>  <SessionID>K/SessionID>
<MsgID>2</MsgID>  <MsgID>2</MsgID>
<Target><LocURI>IMEI:493005100592800</LocURI></Target>  <Target><LocURI>IMEI:493005100592800</LocURI></Target>
<Source>  <Source>
<LocURI>http:〃 www. syncml.org/ sync-server</LocURI></Source>  <LocURI>http:〃 www.syncml.org/ sync-server</LocURI></Source>
</SyncHdr>  </SyncHdr>
<SyncBody>  <SyncBody>
<Status>  <Status>
<CmdID>K/CmdID>  <CmdID>K/CmdID>
<MsgRe^2</MsgRef <CmdRef 0</CmdRef  <MsgRe^2</MsgRef <CmdRef 0</CmdRef
<Cmd>SyncHdr</Cmd>  <Cmd>SyncHdr</Cmd>
<TargetRef^http ://www. syncml . org/ sync-server</TargetRef^>  <TargetRef^http ://www. syncml . org/ sync-server</TargetRef^>
<SourceReMMEI:493005100592800</SourceRef  <SourceReMMEI: 493005100592800</SourceRef
<Data>200</Data></Status>  <Data>200</Data></Status>
</SyncBody>  </SyncBody>
</SyncML>  </SyncML>
示例消息二:  Example message two:
<StatusCode>200</StatusCode>  <StatusCode>200</StatusCode>
其中, 示例消息一中的<0 1 >200</0 1 >和示例消息二中的代码 200表 示已经成功取消了本次同歩。 上述传输协议也可以是其它可用承载协议, 如 OBEX和 WSP。  The <0 1 >200</0 1 > in the example message one and the code 200 in the example message 2 indicate that the peer has been successfully cancelled. The above transport protocols may also be other available bearer protocols, such as OBEX and WSP.
另一种方式是, 取消同歩响应中使用在传输协议中增加的控制参数表示 已成功取消同歩。 控制参数可以位于传输协议消息头、 请求参数、 消息体中 的任一者之中。  Alternatively, the cancellation of the control parameter added to the transport protocol in the peer response indicates that the peer has been successfully cancelled. The control parameters can be located in any of the transport protocol message headers, request parameters, and message bodies.
传输协议可以是 HTTP, OBEX和 WSP等。 以 HTTP承载方式为例, 如在 HTTP消息头增加控制参数 "X- Abort-Sync-Result: 200 " , 表示已 成功取消同歩。 The transport protocol can be HTTP, OBEX, WSP, etc. Take the HTTP bearer as an example. If the control parameter "X-Abort-Sync-Result: 200" is added to the HTTP header, it means that the peer has been successfully canceled.
也可以直接利用 HTTP消息的状态码表示取消结果, 如 "HTTP/1.1 200 OK" , 表示已成功取消同歩。  You can also directly use the status code of the HTTP message to indicate the cancellation result, such as "HTTP/1.1 200 OK", indicating that the peer has been successfully cancelled.
另外, 还可以在 HTTP消息体中增加控制参数, 如< 1)0118 1^0 />来 表示已成功取消同歩。  In addition, you can also add control parameters in the HTTP message body, such as < 1)0118 1^0 /> to indicate that the peer has been successfully canceled.
本实施例中, 通过向取消同歩通知的发送方返回取消同歩响应, 表示已 成功取消了本次同歩, 实现了同歩双方在取消同歩时的交互, 使得取消同歩 的发起方可以及时了解取消同歩的执行情况。  In this embodiment, by canceling the cancellation of the peer response to the sender that cancels the peer notification, it indicates that the peer has been successfully canceled, and the mutual interaction between the peers when canceling the peer is implemented, so that the initiator of the peer is canceled. You can keep abreast of the execution of your peers.
图 2所示的取消同歩的方法中, 还可以在执行取消同歩操作后, 记录本 次取消同歩操作以及记录所述取消同歩通知的发送方。 具体是在日志中记 录, 可以是将本次取消同歩操作记录为对方取消同歩。 如: 客户端向服务器 发送的取消同歩通知, 那么服务器在根据该通知执行取消同歩操作后, 可以 在日志中记录本次取消同歩操作, 可以记录为: "客户端取消同歩" ; 同样 客户端根据服务器发送的取消同歩通知执行取消同歩后, 可以在日志中记录 本次取消同歩操作为: "服务器取消同歩" 。  In the method of canceling the peer shown in FIG. 2, after the cancellation of the peer operation, the sender canceling the peer operation and recording the cancellation of the peer notification may also be recorded. Specifically, it is recorded in the log, and it is possible to record the cancellation of the same operation as the other party cancels the peer. For example, if the client sends a cancel notification to the server, the server can record the cancel peer operation in the log after canceling the peer operation according to the notification, which can be recorded as: "The client cancels the peer"; Similarly, after the client cancels the cancellation according to the canceled peer notification sent by the server, the cancellation of the same operation can be recorded in the log as: "Server cancels the peer".
另外, 在取消同歩后还可以进一歩进行断开同歩连接操作。 在进行断开 同歩连接的操作时, 取消同歩通知的接收方也可以主动断开同歩连接, 或根 据同歩对方的指示来断开同歩连接。  In addition, you can also disconnect the peer connection after canceling the peer. When disconnecting the peer connection, the receiver that cancels the peer notification can also actively disconnect the peer or disconnect the peer according to the instructions of the peer.
当取消同歩通知的接收方主动断开同歩连接时, 还需要指示对方在取消 同歩后断开同歩连接。 具体的, 可以在取消同歩响应中可以包含断开同歩连 接的指示, 或者, 取消同歩通知的接收方单独发送一个指示对方断开同歩连 接的通知。  When the receiver that cancels the peer notification actively disconnects the peer, it also needs to instruct the other party to disconnect the peer after canceling the peer. Specifically, the cancel peer response may include an indication to disconnect the peer connection, or the receiver canceling the peer notification separately sends a notification indicating that the other party disconnects the peer.
取消同歩通知的接收方可以在取消同歩响应中使用< ^11>命令来表示 断开同歩连接的指示, 也可以将 <AbortSyncOK/>命令定义已成功取消同 歩, 并指示断开同歩连接。 当然, 也可以另外发送一个通知, 使用 < ^11>命令或状态码来表示断 开同歩连接。 使用 <Alert>命令的例子可以参见如图 1 所示的实施例的说 明。 The receiver that cancels the peer notification can use the <^11> command in the cancel peer response to indicate the disconnection of the peer connection, or the <AbortSyncOK/> command definition has successfully canceled the peer and indicates the disconnection歩 Connect. Of course, you can also send a separate notification, using the <^11> command or status code to indicate that the peer connection is broken. An example of using the <Alert> command can be seen in the description of the embodiment as shown in FIG.
在断开同歩连接的通知中使用状态码表示断开同歩连接的例子如下: <SyncBody>  An example of using a status code to disconnect a peer connection in a notification to disconnect a peer is as follows: <SyncBody>
<!->  <!->
<Status>  <Status>
<!->  <!->
<Data>520</Data> <!一表明断开同歩连接-〉  <Data>520</Data> <! One indicates that the disconnection is connected ->
</Status>  </Status>
</SyncBody>  </SyncBody>
上例中, 接收方使用 <81 8>来发回一个错误响应, 比如返回码 520, 表明会话异常, 需断开同歩连接。 接收方可以在发送该响应后执行断开同歩 连接操作, 具体可以是关闭同歩端口。  In the above example, the receiver uses <81 8> to send back an error response, such as a return code of 520, indicating that the session is abnormal and disconnects the peer. The receiver can perform the disconnection of the peer connection after sending the response, specifically by closing the peer port.
本实施例中取消同歩通知的接收方通过发送断开同歩连接的指示给对 方, 并在发送后断开同歩连接, 及时释放了网络资源。  In this embodiment, the receiver that cancels the peer notification is sent to the opposite party by sending an indication of disconnecting the peer, and disconnects the peer after the transmission, and releases the network resource in time.
图 3为本发明一个实施例中的同歩装置的结构示意图, 包括:  FIG. 3 is a schematic structural diagram of a homophone device according to an embodiment of the present invention, including:
通知生成单元 301, 用于当需要取消同歩时, 生成取消同歩通知; 具体的, 当该同歩装置接收到取消同歩的请求后, 或者在发生特殊情 况, 如内存满或发生错误时, 需要取消同歩时, 通知生成单元生成取消同歩 通知。  The notification generating unit 301 is configured to generate a cancel peer notification when the peer needs to be canceled; specifically, when the peer device receives the request to cancel the peer, or when a special situation occurs, such as when the memory is full or an error occurs When the peer needs to be canceled, the notification generation unit generates a cancellation cancellation notice.
该生成的取消同歩通知可以使用同歩标记语言 SyncML 中保留的代码 表示取消同歩; 或, 通过在传输协议中增加控制参数表示取消同歩。 具体实 现参见 101中的举例。  The generated canceled peer notification can use the code reserved in the peer markup language SyncML to indicate cancellation of the peer; or, by adding control parameters to the transport protocol, cancel the peer. See the example in 101 for details.
通知发送单元 302, 用于发送该取消同歩通知给同歩的对方, 以便同歩 的对方根据该取消同歩通知取消该次同歩。 本实施例中的同歩装置通过在需要取消同歩时, 发送取消同歩通知给同 歩的对方, 这样, 对方就可以在收到通知后, 及时取消本次同歩。 The notification sending unit 302 is configured to send the canceled peer notification to the peer of the peer, so that the peer of the peer cancels the peer according to the canceled peer notification. The peer device in this embodiment sends a cancel cancellation notice to the peer of the peer when the peer needs to be canceled, so that the other party can cancel the peer in time after receiving the notification.
该同歩装置还可以包括响应接收单元 303, 用于接收同歩的对方发送的 取消同歩响应。 以实现和同歩对方的交互, 从而及时了解取消同歩操作的执 行情况。  The peer device may further include a response receiving unit 303 for receiving a cancel peer response sent by the peer. In order to realize and interact with the other party, it is timely to understand the execution of canceling the peer operation.
在一种实施方式中, 通知生成单元 301在生成取消同歩通知时, 可以同 时在该取消同歩通知中包括断开同歩连接的指示, 该指示可以用表示取消同 歩的保留代码或者控制参数来表示, 即表示取消同歩的保留代码或者控制参 数同时表示取消同歩和断开同歩连接两层含义; 也可以用与表示取消同歩的 保留代码或者控制参数不同的保留代码或者控制参数来表示, 即该取消同歩 通知中即包括表示取消同歩的保留代码或者控制参数, 又包括表示断开同歩 连接的保留代码或者控制参数。  In an embodiment, the notification generating unit 301 may simultaneously include an indication of disconnecting the peer connection in the cancellation of the peer notification when the cancel cancellation notification is generated, and the indication may be used to indicate the cancellation of the retention code or control of the peer. The parameter is used to indicate that the cancellation of the same code or control parameter indicates that the cancellation of the peer and the disconnection of the peer are two layers; it can also be used with a reserved code or control that is different from the reserved code or control parameter that indicates cancellation of the peer. The parameter indicates that the cancellation of the same notification includes a reserved code or control parameter indicating cancellation of the peer, and a reserved code or control parameter indicating that the peer connection is disconnected.
在另一实施方式中, 断开同歩连接的指示可以采用单独的通知消息发 送。 此时, 通知生成单元 301还用于生成用于指示对方断开同歩连接通知, 该断开同歩连接通知独立于取消同歩通知。 具体实现可以参见图 1实施例中 的说明。  In another embodiment, the indication to disconnect the peer connection may be sent using a separate notification message. At this time, the notification generating unit 301 is further configured to generate a notification for instructing the other party to disconnect the peer connection, and the disconnected peer connection notification is independent of the cancellation of the peer notification. For specific implementation, reference may be made to the description in the embodiment of FIG. 1.
通知发送单元 302还用于发送该指示对方断开同歩连接的通知。 即将该 断开同歩连接的通知可以独立于取消同歩通知发送。  The notification sending unit 302 is further configured to send the notification indicating that the other party disconnects the peer connection. That is, the notification to disconnect the peer can be sent independently of the cancellation of the peer notification.
另外, 该同歩装置还可以包括断开单元 304, 用于断开同歩连接。 这里 的断开同歩连接是指停止同歩数据的传输后, 断开该同歩的连接, 具体操作 可以是关闭同歩端口, 以便于及时释放同歩相关的网络资源。  Additionally, the peer device can also include a disconnect unit 304 for disconnecting the peer. Here, disconnecting the peer connection means disconnecting the peer's data after stopping the transmission of the peer data. The specific operation may be to close the peer port, so as to release the network resources related to the peer in time.
图 4为本发明另一个实施例中的同歩装置的结构示意图, 具体包括: 通知接收单元 401, 用于接收同歩的对方发送的取消同歩通知; 该取消 同歩通知由同歩的对方发送, 可以是以消息形式发送, 可以使用同歩标记语 言 SyncML中保留的特殊警报代码; 或, 通过在传输协议消息头或传输协议 请求参数或传输协议消息体中增加控制参数表示取消同歩。 具体实现参见FIG. 4 is a schematic structural diagram of a peer device according to another embodiment of the present invention, which specifically includes: a notification receiving unit 401, configured to receive a cancel peer notification sent by a peer of a peer; the cancellation peer is notified by the peer Send, can be sent as a message, can use the special alert code retained in the peer markup language SyncML; or, through the transport protocol header or transport protocol Adding a control parameter to the request parameter or the transport protocol message body means canceling the peer. See the specific implementation
101中的举例。 An example from 101.
解析单元 402, 用于解析该取消同歩通知, 并识别该取消同歩通知包含 的取消同歩控制信息;  The parsing unit 402 is configured to parse the cancellation peer notification, and identify cancellation peer control information included in the cancellation peer notification;
解析单元识别该取消同歩通知包含的取消同歩控制信息具体为: 识别所 述取消同歩通知中包括的同歩标记语言 SyncML中保留的代码; 或, 识别所 述取消同歩通知中包括的在传输协议中增加的控制参数。  The parsing unit identifies that the cancel peer control information included in the cancellation peer notification is specifically: identifying a code retained in the peer markup language SyncML included in the cancel peer notice; or identifying the cancellation included in the cancel peer notice Control parameters added in the transport protocol.
如识别 101中所述的特殊警报代码 226, 或在 HTTP消息头中携带的控 制参数 X-DS-Abort-Sync=tme, 或在 HTTP请求参数中携带的控制参数 Abort- Sync=y。  The special alert code 226 as described in 101 is identified, or the control parameter X-DS-Abort-Sync=tme carried in the HTTP header, or the control parameter Abort-Sync=y carried in the HTTP request parameter.
取消同歩单元 403, 用于根据取消同歩控制信息取消同歩。  The cancellation unit 403 is used to cancel the peer according to the cancellation of the peer control information.
取消同歩单元 403可以读取解析单元 402识别的取消同歩控制信息的含 义, 并根据该控制信息执行取消本次同歩的操作。  The cancel peer unit 403 can read the meaning of the cancel peer control information identified by the parsing unit 402, and perform the operation of canceling the peer according to the control information.
也可以是接收解析单元 402根据取消同歩控制信息发送的执行取消同歩 操作的指示, 并根据该指示执行取消本次同歩的操作。 取消同歩的具体操作 可为关闭本次同歩会话, 同时释放本次同歩相关资源。  It is also possible that the reception parsing unit 402 performs an instruction to cancel the peer operation according to the execution of canceling the transmission of the peer control information, and performs an operation of canceling the current peer according to the instruction. To cancel the peer's specific operation, you can close this peer session and release the resources of this peer.
本发明实施例提供的同歩装置, 通过解析同歩对方发送的取消同歩通 知来执行取消同歩操作, 实现了同歩双方在取消同歩时的一致性, 以便于及 时释放同歩相关资源。  The peer device provided by the embodiment of the present invention performs the cancellation of the peer operation by parsing the cancel peer notification sent by the peer, thereby realizing the consistency between the peers when canceling the peer, so as to release the peer-related resources in time. .
该同歩装置还可以包括响应生成单元 404, 响应发送单元 405, 响应生 成单元 404用于生成取消同歩响应, 该取消同歩响应可以使用同歩标记语言 SyncML中保留的代码; 或, 通过在传输协议增加控制参数表示已成功取消 同歩。 该取消同歩响应具体内容请参见图 2所示的实施例的说明。 响应发送 单元 405, 向同歩的对方发送取消同歩响应。  The peer device may further include a response generating unit 404, and the response generating unit 404 is configured to generate a cancel peer response, and the cancel peer response may use the code retained in the peer markup language SyncML; or, by Adding a control parameter to the transport protocol indicates that the peer has been successfully cancelled. For details of the cancellation peer response, please refer to the description of the embodiment shown in FIG. 2. The response transmitting unit 405 transmits a cancel peer response to the peer.
本实施例中, 通过向取消同歩通知的发送方返回取消同歩响应, 表示已 成功取消了本次同歩, 实现了同歩双方在取消同歩时的交互。 响应生成单元 404在生成取消同歩响应时, 可以同时在该取消同歩通知 中包括断开同歩连接的指示, 该指示可以用表示已成功取消同歩的保留代码 或者控制参数来表示, 即表示已成功取消同歩的保留代码或者控制参数同时 表示已成功取消同歩和指示对方断开同歩连接两层含义; 也可以用与表示已 成功取消同歩的保留代码或者控制参数不同的保留代码或者控制参数来表 示, 即该取消同歩通知中即包括表示已成功取消同歩的保留代码或者控制参 数, 又包括表示断开同歩连接的保留代码或者控制参数。 In this embodiment, by canceling the cancellation of the peer response to the sender that cancels the peer notification, it indicates that the peer has been successfully canceled, and the interaction between the peers when canceling the peer is realized. When the response generation unit 404 generates the cancel peer response, the indication of disconnecting the peer connection may be included in the cancel peer notification, and the indication may be represented by a reserved code or a control parameter indicating that the peer has been successfully canceled, that is, Indicates that the retention code or control parameter of the peer has been successfully canceled and indicates that the peer has been successfully canceled and the other party is disconnected from the peer connection. It is also possible to use a reservation that is different from the reserved code or control parameter indicating that the peer has been successfully canceled. The code or control parameter is used to indicate that the cancellation of the same notification includes a reserved code or control parameter indicating that the peer has been successfully canceled, and a reserved code or control parameter indicating that the peer connection is disconnected.
另外, 在一种实施方式中, 响应生成单元 404还可以用于生成指示对方 断开同歩连接通知, 该指示对方断开同歩连接通知独立于取消同歩通知。 可 以参见图 2实施例中的说明。  In addition, in an embodiment, the response generating unit 404 may be further configured to generate a notification indicating that the other party disconnects the peer connection, and the instructing the other party to disconnect the peer connection notification is independent of the cancel peer notification. See the description in the embodiment of Fig. 2.
响应发送单元 405还用于发送该指示对方断开同歩连接的通知。 即将该 指示对方断开同歩连接的通知独立于取消同歩通知发送。  The response sending unit 405 is further configured to send the notification indicating that the other party disconnects the peer connection. That is, the notification indicating that the other party disconnects the peer connection is independent of the cancellation of the peer notification transmission.
该同歩装置还可以包括断开单元 406, 用于断开同歩连接。 这里的断开 同歩连接是指停止同歩数据的传输后, 断开该同歩的连接, 关闭同歩端口, 以便于及时释放同歩相关的资源。  The peer device can also include a disconnect unit 406 for disconnecting the peer. Here, the disconnection of the peer connection means that after the transmission of the peer data is stopped, the peer connection is disconnected, and the peer port is closed, so that the resources related to the peer are released in time.
图 4所示的同歩装置还可以包括记录单元 407用于记录本次取消同歩操 作。 记录单元具体用于将本次取消同歩操作记录为对方取消同歩。 具体是 在日志中记录, 可以是将本次取消同歩操作记录为对方取消同歩。 如: 客户 端向服务器发送的取消同歩通知, 那么服务器在根据该通知执行取消同歩操 作后, 可以在日志中记录本次取消同歩操作, 可以记录为: "客户端取消同 歩" ; 同样客户端根据服务器发送的取消同歩通知执行取消同歩后, 可以在 日志中记录本次取消同歩操作为: "服务器取消同歩" 。  The peer device shown in Fig. 4 may further include a recording unit 407 for recording the cancellation of the same operation. The recording unit is specifically used to record the cancellation of the same operation as the other party cancels the peer. Specifically, it is recorded in the log, and it may be that the cancellation of the same operation is recorded as the other party cancels the peer. For example, if the client sends a cancel notification to the server, the server can record the cancel peer operation in the log after canceling the peer operation according to the notification, which can be recorded as: "The client cancels the peer"; Similarly, after the client cancels the cancellation according to the canceled peer notification sent by the server, the cancellation of the same operation can be recorded in the log as: "Server cancels the peer".
图 5为本发明一种取消同歩方法的一个实施例的流程图。 包括:  FIG. 5 is a flow chart of an embodiment of a method for canceling a peer in accordance with the present invention. Includes:
501、 同歩的一方 A检测到需要取消同歩, 执行取消同歩操作。 A可以是客户端, 也可以是服务器。 可以是客户端检测到用户取消同 歩, 也可以是装置本身的原因需要取消同歩。 取消同歩通知消息报文的具体 形式参见 101中的举例。 501. One party A of the peer detects that it is necessary to cancel the peer and perform the cancellation of the peer operation. A can be either a client or a server. It may be that the client detects that the user cancels the peer or the device itself needs to cancel the peer. For details on how to cancel the peer notification message, see the example in 101.
502、 A生成取消同歩通知。  502. A generates a cancellation cancellation notice.
取消同歩通知消息报文的具体形式参见 101中的举例。  For details on how to cancel the peer notification message, see the example in 101.
503、 发送取消同歩通知给同歩的对方 B。  503. Send a cancellation notice to the other party B.
B可以是服务器也可以是客户端。  B can be either a server or a client.
504、 B接收到该取消同歩通知后, 解析该取消同歩通知, 提取其中包 含的表示取消同歩的控制信息。  504. After receiving the cancellation cancellation notice, B parses the cancellation cancellation notification, and extracts control information indicating cancellation of the cancellation.
505、 B根据该控制信息执行取消同歩操作, 并记录本次操作为 " A取 消同歩" 。  505. B performs the cancel peer operation according to the control information, and records the operation as “A cancels the same”.
取消同歩操作包括关闭同歩会话, 释放相关资源。  Cancelling peer actions includes closing peer sessions and releasing related resources.
506、 B发送取消同歩响应给 A。  506, B sends a cancel peer response to A.
取消同歩响应表示已经成功取消同歩。 响应消息的具体形式已在图 2所 示的实施例中有详细介绍, 在此不再赘述。  Cancelling a peer response indicates that the peer has been successfully cancelled. The specific form of the response message is described in detail in the embodiment shown in FIG. 2, and details are not described herein again.
507、 A发送断开同歩连接通知给 B。  507, A sends a disconnected peer connection notification to B.
508、 A断开同歩连接, 具体为关闭同歩端口。  508, A disconnects the peer, specifically to close the peer port.
上述执行顺序也可以是其它顺序, 如 A可以在发送取消同歩通知或收 到取消同歩响应后再执行取消同歩操作。  The above execution order may also be other sequences, for example, A may perform the cancellation of the peer operation after sending the cancel peer notification or receiving the cancel peer response.
本实施例通过同歩的一方在需要取消同歩时, 发送取消同歩通知给同歩 的对方, 对方根据该同歩通知执行取消同歩操作后, 再返回取消同歩响应, 实现了同歩的双方在取消同歩操作上的一致性和交互性, 以便于及时释放相 关资源, 提高了同歩行为分析的准确性。 避免了一方取消了同歩, 而另一方 并不知道, 将取消同歩的行为错误地当成了同歩超时的情况。  In this embodiment, when the peer of the peer needs to cancel the peer, the party cancels the notification to the peer of the peer, and the other party returns to cancel the peer response according to the peer notification, and then the peer response is realized. Both parties cancel the consistency and interactivity of peer-to-peer operations in order to release relevant resources in a timely manner and improve the accuracy of peer behavior analysis. It is avoided that one party cancels the same class, and the other party does not know that the act of canceling the peer is mistakenly treated as a peer timeout.
需要说明的是, 本发明实施例不需要引入独立的功能部件, 可借助软件 加必需的通用硬件平台的方式来实现。 基于这样的理解, 本发明实施例的技 术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现 出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令用以执行本 发明各个实施例所述的方法。 这里所称的存储介质, 如: ROM/RAM、 磁 综上所述, 以上仅为本发明的较佳实施例而已, 并非用于限定本发明的 保护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改 进等, 均应包含在本发明的保护范围之内。 It should be noted that the embodiment of the present invention does not need to introduce independent functional components, and can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technique of the embodiment of the present invention The portion of the invention that contributes in nature or contributes to the prior art may be embodied in the form of a software product stored in a storage medium, including instructions for performing the methods described in various embodiments of the present invention. . The storage medium referred to herein, such as the ROM/RAM and the magnetic assembly, is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权利要求书 Claim
1、 一种取消同歩的方法, 其特征在于, 包括: A method for canceling a peer, characterized in that it comprises:
当需要取消同歩时, 生成取消同歩通知;  When canceling the peer, a cancel cancellation notice is generated;
发送所述取消同歩通知给所述同歩的对方, 以便所述同歩的对方根据所 述取消同歩通知取消所述同歩。  Sending the canceled peer notification to the peer of the peer, so that the peer of the peer cancels the peer according to the cancel cancellation notice.
2、 如权利要求 1所述的方法, 其特征在于, 所述取消同歩通知使用同 歩标记语言中保留的代码表示取消同歩; 或, 通过在传输协议中增加控制参 数表示取消同歩。  2. The method of claim 1, wherein the canceling the peer notification uses the code reserved in the peer markup language to indicate cancellation of the peer; or, by adding the control parameter to the transport protocol, canceling the peer.
3、 如权利要求 1或 2所述的方法, 其特征在于, 还包括:  3. The method according to claim 1 or 2, further comprising:
接收所述同歩对方发送的取消同歩响应。  Receiving the cancel peer response sent by the peer.
4、 如权利要求 1或 2所述的方法, 其特征在于, 还包括: 主动断开同 歩连接, 并在所述取消同歩通知中指示对方断开同歩连接或发送断开同歩连 接的通知指示对方断开同歩连接。  The method according to claim 1 or 2, further comprising: actively disconnecting the peer connection, and instructing the other party to disconnect the peer connection or send the disconnected peer connection in the cancel peer notification The notification instructs the other party to disconnect the peer.
5、 如权利要求 1或 2所述的方法, 其特征在于, 还包括: 接收所述同 歩对方发送的断开同歩连接的指示, 根据所述指示断开所述同歩连接。  The method according to claim 1 or 2, further comprising: receiving an indication of disconnection of the peer connection sent by the peer, and disconnecting the peer connection according to the indication.
6、 一种取消同歩的方法, 其特征在于, 包括:  6. A method of canceling a peer, characterized in that it comprises:
接收同歩对方发送的取消同歩通知;  Receiving a cancellation notice sent by the other party;
解析所述取消同歩通知, 并识别所述取消同歩通知中包含的取消同歩控 制信息;  Parsing the cancel peer notification, and identifying cancellation peer control information included in the cancel peer notice;
根据所述取消同歩控制信息取消所述同歩。  The peer is cancelled according to the cancel peer control information.
7、 如权利要求 6所述的方法, 其特征在于, 所述取消同歩控制信息包 括: 同歩标记语言中保留的代码, 所述保留的代码用于表示取消同歩; 或, 在传输协议中增加的用于表示取消同歩的控制参数。  7. The method according to claim 6, wherein the canceling the peer control information comprises: a code retained in a peer markup language, the reserved code being used to indicate cancellation of a peer; or, in a transport protocol The control parameter added to indicate the cancellation of the peer.
8、 如权利要求 6所述的方法, 其特征在于, 还包括: 记录本次取消同 歩操作以及所述取消同歩通知的发送方。 8. The method of claim 6, further comprising: recording the cancellation of the peer operation and the canceling the sender of the peer notification.
9、 如权利要求 6所述的方法, 其特征在于, 还包括: 生成取消同歩响 应, 并向所述同歩对方发送取消同歩响应。 9. The method of claim 6, further comprising: generating a cancel peer response and transmitting a cancel peer response to the peer.
10、 如权利要求 9所述的方法, 其特征在于, 所述取消同歩响应使用同 歩标记语言 SyncML中保留的代码表示已成功取消同歩; 或, 通过在传输协 议中增加控制参数表示已成功取消同歩。  10. The method according to claim 9, wherein the canceling the peer response uses the code retained in the peer markup language SyncML to indicate that the peer has been successfully canceled; or, by adding a control parameter to the transport protocol, Successful cancellation of peers.
11、 如权利要求 6-9任一项所述的方法, 其特征在于, 还包括: 主动断 开同歩连接, 并在所述取消同歩响应中指示对方断开同歩连接或发送断开同 歩连接的通知指示对方断开同歩连接。  The method according to any one of claims 6-9, further comprising: actively disconnecting the peer connection, and instructing the other party to disconnect the peer connection or send the disconnection in the cancel peer response The notification of the peer connection instructs the other party to disconnect the peer.
12、 如权利要求 6-9任一项所述的方法, 其特征在于, 还包括: 接收所 述同歩对方发送的断开同歩连接的指示, 根据所述指示断开所述同歩连接。  The method according to any one of claims 6-9, further comprising: receiving an indication of the disconnection of the peer connection sent by the peer, and disconnecting the peer connection according to the indication .
13、 一种同歩装置, 其特征在于, 包括:  13. A homogenous device, comprising:
通知生成单元, 用于当需要取消同歩时, 生成取消同歩通知; 通知发送单元, 用于发送所述取消同歩通知给同歩的对方, 以便所述同 歩的对方根据所述取消同歩通知取消所述同歩。  a notification generating unit, configured to generate a cancel peer notification when the peer needs to be canceled, and a notification sending unit, configured to send the cancel peer notice to the peer, so that the peer is in accordance with the cancellation歩Notify cancel the same.
14、 如权利要求 13所述的同歩装置, 其特征在于, 所述取消同歩通知 使用同歩标记语言 SyncML中保留的代码表示取消同歩; 或, 通过在传输协 议中增加控制参数表示取消同歩。  14. The peer device of claim 13, wherein the canceling the peer notification uses a code reserved in the peer markup language SyncML to indicate cancellation of the peer; or, by adding a control parameter to the transport protocol, canceling Peer.
15、 如权利要求 13或 14所述的同歩装置, 其特征在于, 还包括: 响应 接收单元, 用于接收所述同歩的对方发送的取消同歩响应。  The peer device according to claim 13 or 14, further comprising: a response receiving unit, configured to receive the cancel peer response sent by the peer of the peer.
16、 如权利要求 13或 14所述的同歩装置, 其特征在于, 所述取消同歩 通知中还包括断开同歩连接的指示。  The peer device according to claim 13 or 14, wherein the canceling the peer notification further includes an instruction to disconnect the peer.
17、 如权利要求 13或 14所述的同歩装置, 其特征在于, 所述通知生成 单元还用于生成指示所述同歩对方断开同歩连接的通知;  The peer device according to claim 13 or 14, wherein the notification generating unit is further configured to generate a notification indicating that the peer is disconnected from the peer;
所述通知发送单元还用于发送所述指示所述同歩对方断开同歩连接的通 知。  The notification sending unit is further configured to send the notification that the peer is disconnected from the peer.
18、 一种同歩装置, 其特征在于, 包括: 通知接收单元, 用于接收同歩的对方发送的取消同歩通知; 解析单元, 用于解析所述取消同歩通知, 并识别所述取消同歩通知包含 的取消同歩控制信息; 18. A homogenous device, comprising: a notification receiving unit, configured to receive a cancel peer notification sent by a peer of the peer; a parsing unit, configured to parse the cancel peer notice, and identify cancellation peer control information included in the cancel peer notice;
取消同歩单元, 用于根据所述取消同歩控制信息取消所述同歩。  The cancellation unit is used to cancel the peer according to the cancellation of the peer control information.
19、 如权利要求 18所述的同歩装置, 其特征在于, 所述取消同歩控制 信息包括: 同歩标记语言中保留的代码, 所述保留的代码用来表示取消同 歩; 或, 在传输协议中增加的用于表示取消同歩的控制参数。  19. The peer device of claim 18, wherein the cancel peer control information comprises: a code retained in a peer markup language, the reserved code being used to indicate cancellation of a peer; or, Control parameters added in the transport protocol to indicate cancellation of peers.
20、 如权利要求 18所述的同歩装置, 其特征在于, 还包括:  20. The homophone device of claim 18, further comprising:
记录单元, 用于记录本次取消同歩操作以及记录所述取消同歩通知的发 送方。  a recording unit, configured to record the cancellation of the same operation and the sender of the cancellation of the cancellation notice.
21、 如权利要求 18-20任一项所述的同歩装置, 其特征在于, 还包括: 响应生成单元, 用于生成取消同歩响应;  The homophone device according to any one of claims 18 to 20, further comprising: a response generating unit, configured to generate a cancel peer response;
响应发送单元, 用于向所述同歩的对方发送所述取消同歩响应。  The response sending unit is configured to send the cancel peer response to the peer of the peer.
22、 如权利要求 21所述的同歩装置, 其特征在于, 所述取消同歩响应 使用同歩标记语言 SyncML中保留的代码表示已成功取消同歩; 或, 通过在 传输协议中增加控制参数表示已成功取消同歩。  22. The peer device of claim 21, wherein the cancel peer response uses a code reserved in the peer markup language SyncML to indicate that the peer has been successfully cancelled; or by adding a control parameter to the transport protocol. Indicates that the peer has been successfully cancelled.
23、 如权利要求 21所述的同歩装置, 其特征在于, 所述取消同歩响应 还包括断开同歩连接的指示。  23. The peer device of claim 21, wherein the canceling the peer response further comprises indicating to disconnect the peer connection.
24、 如权利要求 21所述的同歩装置, 其特征在于, 所述响应生成单元 还用于生成指示所述同歩对方断开同歩连接的通知; 所述响应发送单元还用 于发送所述指示所述同歩对方断开同歩连接的通知。  The response device according to claim 21, wherein the response generating unit is further configured to generate a notification that the peer is disconnected from the peer connection; the response sending unit is further configured to send the The notification indicating that the peer is disconnected from the peer.
PCT/CN2009/074655 2008-12-16 2009-10-28 Canceling synchronization method and device thereof WO2010069207A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200810241224 CN101753611B (en) 2008-12-16 2008-12-16 Method and device for canceling synchronization
CN200810241224.6 2008-12-16

Publications (1)

Publication Number Publication Date
WO2010069207A1 true WO2010069207A1 (en) 2010-06-24

Family

ID=42268301

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/074655 WO2010069207A1 (en) 2008-12-16 2009-10-28 Canceling synchronization method and device thereof

Country Status (2)

Country Link
CN (1) CN101753611B (en)
WO (1) WO2010069207A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294635A (en) * 2017-06-28 2017-10-24 中国银行股份有限公司 Information processing method, device and server
CN108390989B (en) * 2018-01-05 2021-08-27 郑州信大捷安信息技术股份有限公司 Inter-system notification synchronization method based on Android dual systems

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002067533A1 (en) * 2001-02-19 2002-08-29 Nokia Corporation Closing a sip active session
CN1750465A (en) * 2004-09-15 2006-03-22 华为技术有限公司 Method for informing user multimedia broadcast/multi broadcast service conversation end
EP1691508A1 (en) * 2005-02-04 2006-08-16 Samsung Electronics Co., Ltd. Method and apparatus for dispersing user equipments to non-preferred frequencies in a multimedia broadcast/multicast service system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7305420B2 (en) * 2005-05-25 2007-12-04 Microsoft Corporation Synchronizing modifiable documents with multiple clients using document subsections

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002067533A1 (en) * 2001-02-19 2002-08-29 Nokia Corporation Closing a sip active session
CN1750465A (en) * 2004-09-15 2006-03-22 华为技术有限公司 Method for informing user multimedia broadcast/multi broadcast service conversation end
EP1691508A1 (en) * 2005-02-04 2006-08-16 Samsung Electronics Co., Ltd. Method and apparatus for dispersing user equipments to non-preferred frequencies in a multimedia broadcast/multicast service system

Also Published As

Publication number Publication date
CN101753611A (en) 2010-06-23
CN101753611B (en) 2012-12-12

Similar Documents

Publication Publication Date Title
KR101440670B1 (en) A method and a network element for controlling the end-to-end overload based on the diameter application
JP5173607B2 (en) Communications system
WO2007016851A1 (en) A method for establishing the chat room data transmission channel to realize the chat message transmission
US10110642B2 (en) Communication apparatus, communication system, communication method, and storage medium
WO2007033549A1 (en) An offline message transmission method
JP2005267658A (en) Session control device, software applied to it, session control method and network system
JP2006279636A (en) Consistency guarantee management system for inter-client communication log
KR101466712B1 (en) HTTP-CoAP PROXY APPARATUS AND METHOD FOR MANAGING TIMEOUT THEREOF
JP2008078878A (en) Session control system, session proxy device, communication method, and program
WO2015172629A1 (en) Message transmission method, apparatus and system
CN110771117B (en) Session layer communication using ID-oriented network
WO2014117506A1 (en) Method and device for sending multimedia message to group member
WO2012013094A1 (en) Session establishment method and system based on dialog correlation identifier
WO2010069207A1 (en) Canceling synchronization method and device thereof
US20120011260A1 (en) Method and system for transmitting large message mode converged IP messaging
US9596326B2 (en) Communication apparatus, communication method, and non-transitory computer-readable medium
US9444649B2 (en) Method for sending and receiving session history in a communications system
WO2012071882A1 (en) Session detection method, device and session initiation protocol server
WO2018133542A1 (en) File transmission method, system and apparatus, and electronic device, and computer storage medium
US8493936B2 (en) Method and device for handover between UEs in process of sending message
JP5026551B2 (en) Relay device, communication system, and communication monitoring method
CN116896546B (en) Visual intercom method, system and storage medium based on SRT communication protocol
KR102396634B1 (en) Apparatus and method for transmitting of message reception information in wireless communication system
JP5447171B2 (en) Session control device, software applied to the session control device, session control method, and network system
US8688848B2 (en) Method of establishing a media link for transmitting a large message mode CPM message to a group

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

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

Country of ref document: EP

Kind code of ref document: A1