CN103200211B - A kind of method of data synchronization, system and equipment - Google Patents
A kind of method of data synchronization, system and equipment Download PDFInfo
- Publication number
- CN103200211B CN103200211B CN201210004837.4A CN201210004837A CN103200211B CN 103200211 B CN103200211 B CN 103200211B CN 201210004837 A CN201210004837 A CN 201210004837A CN 103200211 B CN103200211 B CN 103200211B
- Authority
- CN
- China
- Prior art keywords
- synchronization
- client
- data
- session
- control server
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000005540 biological transmission Effects 0.000 claims abstract description 24
- 230000001360 synchronised effect Effects 0.000 claims description 43
- 230000008569 process Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004064 recycling Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
本发明实施例公开了一种数据同步方法和系统。该方法包括:同步控制服务器接收同步客户端的同步服务注册请求,存储该注册请求携带的用户信息;同步控制服务器根据自身存储的用户信息,在参与同步会话的同步客户端之间转发数据同步会话信息;根据所述数据同步会话信息,直接在参与同步会话的同步客户端之间进行数据传输。应用本发明能够降低服务器端的压力。
The embodiment of the invention discloses a data synchronization method and system. The method includes: the synchronization control server receives a synchronization service registration request from a synchronization client, and stores user information carried in the registration request; the synchronization control server forwards data synchronization session information between synchronization clients participating in the synchronization session according to the user information stored by itself ; According to the data synchronization session information, directly perform data transmission between the synchronization clients participating in the synchronization session. Applying the invention can reduce the pressure on the server side.
Description
技术领域 technical field
本发明涉及通信技术领域,尤其涉及一种数据同步方法、系统和设备。The present invention relates to the field of communication technology, in particular to a data synchronization method, system and equipment.
背景技术 Background technique
随着移动互联网的快速发展和智能终端的大面积普及,用户设备越来越多样化,出现了个人电脑(PC机)、手提电脑、智能手机、掌上电脑(PDA)等多种形式的用户设备,一个用户常常拥有多个用户设备。随着人们对用户设备的功能性要求的不断提高,以及用户设备的多样化,使人们产生了对在不同用户设备之间进行数据资源同步的需求。With the rapid development of the mobile Internet and the large-scale popularization of smart terminals, user equipment is becoming more and more diverse, and there are various forms of user equipment such as personal computers (PCs), laptop computers, smart phones, and handheld computers (PDAs). , a user often owns multiple user devices. With the continuous improvement of people's functional requirements on user equipment and the diversification of user equipment, people have a demand for data resource synchronization between different user equipment.
目前,在不同用户设备之间进行数据同步的方案为:基于客户端/服务器(C/S)模型进行数据同步。具体地:用户在网络服务器上保存有自己的数据,可从多个客户端对数据进行操作,这样就可以保持多个客户端上数据的统一而无需对各客户端分别进行操作,简化了用户的操作过程,提高了效率和用户实时性要求,并为移动办公提供了很好的支持。Currently, a solution for data synchronization between different user equipments is: data synchronization based on a client/server (C/S) model. Specifically: users save their own data on the network server, and can operate data from multiple clients, so that the unity of data on multiple clients can be maintained without operating each client separately, which simplifies user The operation process improves the efficiency and real-time requirements of users, and provides good support for mobile office.
图1是目前基于C/S模型的数据同步系统组成示意图。Figure 1 is a schematic diagram of the composition of the current data synchronization system based on the C/S model.
如图1所示,目前基于C/S模型的数据同步系统包括中心数据库服务器、同步服务器、Web服务器、移动终端和固定客户端。As shown in Figure 1, the current data synchronization system based on the C/S model includes a central database server, a synchronization server, a Web server, a mobile terminal and a fixed client.
其中,中心数据库服务器采用的是轻量级目录访问协议(LDAP)。LDAP目录服务是一种特殊的数据库系统,其专门针对读取、浏览和搜索操作进行了特定的优化,被广泛地应用于基础性、关键性信息的管理,如用户信息、网络资源信息等。Among them, the central database server uses the Lightweight Directory Access Protocol (LDAP). LDAP directory service is a special database system, which is specially optimized for reading, browsing and searching operations, and is widely used in the management of basic and critical information, such as user information and network resource information.
中心数据库服务器上的数据可以通过两种途径修改:①固定客户端通过Web页面经Web服务器对中心数据库中的记录进行修改;②移动客户端经过同步服务器访问中心数据库并和其同步。The data on the central database server can be modified in two ways: ①The fixed client modifies the records in the central database through the Web server through the Web page; ②The mobile client accesses the central database through the synchronization server and synchronizes with it.
图1所示的数据同步系统采用syncML协议来实现数据同步。SyncML同步协议主要定义了数据同步操作的会话流程、会话过程中的数据交互过程、同步双方的握手过程及数据同步的类型等。The data synchronization system shown in Figure 1 uses the syncML protocol to realize data synchronization. The SyncML synchronization protocol mainly defines the session process of data synchronization operation, the data interaction process in the session process, the handshake process between the two sides of the synchronization, and the type of data synchronization.
图1所示的数据同步系统在同步过程中,数据同步的控制过程与传输过程是相绑定的,即控制信息和数据信息都需要经过控制服务器,因此,会在服务器端产生巨大的压力,具体表现在:In the data synchronization system shown in Figure 1, during the synchronization process, the control process of data synchronization is bound to the transmission process, that is, both control information and data information need to pass through the control server, therefore, huge pressure will be generated on the server side. Specifically in:
当多用户进行大数据量的数据同步时,服务器端的处理和存储压力急剧提升。When multiple users synchronize data with a large amount of data, the processing and storage pressure on the server side increases sharply.
另外,基于C/S模式的数据同步系统,还会导致海量的数据积累在少数计算中心,使得网络服务器超负荷、而大量终端的处理能力却被闲置,这无疑是一种巨大的浪费;而且,C/S模型易受攻击的弱点,对数据同步系统的健壮性及安全性提出了更高的要求。In addition, the data synchronization system based on the C/S mode will also lead to the accumulation of massive data in a few computing centers, overloading the network server, while the processing capacity of a large number of terminals is idle, which is undoubtedly a huge waste; and , the weakness of the C/S model, which is vulnerable to attack, puts forward higher requirements for the robustness and security of the data synchronization system.
发明内容 Contents of the invention
有鉴于此,本发明提供了一种数据同步方法、系统和设备,以便降低服务器端的压力。In view of this, the present invention provides a data synchronization method, system and equipment, so as to reduce the pressure on the server side.
本发明的技术方案具体是这样实现的:Technical scheme of the present invention is specifically realized like this:
一种数据同步方法,该方法包括:A data synchronization method, the method comprising:
同步控制服务器接收同步客户端的同步服务注册请求,存储该注册请求携带的用户信息;The synchronization control server receives the synchronization service registration request from the synchronization client, and stores the user information carried in the registration request;
同步控制服务器根据自身存储的用户信息,在参与同步会话的同步客户端之间转发数据同步会话信息;The synchronization control server forwards the data synchronization session information between the synchronization clients participating in the synchronization session according to the user information stored by itself;
根据所述数据同步会话信息,直接在参与同步会话的同步客户端之间进行数据传输。According to the data synchronization session information, data transmission is directly performed between the synchronization clients participating in the synchronization session.
一种数据同步系统,该系统包括同步控制服务器和同步客户端;A data synchronization system, the system includes a synchronization control server and a synchronization client;
所述同步控制服务器,用于接收同步客户端的同步服务注册请求,存储该注册请求携带的用户信息,根据自身存储的用户信息,在参与同步会话的同步客户端之间转发数据同步会话信息;The synchronization control server is configured to receive a synchronization service registration request from a synchronization client, store user information carried in the registration request, and forward data synchronization session information between synchronization clients participating in the synchronization session according to the user information stored by itself;
所述同步客户端,用于根据所述数据同步会话信息,直接与参与同步会话的其他同步客户端进行数据传输。The synchronization client is configured to directly perform data transmission with other synchronization clients participating in the synchronization session according to the data synchronization session information.
一种同步控制服务器,该同步控制服务器包括同步服务注册模块、同步客户端永远在线模块和同步会话控制模块;A synchronous control server, the synchronous control server includes a synchronous service registration module, a synchronous client always-on module and a synchronous session control module;
所述同步服务注册模块,用于接收同步客户端的同步服务注册请求,存储该同步客户端的用户信息;The synchronization service registration module is used to receive a synchronization service registration request from a synchronization client, and store user information of the synchronization client;
所述同步客户端永远在线模块,用于接收同步客户端周期性发送的、或在同步客户端自身用户信息更新时发送的同步服务注册请求,将该同步服务注册请求发给所述同步服务注册模块;The always-on module of the synchronization client is used to receive the synchronization service registration request sent periodically by the synchronization client or when the user information of the synchronization client itself is updated, and send the synchronization service registration request to the synchronization service registration module;
所述同步会话控制模块,用于接收同步客户端的同步会话建立请求,根据所述同步客户端永远在线模块维护的用户信息,查询到同步会话对端的同步客户端,在参与所述同步会话的同步客户端之间转发数据同步会话信息。The synchronization session control module is configured to receive a synchronization session establishment request from a synchronization client, query the synchronization client at the opposite end of the synchronization session according to the user information maintained by the synchronization client always-on module, and participate in the synchronization of the synchronization session Forward data synchronization session information between clients.
一种同步客户端,该同步客户端包括同步服务注册模块、永远在线模块、同步会话控制模块和数据同步模块;A synchronous client, the synchronous client includes a synchronous service registration module, an always-on module, a synchronous session control module and a data synchronous module;
所述同步服务注册模块,用于向同步服务器发送同步服务注册请求,该同步服务注册请求中携带有同步客户端的用户信息;The synchronization service registration module is configured to send a synchronization service registration request to the synchronization server, and the synchronization service registration request carries user information of the synchronization client;
所述永远在线模块,用于周期性地、或在同步客户端自身的用户信息更新时,向同步控制服务器发送同步服务注册请求,该同步服务注册请求中携带有同步客户端的用户信息,The always-on module is configured to periodically or when the user information of the synchronization client itself is updated, send a synchronization service registration request to the synchronization control server, the synchronization service registration request carrying the user information of the synchronization client,
所述同步会话控制模块,用于在有需要同步的数据时,通过同步控制服务器,与参与数据同步的其他同步客户端交互数据同步会话信息;The synchronization session control module is used to exchange data synchronization session information with other synchronization clients participating in data synchronization through the synchronization control server when there is data that needs to be synchronized;
所述数据同步模块,用于根据所述数据同步会话信息,直接与其他同步客户端进行数据传输。The data synchronization module is configured to directly perform data transmission with other synchronization clients according to the data synchronization session information.
由上述方案可见,由于本发明中数据同步的控制过程和传输过程相分离,数据传输直接在用户设备之间进行,因而能够降低对服务端的压力,并且还能保证数据传输的实时性,提高了数据同步效率。It can be seen from the above scheme that since the data synchronization control process and the transmission process are separated in the present invention, the data transmission is directly carried out between the user equipments, thereby reducing the pressure on the server and ensuring the real-time performance of the data transmission, improving the Data synchronization efficiency.
附图说明 Description of drawings
图1是目前基于C/S模型的数据同步系统组成示意图。Figure 1 is a schematic diagram of the composition of the current data synchronization system based on the C/S model.
图2是本发明提供的数据同步方法流程图。Fig. 2 is a flow chart of the data synchronization method provided by the present invention.
图3是本发明提供的两个用户设备进行数据同步的详细流程图。Fig. 3 is a detailed flowchart of data synchronization between two user equipments provided by the present invention.
图4是本发明提供的数据同步系统的组成示意图。Fig. 4 is a schematic diagram of the composition of the data synchronization system provided by the present invention.
图5是本发明提供的同步控制服务器的结构图。Fig. 5 is a structural diagram of the synchronization control server provided by the present invention.
图6是本发明提供的同步客户端的结构图。Fig. 6 is a structural diagram of a synchronization client provided by the present invention.
具体实施方式 detailed description
本发明提供了一种新颖的数据同步方法、系统和设备,采用数据同步控制与传输相分离的方法进行数据同步,具体包括:The present invention provides a novel data synchronization method, system and equipment, which adopts a method of separating data synchronization control and transmission for data synchronization, specifically including:
同步控制服务器接收同步客户端的同步服务注册请求,存储该注册请求携带的用户信息;同步控制服务器根据自身存储的用户信息,在参与同步会话的同步客户端之间转发数据同步会话信息;根据所述数据同步会话信息,直接在参与同步会话的同步客户端之间进行数据传输。The synchronization control server receives the synchronization service registration request of the synchronization client, and stores the user information carried by the registration request; the synchronization control server forwards the data synchronization session information between the synchronization clients participating in the synchronization session according to the user information stored by itself; according to the Data synchronization session information, data transmission directly between the synchronization clients participating in the synchronization session.
可见,采用本发明,首先用户设备不需要将自己的数据保存在网络服务器上,当需要和其它用户设备进行数据同步时,需向网络服务端发送控制请求命令,服务端在收到此命令时,根据需要进行处理并转发给对端需要数据同步的用户设备,当需要进行数据同步的用户设备之间建立好控制流之后,用户设备之间就可直接进行数据同步,而无需再经过网络服务器端,从而降低了服务器侧的压力。It can be seen that, by adopting the present invention, firstly, the user equipment does not need to save its own data on the network server. When it needs to synchronize data with other user equipment, it needs to send a control request command to the network server. When the server receives this command , according to the need to process and forward to the peer user equipment that needs data synchronization. After the control flow is established between the user equipment that needs data synchronization, the user equipment can directly perform data synchronization without going through the network server. end, thereby reducing the pressure on the server side.
另外,由于数据同步的控制过程和传输过程相分离,数据传输直接在用户设备之间进行,因而保证了数据传输的实时性,提高了数据同步效率。而且,由于数据存储在用户设备中,因此,也为数据同步系统提供了更强的健壮性和安全性。In addition, since the control process of data synchronization is separated from the transmission process, data transmission is directly performed between user equipments, thereby ensuring the real-time performance of data transmission and improving the efficiency of data synchronization. Moreover, since the data is stored in the user equipment, it also provides stronger robustness and security for the data synchronization system.
图2是本发明提供的数据同步方法流程图。Fig. 2 is a flow chart of the data synchronization method provided by the present invention.
如图2所示,该流程包括:As shown in Figure 2, the process includes:
步骤201,用户设备向同步控制服务器发起同步服务注册,并保持该用户设备永远在线。In step 201, the user equipment initiates synchronization service registration with the synchronization control server, and keeps the user equipment always online.
本步骤中,用户设备可以通过周期性地向同步控制服务器发送同步服务注册请求,来保持该用户设备永远在线,即保持所述同步控制服务器中存储有该用户设备的IP地址和端口号等信息。用户设备还可以通过在自身信息发生变化时,向同步控制服务器发送同步服务注册请求,在该同步服务注册请求中携带自身更新的信息,来保持该用户设备永远在线。In this step, the user equipment can keep the user equipment always online by periodically sending a synchronization service registration request to the synchronization control server, that is, keep information such as the IP address and port number of the user equipment stored in the synchronization control server . The user equipment can also keep the user equipment always online by sending a synchronization service registration request to the synchronization control server when its own information changes, and carrying its own updated information in the synchronization service registration request.
其中,所述同步服务注册请求可以是会话启动协议(Session InitiationProtocol,SIP)注册消息。Wherein, the synchronization service registration request may be a Session Initiation Protocol (Session Initiation Protocol, SIP) registration message.
步骤202,用户设备通过同步控制服务器与另一用户设备交互数据同步会话信息,从而在用户设备之间建立数据同步会话。In step 202, the user equipment exchanges data synchronization session information with another user equipment through the synchronization control server, so as to establish a data synchronization session between the user equipments.
步骤203,根据数据同步会话信息,直接在用户设备之间进行数据传输。Step 203, according to the data synchronization session information, directly perform data transmission between user equipments.
步骤204,在需要结束数据同步会话时,用户设备通过同步控制服务器结束与另一用户设备的同步会话。Step 204, when the data synchronization session needs to be terminated, the user equipment terminates the synchronization session with another user equipment through the synchronization control server.
下面举一个具体的例子,对本发明提供的数据同步方法进行示例性说明,具体请参见图3。A specific example is given below to illustrate the data synchronization method provided by the present invention, please refer to FIG. 3 for details.
图3是本发明提供的两个用户设备进行数据同步的详细流程图。Fig. 3 is a detailed flowchart of data synchronization between two user equipments provided by the present invention.
图3所示流程包括四个阶段:步骤1-步骤10对应图2中的步骤201,是用户设备进行同步服务注册、并保持终端永远在线的阶段,步骤11-步骤18对应图2中的步骤202,是获取数据同步会话控制信息的阶段,步骤19对应图2中的步骤203,是在用户设备之间建立数据同步会话并直接进行数据传输的阶段,步骤20-步骤23对应图2中的步骤204,是结束数据同步会话的阶段。The process shown in Figure 3 includes four stages: Step 1-Step 10 corresponds to Step 201 in Figure 2, which is the stage for the user equipment to register for the synchronization service and keep the terminal always online, and Step 11-Step 18 corresponds to the steps in Figure 2 202 is the stage of acquiring data synchronization session control information. Step 19 corresponds to step 203 in FIG. 2, which is the stage of establishing a data synchronization session between user equipments and directly performing data transmission. Step 204 is the stage of ending the data synchronization session.
如图3所示,该流程具体包括以下步骤:As shown in Figure 3, the process specifically includes the following steps:
步骤1:用户设备1(UE1)向同步控制服务器发送注册请求(REGISTER),目的是为了让同步控制服务器获得当前用户的注册信息。Step 1: User Equipment 1 (UE1) sends a registration request (REGISTER) to the synchronization control server, the purpose of which is to allow the synchronization control server to obtain the registration information of the current user.
所述注册信息一般包括用户设备的IP地址、端口号等。The registration information generally includes the IP address, port number, etc. of the user equipment.
步骤2:同步控制服务器通过后端认证,获知用户IP地址不在数据库中,便向UE1回送401未鉴权的质询信息,其中包括安全认证所需的令牌。Step 2: The synchronization control server passes the back-end authentication and knows that the user's IP address is not in the database, so it returns a 401 Unauthenticated challenge message to UE1, including the token required for security authentication.
步骤3:UE1根据安全认证令牌将其标识和密码加密后,再次用REGISTER消息报告给同步控制服务器。Step 3: After UE1 encrypts its ID and password according to the security authentication token, it reports to the synchronization control server again with a REGISTER message.
步骤4:同步控制服务器将REGISTER消息中的用户信息解密,通过认证验证该用户信息合法后,将该用户信息登记数据库中,并向UE1返回成功响应消息200OK。Step 4: The synchronization control server decrypts the user information in the REGISTER message, and after verifying that the user information is legal through authentication, registers the user information in the database, and returns a success response message 200 OK to UE1.
步骤5:为了保持用户UE1在线,UE1需隔一定时间,例如1分钟,定期再向同步控制服务器循环发送注册消息。Step 5: In order to keep the user UE1 online, UE1 needs to periodically send a registration message to the synchronization control server periodically after a certain period of time, such as 1 minute.
步骤6-10:用户设备2(UE2)同样也需要定期循环发送REGISTER注册请求到同步控制服务器,以便让同步控制服务器获取UE2的用户信息。Steps 6-10: User Equipment 2 (UE2) also needs to periodically and cyclically send a REGISTER registration request to the synchronization control server, so that the synchronization control server can obtain the user information of UE2.
步骤11:UE1发送邀请(INVITE)消息到同步控制服务器。Step 11: UE1 sends an INVITE message to the synchronization control server.
本步骤中发送的INVITE消息含有数据同步会话(session)的要素信息,包括当前UE1请求数据同步的数据类型以及所采用的同步协议等。The INVITE message sent in this step contains essential information of a data synchronization session (session), including the data type currently requested by UE1 for data synchronization and the synchronization protocol adopted.
步骤12:同步控制服务器给UE1返回尝试(Trying)消息,表示该同步控制服务器已经接收到UE1发送的INVITE消息,正在对其进行处理。Step 12: The synchronization control server returns a Trying (Trying) message to UE1, indicating that the synchronization control server has received the INVITE message sent by UE1 and is processing it.
步骤13:同步控制服务器通过对UE1进行认证,确认用户UE1已认证通过后,检查INVITE请求消息中的via头域中是否包含该用户UE1的地址。如果INVITE请求消息中的via头域中携带了UE1的地址,同步控制服务器在INVITE请求消息的Via头域插入自身的地址,并向INVITE消息的To域所指示的被叫用户设备UE2转发INVITE请求。Step 13: After the synchronization control server authenticates UE1 and confirms that the user UE1 has passed the authentication, it checks whether the via header field in the INVITE request message contains the address of the user UE1. If the via header field in the INVITE request message carries the address of UE1, the synchronization control server inserts its own address in the Via header field of the INVITE request message, and forwards the INVITE request to the called user equipment UE2 indicated by the To field of the INVITE message .
步骤14:UE2返回Trying消息,表示UE2已经接收到同步控制服务器发送的INVITE请求。Step 14: UE2 returns a Trying message, indicating that UE2 has received the INVITE request sent by the synchronization control server.
步骤15:UE2在收到同步控制服务器转发的INVITE消息后,首先将UE1所需数据同步的数据类型和同步协议进行匹配,并将自身的用户信息,例如IP地址、端口号等,封装到要发出的200 OK消息中,之后再向同步控制服务器发送此200 OK消息,表示成功接收和处理INVITE请求。Step 15: After receiving the INVITE message forwarded by the synchronization control server, UE2 first matches the data type and synchronization protocol required by UE1 for data synchronization, and encapsulates its own user information, such as IP address, port number, etc., into the desired In the 200 OK message sent, the 200 OK message is then sent to the synchronization control server, indicating that the INVITE request is successfully received and processed.
步骤16:同步控制服务器收到此200 OK消息后,将该200 OK消息转发到UE1。Step 16: After receiving the 200 OK message, the synchronization control server forwards the 200 OK message to UE1.
可见,经过同步控制服务器的转发,UE2的信息就被转发到了UE1。It can be seen that, after being forwarded by the synchronization control server, the information of UE2 is forwarded to UE1.
步骤17:UE1收到200 OK消息后就获取到了与终端UE2的数据同步会话控制信息,并最终向同步控制服务器发送一个ACK确认消息,表示该消息成功接收。Step 17: After receiving the 200 OK message, UE1 obtains the data synchronization session control information with the terminal UE2, and finally sends an ACK confirmation message to the synchronization control server, indicating that the message is successfully received.
步骤18:同步控制服务器转发ACK消息到UE2,证实UE1已经收到UE2发送的200 OK响应消息,此时UE1与UE2就建立好SIP控制连接,并随时准备好与UE1的数据同步。Step 18: The synchronization control server forwards the ACK message to UE2 to confirm that UE1 has received the 200 OK response message sent by UE2. At this time, UE1 and UE2 have established a SIP control connection and are ready to synchronize data with UE1 at any time.
步骤19:UE1根据获得到的数据同步会话信息,分别对每种需要同步的数据类型,选择与UE2协商好的同步协议,例如syncML协议或者rSync协议,与UE2进行数据同步。Step 19: According to the obtained data synchronization session information, UE1 selects a synchronization protocol negotiated with UE2, such as syncML protocol or rSync protocol, for each type of data that needs to be synchronized, and performs data synchronization with UE2.
步骤20:UE1向同步控制服务器发送BYE结束同步信息,表示请求结束本次同步过程。Step 20: UE1 sends BYE synchronization end information to the synchronization control server, indicating that it requests to end the current synchronization process.
步骤21:同步控制服务器收到UE1发送的BYE消息时,回送结束响应消息,表示请求终止。Step 21: When the synchronization control server receives the BYE message sent by UE1, it sends back an end response message, indicating that the request is terminated.
步骤22:同步控制服务器向UE2发送BYE请求消息,请求结束同步控制过程,同时准备回收本次同步过程所建立的同步会话信息,并在收到UE2的200 OK消息后,删除本次同步过程所建立的同步会话信息,从而实现对所述同步会话信息的回收。Step 22: The synchronization control server sends a BYE request message to UE2, requesting to end the synchronization control process, and at the same time prepares to recycle the synchronization session information established in this synchronization process, and deletes the session information established in this synchronization process after receiving the 200 OK message from UE2. The established synchronous session information, so as to realize the recycling of the synchronous session information.
步骤23:UE2结束同步传输,向同步控制服务器回送200 OK消息,表示成功结束本次同步传输过程。Step 23: UE2 ends the synchronous transmission, and returns a 200 OK message to the synchronous control server, indicating that the synchronous transmission process is successfully completed.
图4是本发明提供的数据同步系统的组成示意图。Fig. 4 is a schematic diagram of the composition of the data synchronization system provided by the present invention.
如图4所示,该系统包括同步控制服务器401和多个同步客户端402。As shown in FIG. 4 , the system includes a synchronization control server 401 and multiple synchronization clients 402 .
同步控制服务器401,是用于实现数据同步的网络服务器,具体用于接收同步客户端402的同步服务注册请求,存储该同步服务注册请求中携带的用户信息,从而建立和保持与同步客户端402的IP在线连接,根据自身存储的用户信息,在参与同步会话的同步客户端之间转发数据同步会话信息,从而实现不同同步客户端402之间的数据同步会话控制,例如数据同步会话的建立、维持和拆除。The synchronization control server 401 is a network server for realizing data synchronization, specifically for receiving the synchronization service registration request of the synchronization client 402, and storing the user information carried in the synchronization service registration request, so as to establish and maintain the synchronization with the synchronization client 402. According to the user information stored by itself, the data synchronization session information is forwarded between the synchronization clients participating in the synchronization session, so as to realize the data synchronization session control between different synchronization clients 402, such as the establishment of the data synchronization session, Maintain and dismantle.
其中,同步控制服务器401通过存储和更新同步客户端402的IP地址和端口号,来建立和保持与同步客户端402的IP在线连接。Wherein, the synchronization control server 401 establishes and maintains the IP online connection with the synchronization client 402 by storing and updating the IP address and port number of the synchronization client 402 .
同步客户端402是用户设备中的一个模块,例如可以设置在手机、PDA、PC等各种设备中,同步客户端402通过无线网络或因特网与同步控制服务器401通信。The synchronization client 402 is a module in the user equipment, for example, can be installed in various devices such as mobile phones, PDAs, PCs, etc. The synchronization client 402 communicates with the synchronization control server 401 through a wireless network or the Internet.
同步客户端402,具体用于向同步控制服务器401发送同步服务注册请求,从而建立和保持与同步控制服务器401的IP在线连接,通过同步控制服务器401控制与其他同步客户端402的数据同步会话,根据同步控制服务器转发的数据同步会话信息,直接与所述其他同步客户端402进行数据传输。The synchronization client 402 is specifically used to send a synchronization service registration request to the synchronization control server 401, thereby establishing and maintaining an IP online connection with the synchronization control server 401, and controlling data synchronization sessions with other synchronization clients 402 by the synchronization control server 401, Data transmission is directly performed with the other synchronization client 402 according to the data synchronization session information forwarded by the synchronization control server.
同步客户端402通过向同步控制服务器401发送和更新自身的IP地址和端口号,来建立和保持与同步控制服务器401的IP在线连接。The synchronization client 402 establishes and maintains an IP online connection with the synchronization control server 401 by sending and updating its own IP address and port number to the synchronization control server 401 .
同步客户端402通过同步控制服务器401控制与其他同步客户端402的数据同步会话,具体可以包括:同步客户端402通过同步控制服务器401建立、维持和拆除与其他同步客户端402的数据同步会话。The synchronization client 402 controls data synchronization sessions with other synchronization clients 402 through the synchronization control server 401 , which may specifically include: the synchronization client 402 establishes, maintains, and dismantles data synchronization sessions with other synchronization clients 402 through the synchronization control server 401 .
其中,通过同步控制服务器401建立数据同步会话具体为:参与数据同步会话的同步客户端402通过同步控制服务器401获取参与数据同步会话的其他同步客户端402的同步会话信息。更为具体地,参与数据同步会话的同步客户端402首先将本地的同步会话信息通过同步控制服务器401转发到其他同步客户端402,其他同步客户端402在收到此同步会话信息之后,将所需数据同步的数据类型和同步协议进行匹配,并根据匹配结果,再次通过同步控制服务器401将其自身的同步会话信息转发到原同步客户端402中,这样原同步客户端402和其他同步客户端402都获得了对方的同步会话信息,之后就便可进行同步传输。所述同步会话信息包括:所述其他同步客户端402的IP地址、端口号、需要同步的数据类型和采用的同步协议等。The establishment of the data synchronization session through the synchronization control server 401 specifically includes: the synchronization client 402 participating in the data synchronization session obtains the synchronization session information of other synchronization clients 402 participating in the data synchronization session through the synchronization control server 401 . More specifically, the synchronization client 402 participating in the data synchronization session first forwards the local synchronization session information to other synchronization clients 402 through the synchronization control server 401, and after receiving the synchronization session information, the other synchronization clients 402 forward all the synchronization session information The data types that need data synchronization are matched with the synchronization protocol, and according to the matching result, the synchronization session information of itself is forwarded to the original synchronization client 402 by the synchronization control server 401 again, so that the original synchronization client 402 and other synchronization clients 402 have obtained the synchronous session information of the other party, and then the synchronous transmission can be performed. The synchronization session information includes: the IP address and port number of the other synchronization client 402, the type of data to be synchronized, the synchronization protocol adopted, and the like.
通过同步控制服务器401维持数据同步会话具体为:参与数据同步会话的同步客户端402通过同步控制服务器401,将自身更新的同步会话信息发给参与数据同步会话的其他同步客户端402。Maintaining the data synchronization session through the synchronization control server 401 specifically includes: the synchronization client 402 participating in the data synchronization session sends its updated synchronization session information to other synchronization clients 402 participating in the data synchronization session through the synchronization control server 401 .
通过同步控制服务器401删除数据同步会话具体为:同步控制服务器401删除本次数据同步过程的数据同步会话信息。Deleting the data synchronization session through the synchronization control server 401 is specifically: the synchronization control server 401 deletes the data synchronization session information in this data synchronization process.
下面对同步控制服务器401和同步客户端402的具体结构进行介绍,具体请参见图5和图6。The specific structures of the synchronization control server 401 and the synchronization client 402 are introduced below, please refer to FIG. 5 and FIG. 6 for details.
图5是本发明提供的同步控制服务器的结构图。Fig. 5 is a structural diagram of the synchronization control server provided by the present invention.
如图5所示,同步控制服务器包括同步服务注册模块501、同步客户端永远在线模块502、同步会话控制模块503。As shown in FIG. 5 , the synchronization control server includes a synchronization service registration module 501 , a synchronization client always-on module 502 , and a synchronization session control module 503 .
同步服务注册模块501,用于接收同步客户端的同步服务注册请求,存储该同步客户端的用户信息。The synchronization service registration module 501 is configured to receive a synchronization service registration request from a synchronization client, and store user information of the synchronization client.
同步客户端永远在线模块502,用于建立和保持与同步客户端之间的IP在线连接。The synchronization client always-on module 502 is configured to establish and maintain an IP online connection with the synchronization client.
同步客户端永远在线模块502,具体可以用于接收同步客户端周期性发送的同步服务注册请求、或在同步客户端自身用户信息更新时发送的同步服务注册请求,将该同步服务注册请求发给所述同步服务注册模块501,从而建立和保持与同步客户端之间的IP在线连接。The always-on module 502 of the synchronization client can specifically be used to receive the synchronization service registration request periodically sent by the synchronization client, or the synchronization service registration request sent when the user information of the synchronization client itself is updated, and send the synchronization service registration request to The synchronization service registration module 501 establishes and maintains an IP online connection with the synchronization client.
同步会话控制模块503,用于实现同步客户端之间的数据同步会话控制,包括数据同步会话的建立、维护和删除。The synchronization session control module 503 is configured to implement data synchronization session control between synchronization clients, including establishment, maintenance and deletion of data synchronization sessions.
同步会话控制模块503,具体用于接收同步客户端的同步会话建立请求,所述同步会话建立请求中携带有数据同步会话信息,根据同步客户端永远在线模块502维护的同步客户端的IP连接,查询到对端的同步客户端,在同步客户端之间转发数据同步会话信息,从而建立同步客户端之间的数据同步会话。The synchronization session control module 503 is specifically configured to receive a synchronization session establishment request from a synchronization client, wherein the synchronization session establishment request carries data synchronization session information, and is queried according to the IP connection of the synchronization client maintained by the synchronization client always-on module 502 The synchronization client at the opposite end forwards the data synchronization session information between the synchronization clients, thereby establishing a data synchronization session between the synchronization clients.
其中,同步服务注册模块501,用于在接收到同步客户端的同步服务注册请求后,查询是否已存储该同步客户端本次发送的同步服务注册请求中携带的用户信息,如果已存储,保持该同步客户端的用户信息不变,如果未存储,则对该同步客户端进行认证,在认证通过后,更新该同步客户端的用户信息。Wherein, the synchronization service registration module 501 is configured to, after receiving the synchronization service registration request from the synchronization client, inquire whether the user information carried in the synchronization service registration request sent by the synchronization client this time has been stored, and if it has been stored, keep the The user information of the synchronization client remains unchanged, if not stored, the synchronization client is authenticated, and after the authentication is passed, the user information of the synchronization client is updated.
同步会话控制模块503,还用于维护同步客户端之间的数据同步会话。The synchronization session control module 503 is also configured to maintain a data synchronization session between synchronization clients.
同步会话控制模块503,具体用于更新数据同步会话信息,将更新的数据同步会话信息,实时转发给参与数据同步会话的同步客户端。The synchronization session control module 503 is specifically configured to update the data synchronization session information, and forward the updated data synchronization session information to the synchronization clients participating in the data synchronization session in real time.
同步会话控制模块503,还用于接收同步客户端结束数据同步会话的请求,删除本次的数据同步会话信息。其中,同步客户端一般在数据同步完成后,向同步会话控制模块503发出结束数据同步会话的请求,当然,也不排除同步客户端在其他特殊情况下,向同步会话控制模块503发出结束数据同步会话的请求。The synchronization session control module 503 is further configured to receive a request from the synchronization client to end the data synchronization session, and delete the current data synchronization session information. Wherein, the synchronization client generally sends a request for ending the data synchronization session to the synchronization session control module 503 after the data synchronization is completed. Of course, it does not rule out that the synchronization client sends an end data synchronization session to the synchronization session control module 503 in other special cases. session request.
其中,所述的数据同步会话信息是建立数据同步所需要的上下文(context)信息,包括但不限于以下信息:同步客户端的IP地址、同步会话的端口号、需要同步的数据类型、采用的同步协议等。Wherein, the data synchronization session information is the context (context) information required to establish data synchronization, including but not limited to the following information: the IP address of the synchronization client, the port number of the synchronization session, the data type to be synchronized, and the synchronization method used. agreement etc.
图6是本发明提供的同步客户端的结构图。Fig. 6 is a structural diagram of a synchronization client provided by the present invention.
如图6所示,同步客户端包括同步服务注册模块601、永远在线模块602、同步会话控制模块603和数据同步模块604。As shown in FIG. 6 , the synchronization client includes a synchronization service registration module 601 , an always-on module 602 , a synchronization session control module 603 and a data synchronization module 604 .
同步服务注册模块601,用于向同步服务器发送同步服务注册请求。该同步服务注册请求中携带有同步客户端的基本信息,例如,同步客户端的IP地址和端口号等。The synchronization service registration module 601 is configured to send a synchronization service registration request to the synchronization server. The synchronization service registration request carries basic information of the synchronization client, for example, the IP address and port number of the synchronization client.
永远在线模块602,用于周期性地、或在同步客户端自身的用户信息更新时,向同步控制服务器发送同步服务注册请求,该同步服务注册请求中携带有同步客户端的用户信息,从而建立和保持与服务器之间的IP在线连接。The always-on module 602 is configured to periodically or when the user information of the synchronization client itself is updated, send a synchronization service registration request to the synchronization control server, where the synchronization service registration request carries the user information of the synchronization client, so as to establish and Keep an IP online connection with the server.
通过永远在线模块602实现该永远在线模块602所在用户设备的永远在线以后,使得各永远在线的用户设备之间可以随时进行数据同步。After the always-on module 602 is used to implement the always-on of the user equipment where the always-on module 602 is located, data synchronization can be performed at any time between the always-on user equipment.
同步会话控制模块603,用于与同步控制服务器通信,完成用户设备之间的同步会话控制,包括同步会话的建立、维护和删除。The synchronization session control module 603 is configured to communicate with the synchronization control server to complete the synchronization session control between user equipments, including establishment, maintenance and deletion of the synchronization session.
同步会话控制模块603,具体用于在用户设备有需要同步的数据时,通过同步控制服务器与另一用户设备的同步会话控制模块建立数据同步会话。The synchronization session control module 603 is specifically configured to establish a data synchronization session with a synchronization session control module of another user equipment through the synchronization control server when the user equipment has data that needs to be synchronized.
其中,同步服务注册模块601,用于接收同步控制服务器的质询信息,其中包括安全认证所需的令牌,根据所述令牌将该同步客户端的标识和密码加密后发给同步控制服务器进行认证。Wherein, the synchronization service registration module 601 is used to receive the query information of the synchronization control server, which includes the token required for security authentication, encrypt the identification and password of the synchronization client according to the token, and then send it to the synchronization control server for authentication .
同步会话控制模块603建立数据同步会话具体为:同步会话控制模块603与参与数据同步的其他同步会话控制模块603交互数据同步所需要的上下文信息。所述上下文信息具体包括但不限于以下信息:用户设备的IP地址、同步会话的端口号、需要同步的数据类型、采用的同步协议等。The establishment of the data synchronization session by the synchronization session control module 603 specifically includes: the synchronization session control module 603 exchanges context information required for data synchronization with other synchronization session control modules 603 participating in data synchronization. The context information specifically includes but is not limited to the following information: IP address of the user equipment, port number of the synchronization session, data type to be synchronized, synchronization protocol adopted, and the like.
数据同步模块604,根据同步会话控制模块603建立的数据同步会话,直接与其他数据同步模块进行数据传输,即在进行数据传输时,不需要经过同步控制服务器,而是在用户设备之间直接进行。The data synchronization module 604, according to the data synchronization session established by the synchronization session control module 603, directly performs data transmission with other data synchronization modules, that is, when performing data transmission, it does not need to go through the synchronization control server, but directly between the user equipment .
数据同步模块604,具体根据同步会话建立的上下文,采用商定的同步协议(SyncML或者rSync)分别完成每种数据的同步。The data synchronization module 604 uses an agreed synchronization protocol (SyncML or rSync) to complete the synchronization of each type of data, specifically according to the context established by the synchronization session.
其中,本发明所述的同步会话上下文信息,可以用xml描述,下面举一个具体的例子进行说明:Wherein, the synchronous session context information described in the present invention can be described in xml, and a specific example is given below to illustrate:
可见,本发明提供的数据同步方案,无需服务器进行数据中转,能够有效降低服务器的负载,提高同步效率。It can be seen that the data synchronization solution provided by the present invention does not require a server for data transfer, can effectively reduce the load on the server, and improve synchronization efficiency.
采用本发明,用户设备在数据同步时,可根据需要选择不同的协议进行数据同步,此方法支持多种类型的数据同步,例如,可以根据数据的存储特点、数据的呈现方式、同步触发方式等,采用syncML协议或者rSync协议实现数据同步。With the present invention, the user equipment can select different protocols for data synchronization according to needs during data synchronization. This method supports multiple types of data synchronization. For example, it can be based on data storage characteristics, data presentation methods, synchronization trigger methods, etc. , using syncML protocol or rSync protocol to realize data synchronization.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210004837.4A CN103200211B (en) | 2012-01-04 | 2012-01-04 | A kind of method of data synchronization, system and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210004837.4A CN103200211B (en) | 2012-01-04 | 2012-01-04 | A kind of method of data synchronization, system and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103200211A CN103200211A (en) | 2013-07-10 |
CN103200211B true CN103200211B (en) | 2016-12-14 |
Family
ID=48722568
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210004837.4A Active CN103200211B (en) | 2012-01-04 | 2012-01-04 | A kind of method of data synchronization, system and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103200211B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105376062B (en) * | 2015-10-26 | 2019-05-31 | 努比亚技术有限公司 | A kind of communication security exchange method, apparatus and system |
CN116561089B (en) * | 2023-07-10 | 2023-09-19 | 成都泛联智存科技有限公司 | Data synchronization method, device, client and computer readable storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102137065A (en) * | 2010-01-25 | 2011-07-27 | 中国移动通信集团公司 | Communication method, terminals and system applied in multiple networks |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4118800B2 (en) * | 2003-12-26 | 2008-07-16 | ソフトバンクモバイル株式会社 | Presence display system and gateway device |
KR101017365B1 (en) * | 2006-02-14 | 2011-02-28 | 삼성전자주식회사 | A method of synchronizing a plurality of content directory service devices, a content directory service device and a system |
CN101257375B (en) * | 2006-12-31 | 2012-08-08 | 华为技术有限公司 | Method and device for realizing multi-terminal message synchronization |
-
2012
- 2012-01-04 CN CN201210004837.4A patent/CN103200211B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102137065A (en) * | 2010-01-25 | 2011-07-27 | 中国移动通信集团公司 | Communication method, terminals and system applied in multiple networks |
Non-Patent Citations (2)
Title |
---|
基于P2P-SIP融合技术的VoIP系统设计研究;黄文聪;《中国优秀硕士学位论文全文数据库信息科技辑》;20091215;第I136-111页 * |
面向异构网络视频点播系统关键技术的研究;黄宏杰;《中国优秀硕士学位论文全文数据库信息科技辑》;20111215;第I136-626页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103200211A (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8955084B2 (en) | Timestamp-based token revocation | |
CN101217431B (en) | A method and system of photos in synchronous mobile terminal network TV and network album | |
US20070078986A1 (en) | Techniques for reducing session set-up for real-time communications over a network | |
CN105531979B (en) | It is a kind of for exchanging the method and server of data between a client and a server | |
WO2018072753A1 (en) | Seamless handover method and apparatus based on web real-time communication session | |
JP2005303485A (en) | Key distribution method and system for encrypted communication | |
CA2419853A1 (en) | Location-independent packet routing and secure access in a short-range wireless networking environment | |
WO2019178942A1 (en) | Method and system for performing ssl handshake | |
WO2012000226A1 (en) | Method for realizing peer-to-peer (p2p) communication on webpage | |
JP2003510902A (en) | Wide area network synchronization | |
CN103812900A (en) | Data synchronization method, device and system | |
TW201423430A (en) | Method for data sharing, server and system | |
WO2014067284A1 (en) | Cross-domain controller authentication method, apparatus, and host | |
CN102858025A (en) | Method and device of point-to-point interactive operation | |
CN102065143B (en) | Communication method and system based on HTTP (hyper Text Transfer Protocol), HTTP server and HTTP client | |
CN103220345B (en) | Door device management method and door equipment and system | |
CN103200211B (en) | A kind of method of data synchronization, system and equipment | |
CN103200146B (en) | The method of data synchronization of terminal and server and device | |
CN1921682B (en) | Enhancing the key agreement method in the general authentication framework | |
CN101902722B (en) | Method for realizing roaming authentication of mobile terminal in wireless local area network and access point | |
CN102714653B (en) | For the system and method for accessing private digital content | |
US7774464B2 (en) | Automatic syncML client profile creation for new servers | |
CA2794818C (en) | Timestamp-based token revocation | |
CN103024049A (en) | System capable of achieving browser data synchronization | |
CN114979237B (en) | Long connection verification method, device, equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |