SyncML protocol description

Source: Internet
Author: User
Tags vcard

At present, mobile computing and communication devices are popular mostly because they have some convenient functions. For example, they can send information to other users as needed, you can use your handheld devices to access and execute applications anytime, anywhere, and even obtain and update information during flight. Qqreadereff8b4dfc3e8c03b

The ability to run applications and process information on a handheld device, and to synchronize updates of applications and information to devices in the office or on the Internet is widely used and popular in offline computing. is a key.

Unfortunately, two other methods have not been implemented so far:

Supports Network Data synchronized from any mobile device
Mobile devices that can synchronize any network data
In this way, you need to add a lot of protocols for mobile devices to synchronize different and as much data as possible, each of these protocols only applies to the transmission and operation of a selected subset of devices and can access part of network data, the absence of a single synchronization standard creates many problems for end users, device manufacturers, application developers, and device providers

SyncML is a new standard. to develop a simple and general data synchronization protocol that can be used in the industry, IBM, Lotus, Motorola, Nokia, Palm Inc, Psion, and stafish software promote this standard. Other companies and enterprises are constantly supplemented.

1.1 advantages of universal synchronization protocol

Next let's take a look at the benefits of data synchronization protocols suitable for the industry for each group of roles.

1. End User: Today, mobile device users may use different synchronization products on each device. In this way, there will be a program used to synchronize files between the laptop and network data, the other is used to synchronize the calendar of the handheld computer, as well as remote email access, each technology can only be used to synchronize a few applications or be restricted to special types of network connections. This arrangement is expensive to install, complicated to configure and operate, and expensive to manage. With SyncML, you can purchase devices that can use a wide range of data types.

2. device manufacturer: when each device manufacturer wants to support this technology that supports data access by all users and service providers. In fact, a device supports a data synchronization technology. This option forces manufacturers to compress storage space, memory, power usage, and consumption. Device manufacturers will benefit from generic protocols that enable devices to use a wide range of applications, services, networks, and transmission technologies together.

3. service providers: service providers that are entering the rapidly growing application stage are very concerned about this phenomenon, that is, the increase in synchronization technology will make it impossible to expand users and support users at an effective cost. Service providers now support a certain range of data types and devices in applications. You must also install and configure the infrastructure for multiple services, maintain and support these infrastructures, and ensure compatibility and performance. Currently, we can choose to use a separate data connectivity solution, which is a private solution that avoids close integration. Using SyncML will make it possible to provide connections that support a wide range of applications.

4. Application developers: Selecting to support multiple synchronization technologies can enable applications to support more device types and network data. However, such selection is a waste. To maintain downward compatibility, developers lose the flexibility to select a network data warehouse, which also increases the consumption of program development and the complexity of the final product. The complex network data warehouse is an obstacle to the installation and adoption of service providers. With SyncML, you can develop applications that can connect more device sets and network data.

1.2 description of universal synchronization protocol
The target of universal synchronization protocol is universal. The two ends of synchronization can be of any type and on any network:

Synchronize network data with any mobile device
Synchronize data between a mobile device and any network
The data synchronization protocol synchronizes network data and many different devices, including handheld computers, mobile phones, automated computers, and desktop computers. A user can access and operate the same data set on different devices. For example, you can use a handheld device or mobile phone to read emails, A consistent and updated record can also be maintained.

Similarly, the synchronization ends can use any type, which allows mobile devices to support more data types, including email, calendar, transaction management information, enterprise data in the database, and Web documents. This feature allows users who want to receive orders via email to access the company's Directory Listing System on the same device to determine the delivery date.

To achieve this goal, the Protocol requires the following features:

It can operate on both wired and wireless networks effectively.
Supports multiple transmission protocols
Support any network data
Accessible by multiple applications
Considering the resource restrictions of mobile devices
Built on existing global Internet and Web technologies
The minimum protocol function is to grant the most common synchronization capabilities to all devices.
 
2 SyncML underlying communication

2.1 bind HTTP

2.1.1 TCP transmission service

TTP communication is generally over TCP connections. This binding is not required. If HTTP is based on other protocols, the requirements are similar to the TCP definitions below.

2.1.1.1 connection
When the HTTP client is connected to the HTTP server, the SyncML client establishes a TCP connection between the client and the server by using the TCP open operation. In case of timeout, the SyncML client also needs to establish a new connection.

2.1.1.2 connection options
Some options about the port and Protocol version.

