[go: up one dir, main page]

CN103024049B - Realize the system that browser data is synchronous - Google Patents

Realize the system that browser data is synchronous Download PDF

Info

Publication number
CN103024049B
CN103024049B CN201210548764.5A CN201210548764A CN103024049B CN 103024049 B CN103024049 B CN 103024049B CN 201210548764 A CN201210548764 A CN 201210548764A CN 103024049 B CN103024049 B CN 103024049B
Authority
CN
China
Prior art keywords
server
information
client
socket
connection
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
Application number
CN201210548764.5A
Other languages
Chinese (zh)
Other versions
CN103024049A (en
Inventor
吴浩
任寰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210548764.5A priority Critical patent/CN103024049B/en
Publication of CN103024049A publication Critical patent/CN103024049A/en
Application granted granted Critical
Publication of CN103024049B publication Critical patent/CN103024049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

本发明涉及一种实现浏览器数据同步的系统,该系统包括:云存储服务器端、推送服务器和多个浏览器客户端以及套接字服务器,其中:所述云存储服务器端用于在有数据更新时向所述推送服务器下发条件信息和命令信息;所述推送服务器用于根据该条件信息在所述多个浏览器客户端中确定目标客户端,并将所述命令信息发送给与所述目标客户端连接的套接字服务器;以及所述目标客户端用于根据所述命令信息实现其与云存储服务器端的数据同步;所述套接字服务器用于将来自推送服务器的命令信息发送给相应的目标客户端。本发明能实现同步数据的高效发送,缩短执行时间,降低资源消耗,提高系统效率,改进业务的实时性。

The invention relates to a system for synchronizing browser data. The system includes: a cloud storage server, a push server, multiple browser clients, and a socket server, wherein: the cloud storage server is used for When updating, send condition information and command information to the push server; the push server is used to determine the target client among the plurality of browser clients according to the condition information, and send the command information to all browser clients. The socket server connected to the target client; and the target client is used to realize data synchronization with the cloud storage server according to the command information; the socket server is used to send the command information from the push server to the corresponding target client. The invention can realize high-efficiency transmission of synchronous data, shorten execution time, reduce resource consumption, improve system efficiency, and improve real-time performance of services.

Description

实现浏览器数据同步的系统A system for synchronizing browser data

技术领域technical field

本发明涉及信息技术数据同步领域,尤其涉及一种实现浏览器数据同步的系统。The invention relates to the field of information technology data synchronization, in particular to a system for realizing browser data synchronization.

背景技术Background technique

目前,随着网络技术的发展,互联网作为一个庞大的信息资源,成为人们获取信息的最方便、快捷的途径。目前,用户通常使用个人计算机接入英特网(Internet),并通过个人计算机中安装的浏览器(Browser)访问网页,获得需要的信息。随着移动通信技术的发展,用户还可以通过支持浏览器功能的移动终端接入英特网,例如手机、个人数字助理(PersonalDigitalAssistant,简称PDA)。At present, with the development of network technology, the Internet, as a huge information resource, has become the most convenient and fast way for people to obtain information. At present, a user usually uses a personal computer to access the Internet (Internet), and accesses a webpage through a browser installed in the personal computer to obtain required information. With the development of mobile communication technologies, users can also access the Internet through mobile terminals supporting browser functions, such as mobile phones and personal digital assistants (Personal Digital Assistant, PDA for short).

然而,无论是个人计算机上的浏览器还是移动终端上的浏览器,一般不提供推送服务,服务器端与客户端的信息交互依赖于客户端发起的连接,服务器端无法主动地将信息发送给客户端,从而无法实现服务器端与浏览器客户端之间的信息的实时同步。However, whether it is a browser on a personal computer or a browser on a mobile terminal, generally no push service is provided, and the information interaction between the server and the client depends on the connection initiated by the client, and the server cannot actively send information to the client , so that real-time synchronization of information between the server and the browser client cannot be realized.

现有技术中,最常用的实现浏览器客户端与服务器端浏览器数据同步的方式是浏览器客户端以一定频率向服务器端发送请求,如每周一次或每月一次,如果服务端有相关信息的更新则获取这些信息。然而,申请人发现该种数据同步方式存在如下技术缺陷:效率比较低、占用资源多、不能做到内容的真正实时同步更新。In the prior art, the most commonly used way to synchronize browser data between the browser client and the server is that the browser client sends a request to the server at a certain frequency, such as once a week or once a month. Updates to the information capture this information. However, the applicant found that this data synchronization method has the following technical defects: relatively low efficiency, takes up a lot of resources, and cannot achieve true real-time synchronous update of content.

此外,在现有技术中,在服务器与客户端之间建立连接时常使用套接字(socket)服务,所谓套接字是网络中客户端与服务器的一种交流方式,当服务器与客户端要建立连接并进行数据传送时,需要将服务器和需要建立连接的客户端(目标客户端)进行对接,而套接字可以看作是这种对接的“对接号”,只有服务器与目标客户端的“对接号”相同,才能够进行连接以传送数据。而套接字服务就是为服务器和客户端接供的对接服务。然而,通常的套接字服务在实现向多个客户端进行数据推送时采用同步调度方式,即当套接字服务器向客户端发送一个消息后,等待该客户端进行接收和确认,然后向下一个客户端推送消息。并且,一般的套接字服务采用http协议,http协议会占用较多的系统资源,在业务量大时会引起资源的快速消耗,从而降低数据同步的实时性。In addition, in the prior art, a socket (socket) service is often used to establish a connection between the server and the client. The so-called socket is a communication method between the client and the server in the network. When the server and the client need to When establishing a connection and transmitting data, it is necessary to connect the server with the client (target client) that needs to be connected, and the socket can be regarded as the "docking number" of this connection, only the "docking number" between the server and the target client "Docking number" is the same, to be able to connect to transmit data. The socket service is a docking service for the server and the client. However, a common socket service adopts a synchronous scheduling method when implementing data push to multiple clients, that is, after the socket server sends a message to a client, it waits for the client to receive and confirm, and then down A client pushes messages. Moreover, the general socket service adopts the http protocol, which will occupy more system resources, and will cause rapid consumption of resources when the business volume is large, thereby reducing the real-time performance of data synchronization.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的实现浏览器数据同步的系统。In view of the above problems, the present invention is proposed to provide a system for implementing browser data synchronization that overcomes the above problems or at least partially solves the above problems.

本发明提出一种实现浏览器数据同步的系统,该系统包括:云存储服务器端、推送服务器和多个浏览器客户端以及套接字服务器,其中所述云存储服务器端,用于在有数据更新时向所述推送服务器下发条件信息和命令信息;所述推送服务器用于根据该条件信息在所述多个浏览器客户端中确定目标客户端,并将所述命令信息发送给所述目标客户端;以及所述目标客户端,用于根据所述命令信息实现其与云存储服务器端的数据同步;所述套接字服务器用于将来自推送服务器的命令信息发送给相应的目标客户端。The present invention proposes a system for synchronizing browser data. The system includes: a cloud storage server, a push server, multiple browser clients, and a socket server, wherein the cloud storage server is used to When updating, send condition information and command information to the push server; the push server is used to determine the target client among the plurality of browser clients according to the condition information, and send the command information to the The target client; and the target client, used to realize data synchronization with the cloud storage server according to the command information; the socket server is used to send the command information from the push server to the corresponding target client .

可选地,所述套接字服务器包括连接模块,该连接模块用于与所述浏览器客户端建立套接字连接,其中,当所述浏览器客户端发起与所述套接字服务器的连接时,所述连接模块接受该连接,并获得该连接的资源标识符。Optionally, the socket server includes a connection module configured to establish a socket connection with the browser client, wherein when the browser client initiates a connection with the socket server When connecting, the connection module accepts the connection and obtains the resource identifier of the connection.

根据本发明的一种具体实施方式,所述连接模块还用于经由所述连接接收从所述浏览器客户端发送的连接标识符;所述套接字服务器还包括验证模块,所述验证模块用于:当接收从所述浏览器客户端发送的连接标识符时,查询分发信息数据库以验证该连接标识符是否存在于该分发信息数据库中。According to a specific implementation manner of the present invention, the connection module is further configured to receive the connection identifier sent from the browser client via the connection; the socket server further includes a verification module, and the verification module The method is used for: when receiving the connection identifier sent from the browser client, querying the distribution information database to verify whether the connection identifier exists in the distribution information database.

根据本发明的一种具体实施方式,所述验证模块还用于:当所述连接标识符存在于该分发信息数据库时,将所述资源标识符存入所述分发信息数据库。According to a specific implementation manner of the present invention, the verification module is further configured to: when the connection identifier exists in the distribution information database, store the resource identifier in the distribution information database.

根据本发明的一种具体实施方式,所述验证模块还用于:当所述连接标识符不存在于该分发信息数据库时,指示所述连接模块断开所述连接。According to a specific implementation manner of the present invention, the verification module is further configured to: when the connection identifier does not exist in the distribution information database, instruct the connection module to disconnect the connection.

根据本发明的一种具体实施方式,所述套接字服务器还包括一个查询模块,当所述推送服务器将条件信息和命令信息发送给为目标客户端分配的套接字服务器时,所述查询模块根据所述条件信息查询分发信息数据库以确定目标客户端。According to a specific embodiment of the present invention, the socket server further includes a query module, when the push server sends the condition information and command information to the socket server assigned to the target client, the query The module queries the distribution information database according to the condition information to determine the target client.

根据本发明的一种具体实施方式,该连接模块根据条件信息在分发信息数据库中查询资源标识符来确定目标客户端。According to a specific implementation manner of the present invention, the connection module determines the target client by querying the resource identifier in the distribution information database according to the condition information.

根据本发明的一种具体实施方式,当所述套接字服务器接收到了命令信息并已根据条件信息确定了目标客户端,并且目标客户端不止一个时,所述连接模块对其中一个客户端发送命令消息之后,不等待其接收确认就直接向下一个客户端发送命令消息。According to a specific implementation manner of the present invention, when the socket server receives the command information and has determined the target client according to the condition information, and there are more than one target client, the connection module sends a After the command message, send the command message directly to the next client without waiting for its receipt confirmation.

根据本发明的一种具体实施方式,所述连接模块采用传输控制协议与所述浏览器客户端进行连接和命令信息的发送。According to a specific implementation manner of the present invention, the connection module uses the transmission control protocol to connect with the browser client and send command information.

可选地,该系统还包括分发器,用于向浏览器客户端分配与其连接的套接字服务器;所述分发器还包括:分发信息数据库,用于存储与套接字服务器分配相关的信息Optionally, the system also includes a distributor for distributing socket servers connected to the browser client; the distributor also includes: a distribution information database for storing information related to socket server distribution

从上述技术方案可以看出,本发明具有以下有益效果:As can be seen from the foregoing technical solutions, the present invention has the following beneficial effects:

(1)通过套接字服务器、分发器和分发信息数据库,顺利实现了云存储服务器端、推送服务器和目标客户端的连接;(1) Through the socket server, the distributor and the distribution information database, the connection between the cloud storage server, the push server and the target client is successfully realized;

(2)本发明的套接字服务器采用异步调度方式,从而达到数据的高效发送,进而缩短执行时间,提高系统效率而且减少不同客户端接收到消息的时间差,改进业务的实时性。(2) The socket server of the present invention adopts an asynchronous scheduling mode, thereby achieving efficient transmission of data, further shortening execution time, improving system efficiency and reducing the time difference between different clients receiving messages, and improving real-time performance of services.

(3)本发明在实现套接字服务器时采用更为底层的传输控制协议协议(TransmissionControlProtocol),从而实现资源消耗的减小,在有限的资源条件下提高系统的业务处理能力。(3) The present invention adopts a lower transmission control protocol (TransmissionControlProtocol) when realizing the socket server, so as to realize the reduction of resource consumption and improve the service processing capability of the system under the condition of limited resources.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1为根据本发明一个实施例的实现浏览器数据同步的系统的结构示意图;FIG. 1 is a schematic structural diagram of a system for realizing browser data synchronization according to an embodiment of the present invention;

图2为根据本发明另一个实施例的实现浏览器数据同步的系统的结构示意图;2 is a schematic structural diagram of a system for realizing browser data synchronization according to another embodiment of the present invention;

图3为图2所示实现浏览器数据同步的系统中浏览器客户端与套接字服务器建立连接的过程的示意图;Fig. 3 is a schematic diagram of the process of establishing a connection between the browser client and the socket server in the system for realizing browser data synchronization shown in Fig. 2;

图4为图2所示实现浏览器数据同步的系统中在第一类场景下向目标客户端进行信息推送的过程的示意图;Fig. 4 is a schematic diagram of the process of pushing information to the target client in the first type of scenario in the system for realizing browser data synchronization shown in Fig. 2;

图5为图2所示实现浏览器数据同步的系统中在第二类场景下向目标客户端进行信息推送的过程的示意图;Fig. 5 is a schematic diagram of the process of pushing information to the target client in the second type of scenario in the system for implementing browser data synchronization shown in Fig. 2;

图6为图2所示实现浏览器数据同步的系统中在第三类场景下向目标客户端进行信息推送的过程的示意图;Fig. 6 is a schematic diagram of the process of pushing information to the target client in the third type of scenario in the system for realizing browser data synchronization shown in Fig. 2;

图7为根据本发明实施例的实现浏览器数据同步的方法的流程图;7 is a flowchart of a method for implementing browser data synchronization according to an embodiment of the present invention;

图8为根据本发明实施例的实现浏览器数据同步的浏览器客户端的结构示意图;FIG. 8 is a schematic structural diagram of a browser client implementing browser data synchronization according to an embodiment of the present invention;

图9为根据本发明实施例的套接字服务器的结构示意图;FIG. 9 is a schematic structural diagram of a socket server according to an embodiment of the present invention;

图10为根据本发明实施例的应用于套接字服务器的套接字服务方法的流程图。FIG. 10 is a flowchart of a socket service method applied to a socket server according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

在本发明的一个示例性实施例中,提供了一种实现浏览器数据同步的系统。如图1所示,该实现浏览器数据同步的系统包括:云存储服务器端1、推送服务器2和多个浏览器客户端3、4。其中,云存储服务器端1,用于在有数据更新时向推送服务器下发条件信息和命令信息;推送服务器2,用于根据条件信息在多个浏览器客户端中确定目标客户端,并将该命令信息推送至目标客户端3;目标客户端3,用于根据该命令信息实现目标客户端与云存储服务器端的数据同步。In an exemplary embodiment of the present invention, a system for implementing browser data synchronization is provided. As shown in FIG. 1 , the system for synchronizing browser data includes: a cloud storage server 1 , a push server 2 and multiple browser clients 3 and 4 . Among them, the cloud storage server 1 is used to send condition information and command information to the push server when there is data update; the push server 2 is used to determine the target client among multiple browser clients according to the condition information, and send The command information is pushed to the target client 3; the target client 3 is used to realize data synchronization between the target client and the cloud storage server according to the command information.

在图1所示的实施例中,通过设置单独的推送服务器2,在云存储服务器端存储的数据内容发生更新的情况下,及时地将命令信息通过推送服务器发送至目标客户端,从而简单、高效地实现了服务端信息与客户端实时同步。In the embodiment shown in Figure 1, by setting up a separate push server 2, when the data content stored at the cloud storage server end is updated, the command information is sent to the target client through the push server in time, so that it is simple, Efficiently realize the real-time synchronization of server-side information and client-side information.

如图1所示,多个浏览器客户端中包含有发起客户端4和目标客户端3。其中,发起客户端4,用于对存储于云存储服务器端1中的数据进行更新。该发起客户端4和目标客户端3可以属于同一个用户,也可以属于不同的用户。该发起客户端4和目标客户端3属于同一个用户的情况主要的应用场景在于:同一用户使用不同的设备(例如手机和PC)登录浏览器,其中一个(例如PC)更改收藏夹,那么需要将该更新同步到同一用户的另一设备(手机)。该发起客户端4和目标客户端3不属于同一个用户的情况的应用场景例如是不同浏览器客户端之间的信息通信。As shown in FIG. 1 , multiple browser clients include an initiating client 4 and a target client 3 . Wherein, the initiating client 4 is used to update the data stored in the cloud storage server 1 . The initiating client 4 and the target client 3 may belong to the same user, or may belong to different users. The main application scenario where the initiating client 4 and the target client 3 belong to the same user is: the same user uses different devices (such as a mobile phone and a PC) to log in to the browser, and one of them (such as a PC) changes favorites, then it needs Sync that update to another device (phone) of the same user. An application scenario where the initiating client 4 and the target client 3 do not belong to the same user is, for example, information communication between different browser clients.

当然,本发明也可以由云存储服务器端自身发起对数据内容的更新,在这种情况下,图1中的发起浏览器客户端4则可以不存在。这种情况的场景例如是:系统向所有浏览器客户端推送新闻消息或天气预报;或系统向所有某版本的浏览器客户端发起更新指示。Of course, in the present invention, the cloud storage server itself can also initiate an update of the data content. In this case, the initiating browser client 4 in FIG. 1 may not exist. The scenario of this situation is, for example: the system pushes news messages or weather forecasts to all browser clients; or the system initiates an update instruction to all browser clients of a certain version.

由于图1中虚线框以内的云存储服务器端1、目标客户端3和发起客户端4是现有浏览器系统中已有的,因此在此基础上添加推送服务器可以有效地利用原有的系统架构,降低实现本发明的成本。Since the cloud storage server 1, the target client 3 and the initiating client 4 within the dotted line box in Figure 1 are existing in the existing browser system, adding a push server on this basis can effectively utilize the original system Architecture, reducing the cost of implementing the present invention.

为了实现云存储服务器端1、推送服务器2和目标客户端3的连接,如图2所示,实现浏览器客户端与云存储服务器端数据同步的系统还可以包括多个套接字服务器(socketserver)、分发器。In order to realize the connection of the cloud storage server 1, the push server 2 and the target client 3, as shown in Figure 2, the system for realizing data synchronization between the browser client and the cloud storage server can also include multiple socket servers (socketserver ),Distributor.

根据本发明,为了提高实现浏览器客户端与云存储服务器端的数据同步效率,提出了推送服务器与云存储服务器端之间专用于提供套接字服务的套接字服务器。套接字服务器用于与多个浏览器客户端建立套接字连接,并且在接收到条件信息和命令信息时,根据该条件信息从多个浏览器客户端中确定目标客户端,并将命令信息发送到目标客户端。According to the present invention, in order to improve the data synchronization efficiency between the browser client and the cloud storage server, a socket server dedicated to providing socket services between the push server and the cloud storage server is proposed. The socket server is used to establish a socket connection with multiple browser clients, and when receiving condition information and command information, determine the target client from multiple browser clients according to the condition information, and send the command The information is sent to the target client.

所述的套接字服务器是一种虚拟服务器,可对现有的提供套接字服务的服务器进行配置实现,也可以由是具有独立功能的软件或软件模块来实现。The socket server is a virtual server, which can be implemented by configuring the existing server providing socket services, or can be realized by software or software modules with independent functions.

分发器,用于在接收到客户端的连接请求后,为其分配相应的套接字服务器以及连接标识符,并将用户标识信息以及连接标识符存储至分发信息数据库。详细的连接建立过程如图3所示,包括:The distributor is configured to allocate a corresponding socket server and a connection identifier to the client after receiving the connection request, and store the user identification information and the connection identifier in the distribution information database. The detailed connection establishment process is shown in Figure 3, including:

步骤S301,浏览器客户端向分发器提交连接请求,该连接请求中至少包括用户标识信息,对于登录用户来讲,其用户标识信息可以包括用户名,而对于非登录用户来讲,其用户标识信息可以包括用户的机器标识。Step S301, the browser client submits a connection request to the distributor. The connection request includes at least user identification information. For a logged-in user, the user identification information may include a user name; for a non-login user, the user identification Information may include a user's machine identification.

对于登录用户来讲,该用户标识信息可以为一字符串。其中,该字符串除了登录用户的用户名之外,还包括登录时间和验证字符等信息。用户名为用户唯一标示号,即一个数字,用于代表一个用户。验证字符根据用户名生成,即可通过验证字符判定用户标识信息是否被更改。For a logged-in user, the user identification information may be a character string. Wherein, in addition to the username of the logged-in user, the character string also includes information such as login time and verification characters. The username is the user's unique identification number, which is a number used to represent a user. The verification character is generated according to the user name, and it can be determined whether the user identification information has been changed through the verification character.

对于非登录用户来讲,该用户标识信息可以包括非登录用户的机器标识,其中机器标识为机器唯一标识,为客户端通过用户机器硬件、系统配置等哈希生成。For non-login users, the user identification information may include the machine identification of the non-login user, where the machine identification is a unique identification of the machine, which is generated by the client through the hash of the user's machine hardware and system configuration.

此外,为了后续的目标客户端筛选,该连接请求还可以包括用户特征信息,例如:IP地址信息、浏览器版本信息,或用户分类信息等用户特征信息。其中,浏览器版本号、用户分类信息,或IP地址信息等用户特征信息可以用于后续的客户端筛选使用。In addition, for subsequent target client screening, the connection request may also include user feature information, such as IP address information, browser version information, or user feature information such as user classification information. Wherein, user characteristic information such as browser version number, user classification information, or IP address information can be used for subsequent client screening.

步骤S302,分发器基于该用户标识信息使用预设算法进行计算得到一个数值,根据该数值为提交连接请求的浏览器客户端分配套接字服务器;该数值是全局唯一的,即连接标识符;分发器将该套接字服务器的IP地址、端口等连接信息及连接标识符发送至提交请求的浏览器客户端;Step S302, the distributor calculates a value based on the user identification information using a preset algorithm, and assigns a socket server to the browser client that submits the connection request according to the value; the value is globally unique, that is, the connection identifier; The distributor sends the connection information such as the IP address and port of the socket server and the connection identifier to the browser client that submitted the request;

本步骤中,使用预设的算法根据登录用户的用户名计算上述数值。对于非登录用户来讲,直接采用非登录用户的机器标识计算上述数值,该算法可以为循环冗余校验(CRC)32算法。In this step, a preset algorithm is used to calculate the above value based on the username of the logged-in user. For a non-login user, the above-mentioned value is directly calculated using the machine identifier of the non-login user, and the algorithm may be a cyclic redundancy check (CRC) 32 algorithm.

步骤S303,浏览器客户端根据接收到的套接字服务器的IP地址和端口号与对应的套接字服务器建立连接,该连接可以是传输控制协议(TCP,TransmissionControlProtocol)连接。在浏览器客户端与套接字服务器建立连接时,该套接字服务器得到标识该套接字服务器和浏览器客户端连接关系的资源标识符。浏览器客户端利用已经建立的连接向该套接字服务器传送其接收到的连接标识符。Step S303, the browser client establishes a connection with the corresponding socket server according to the received IP address and port number of the socket server, and the connection may be a Transmission Control Protocol (TCP, Transmission Control Protocol) connection. When the browser client establishes a connection with the socket server, the socket server obtains a resource identifier identifying the connection relationship between the socket server and the browser client. The browser client transmits the received connection identifier to the socket server using the established connection.

步骤S304,套接字服务器接收到连接标识符后,向分发器对该连接标识符进行验证,若验证成功,则保持与浏览器客户端之间建立的连接,若验证不成功,则断开已经建立的连接。Step S304, after the socket server receives the connection identifier, it verifies the connection identifier to the distributor, if the verification is successful, it maintains the connection established with the browser client, and if the verification is unsuccessful, it disconnects connection already established.

步骤S305,分发器将用户标识信息(登录用户的用户名或非登录用户的机器标识)、用户特征信息(如果有的话)以及连接标识符存储在分发信息数据库中,并且套接字服务器也将所得到的资源标识符存储在该分发信息数据库中。Step S305, the distributor stores the user identification information (the user name of the login user or the machine identification of the non-login user), user characteristic information (if any) and the connection identifier in the distribution information database, and the socket server also The resulting resource identifier is stored in the distribution information database.

需要说明的是,为了防止服务器端变化引起的分配混乱,浏览器客户端需要在隔一段时间后重新执行步骤S301-步骤S304进行连接。It should be noted that, in order to prevent allocation confusion caused by server-side changes, the browser client needs to re-execute steps S301-step S304 to connect after a period of time.

此外,对于每一个套接字服务器,在分发信息数据库中均存在对应的单独数据表,以减小数据表的规模,加快在后续信息推送阶段,套接字服务器的查询速度。In addition, for each socket server, there is a corresponding separate data table in the distribution information database, so as to reduce the size of the data table and speed up the query speed of the socket server in the subsequent information push stage.

通过增加分发器和套接字服务器,并且在分发器中设置分发信息数据库,使得能够在建立连接阶段将用户标识信息、连接标识符、资源标识符和用户特征信息等存储于分发信息数据库中,从而实现了推送服务器对预设目标客户端的数据内容的推送。By increasing the distributor and socket server, and setting the distribution information database in the distributor, so that user identification information, connection identifier, resource identifier and user characteristic information can be stored in the distribution information database during the connection establishment phase, Thus, the push server can push the data content of the preset target client.

在信息推送阶段:推送服务器,用于将条件信息和命令信息发送至套接字服务器;套接字服务器,用于将推送服务器推送的信息转发至相应的目标客户端。详细的信息推送过程以下分三类场景进行详细说明。In the information push phase: the push server is used to send condition information and command information to the socket server; the socket server is used to forward the information pushed by the push server to the corresponding target client. The detailed information push process is described in detail in the following three types of scenarios.

(1)当该实时同步由发起客户端发起,且发起客户端和接收客户端属于同一用户时,条件信息中包括用户标识信息。举例来讲,如图4所示,该信息推送过程包括:(1) When the real-time synchronization is initiated by the initiating client, and the initiating client and the receiving client belong to the same user, the condition information includes user identification information. For example, as shown in Figure 4, the information push process includes:

步骤S401,发起客户端发起对存储在云存储服务器端存储的数据进行更新;Step S401, initiating the client to update the data stored in the cloud storage server;

本步骤中,云存储服务器端存储的数据包括以下之一:收藏夹信息、历史记录信息、浏览器配置信息、便签信息、登录管家信息、消息提醒信息、密钥信息等等其他可能的信息。In this step, the data stored on the cloud storage server side includes one of the following: favorites information, history information, browser configuration information, note information, login manager information, message reminder information, key information, and other possible information.

步骤S402,云存储服务器端向推送服务器发送条件信息和命令信息,该条件信息包括用户标识信息,例如登录用户的用户名或未登录用户的机器硬件标识,并且该条件信息中还包括标识该发起客户端与其对应的套接字服务器的连接的资源标识符;Step S402, the cloud storage server sends condition information and command information to the push server, the condition information includes user identification information, such as the user name of the logged-in user or the machine hardware identifier of the user who is not logged in, and the condition information also includes the identification of the initiator the resource identifier of the client's connection to its corresponding socket server;

步骤S403,推送服务器由与分发器中同样的算法根据用户标识信息计算得到一个数值,从而得到为目标客户端分配的套接字服务器,该数值是全局唯一的,即连接标识符,并将条件信息及命令信息发送给该为目标客户端分配的套接字服务器;Step S403, the push server uses the same algorithm as in the distributor to calculate a value based on the user identification information, so as to obtain the socket server assigned to the target client. This value is globally unique, that is, the connection identifier, and the condition Information and command information are sent to the socket server allocated for the target client;

步骤S404,套接字服务器根据条件信息中的用户标识信息查询分发器中的分发信息数据库,确定与目标客户端对应的资源标识符,其中排除了标识发起客户端与其对应的套接字服务器的连接的资源标识符;Step S404, the socket server queries the distribution information database in the distributor according to the user identification information in the condition information, and determines the resource identifier corresponding to the target client, excluding those identifying the originating client and its corresponding socket server the resource identifier for the connection;

步骤S405,套接字服务器根据该资源标识符在与该目标客户端(一个或多个)的连接中向该客户端发送该命令信息。Step S405, the socket server sends the command information to the target client (one or more) in connection with the target client according to the resource identifier.

(2)当该实时同步由发起客户端发起,且发起客户端和接收客户端属于不同登录用户时,即条件信息中包括用户标识信息,如图5所示,该信息推送过程包括:(2) When the real-time synchronization is initiated by the initiating client, and the initiating client and the receiving client belong to different login users, that is, the condition information includes user identification information, as shown in Figure 5, the information push process includes:

步骤S501,发起客户端发起对存储在云存储服务器端存储的数据进行更新;Step S501, the initiating client initiates updating the data stored in the cloud storage server;

本步骤中,云存储服务器端存储的数据包括以下之一:收藏夹信息、历史记录信息、浏览器配置信息、便签信息、登录管家信息、消息提醒信息、密钥信息、新闻信息和/或用户生成的信息等等。In this step, the data stored on the cloud storage server side includes one of the following: favorites information, history information, browser configuration information, note information, login manager information, message reminder information, key information, news information and/or user Generated information and more.

步骤S502,云存储服务器端向推送服务器发送条件信息和命令信息,其中该条件信息可以包括用户标识信息,例如登录用户的用户名或未登录用户的机器硬件标识;Step S502, the cloud storage server sends condition information and command information to the push server, where the condition information may include user identification information, such as the user name of a logged-in user or the machine hardware identifier of a non-logged-in user;

步骤S503,推送服务器由与分发器中同样的算法根据用户标识信息计算得到一个数值,从而得到为目标客户端分配的套接字服务器,该数值是全局唯一的,即连接标识符,并将条件信息及命令信息发送给该为目标客户端分配的套接字服务器;Step S503, the push server uses the same algorithm as in the distributor to calculate a value based on the user identification information, so as to obtain the socket server allocated for the target client. This value is globally unique, that is, the connection identifier, and sets the condition Information and command information are sent to the socket server allocated for the target client;

步骤S504,套接字服务器根据条件信息中的用户标识信息查询分发器中的分发信息数据库,确定目标客户端的资源标识符;Step S504, the socket server queries the distribution information database in the distributor according to the user identification information in the condition information, and determines the resource identifier of the target client;

步骤S505,对应的套接字服务器依据该资源标识符,在与目标客户端(一个或多个)的连接中向该客户端发送该通知消息,至此,信息推送过程结束。Step S505, according to the resource identifier, the corresponding socket server sends the notification message to the target client (one or more) in connection with the client, so far, the information pushing process ends.

(3)当该实时同步由云存储服务器端主动发起,且条件信息中包括目标客户端的特征筛选信息,而不包括用户标识信息,其中特征筛选信息也可以为空,(3) When the real-time synchronization is actively initiated by the cloud storage server, and the condition information includes the characteristic screening information of the target client, but does not include the user identification information, wherein the characteristic screening information can also be empty,

这种情况下,在连接建立阶段,由浏览器客户端向分发器提交连接请求中还包含特征筛选信息,其与如前的在分发信息数据库中保存的用户特征信息相对应。In this case, during the connection establishment phase, the connection request submitted by the browser client to the distributor also includes feature screening information, which corresponds to the user feature information stored in the distribution information database as before.

如图6所示,该信息推送过程包括:As shown in Figure 6, the information push process includes:

步骤S601,云存储服务器端向推送服务器下发条件信息和命令信息中,条件信息中包含目标客户端的特征筛选信息(例如某浏览器的版本号),该命令信息例如是通知用户升级的指令;Step S601, the cloud storage server sends condition information and command information to the push server, the condition information includes feature screening information of the target client (such as the version number of a certain browser), and the command information is, for example, an instruction to notify the user to upgrade;

步骤S602,推送服务器将条件信息和命令信息推送给所有的套接字服务器;Step S602, the push server pushes the condition information and command information to all socket servers;

步骤S603,各个套接字服务器分别向分发器的分发信息数据库递交查询请求,该查询请求中包含特征筛选信息;分发信息数据库根据特征筛选条件查询分发信息数据库中各个浏览器客户端的用户特征信息,确定满足该特征筛选条件的目标客户端的资源标识符,并将该资源标识符返回至发起查询的各套接字服务器;Step S603, each socket server submits a query request to the distribution information database of the distributor respectively, and the query request includes characteristic screening information; the distribution information database queries the user characteristic information of each browser client in the distribution information database according to the characteristic screening condition, Determine the resource identifier of the target client satisfying the characteristic filter condition, and return the resource identifier to each socket server that initiates the query;

步骤S604,各套接字服务器根据接收到的资源标识符向相应的客户端发送命令信息,至此,信息推送过程结束。Step S604, each socket server sends command information to the corresponding client according to the received resource identifier, so far, the information pushing process ends.

基于图1及图2所示的实现浏览器数据同步的系统,本发明又提供了一种实现浏览器数据同步的方法。如图7所示,该实现浏览器数据同步的方法包括:Based on the system for realizing browser data synchronization shown in FIG. 1 and FIG. 2 , the present invention further provides a method for realizing browser data synchronization. As shown in Figure 7, the method for implementing browser data synchronization includes:

步骤S710,云存储服务器端在有数据更新时向推送服务器下发条件信息和命令信息;Step S710, the cloud storage server sends condition information and command information to the push server when there is data update;

步骤S720,推送服务器根据该条件信息在多个浏览器客户端中确定目标客户端,并将该命令信息发送给目标客户端;Step S720, the push server determines the target client among multiple browser clients according to the condition information, and sends the command information to the target client;

步骤S730,目标客户端根据命令信息实现其与云存储服务器端的数据同步。In step S730, the target client implements data synchronization with the cloud storage server according to the command information.

进一步地,步骤S710之前还包括浏览器客户端与套接字服务器之间建立套接字连接,该连接的建立过程如图3所示,这里就不再赘述。Further, before step S710, a socket connection is established between the browser client and the socket server, and the establishment process of the connection is shown in FIG. 3 , which will not be repeated here.

进一步地,步骤S710云存储服务器端在有数据更新时向推送服务器下发条件信息和命令信息的步骤中,如果条件信息中包含目标客户端的登录用户用户名或未登录用户的机器标识,包括以下两种情况:Further, in step S710, in the step where the cloud storage server sends condition information and command information to the push server when there is data update, if the condition information includes the user name of the logged-in user of the target client or the machine identifier of the non-login user, the following are included: Two situations:

情况一:发起客户端和接收客户端属于同一用户,该用户使用不同的设备(例如手机和PC)登录浏览器,其中一个(例如PC)更改收藏夹,那么需要将该更新同步到同一用户的另一设备(手机);Situation 1: The originating client and the receiving client belong to the same user, and the user uses different devices (such as a mobile phone and a PC) to log in to the browser, and one of them (such as a PC) changes favorites, then the update needs to be synchronized to the same user's another device (mobile phone);

该情况下,发起客户端首先发起对存储在云存储服务器端中的有关配置、功能、或收藏的信息或其他的信息的修改。然后云存储服务器端向推送服务器发送条件信息和命令信息,该命令信息包括内容消息和通知消息,推送服务器通过套接字服务器将根据条件信息将该命令信息发送到目标客户端,其中该目标客户端排除了发起客户端。该种情况下的信息推送过程如图4所示,这里也不再赘述。In this case, the initiating client first initiates modification of information about configurations, functions, or favorites or other information stored in the cloud storage server. Then the cloud storage server sends conditional information and command information to the push server, the command information includes content messages and notification messages, and the push server sends the command information to the target client through the socket server according to the condition information, wherein the target client side excludes the originating client. The information pushing process in this case is shown in FIG. 4 , which will not be repeated here.

情况二:发起客户端和接收客户端不属于同一用户,从而实现不同用户之间通过客户端的信息交互。Case 2: The initiating client and the receiving client do not belong to the same user, so that information exchange between different users through the client is realized.

具体来说,一个用户的客户端将条件信息和内容消息发送至云存储服务器端,云存储服务器端将条件信息和相关通知消息其发送至推送器,推送器根据条件信息将通知消息发送至目的客户端,进而目的客户端可以访问云存储服务器端以获取内容。在这种情况下的信息推送过程如图5所示,这里也不再赘述。Specifically, a user's client sends condition information and content messages to the cloud storage server, and the cloud storage server sends the condition information and related notification messages to the pusher, and the pusher sends the notification message to the destination according to the condition information. The client, and then the target client can access the cloud storage server to obtain content. The information pushing process in this case is shown in FIG. 5 , and will not be repeated here.

此外,如果条件信息中不包含目标客户端的用户标识信息,而可以包括特征筛选信息,则还包括以下情况:In addition, if the conditional information does not include the user identification information of the target client, but may include characteristic screening information, the following situations are also included:

情况三:云存储服务器端自身有数据更新,需要浏览器客户端与云存储服务器端进行数据同步,云存储服务器端主动向推送服务器下发条件信息和命令信息,例如:Situation 3: The cloud storage server itself has data updates, and the browser client needs to synchronize data with the cloud storage server. The cloud storage server actively sends condition information and command information to the push server, for example:

1、云存储服务器端向某版本的所有浏览器客户端发起更新指示,以使该版本的所有浏览器客户端升级为新版本,其中,命令信息为升级为新版本的通知消息,条件为某版本浏览器的客户端,即其中的特征筛选信息为浏览器客户端的版本号。则推送服务器根据该条件信息将该命令信息发送给多个浏览器客户端中的目标客户端包括:推送服务器将升级为新版本的通知消息发送给某版本的所有浏览器客户端。1. The cloud storage server sends an update instruction to all browser clients of a certain version, so that all browser clients of this version can be upgraded to a new version, where the command information is a notification message for upgrading to a new version, and the condition is a certain The client version of the browser, that is, the feature filtering information is the version number of the browser client. Then, the push server sending the command information to the target client among the plurality of browser clients according to the condition information includes: the push server sends a notification message of upgrading to a new version to all browser clients of a certain version.

2、云存储服务器端向所有浏览器客户端推送新闻消息,其中条件为所有浏览器客户端,即特征筛选信息为空,命令信息为包含新闻消息的内容消息;则推送服务器根据该条件信息将该命令信息发送给多个浏览器客户端中的目标客户端包括:推送服务器将包含新闻消息的内容消息发送给所有浏览器客户端。应该理解,发送的也可以是通知消息。2. The cloud storage server pushes news messages to all browser clients, where the condition is all browser clients, that is, the feature screening information is empty, and the command information is content messages containing news messages; then the push server will send The sending of the command information to the target client among the plurality of browser clients includes: the push server sends the content message including the news message to all the browser clients. It should be understood that what is sent may also be a notification message.

3、云存储服务器端向不同地区的浏览器客户端推送天气预报,其中条件为某一地区的浏览器客户端,即特征筛选信息为该某一地区对应的IP段,命令信息为包含天气预报的内容消息;则推送服务器根据该条件信息将该命令信息发送给多个浏览器客户端中的目标客户端包括:推送服务器将包含天气预报的内容消息发送给某一地区的浏览器客户端。应该理解,发送的也可以是通知消息。3. The cloud storage server pushes the weather forecast to the browser clients in different regions, where the condition is the browser client in a certain region, that is, the feature screening information is the IP segment corresponding to the certain region, and the command information contains the weather forecast The push server sends the command information to the target client among the plurality of browser clients according to the condition information, including: the push server sends the content message containing the weather forecast to the browser client in a certain area. It should be understood that what is sent may also be a notification message.

在这种情况下的信息推送过程如图6所示,这里也不再赘述。The information pushing process in this case is shown in FIG. 6 , which will not be repeated here.

基于图1及图2所示的实现浏览器数据同步的系统,本发明又提供了一种实现浏览器数据同步的浏览器客户端。如图8所示,该浏览器客户端包括:连接模块,用于通过分发器与套接字服务器建立连接关系,并从相应的套接字服务器接收命令信息;应用模块,用于根据该命令信息,执行其对应的应用操作。其中,所述命令信息为通知消息或内容消息。Based on the system for realizing browser data synchronization shown in FIG. 1 and FIG. 2 , the present invention further provides a browser client for realizing browser data synchronization. As shown in Figure 8, the browser client includes: a connection module, used to establish a connection relationship with the socket server through the distributor, and receive command information from the corresponding socket server; Information, execute its corresponding application operation. Wherein, the command information is a notification message or a content message.

如图8所示,连接模块又包括:分发器连接子模块,用于向所述分发器提交连接请求,该连接请求中至少包括用户标识信息,并接收由分发器返回的被分配的套接字服务器的连接信息及连接标识符;套接字连接子模块,用于根据接收到的套接字服务器的连接信息及所述连接标识符与对应的套接字服务器建立套接字连接,并通过该套接字连接从相应的套接字服务器接收命令信息。其中,所述用户标识信息为登录用户的用户名或非登录用户的机器硬件标识。As shown in Figure 8, the connection module further includes: a distributor connection submodule, which is used to submit a connection request to the distributor, the connection request at least includes user identification information, and receives the allocated socket returned by the distributor The connection information of the word server and the connection identifier; the socket connection submodule is used to establish a socket connection with the corresponding socket server according to the received connection information of the socket server and the connection identifier, and Receive command information from the corresponding socket server through the socket connection. Wherein, the user identification information is a user name of a login user or a machine hardware identification of a non-login user.

如图8所示,上述浏览器客户端中还可以包括:云存储通信模块,用于响应应用模块的应用操作,与云存储服务器端进行通信。As shown in FIG. 8 , the browser client may further include: a cloud storage communication module, configured to communicate with the cloud storage server in response to an application operation of the application module.

如前所述,套接字服务器在实现云存储服务器与目标客户端之前的信息推送时能够起到关键的作用。图9为根据本发明实施例的套接字服务器的结构示意图。如图9所示,所述套接字服务器通常都需要包括连接模块,该连接模块用于与多个浏览器客户端建立套接字连接,并且与建立连接的浏览器客户端进行信息交互。As mentioned above, the socket server can play a key role in realizing the information push between the cloud storage server and the target client. FIG. 9 is a schematic structural diagram of a socket server according to an embodiment of the present invention. As shown in FIG. 9 , the socket server generally needs to include a connection module, which is used to establish socket connections with multiple browser clients, and perform information exchange with the browser clients that establish connections.

如前所述,所述连接模块用于与浏览器客户建立套接字连接,具体来说,当浏览器客户端发起与套接字服务器的连接时,所述连接模块接受该连接,并获得该连接的资源标识符,资源标识符是套接字服务器的系统生成的用于标识该浏览器客户端与该套接字服务器的连接的标识符。As mentioned above, the connection module is used to establish a socket connection with the browser client, specifically, when the browser client initiates a connection with the socket server, the connection module accepts the connection and obtains The resource identifier of the connection, the resource identifier is an identifier generated by the socket server system for identifying the connection between the browser client and the socket server.

在一种具体实施方式中,浏览器客户端向分发器提交连接请求,该连接请求至少包括用户标识信息,分发器由该用户标识信息使用预设算法进行计算得到一个数值,根据该数值为提交连接请求的浏览器客户端分配套接字服务器,该数值是全局唯一的,即连接标识符;分发器接着将套接字服务器的连接信息及连接标识符发送给提交连接请求的浏览器客户端,提交连接请求的浏览器客户端根据接收到的套接字服务器的连接信息及连接标识符与对应的套接字服务器的连接模块建立连接。In a specific implementation, the browser client submits a connection request to the distributor. The connection request includes at least user identification information. The distributor calculates a value based on the user identification information using a preset algorithm. The browser client of the connection request allocates a socket server, which is globally unique, that is, the connection identifier; the distributor then sends the connection information and connection identifier of the socket server to the browser client that submits the connection request , the browser client submitting the connection request establishes a connection with the connection module of the corresponding socket server according to the received connection information and connection identifier of the socket server.

如前所述,浏览器数据同步系统中可设置分发信息数据库,根据一种具体实施方式,当系统包括分发器时,该分发信息数据库可设置于分发器中。分发信息数据库中存储有用户标识信息,在上述建立套接字连接的过程中,提交请求的浏览器客户端还可根据接收到的套接字服务器的连接信息向相应的套接字服务器传送连接标识符。此时,套接字服务器还可包括一个验证模块,以对该接收到的连接标识符进行验证。在进行验证时,该验证模块在分发信息数据库中查询该连接标识符,以验证该连接标识符是否存在于该分发信息数据库中,从而验证该请求与该套接字服务器进行套接字连接的浏览器客户端是否合法。As mentioned above, a distribution information database may be set in the browser data synchronization system. According to a specific implementation manner, when the system includes a distributor, the distribution information database may be set in the distributor. User identification information is stored in the distribution information database. During the above-mentioned process of establishing a socket connection, the browser client submitting the request can also transmit the connection to the corresponding socket server according to the received connection information of the socket server. identifier. At this time, the socket server may also include a verification module to verify the received connection identifier. When verifying, the verification module queries the connection identifier in the distribution information database to verify whether the connection identifier exists in the distribution information database, thereby verifying that the request performs a socket connection with the socket server Whether the browser client is legitimate.

当验证模块验证该连接标识符存在于所述分发信息数据库中时,套接字服务器将该资源标识符存储于分发信息数据库中。当验证模块验证该连接标识符不存在于所述分发信息数据库中时,验证模块指示连接模块断开与该浏览器客户端的连接。When the verification module verifies that the connection identifier exists in the distribution information database, the socket server stores the resource identifier in the distribution information database. When the verification module verifies that the connection identifier does not exist in the distribution information database, the verification module instructs the connection module to disconnect the browser client.

如前所述,当推送服务器将条件信息和命令信息发送给为目标客户端分配的套接字服务器时,套接字服务器根据所述条件信息查询分发信息数据库以确定目标客户端。当条件信息中包括用户标识信息时,套接字服务器根据该用户标识信息进行查询。当分发信息数据库中还保存有资源标识符时,套接字服务器根据条件信息在分发信息数据库中查询资源标识符来确定目标客户端。此时,套接字服务器还包括一个查询模块,该查询模块完成上述查询过程。本发明的套接字服务器在向目标客户端发送命令信息时采用异步调度的模式。也就是说,当套接字服务器接收到了命令信息,且已根据条件信息确定了目标客户端之后,采用异步方式向目标客户端发送命令信息。所谓异步方式是指,当目标客户端不止一个时,连接模块对其中一个客户端发送命令消息之后,不等待其接收确认就直接向下一个客户端发送命令消息。该过程连续进行从而达到高效发送,进而缩短执行时间,提高系统效率而且减少不同客户端接收到的消息的时间差,改进业务的实时性。As mentioned above, when the push server sends the condition information and command information to the socket server assigned to the target client, the socket server queries the distribution information database according to the condition information to determine the target client. When the condition information includes user identification information, the socket server performs a query according to the user identification information. When the resource identifier is stored in the distribution information database, the socket server searches the distribution information database for the resource identifier according to the condition information to determine the target client. At this time, the socket server also includes a query module, which completes the above query process. The socket server of the present invention adopts an asynchronous scheduling mode when sending command information to a target client. That is to say, after receiving the command information and determining the target client according to the condition information, the socket server sends the command information to the target client in an asynchronous manner. The so-called asynchronous mode means that when there are more than one target client, after the connection module sends a command message to one of the clients, it directly sends the command message to the next client without waiting for its receipt confirmation. This process is carried out continuously to achieve efficient sending, thereby shortening the execution time, improving system efficiency and reducing the time difference between messages received by different clients, and improving the real-time performance of the business.

下面参照附图10对应用于套接字服务器的套接字服务方法的具体实施方式进行具体说明。根据上述对于套接字服务器的描述可知,本发明的应用于套接字服务器中的套接字服务方法至少包括步骤S1010:当浏览器客户端发起与所述套接字服务器的连接时,套接字服务器接受该连接,并获得该连接的资源标识符。The specific implementation of the socket service method applied to the socket server will be described in detail below with reference to FIG. 10 . According to the above description of the socket server, the socket service method applied to the socket server of the present invention includes at least step S1010: when the browser client initiates a connection with the socket server, the socket The socket server accepts the connection and obtains the connection's resource identifier.

根据本发明的一种具体实施方式,在步骤S1010之后,套接字服务方法还包括步骤S1020:套接字服务器经由所述连接接收从所述浏览器客户端发送的连接标识符,并查询分发信息数据库以验证该连接标识符是否存在于该分发信息数据库中。在步骤S1020之后,优选地,套接字服务方法还包括步骤S1030:当所述连接标识符存在于该分发信息数据库时,套接字服务器将所述资源标识符存入所述分发信息数据库;当所述连接标识符不存在于该分发信息数据库时,套接字服务器断开所述连接。According to a specific implementation manner of the present invention, after step S1010, the socket service method further includes step S1020: the socket server receives the connection identifier sent from the browser client via the connection, and queries the distributed information database to verify that the connection identifier exists in the distribution information database. After step S1020, preferably, the socket service method further includes step S1030: when the connection identifier exists in the distribution information database, the socket server stores the resource identifier into the distribution information database; When the connection identifier does not exist in the distribution information database, the socket server disconnects the connection.

根据本发明的另一实施方式,套接字服务方法还包括步骤S1040:当所述推送服务器将条件信息和命令信息发送给为目标客户端分配的套接字服务器时,该套接字服务器根据所述条件信息查询所述分发信息数据库以确定目标客户端。According to another embodiment of the present invention, the socket service method further includes step S1040: when the push server sends the condition information and command information to the socket server assigned to the target client, the socket server according to The condition information queries the distribution information database to determine the target client.

步骤S1040优选为:该套接字服务器根据条件信息在分发信息数据库中查询资源标识符来确定目标客户端。Step S1040 is preferably: the socket server searches the distribution information database for the resource identifier according to the condition information to determine the target client.

根据本发明的另一实施方式,套接字服务方法还包括:当套接字服务器接收到了命令信息并已根据条件信息确定了目标客户端,并且目标客户端不止一个时,该套接字服务器对其中一个客户端发送命令消息之后,不等待其接收确认就直接向下一个客户端发送命令消息。由前面的说明可知,本发明中的一个套接字服务器可能同时与多个浏览器客户端进行连接,各浏览器客户端与套接字服务器之间的连接状态也可能并不相同。并且,不同的条件信息所指定的目标客户端也可能是不同的。因此,本发明的套接字服务方法中,对于各个不同的浏览器客户端,根据响应于来自推送服务器的不同条件信息和命令信息可执行不同的步骤。According to another embodiment of the present invention, the socket service method further includes: when the socket server receives the command information and has determined the target client according to the condition information, and there are more than one target client, the socket server After sending a command message to one of the clients, the command message is directly sent to the next client without waiting for its receipt confirmation. It can be seen from the foregoing description that a socket server in the present invention may be connected to multiple browser clients at the same time, and the connection status between each browser client and the socket server may also be different. Moreover, target clients specified by different condition information may also be different. Therefore, in the socket service method of the present invention, for each different browser client, different steps may be executed in response to different condition information and command information from the push server.

在具体实现上述具有异步调度方式的套接字服务器及其套接字服务方法时,可以使用javascript语言在Linux-CentOS环境NodeJS套接字服务器进行开发,并且套接字服务器的连接模块采用传输控制协议(TCP)与浏览器客户端进行连接和命令信息的发送。相比于通常采用http协议的websocket,采用Tcp协议可降低系统的资源消耗,提高系统的业务处理能力。When implementing the above-mentioned socket server with asynchronous scheduling mode and its socket service method, javascript language can be used to develop NodeJS socket server in Linux-CentOS environment, and the connection module of socket server adopts transmission control The protocol (TCP) connects with the browser client and sends command information. Compared with the websocket that usually uses the http protocol, the use of the Tcp protocol can reduce the resource consumption of the system and improve the business processing capability of the system.

为了进一步节约系统资源,由推送服务器2推送至浏览器客户端3的命令信息为通知消息。在这种情况下,浏览器客户端,还用于在接收到推送服务器推送的通知消息后,与云存储服务器端建立连接,从云存储服务器端下载发生更新的数据内容,依照下载的数据内容进行本地数据内容的同步。通过传送通知消息可以减少传送数据量,减少系统资源占用。In order to further save system resources, the command information pushed by the push server 2 to the browser client 3 is a notification message. In this case, the browser client is also used to establish a connection with the cloud storage server after receiving the notification message pushed by the push server, and download the updated data content from the cloud storage server. Synchronize local data content. By transmitting notification messages, the amount of transmitted data can be reduced, and the occupation of system resources can be reduced.

当然,由推送服务器推送至目标客户端的命令信息也可以为内容消息,即该内容消息中包含发生更新的数据内容,在这种情况下,目标客户端在接收到推送服务器推送的内容消息后,从该内容消息中提取发生更新的数据内容,依照提取的数据内容进行本地数据内容的同步。通过传送内容消息可以直接将内容消息推送至客户端,信息传递快速,步骤简单。Of course, the command information pushed by the push server to the target client can also be a content message, that is, the content message contains updated data content. In this case, after the target client receives the content message pushed by the push server, The updated data content is extracted from the content message, and the local data content is synchronized according to the extracted data content. The content message can be directly pushed to the client by transmitting the content message, and the information transmission is fast and the steps are simple.

为了实现对多语言的支持、方便地调用文本,推送服务器和云存储服务器端之间采用HTTP接口,也可以是其他合适的接口,本发明对此不做限制。In order to support multiple languages and call texts conveniently, an HTTP interface is used between the push server and the cloud storage server, or other suitable interfaces, which are not limited in the present invention.

综上所述,本发明提供的这种实现浏览器数据同步的系统,通过设置单独的推送服务器,在云存储服务器端存储的浏览器相关内容发生更新的情况下,能够及时地将命令信息通过该推送服务器发送至多个浏览器客户端中的目标客户端,解决了无法简单有效地将浏览器客户端与云存储服务器端数据实时同步的问题,从而简单、高效地实现了浏览器客户端与云存储服务器端的数据同步。由此,可以在原有架构的基础上使浏览器客户端可以高效地、主动地、资源节约地将信息与云存储服务器端实时同步。该系统及方法还能够在原有系统架构的基础上实现,有效利用原有架构,实现成本有效。To sum up, the system for synchronizing browser data provided by the present invention, by setting up a separate push server, can timely send command information through The push server sends to the target client among the multiple browser clients, which solves the problem that the data of the browser client and the cloud storage server cannot be synchronized in real time simply and effectively, thus realizing the browser client and the cloud storage server in a simple and efficient manner. Data synchronization on the cloud storage server side. Therefore, on the basis of the original architecture, the browser client can efficiently, proactively, and resource-savingly synchronize information with the cloud storage server in real time. The system and method can also be implemented on the basis of the original system architecture, effectively utilize the original architecture, and realize cost effectiveness.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的相关设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in related devices according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (8)

1. realize the system that browser data is synchronous, this system comprises: cloud storage server end, distributor, push server and multiple browser client and socket server, wherein:
Described cloud storage server end is used for issuing conditional information and command information when there being Data Update to described push server;
Described push server is used in described multiple browser client, determining destination client according to this conditional information, and described command information is sent to the socket server be connected with described destination client; And
Described destination client is for realizing the data syn-chronization of itself and cloud storage server end according to described command information;
Described distributor, for after receiving the connection request of browser client, for it distributes corresponding socket server and connection identifier (CID; Described distributor also comprises: distribution information database, distributes relevant information for storing to socket server;
Described socket server is used for the command information from push server to send to corresponding destination client; Described socket server comprises link block, and this link block is used for setting up socket with described browser client and is connected; Wherein, described link block is also for connecting via described the connection identifier (CID receiving and send from described browser client; Described socket server also comprises authentication module, and described authentication module is used for: when receiving the connection identifier (CID sent from described browser client, and inquiry distribution information database is to verify whether this connection identifier (CID is present in this distribution information database.
2. the system as claimed in claim 1, wherein, when described browser client initiates the connection with described socket server, described link block accepts this connection, and obtains the resource identifier of this connection.
3. system as claimed in claim 2, wherein, described authentication module also for:
When described connection identifier (CID is present in this distribution information database, by described resource identifier stored in described distribution information database.
4. the system as claimed in claim 1, wherein, described authentication module also for:
When described connection identifier (CID is not present in this distribution information database, described link block is indicated to disconnect described connection.
5. the system as claimed in claim 1, wherein, described socket server also comprises an enquiry module, when conditional information and command information to be sent to the socket server distributed into destination client by described push server, described enquiry module according to described conditional information inquiry distribution information database to determine destination client.
6. system as claimed in claim 5, wherein, this link block determines destination client according to conditional information query resource identifier in distribution information database.
7. system as claimed in claim 2, wherein, have received command information when described socket server and determine destination client according to conditional information, and during more than one of destination client, described link block does not wait for that its confirmation of receipt just sends command messages directly to next client after sending command messages to one of them client.
8. system as claimed in claim 2, wherein, described link block adopts transmission control protocol and described browser client to carry out being connected the transmission with command information.
CN201210548764.5A 2012-12-17 2012-12-17 Realize the system that browser data is synchronous Active CN103024049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210548764.5A CN103024049B (en) 2012-12-17 2012-12-17 Realize the system that browser data is synchronous

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210548764.5A CN103024049B (en) 2012-12-17 2012-12-17 Realize the system that browser data is synchronous

Publications (2)

Publication Number Publication Date
CN103024049A CN103024049A (en) 2013-04-03
CN103024049B true CN103024049B (en) 2016-03-30

Family

ID=47972173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210548764.5A Active CN103024049B (en) 2012-12-17 2012-12-17 Realize the system that browser data is synchronous

Country Status (1)

Country Link
CN (1) CN103024049B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389797B (en) * 2013-07-16 2016-08-31 贝壳网际(北京)安全技术有限公司 instruction synchronization method, terminal and system
CN110515575B (en) * 2018-05-21 2021-08-24 北京仁光科技有限公司 Apparatus and method for interacting with computers within a subnet
CN110830744B (en) * 2018-08-10 2021-10-15 北京仁光科技有限公司 A secure interactive system
CN110830423A (en) * 2018-08-10 2020-02-21 北京仁光科技有限公司 Secure network data interaction system and method
CN111176863B (en) * 2019-12-31 2023-08-11 浪潮软件股份有限公司 A message reminder system and method based on nodejs

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620012A (en) * 2003-11-19 2005-05-25 国际商业机器公司 Method and system for updating/reloading the content of pages browsed over a network
CN101247349A (en) * 2008-03-13 2008-08-20 华耀环宇科技(北京)有限公司 Network flux fast distribution method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8689301B2 (en) * 2008-09-30 2014-04-01 Avaya Inc. SIP signaling without constant re-authentication
CN101431516B (en) * 2008-12-04 2012-04-25 成都市华为赛门铁克科技有限公司 Implementation method, client and communication system of distributed security strategy
CN102006322A (en) * 2010-11-18 2011-04-06 广州广联数字家庭产业技术研究院 Method and system for remote meter reading on basis of internet

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620012A (en) * 2003-11-19 2005-05-25 国际商业机器公司 Method and system for updating/reloading the content of pages browsed over a network
CN101247349A (en) * 2008-03-13 2008-08-20 华耀环宇科技(北京)有限公司 Network flux fast distribution method

Also Published As

Publication number Publication date
CN103024049A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
CN102984278B (en) Realize the system and method that browser data synchronizes
CN103024052B (en) Realize the system and method that browser data synchronizes
US10411956B2 (en) Enabling planned upgrade/downgrade of network devices without impacting network sessions
CN105337961B (en) The method and server communicated with client
US10187445B2 (en) System, method and browser client for enabling browser data synchronization
CN103024050B (en) Distributor and the method that multiple server is distributed
CN104468649B (en) Server, terminal, data delivery system and data push method
CN102984277B (en) Prevent the system and method that malice connects
JP2024504006A (en) Data transmission methods, devices, equipment and computer programs for service integration
US9392081B2 (en) Method and device for sending requests
CN102904903B (en) Communication system and communication means
CN103024049B (en) Realize the system that browser data is synchronous
CN104580267A (en) A resource downloading method, device, server and corresponding system
CN103812900A (en) Data synchronization method, device and system
CN103036989B (en) Socket server and socket service methods
CN102984276B (en) For the distributor distributed multiple socket server and distribution method
CN103024051B (en) A kind of device, method and corresponding system carrying out server distribution
WO2017220021A1 (en) Short message processing method and apparatus
CN103064899B (en) A kind of distribution information database system
CN105635222A (en) Cloud terminal upgrading method and system, network management server and proxy server
KR101857020B1 (en) Apparatas and method for managing service of providing server in a terminal
CN107306289B (en) A method and device for load balancing based on cloud computing
CN103036990B (en) a browser client
CN114710496B (en) Multi-node load balancing method and device
WO2012167473A1 (en) Method for setting message status and converged internet protocol message (cpm) traffic server

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220725

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.