2.1.1.3 disconnect
When the connection is not required, the SyncML client uses the TCP close operation to end the connection. If a fixed connection exists in an HTTP request, the closure of the HTTP connection is completed by an HTTP client. When the HTTP client receives an HTTP response from the server, it indicates that this is the last SyncML package.

2.1.1.4 termination
In some cases, the application may interrupt the TCP connection when an abnormal time occurs. In this case, the TCP is re-initialized to end the current connection.

2.1.1.5 timeout
When the server times out, the SyncML client needs to re-create a new http session and the HTTP server will try to re-Send the current SyncML package

2.1.2. SyncML Information Exchange
Once an HTTP connection is established, one or more SyncML messages are transmitted by the SyncML client through the connection. These messages exist in the HTTP client request or HTTP server response.

The post method in an HTTP request is used to transmit SyncML messages.

2.1.2.1 one message per packet
The following is part of the HTTP Request Code:
Post./servlet/syncit HTTP/1.1
HOST: www.datasync.org
Content-Type: Application/vnd. SyncML-XML; charset = "UTF-8"
Content0length: 1023
Accept: Application/vnd. SyncML-XML

The following is part of the HTTP response code:
HTTP/1.1 200 OK
Content-Type: Application/vnd. SyncML-wbxml; charset = "UTF-8"
Content-lengthl 1, 1023
-- HTTP body ---

2.1.2.2 A package contains multiple messages
Each sync message must be transmitted in an HTTP request or response using the SyncML mime media type. When there are multiple SyncML messages in each package, whether a message is transmitted in a separate HTTP request or response depends on whether it is a SyncML request and response. You can determine whether there are more SyncML messages in the package based on whether each SyncML message has the last element. If the last element exists, the message is the last message in the package.

2.1.3 transmission commands
HTTP uses a series of commands, including transmission methods, header information, request header information, and response header information.

2.1.3.1 Transmission Method
The SyncML client must use the POST method or connect method (if supported) to send SyncML requests to the SyncML server. The connect method is used to initialize an SSL session to verify the HTTP client and server. Other methods are not used on the SyncML client currently.

2.2 bind obex

2.3 bind WSP

3 SyncML synchronization protocol

3.1 motivation:

Indicating that the Protocol is not enough to achieve information interaction
Data in multiple formats can be transmitted between multiple devices.
3.2 Design Principles
Meeting network latency needs
Various Devices
Meet various existing storage modes
Meets multiple security requirements
Multiple usage modes
3.3 sync type
3.3.1 bidirectional Synchronization

Bidirectional transmission of information between the client and the server
In special cases, slow sync is used as the transmission mode.
3.3.2 client one-way Synchronization

Only the client proposes the modification Information
In special cases, data can be output
3.3.3 server-side unidirectional Synchronization

Modification information is only proposed by the server.
In special cases, data can be input
3.3.4 server announcement

Synchronization requests are sent from the server to the client.
3.3.5 bidirectional synchronization example

Synchronous Transmission of calendar
Client authentication request accepted
The client sends two messages
The server sends a message.
Data Consistency between the server and the client will be completed immediately
The following is an example of the general process of synchronous transmission. There are seven synchronous transmission methods. The following example shows two-way transmission, the most complex one. First, make initial preparations, then transmit and confirm.

3.3.5.1 the client sends a synchronization request

It is equivalent to the synchronized header file, basically in fixed mode.

1.0
SyncML/1.0
1
1
The value of synchronization Initialization is one, which is equivalent to the first round.
Target address
Http://www.syncml.org/sync-server
Source Address
IMEI: 493005/10/059280/0
Authentication

Authentication Mode
SyncML: Auth-Basic
Equivalent to Password
Dxnlcmlkonbhc3n3b3jk =

5000

Header file ended

Wake up the other party, which is equivalent to sending a signal

1
Command ID is 1
200
There are seven connection methods, and 200 represents one of them.

./Contacts/james_bond
The target and address of the operation, which is equivalent to the database
./Dev-Contacts

Equivalent to Authentication

234
276

 

Upload

2
Application/XML
Fixed format

Devinf10
Fixed format

Equivalent to local data description
Big Factory, Ltd.
4119
Jane's phones
2.0e
2.0
1.22i
1218182thd000001-2
Phone

./Contacts
Phonebook
32 guid
Equivalent to index

Text/X-vCard
2.1

Text/X-vCard
2.1

Data storage capability

32650
250
22430
122

 

Text/X-vCard
Begin
VCard
End
VCard
Version
2.1
N
Tel
Voice
Cell

01
02

 

 

3
Application/XML

Devinf10

 

 

3.3.5.2 the server sends a synchronization request

Header file

1.0
SyncML/1.0
1
1
IMEI: 493005/10/059280/0
Http://www.syncml.org/sync-server

SyncML: Auth-Basic
Dxnlcmlkonbhc3n3b3jk =

 

It is equivalent to replying to a client request.
Reply header file

10 synchdr
Http://www.syncml.org/sync-server
IMEI: 493005/10/059280/0
212 indicates normal
212

Reply to alert

11 alert
./Contacts/james_bond
./Dev-Contacts
200
200 indicates normal
Sets the value requested by the other party for authentication.

276

 

Reply to put
12put
Devinf10
200

Return Value, requesting the other party

13
Application/XML
Fixed format

Devinf10
Fixed format

Equivalent to data description

Small factory, Ltd.
Tiny Server
Tiny shop
485749kr
Server

./Contacts
Addressbook

Text/X-vCard
2.1

Text/vCard
3.0

Text/X-vCard
2.1

Text/vCard
3.0

Storage Capability

132650
1250
122430
1122

 

Text/X-vCard
Begin
VCard
End
VCard
Version
2.1
N
Tel
Voice
Cell
Text/vCard
Begin
VCard
End
VCard
Version
3.0
N
Tel
Voice
Fax
Cell
Text/vCard
Begin
VCard
End
VCard
Version
3.0
N
Tel
Voice
Fax
Cell

01
02
07

 

 

Two-way transmission to wake up the other party

1
201

./Dev-Contacts
./Contacts/james_bond

Send Authentication

200005021t081812z
200005022t093223z

 

 

 

3.3.5.3 the client submits data

1.0
SyncML/1.0
1
2
Http://www.syncml.org/sync-server
IMEI: 493005/10/059280/0

Reply to server requests

10 synchdr
IMEI: 493005/10/059280/0
Http://www.syncml.org/sync-server
212

Reply to server requests

11 alert
./Dev-Contacts
./Contacts/james_bond
200

Value of Anchor's reply request
200005022t093223z

 

1
./Contacts/james_bond
./Dev-Contacts

Storage Capability

8100

81

 

2
Text/X-vCard

1012
Data item address

 

 

 

3.3.5.4 submit data on the server

1.0
SyncML/1.0
1
2
IMEI: 493005/10/059280/0
Http://www.syncml.org/sync-server

Reply to customer request

20 synchdr
Http://www.syncml.org/sync-server
IMEI: 493005/10/059280/0
200

Reply to sync request

21 sync
./Contacts/james_bond
./Dev-Contacts
200

Reply to replace

22 replace
1012
200

Send synchronization request

1
./Dev-Contacts
./Contacts/james_bond

2
Text/X-vCard

1023

 

3
Text/X-vCard

10536681

 

 

 

3.3.5.5 the client displays data changes

1.0
SyncML/1.0
1
3
Http://www.syncml.org/sync-server
IMEI: 493005/10/059280/0

Reply to synchronization request

20 synchdr
IMEI: 493005/10/059280/0
Http://www.syncml.org/sync-server
200

21 sync
./Dev-Contacts
./Contacts/james_bond
200

22 replace
1023
200

23add
10536681
200

Data synchronization between the server and client
1
./Contacts/james_bond
./Dev-Contacts

10536681 and 1024 refer to the same data.
10536681
1024

 

 

3.3.5.6 confirm changes on the server side

1.0
SyncML/1.0
1
3
IMEI: 493005/10/059280/0
Http://www.syncml.org/sync-server

 

30 synchdr
Http://www.syncml.org/sync-server
IMEI: 493005/10/059280/0
200

Confirm that the data has been changed

31map
./Contacts/james_bond
./Dev-Contacts
200

 

 

4 SyncML indicates the Protocol

SyncML indicates that the data synchronization protocol and synchronization engine are not specified in the Protocol. Instead, some synchronization frameworks and formats are specified to adapt to different data synchronization models. SyncML specifies the results of many synchronization operations.

Defines a format
Registered as a mime (multi-purpose Internet Mail extended protocol) Media Format
An independent synchronous transmission protocol is defined.
Suitable for multiple synchronous transmission modes
Not related to background data storage
Separated from the synchronization object type
4.1 SyncML command

4.1.1 Request command

Add: allows the sender to add data elements to the synchronization data that the receiver can recognize. This command must be specified in the sync command.
Alert: allows the sender to notify the receiver. The notification can be used as an extension of the displayed message between the application and the application or receive the user interface.
Atomic: allows the sender to specify that a command set can be executed with or without any semantics.
Copy: allows the sender to copy data that can be received by the receiver.
Delete: allows the sender to delete data that can be received by the recipient. The DELETE command can contain a request Wei to implement data archiving. The deletion can be recycled or actually deleted.
Exec: the sender can ask the receiver to call a named, executable program.
Get: the sender can apply for data elements from the receiver. This command cannot be specified by the sync command.
Map: the sender can update the identifier between two data sets by the receiver.
Put: allows the sender to send data to the receiver. This command cannot be specified by the sync command.
Release: allows the sender to replace the data elements that the receiver can accept. This command cannot be specified by the sync command.
Search: allows the sender to query data elements.
Sequence: allows the sender to specify a series of sequential executions.
Sync: allows the sender to specify the included commands as part of synchronizing two data sets.
4.1.2 response command

Status: indicates the completion status of an operation when an error occurs during processing of the previous request.
Results: Used to return the data results of the get or search command.
4.2 SyncML Data Format

SyncML not only provides a set of common commands, but also specifies a small common data format. The data format provides a common set of media for exchanging access information. For example, Address Book, calendar, and message. These three data formats are mandatory for this specification. In addition, for these general formats, SyncML allows the identification of other registration formats. SyncML uses the mime content type framework to identify the data format.

4.3 use XML
SyncML messages use a markup language, while synml indicates that the Protocol is actually an XML application. The SyncML DTD defines XML documents used to represent SyncML messages. SyncML uses a large amount of XML namespace. The namespace must be declared in the first element type. The element type in the SyncML DTD is defined in a URI. SyncML DTD can also be recognized by the ISO 9070 standard common identifier-// SyncML // DTD SyncML 1.0/en. Standard attributes of any XML can be used in SyncML documents.

4.4 use MIME
Internet standards provide an industry-wide mechanism to identify different content types. SyncML messages are identified by mime media types. The media types of SyncML messages are registered in the manufacturer list. Currently, two mime content can be used in SyncML messages. The mime content type of Applicattion/vnd. SyncML + XML identifies the text-based XML expression of SyncML messages. The mime content types of Applicattion/vnd. SyncML + wbxml identify the text-based wbxml Binary Expression of SyncML messages.

4.5 SyncML markup language description

4.5.1 general elements

Archive, chal, CMD, producer ID, cmdref, cred, final, Lang, locuri, msgid, msgref, noresp, noresult, respuri, sessionid, sftdel, source, sourceref, target, targetref, verdtd and verproto.
4.5.2 message container elements

SyncML, synchdr, and syncbody.
4.5.3 data description Element

Data, item, Meta.
4.5.4 protocol Management Elements

Status.
4.5.5 protocol command elements

Add, alert, atomic, copy, delete, exec, get, MAP, mapitem, put, replace, result, search, sequence, sync.
For more information, see related documents.

5 SyncML reference Toolkit

The toolkit serves as a bridge between the XML language and SyncML

 
5.1 use the SyncML Toolkit

One buffer zone and storage of SyncML encoding can be either of the following...
You can use only one workspace.
You can allocate a workspace to an application.
Divide in and out into two workspaces.
5.2 When synchronization starts in the workspace using the SyncML toolkit, the workspace is created: instanceoptions. Encoding = sml_wbxml;
Instanceoptions. workspacename = "myworkspace ";
Instanceoptions. workspacesize = 20000;
Callbacks. addmediafunc = & handleaddmediafunc;
... Rc = smlinitinstance (callbacks,
Instanceoptions,
& Instanceid );
 
5.3 use the SyncML toolkit parser

Small Size and optimized processing (instead of Dom XML Parser) supports the following formats:

XML
Wbxml
The callback function sends the parsed information to the application and starts parsing SyncML:

Smlprocessdata (instanceid, // pass the instance
Sml_all_commands, // parse entire msg
Puserdata); // a void PTR

5.4 encoder with Toolkit

The information to be encoded must go through toolkit.

Paddstruct-> elementtype = sml_pe_add;
Paddstruct-> upload id = ...;
Paddstruct-> itemlist = ...;
Paddstruct-> cred = ...;
Smladdcmd (instanceid, paddstruct );

5.5 content and communication

5.5.1 integrated Load

Parse and encode embedded data formats

VCard
Vcalendar
....
Database Interface

Lotus Domino
Outlook
DB2
...
5.5.2 publish synchronization Information

Transfer binding
HTTP
Obex (infrared)
WSP
Floppy Disk

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/dwater/archive/2006/07/13/915071.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.