WO2016090995A1 - Method of communication between page and long-connection server, and client end - Google Patents

Method of communication between page and long-connection server, and client end Download PDF

Info

Publication number
WO2016090995A1
WO2016090995A1 PCT/CN2015/090819 CN2015090819W WO2016090995A1 WO 2016090995 A1 WO2016090995 A1 WO 2016090995A1 CN 2015090819 W CN2015090819 W CN 2015090819W WO 2016090995 A1 WO2016090995 A1 WO 2016090995A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection server
long connection
page
server
long
Prior art date
Application number
PCT/CN2015/090819
Other languages
French (fr)
Chinese (zh)
Inventor
邢岩
陈刚
黄欢
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2016090995A1 publication Critical patent/WO2016090995A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Definitions

  • the present invention relates to the field of Internet applications, and in particular, to a communication method and a client between a page and a long connection server.
  • Common pages include browser pages, online game pages, gift collection pages and/or user information collection pages in mobile games, chat pages of video applications, and shopping malls. Pages, chat rooms, and more.
  • the page can interact with the outside world.
  • the page communicates directly with the long connection server.
  • the page also known as the front end
  • communication between the page and the long connection server necessarily requires manual maintenance.
  • the front end is connected to the long connection server through a channel, and the front end is inquired whether there is data update every fixed time (for example, 30 seconds), and the message push or transmission between the front end and the long connection server is implemented based on the polling access mechanism. .
  • the present invention has been made in order to provide a communication method and corresponding client between a page and a long connection server that overcomes the above problems or at least partially solves or alleviates the above problems.
  • a method for communication between a page and a long connection server including:
  • a page and a long connection server Communication client including:
  • connection establishing component configured to find a corresponding long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local connection server and the long connection server;
  • a transmitting component configured to receive a transmission message sent by the persistent connection server, and forward the transmission message to the current page.
  • a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform a long connection according to any of said pages Communication method between servers.
  • a computer readable medium storing a computer program as described above is provided.
  • the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence.
  • New messages improve the real-time nature of message reception.
  • the long connection channel established between the main body and the long connection server is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security of message transmission and reliability.
  • FIG. 1 is a flow chart showing the processing of a method of communication between a page and a long connection server according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing the implementation of flash as a main body according to an embodiment of the present invention. Schematic diagram of a message transmission path of a communication method between a page and a long connection server;
  • FIG. 3 is a schematic block diagram showing the structure of a communication client between a page and a long connection server according to an embodiment of the present invention
  • FIG. 4 is a block diagram schematically showing a computing device for performing a method of communication between a page and a persistent connection server according to the present invention
  • Fig. 5 schematically shows a storage unit for holding or carrying program code for implementing a communication method between a page according to the present invention and a long connection server.
  • an embodiment of the present invention provides a communication method between a page and a long connection server.
  • 1 is a flow chart showing the processing of a method of communication between a page and a persistent connection server in accordance with one embodiment of the present invention.
  • the communication method between the page and the persistent connection server includes at least steps S102 to S106:
  • Step S102 Find a long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local and the long connection server.
  • the current page finds its corresponding long connection server address and forwards it.
  • the long connection server address sent by the current page is received, and the corresponding long connection server is found correspondingly, thereby establishing a long connection channel between the local and the long connection server.
  • the embodiment of the present invention does not need to establish a long connection channel between the page and the long connection server, but establishes a long connection channel with the long connection server in other applications or clients or devices or devices other than the page. For the page, this connection method will not be good at liberating the pages that communicate with the long connection server, reducing the load on the page and improving the work efficiency of the page.
  • step S102 in order to reduce the load of the page, before the implementation of step S102, it is also necessary to select a main body capable of establishing a stable long connection channel with the long connection server as an implementation body of the communication method between the page and the long connection server. That is, the main body has independent communication capabilities and can communicate with the long connection server. Stable long connection channel is not required Manual maintenance reduces manual wear and tear compared to communication between a normal page and a long connection server in the prior art.
  • the long connection channel is stable, and it is not necessary to use a polling mechanism to periodically ask whether there is data update, whether message transmission or push is needed, and the purpose of pushing or transmitting updated data or messages in real time can be achieved, and the delay is reduced.
  • flash can be used as a main body to implement a communication method between the page and the long connection server.
  • the reason for choosing flash is to consider the function of flash, which can communicate directly with the server, such as receiving the content sent by the long connection server, and so on; and can communicate with the page (also called the front end), for example, from The content received by the long connection server goes to page processing and so on. Further, at this time, a long connection channel can be established between the flash and the long connection server by using the FLASH socket protocol adapted to the flash.
  • the long connection server address is obtained as follows.
  • the page first sends a request message requesting a long connection server address to the corresponding service server.
  • the service server allocates a long connection server to the page, and sends the assigned long connection server address to the page by using a response message.
  • the page receives the response message including the long connection server address returned by the service server, and then sends the long connection server address to the body selected as the implementation body selected in this embodiment.
  • the principal uses the long connection server address to find the assigned long connection server and establishes a long connection channel (ie, step S102).
  • Step S104 Receive a transmission message sent by the persistent connection server.
  • the long connection server will identify different subjects and send the corresponding messages to different subjects.
  • the identifier (ID) of the current page is sent to the long connection server, so that the long connection server finds the content delivery object according to the ID, where The local identifier corresponds to the ID one by one. That is, each body is bound to the page, and its ID is the same.
  • the long connection server identifies the destination address of each transmission message according to the ID, reduces the probability of packet loss, and improves the security and reliability of message transmission.
  • Step S106 Forward the transmission message to the current page.
  • the subject After receiving the transmitted message, the subject forwards it to the current page for processing by the current page.
  • the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence.
  • New messages improve the real-time nature of message reception.
  • the long connection established between the main body and the long connection server The channel is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security and reliability of message transmission.
  • the page mentioned in the embodiment of the present invention includes a browser page, and further includes an online game page, a package receiving page and/or a user information collecting page in a mobile game, a chat page of a video application, a shopping mall page, a chat room page, and the like. .
  • the first is the business message sent by other pages through the business server.
  • the online notification message sent by the game page for the friend, the message pushing or transmitting object is the specified user group (the number of friends usually ranges from one to several hundred);
  • the second type is the system message broadcast by the service server.
  • the system notification issued by the game page the upgrade maintenance notice of the game page, the new server notification, the user function increase notification, etc.
  • the message push or transmission object is the entire system user.
  • the transport message (service message and/or system message) sent by the long connection server to the page includes the ID of the page, and the long connection server uses the ID to identify the body corresponding to the ID, and transmits the message (service message). And/or system messages) are sent to the principal.
  • chat page Take the chat page as an example.
  • This page needs to interact with other pages.
  • This page can be used as a message sender or as a message receiver.
  • the message is sent to the service server, which is forwarded by the service server to the long connection server, and then forwarded to other pages by the long connection server.
  • this page is used as the message receiver, it receives the message sent from the long connection server, of course, the message comes from other pages. That is, in the embodiment of the present invention, the page can perform information interaction with other pages, so that it can be applied to functions such as chat, chat room, and live room.
  • the chat pages are interacted according to the following steps:
  • the long connection server pushes the service message to different flashes. Different users have their own flash.
  • the long connection server can identify different pages for targeted transmission, that is, through a long connection channel, targeted to someone. (page user).
  • FIG. 2 is a schematic diagram showing a message transmission path of a flash as a main communication method between a page and a long connection server according to an embodiment of the present invention. It should be noted that the message transmitted in this example is a service between pages. Message. Referring to Figure 2, the transmission process of each path in the figure is as follows:
  • Step S202 The page sends a request message for requesting a long connection server address to the service server;
  • Step S204 The service server returns an address of the persistent connection server.
  • Step S206 the page notifies the flash of the address of the long connection server
  • Step S208 the flash establishes a socket connection with the long connection server corresponding to the address
  • Step S210 The page sends a service message to the service server.
  • Step S212 The service server forwards the service message sent by the service page to the service server to the persistent connection server.
  • Step S214 The long connection server pushes the service message to other pages.
  • Step S216 the long connection server finds that there is a service message corresponding to the page, and pushes the corresponding service message to the flash;
  • Step S218 The flash sends the service message pushed by the long connection server to the page.
  • Steps S202 to S208 are a long connection establishment process between the flash and the long connection server
  • steps S210 to S214 are page sending service messages to other pages
  • steps S216 to S218 are page reception.
  • the steps S210 to S214 and the steps S216 to S218 are independent, and there is no time or order limitation between them.
  • the page is no longer responsible for the communication task with the long connection server, but the flash is responsible for communication, and the long connection channel between the flash and the long connection server is a natural connection.
  • the channel itself can initiate maintenance, which is much simpler than traditional manual maintenance.
  • FIG. 3 is a block diagram showing the structure of a communication client between a page and a persistent connection server according to an embodiment of the present invention.
  • the schematic diagram at least includes:
  • the connection establishing component 310 is configured to find a corresponding long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local and the long connection server;
  • a transport component 320 coupled to the connection establishment component 310, for receiving a persistent connection server The delivered message is forwarded and the transfer message is forwarded to the current page.
  • the transmission component 320 is further configured to send the identifier ID of the current page to the long connection server, so that the long connection server finds the content delivery object according to the ID, wherein the local identifier corresponds to the ID one-to-one.
  • the transmission messages sent by the long connection server include:
  • the service message and/or the system message include the ID of the current page.
  • the communication client between the page and the persistent connection server is flash.
  • connection establishment component 320 is further configured to establish a long connection channel between the flash and the persistent connection server using the FLASH socket protocol.
  • the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence.
  • New messages improve the real-time nature of message reception.
  • the long connection channel established between the main body and the long connection server is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security of message transmission and reliability.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the components of the communication client between the page and the persistent connection server in accordance with an embodiment of the present invention. Or all features.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 4 illustrates a computing device that can implement a method of communication between a page and a persistent connection server in accordance with the present invention.
  • the computing device conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420.
  • the memory 420 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above.
  • storage space 430 for program code may include various program code 431 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 420 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 431', ie, code readable by a processor, such as 410, that when executed by a computing device causes the computing device to perform each of the methods described above step.

Abstract

A method of communication between a page and a long-connection server, and a client end are disclosed. The method comprises: on the basis of a long-connection server address sent by the current page, finding the corresponding long-connection server, and establishing locally a long-connection channel to the long-connection server; receiving a transmission message issued by the long-connection server; and, forwarding said transmission message to the current page. Use of the present invention strengthens message transmission security and reliability.

Description

页面与长连接服务器间的通信方法及客户端Communication method and client between page and long connection server 技术领域Technical field
本发明涉及互联网应用领域,尤其涉及一种页面与长连接服务器间的通信方法及客户端。The present invention relates to the field of Internet applications, and in particular, to a communication method and a client between a page and a long connection server.
背景技术Background technique
随着互联网技术的发展,页面的应用越来越广泛,常见的页面包括浏览器页面,网络游戏页面,手机游戏中的礼包领取页面和/或用户信息收集页面,视频类应用的聊天页面、商城页面、聊天室页面等等。With the development of Internet technology, the application of the page is more and more extensive. Common pages include browser pages, online game pages, gift collection pages and/or user information collection pages in mobile games, chat pages of video applications, and shopping malls. Pages, chat rooms, and more.
页面能够与外界进行信息交互,现有技术中,页面直接与长连接服务器进行通信。但是,由于页面(也称为前端)不具备连接长连接服务器的能力,因此,页面与长连接服务器间的通信必然需要通过人为的维护实现。现有技术中,前端通过一个通道和长连接服务器连接,每隔固定时间(例如30秒)询问前端是否有数据更新,前端与长连接服务器间的消息推送或传输是基于轮询的访问机制实现。The page can interact with the outside world. In the prior art, the page communicates directly with the long connection server. However, since the page (also known as the front end) does not have the ability to connect to a long connection server, communication between the page and the long connection server necessarily requires manual maintenance. In the prior art, the front end is connected to the long connection server through a channel, and the front end is inquired whether there is data update every fixed time (for example, 30 seconds), and the message push or transmission between the front end and the long connection server is implemented based on the polling access mechanism. .
因此,现有技术中,页面与长连接服务器间的通信需要人为维护,耗费较大。另外,消息的推送或传输是基于轮询机制实现,也存在一定的时延。Therefore, in the prior art, communication between a page and a long connection server requires manual maintenance and is expensive. In addition, the push or transmission of the message is based on the polling mechanism, and there is also a certain delay.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的页面与长连接服务器间的通信方法和相应的客户端。In view of the above problems, the present invention has been made in order to provide a communication method and corresponding client between a page and a long connection server that overcomes the above problems or at least partially solves or alleviates the above problems.
根据本发明的一个方面,提供了一种页面与长连接服务器间的通信方法,包括:According to an aspect of the present invention, a method for communication between a page and a long connection server is provided, including:
根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与所述长连接服务器间建立长连接通道;Finding a corresponding long connection server according to the long connection server address sent by the current page, and establishing a long connection channel between the local and the long connection server;
接收所述长连接服务器下发的传输消息;Receiving a transmission message delivered by the persistent connection server;
将所述传输消息转发至所述当前页面。Forwarding the transfer message to the current page.
根据本发明的另一个方面,还提供了一种页面与长连接服务器间 的通信客户端,包括:According to another aspect of the present invention, there is also provided a page and a long connection server Communication client, including:
连接建立组件,用于根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与所述长连接服务器间建立长连接通道;a connection establishing component, configured to find a corresponding long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local connection server and the long connection server;
传输组件,用于接收所述长连接服务器下发的传输消息,并将所述传输消息转发至所述当前页面。And a transmitting component, configured to receive a transmission message sent by the persistent connection server, and forward the transmission message to the current page.
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据上述任一个页面与长连接服务器间的通信方法。According to still another aspect of the present invention, a computer program is provided, comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform a long connection according to any of said pages Communication method between servers.
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。According to still another aspect of the present invention, a computer readable medium storing a computer program as described above is provided.
本发明的有益效果为:The beneficial effects of the invention are:
根据上述分析可以看出,在本发明实施例中,由具备通信能力的主体替代页面与长连接服务器进行通信,页面只需要对主体转发传输消息进行处理,无须定期主动到长连接服务器查询是否存在新的消息,提高了消息接收的实时性。而主体与长连接服务器间建立的长连接通道是稳定的,不需要人工维护,降低资源损耗,并且,稳定的长连接通道不容易产生丢包漏包事件,大大增加了消息传输的安全性和可靠性。According to the above analysis, in the embodiment of the present invention, the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence. New messages improve the real-time nature of message reception. The long connection channel established between the main body and the long connection server is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security of message transmission and reliability.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示意性示出了根据本发明一个实施例的页面与长连接服务器间的通信方法的处理流程图;1 is a flow chart showing the processing of a method of communication between a page and a long connection server according to an embodiment of the present invention;
图2示意性示出了根据本发明一个实施例的flash作为主体实现 页面与长连接服务器间的通信方法的消息传输路径的示意图;FIG. 2 is a schematic diagram showing the implementation of flash as a main body according to an embodiment of the present invention. Schematic diagram of a message transmission path of a communication method between a page and a long connection server;
图3示意性示出了根据本发明一个实施例的页面与长连接服务器间的通信客户端的结构示意图;FIG. 3 is a schematic block diagram showing the structure of a communication client between a page and a long connection server according to an embodiment of the present invention; FIG.
图4示意性地示出了用于执行根据本发明的页面与长连接服务器间的通信方法的计算设备的框图;以及4 is a block diagram schematically showing a computing device for performing a method of communication between a page and a persistent connection server according to the present invention;
图5示意性地示出了用于保持或者携带实现根据本发明的页面与长连接服务器间的通信方法的程序代码的存储单元。Fig. 5 schematically shows a storage unit for holding or carrying program code for implementing a communication method between a page according to the present invention and a long connection server.
具体实施方式detailed description
下面结合附图和具体的实施方式对本发明作进一步的描述。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。The invention is further described below in conjunction with the drawings and specific embodiments. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
为解决上述技术问题,本发明实施例提供了一种页面与长连接服务器间的通信方法。图1示出了根据本发明一个实施例的页面与长连接服务器间的通信方法的处理流程图。参见图1,该页面与长连接服务器间的通信方法至少包括步骤S102至步骤S106:To solve the above technical problem, an embodiment of the present invention provides a communication method between a page and a long connection server. 1 is a flow chart showing the processing of a method of communication between a page and a persistent connection server in accordance with one embodiment of the present invention. Referring to FIG. 1, the communication method between the page and the persistent connection server includes at least steps S102 to S106:
步骤S102、根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与长连接服务器间建立长连接通道。Step S102: Find a long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local and the long connection server.
在步骤S102之前,当前页面查找到其对应的长连接服务器地址,将其转发。相应的,在步骤S102中接收当前页面发送的长连接服务器地址,并相应查找到对应的长连接服务器,从而在本地和长连接服务器间建立长连接通道。由此可见,本发明实施例并不需要在页面与长连接服务器间建立长连接通道,而是在除页面外的其他应用或客户端或设备或装置与长连接服务器建立长连接通道。对于页面来说,这种连接方式将不擅长与长连接服务器进行通信的页面解放出来,减轻页面的负载,提高页面的工作效率。Before step S102, the current page finds its corresponding long connection server address and forwards it. Correspondingly, in step S102, the long connection server address sent by the current page is received, and the corresponding long connection server is found correspondingly, thereby establishing a long connection channel between the local and the long connection server. It can be seen that the embodiment of the present invention does not need to establish a long connection channel between the page and the long connection server, but establishes a long connection channel with the long connection server in other applications or clients or devices or devices other than the page. For the page, this connection method will not be good at liberating the pages that communicate with the long connection server, reducing the load on the page and improving the work efficiency of the page.
相应的,为减轻的页面的负载,在步骤S102实施之前,还需要选择能够与长连接服务器间建立稳定的长连接通道的主体,作为所述页面与长连接服务器间的通信方法的实施主体。即,该主体具备独立的通信能力,能够与长连接服务器间进行通信。稳定的长连接通道无须 人工维护,相对于现有技术中的普通页面与长连接服务器的通信而言,降低了人工损耗。另外,长连接通道是稳定的,无须采用轮询机制定期询问是否有数据更新,是否需要进行消息传输或推送,能够达到实时推送或传输更新数据或消息的目的,降低时延。Correspondingly, in order to reduce the load of the page, before the implementation of step S102, it is also necessary to select a main body capable of establishing a stable long connection channel with the long connection server as an implementation body of the communication method between the page and the long connection server. That is, the main body has independent communication capabilities and can communicate with the long connection server. Stable long connection channel is not required Manual maintenance reduces manual wear and tear compared to communication between a normal page and a long connection server in the prior art. In addition, the long connection channel is stable, and it is not necessary to use a polling mechanism to periodically ask whether there is data update, whether message transmission or push is needed, and the purpose of pushing or transmitting updated data or messages in real time can be achieved, and the delay is reduced.
优选地,可以采用flash作为主体,实现页面与长连接服务器间的通信方法。选择flash的理由是考虑到flash的功能,其能够直接与服务器做通信,例如接收长连接服务器下发的内容,等等;并且,能够与页面(也称为前端)进行数据交流,例如将从长连接服务器接收的内容转至页面处理等等。进一步,此时可以使用与flash适配的FLASH socket协议在flash与长连接服务器间建立长连接通道。Preferably, flash can be used as a main body to implement a communication method between the page and the long connection server. The reason for choosing flash is to consider the function of flash, which can communicate directly with the server, such as receiving the content sent by the long connection server, and so on; and can communicate with the page (also called the front end), for example, from The content received by the long connection server goes to page processing and so on. Further, at this time, a long connection channel can be established between the flash and the long connection server by using the FLASH socket protocol adapted to the flash.
其中,长连接服务器地址的获取方式如下。页面首先发送请求长连接服务器地址的请求消息至对应的业务服务器。业务服务器接收请求消息后,为本页面分配长连接服务器,并将分配的长连接服务器地址利用应答消息发送至页面。随后,页面接收到业务服务器返回的包括长连接服务器地址的应答消息,进而将长连接服务器地址发送至本实施例选择的作为实施主体的主体。随后,主体利用长连接服务器地址查找到分配的长连接服务器,并建立长连接通道(即步骤S102)。The long connection server address is obtained as follows. The page first sends a request message requesting a long connection server address to the corresponding service server. After receiving the request message, the service server allocates a long connection server to the page, and sends the assigned long connection server address to the page by using a response message. Then, the page receives the response message including the long connection server address returned by the service server, and then sends the long connection server address to the body selected as the implementation body selected in this embodiment. Subsequently, the principal uses the long connection server address to find the assigned long connection server and establishes a long connection channel (ie, step S102).
步骤S104、接收长连接服务器下发的传输消息。Step S104: Receive a transmission message sent by the persistent connection server.
在本步骤中,长连接服务器会识别不同的主体,将传输消息分别对应发送不同的主体。为识别不同的主体,当本地实体与长连接服务器间建立长连接通道之后,将当前页面的标识(ID)发送至长连接服务器,以供长连接服务器根据ID查找到内容下发对象,其中,本地标识与ID一一对应。即,每个主体与页面绑定,其ID是相同的,长连接服务器根据ID识别每个传输消息的目的地址,降低错包漏包的概率,提高消息传输的安全性和可靠性。In this step, the long connection server will identify different subjects and send the corresponding messages to different subjects. To identify a different entity, after the local entity establishes a long connection channel with the persistent connection server, the identifier (ID) of the current page is sent to the long connection server, so that the long connection server finds the content delivery object according to the ID, where The local identifier corresponds to the ID one by one. That is, each body is bound to the page, and its ID is the same. The long connection server identifies the destination address of each transmission message according to the ID, reduces the probability of packet loss, and improves the security and reliability of message transmission.
步骤S106、将传输消息转发至当前页面。Step S106: Forward the transmission message to the current page.
主体接收到传输消息之后,将其转发至当前页面,由当前页面进行处理。After receiving the transmitted message, the subject forwards it to the current page for processing by the current page.
根据上述分析可以看出,在本发明实施例中,由具备通信能力的主体替代页面与长连接服务器进行通信,页面只需要对主体转发传输消息进行处理,无须定期主动到长连接服务器查询是否存在新的消息,提高了消息接收的实时性。而主体与长连接服务器间建立的长连接通 道是稳定的,不需要人工维护,降低资源损耗,并且,稳定的长连接通道不容易产生丢包漏包事件,大大增加了消息传输的安全性和可靠性。According to the above analysis, in the embodiment of the present invention, the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence. New messages improve the real-time nature of message reception. The long connection established between the main body and the long connection server The channel is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security and reliability of message transmission.
本发明实施例中提及的页面包括浏览器页面,还包括网络游戏页面,手机游戏中的礼包领取页面和/或用户信息收集页面,视频类应用的聊天页面、商城页面、聊天室页面等等。The page mentioned in the embodiment of the present invention includes a browser page, and further includes an online game page, a package receiving page and/or a user information collecting page in a mobile game, a chat page of a video application, a shopping mall page, a chat room page, and the like. .
在本发明实施例中,长连接服务器下发的传输消息的种类有多种,其中最主要的两种包括:In the embodiment of the present invention, there are various types of transmission messages delivered by the persistent connection server, and the most important ones include:
第一种是其他页面通过业务服务器发出的业务消息,The first is the business message sent by other pages through the business server.
例如,游戏页面发出的针对好友的上线通知消息,其消息推送或传输对象是指定用户群(好友数通常从一到几百不等);For example, the online notification message sent by the game page for the friend, the message pushing or transmitting object is the specified user group (the number of friends usually ranges from one to several hundred);
第二种是业务服务器广播的系统消息,The second type is the system message broadcast by the service server.
例如,游戏页面发出的系统通知,游戏页面的升级维护通知、新增服务器通知、用户功能增加通知等,其消息推送或传输对象是整个系统用户。For example, the system notification issued by the game page, the upgrade maintenance notice of the game page, the new server notification, the user function increase notification, etc., the message push or transmission object is the entire system user.
其中,长连接服务器下发至本页面的传输消息(业务消息和/或系统消息)均包括本页面的ID,长连接服务器利用该ID识别出与ID对应的主体,并将传输消息(业务消息和/或系统消息)发送到该主体。The transport message (service message and/or system message) sent by the long connection server to the page includes the ID of the page, and the long connection server uses the ID to identify the body corresponding to the ID, and transmits the message (service message). And/or system messages) are sent to the principal.
以聊天页面为例,本页面需要与其他页面进行消息交互,本页面可以作为消息发送方,也可以作为消息接收方。当本页面作为消息发送方时,将消息发送至业务服务器,由业务服务器转发至长连接服务器,再由长连接服务器转发至其他页面。当本页面作为消息接收方时,接收来自长连接服务器下发的消息,当然该消息来自其他页面。即,本发明实施例中,页面可以和其他页面进行信息交互,从而可以应用到聊天、聊天室、直播室等功能上。具体的,聊天的页面之间根据如下步骤进行交互:Take the chat page as an example. This page needs to interact with other pages. This page can be used as a message sender or as a message receiver. When this page is used as the sender of the message, the message is sent to the service server, which is forwarded by the service server to the long connection server, and then forwarded to other pages by the long connection server. When this page is used as the message receiver, it receives the message sent from the long connection server, of course, the message comes from other pages. That is, in the embodiment of the present invention, the page can perform information interaction with other pages, so that it can be applied to functions such as chat, chat room, and live room. Specifically, the chat pages are interacted according to the following steps:
长连接服务器将业务消息推送到不同的flash上,不同的用户有自己的flash,长连接服务器能够识别不同的页面进行有针对性的发送,即,通过长连接通道,针对性的推给某个人(页面用户)。The long connection server pushes the service message to different flashes. Different users have their own flash. The long connection server can identify different pages for targeted transmission, that is, through a long connection channel, targeted to someone. (page user).
现以flash为例进行说明。图2示出了根据本发明一个实施例的flash作为主体实现页面与长连接服务器间的通信方法的消息传输路径的示意图。需要说明的是,本例中传输的消息为页面间交互的业务 消息。参见图2,该图中各路径的传输过程如下:Now take flash as an example to illustrate. 2 is a schematic diagram showing a message transmission path of a flash as a main communication method between a page and a long connection server according to an embodiment of the present invention. It should be noted that the message transmitted in this example is a service between pages. Message. Referring to Figure 2, the transmission process of each path in the figure is as follows:
步骤S202、页面发送请求长连接服务器地址的请求消息给业务服务器;Step S202: The page sends a request message for requesting a long connection server address to the service server;
步骤S204、业务服务器返回长连接服务器的地址;Step S204: The service server returns an address of the persistent connection server.
步骤S206、页面将长连接服务器的地址通知flash;Step S206, the page notifies the flash of the address of the long connection server;
步骤S208、flash与上述地址对应的长连接服务器建立socket连接;Step S208, the flash establishes a socket connection with the long connection server corresponding to the address;
步骤S210、页面发送业务消息至业务服务器;Step S210: The page sends a service message to the service server.
步骤S212、业务服务器将页面发给业务服务器的业务消息转发给长连接服务器;Step S212: The service server forwards the service message sent by the service page to the service server to the persistent connection server.
步骤S214、长连接服务器将业务消息推送到其他页面。Step S214: The long connection server pushes the service message to other pages.
步骤S216、长连接服务器发现存在与本页面对应的业务消息,将相应的业务消息推送给flash;Step S216, the long connection server finds that there is a service message corresponding to the page, and pushes the corresponding service message to the flash;
步骤S218、flash将长连接服务器推送来的业务消息发给页面。Step S218: The flash sends the service message pushed by the long connection server to the page.
图2所示流程概括了三部分,步骤S202至步骤S208是flash与长连接服务器间的长连接建立过程,步骤S210至步骤S214是页面发送业务消息至其他页面,步骤S216至步骤S218是页面接收其他页面的业务消息。其中,步骤S210至步骤S214,以及步骤S216至步骤S218两段流程是独立的,相互间并不存在时间或顺序上的限定。The flow shown in FIG. 2 summarizes three parts. Steps S202 to S208 are a long connection establishment process between the flash and the long connection server, steps S210 to S214 are page sending service messages to other pages, and steps S216 to S218 are page reception. Business messages on other pages. The steps S210 to S214 and the steps S216 to S218 are independent, and there is no time or order limitation between them.
由图2流程中可以看出,与现有技术相比,页面不再负责与长连接服务器间的通信任务,而是由flash负责通信,flash与长连接服务器间的长连接通道为天然的连接通道,自身即可以发起维护,相对于传统的人工维护要简单得多。As can be seen from the flow of FIG. 2, compared with the prior art, the page is no longer responsible for the communication task with the long connection server, but the flash is responsible for communication, and the long connection channel between the flash and the long connection server is a natural connection. The channel itself can initiate maintenance, which is much simpler than traditional manual maintenance.
基于同一发明构思,本发明实施例还提供了一种页面与长连接服务器间的通信客户端,用于支持上述任意一个实施例或其组合所提供的页面与长连接服务器间的通信方法。图3示出了根据本发明一个实施例的页面与长连接服务器间的通信客户端的结构示意图。参见图3,该示意图至少包括:Based on the same inventive concept, the embodiment of the present invention further provides a communication client between a page and a long connection server, which is used to support a communication method between a page provided by any one of the above embodiments or a combination thereof and a long connection server. FIG. 3 is a block diagram showing the structure of a communication client between a page and a persistent connection server according to an embodiment of the present invention. Referring to FIG. 3, the schematic diagram at least includes:
连接建立组件310,用于根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与长连接服务器间建立长连接通道;The connection establishing component 310 is configured to find a corresponding long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local and the long connection server;
传输组件320,与连接建立组件310耦合,用于接收长连接服务器 下发的传输消息,并将传输消息转发至当前页面。A transport component 320, coupled to the connection establishment component 310, for receiving a persistent connection server The delivered message is forwarded and the transfer message is forwarded to the current page.
在一个优选的实施例中,In a preferred embodiment,
传输组件320,还用于将当前页面的标识ID发送至长连接服务器,以供长连接服务器根据ID查找到内容下发对象,其中,本地标识与ID一一对应。The transmission component 320 is further configured to send the identifier ID of the current page to the long connection server, so that the long connection server finds the content delivery object according to the ID, wherein the local identifier corresponds to the ID one-to-one.
在一个优选的实施例中,In a preferred embodiment,
长连接服务器下发的传输消息包括:The transmission messages sent by the long connection server include:
其他页面通过业务服务器发出的业务消息;和/或,Business messages sent by other pages through the business server; and/or,
业务服务器广播的系统消息;System message broadcast by the business server;
其中,业务消息和/或系统消息均包括当前页面的ID。Wherein, the service message and/or the system message include the ID of the current page.
在一个优选的实施例中,页面与长连接服务器间的通信客户端为flash。In a preferred embodiment, the communication client between the page and the persistent connection server is flash.
在一个优选的实施例中,连接建立组件320还用于使用FLASH socket协议在flash与长连接服务器间建立长连接通道。In a preferred embodiment, the connection establishment component 320 is further configured to establish a long connection channel between the flash and the persistent connection server using the FLASH socket protocol.
采用本发明实施例提供的页面与长连接服务器间的通信方法及页面客户端,能够达到如下有益效果:The communication method between the page and the long connection server and the page client provided by the embodiment of the present invention can achieve the following beneficial effects:
根据上述分析可以看出,在本发明实施例中,由具备通信能力的主体替代页面与长连接服务器进行通信,页面只需要对主体转发传输消息进行处理,无须定期主动到长连接服务器查询是否存在新的消息,提高了消息接收的实时性。而主体与长连接服务器间建立的长连接通道是稳定的,不需要人工维护,降低资源损耗,并且,稳定的长连接通道不容易产生丢包漏包事件,大大增加了消息传输的安全性和可靠性。According to the above analysis, in the embodiment of the present invention, the host with the communication capability replaces the page and communicates with the long connection server, and the page only needs to process the forwarding message for the main body, and does not need to periodically and actively query the long connection server for existence. New messages improve the real-time nature of message reception. The long connection channel established between the main body and the long connection server is stable, does not require manual maintenance, reduces resource loss, and the stable long connection channel is not prone to packet loss and packet leakage events, which greatly increases the security of message transmission and reliability.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本 发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the disclosed method should not be construed as reflecting the intent of the claimed The invention requires more features than those explicitly recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的页面与长连接服务器间的通信客户端中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。 The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the components of the communication client between the page and the persistent connection server in accordance with an embodiment of the present invention. Or all features. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图4示出了可以实现根据本发明的页面与长连接服务器间的通信方法的计算设备。该计算设备传统上包括处理器410和以存储器420形式的计算机程序产品或者计算机可读介质。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有用于执行上述方法中的任何方法步骤的程序代码431的存储空间430。例如,用于程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个程序代码431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图5所述的便携式或者固定存储单元。该存储单元可以具有与图4的计算设备中的存储器420类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码431’,即可以由例如诸如410之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。For example, Figure 4 illustrates a computing device that can implement a method of communication between a page and a persistent connection server in accordance with the present invention. The computing device conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420. The memory 420 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above. For example, storage space 430 for program code may include various program code 431 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 420 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit includes computer readable code 431', ie, code readable by a processor, such as 410, that when executed by a computing device causes the computing device to perform each of the methods described above step.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。 It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。 In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.

Claims (13)

  1. 一种页面与长连接服务器间的通信方法,包括:A method for communicating between a page and a long connection server, comprising:
    根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与所述长连接服务器间建立长连接通道;Finding a corresponding long connection server according to the long connection server address sent by the current page, and establishing a long connection channel between the local and the long connection server;
    接收所述长连接服务器下发的传输消息;Receiving a transmission message delivered by the persistent connection server;
    将所述传输消息转发至所述当前页面。Forwarding the transfer message to the current page.
  2. 如权利要求1所述的方法,其中,在本地与所述长连接服务器间建立长连接通道之后,还包括:The method of claim 1, wherein after establishing a long connection channel between the local and the persistent connection server, the method further comprises:
    将所述当前页面的标识ID发送至所述长连接服务器,以供所述长连接服务器根据所述ID查找到内容下发对象,其中,本地标识与所述ID一一对应。Sending the identifier ID of the current page to the long connection server, so that the long connection server finds a content delivery object according to the ID, wherein the local identifier has a one-to-one correspondence with the ID.
  3. 如权利要求2所述的方法,其中,所述长连接服务器下发的传输消息包括:The method of claim 2, wherein the transmission message delivered by the persistent connection server comprises:
    其他页面通过业务服务器发出的业务消息;和/或,Business messages sent by other pages through the business server; and/or,
    所述业务服务器广播的系统消息;a system message broadcast by the service server;
    其中,所述业务消息和/或所述系统消息均包括所述当前页面的ID。The service message and/or the system message each include an ID of the current page.
  4. 如权利要求1至3任一项所述的方法,其中,在所述根据当前页面发送的长连接服务器地址查找到对应的长连接服务器之前,还包括:The method according to any one of claims 1 to 3, further comprising: before finding the corresponding long connection server according to the long connection server address sent by the current page, further comprising:
    选择能够与长连接服务器间建立稳定的长连接通道的主体,作为所述页面与长连接服务器间的通信方法的实施主体。A main body capable of establishing a stable long connection channel with the long connection server is selected as an implementation body of the communication method between the page and the long connection server.
  5. 如权利要求4所述的方法,其中,所述主体为flash。The method of claim 4 wherein said subject is flash.
  6. 如权利要求5所述的方法,其中,在本地与所述长连接服务器间建立长连接通道,包括:The method of claim 5, wherein establishing a long connection channel between the local and the persistent connection server comprises:
    使用FLASH socket协议在flash与所述长连接服务器间建立长连接通道。A long connection channel is established between the flash and the long connection server by using the FLASH socket protocol.
  7. 一种页面与长连接服务器间的通信客户端,包括:A communication client between a page and a long connection server, including:
    连接建立组件,配置为根据当前页面发送的长连接服务器地址查找到对应的长连接服务器,并在本地与所述长连接服务器间建立长连接通道; The connection establishing component is configured to find a corresponding long connection server according to the long connection server address sent by the current page, and establish a long connection channel between the local connection server and the long connection server;
    传输组件,配置为接收所述长连接服务器下发的传输消息,并将所述传输消息转发至所述当前页面。And a transmission component, configured to receive the transmission message delivered by the persistent connection server, and forward the transmission message to the current page.
  8. 如权利要求7所述的客户端,其中,The client of claim 7 wherein
    所述传输组件,还配置为将所述当前页面的标识ID发送至所述长连接服务器,以供所述长连接服务器根据所述ID查找到内容下发对象,其中,本地标识与所述ID一一对应。The transmission component is further configured to send the identifier ID of the current page to the persistent connection server, so that the long connection server finds a content delivery object according to the ID, where the local identifier and the ID are One-to-one correspondence.
  9. 如权利要求8所述的客户端,其中,所述长连接服务器下发的传输消息包括:The client according to claim 8, wherein the transmission message delivered by the persistent connection server comprises:
    其他页面通过业务服务器发出的业务消息;和/或,Business messages sent by other pages through the business server; and/or,
    所述业务服务器广播的系统消息;a system message broadcast by the service server;
    其中,所述业务消息和/或所述系统消息均包括所述当前页面的ID。The service message and/or the system message each include an ID of the current page.
  10. 如权利要求7至9任一项所述的客户端,其中,所述页面与长连接服务器间的通信客户端为flash。The client according to any one of claims 7 to 9, wherein the communication client between the page and the persistent connection server is flash.
  11. 如权利要求7至10任一项所述的客户端,其中,所述连接建立组件还配置为使用FLASH socket协议在flash与所述长连接服务器间建立长连接通道。The client according to any one of claims 7 to 10, wherein the connection establishing component is further configured to establish a long connection channel between the flash and the persistent connection server using a FLASH socket protocol.
  12. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-6中的任一个页面与长连接服务器间的通信方法。A computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform a communication method between any of the pages of claims 1-6 and a persistent connection server .
  13. 一种计算机可读介质,其中存储了如权利要求12所述的计算机程序。 A computer readable medium storing the computer program of claim 12.
PCT/CN2015/090819 2014-12-10 2015-09-25 Method of communication between page and long-connection server, and client end WO2016090995A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410758655.5A CN104486327B (en) 2014-12-10 2014-12-10 Communication means and client between the page and long connection server
CN201410758655.5 2014-12-10

Publications (1)

Publication Number Publication Date
WO2016090995A1 true WO2016090995A1 (en) 2016-06-16

Family

ID=52760831

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/090819 WO2016090995A1 (en) 2014-12-10 2015-09-25 Method of communication between page and long-connection server, and client end

Country Status (2)

Country Link
CN (1) CN104486327B (en)
WO (1) WO2016090995A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383617A (en) * 2020-11-12 2021-02-19 百度在线网络技术(北京)有限公司 Method, device, terminal equipment and medium for long connection
CN113472893A (en) * 2021-07-22 2021-10-01 咪咕数字传媒有限公司 Data processing method and device, computing equipment and computer storage medium
CN114040007A (en) * 2021-11-02 2022-02-11 北京华云安信息技术有限公司 Method and equipment for transmitting data among multiple nodes

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486327B (en) * 2014-12-10 2019-02-05 北京奇虎科技有限公司 Communication means and client between the page and long connection server
CN105099885B (en) * 2015-07-13 2018-06-12 小米科技有限责任公司 Method for sending information and device
CN108965413B (en) * 2018-07-03 2021-08-03 北京小米移动软件有限公司 Information interaction method and device and storage medium
CN110012115A (en) * 2019-05-06 2019-07-12 广州华多网络科技有限公司 The update method and system of direct broadcasting room pushed information
CN116708533A (en) * 2022-10-31 2023-09-05 荣耀终端有限公司 Connection switching method, server stopping method, terminal equipment and server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297453A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Method, browser end and system for achieving instant communication
CN103905435A (en) * 2014-03-14 2014-07-02 北京六间房科技有限公司 Communication method of front end page and rear end server
CN104009938A (en) * 2014-06-17 2014-08-27 合一网络技术(北京)有限公司 Method and system for long connections based on router level
CN104486327A (en) * 2014-12-10 2015-04-01 北京奇虎科技有限公司 Method and client side of communication between pages and long connection servers

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743254B2 (en) * 2005-03-23 2010-06-22 Microsoft Corporation Visualization of trust in an address bar
CN102761564B (en) * 2011-04-25 2015-04-22 阿里巴巴集团控股有限公司 Graphic sharing method, system and terminal
CN103634384B (en) * 2013-11-21 2016-09-14 山东康威通信技术股份有限公司 A kind of method based on Flash technology real-time remote monitoring terminal unit on a web browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297453A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Method, browser end and system for achieving instant communication
CN103905435A (en) * 2014-03-14 2014-07-02 北京六间房科技有限公司 Communication method of front end page and rear end server
CN104009938A (en) * 2014-06-17 2014-08-27 合一网络技术(北京)有限公司 Method and system for long connections based on router level
CN104486327A (en) * 2014-12-10 2015-04-01 北京奇虎科技有限公司 Method and client side of communication between pages and long connection servers

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383617A (en) * 2020-11-12 2021-02-19 百度在线网络技术(北京)有限公司 Method, device, terminal equipment and medium for long connection
CN113472893A (en) * 2021-07-22 2021-10-01 咪咕数字传媒有限公司 Data processing method and device, computing equipment and computer storage medium
CN113472893B (en) * 2021-07-22 2023-08-01 咪咕数字传媒有限公司 Data processing method, device, computing equipment and computer storage medium
CN114040007A (en) * 2021-11-02 2022-02-11 北京华云安信息技术有限公司 Method and equipment for transmitting data among multiple nodes
CN114040007B (en) * 2021-11-02 2024-04-16 北京华云安信息技术有限公司 Method and device for data transmission between multiple nodes

Also Published As

Publication number Publication date
CN104486327A (en) 2015-04-01
CN104486327B (en) 2019-02-05

Similar Documents

Publication Publication Date Title
WO2016090995A1 (en) Method of communication between page and long-connection server, and client end
US9137313B2 (en) Data transmission system and method using relay server
US9591524B2 (en) Method and apparatus for transmitting data in network system, and data transmission system
CN101997768B (en) Method and device for uploading address resolution protocol messages
KR101317178B1 (en) ZigBee Gateway and method for identifying message of the same
WO2017128178A1 (en) Information interaction method, client and device
EP2234332A1 (en) Method, device and system for diagnosing whether nodes are abnormal or not in p2p network
CN103580988A (en) Method for message receiving, pushing and transmitting, device, server group and system
US20230031062A1 (en) Data processing method and apparatus, related device, and storage medium
CN104410562A (en) Method of processing instant message associated with business
US8650313B2 (en) Endpoint discriminator in network transport protocol startup packets
CN103581361A (en) Domain name resolution proxy method, device and system
JP2017201776A (en) Content delivery through uneven network
JP2014123363A5 (en)
WO2015172629A1 (en) Message transmission method, apparatus and system
US8861503B2 (en) Method and system for synchronizing data between mobile terminal and internet phone
US9439049B2 (en) System and method for message service gateway
WO2019242279A1 (en) Message processing method and device
WO2017005118A1 (en) Method, device, terminal and server for maintaining communication connection
CN106612307A (en) Always-on service implementation method and device
US10021067B2 (en) Internet protocol address distribution for wireless network
AU2014231331B2 (en) System and method for reliable messaging between application sessions across volatile networking conditions
CN103873355A (en) Information matching method
CN106657179A (en) File transfer method and system
CN114793234B (en) Message processing method, device, equipment and storage medium

Legal Events

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

Ref document number: 15867682

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15867682

Country of ref document: EP

Kind code of ref document: A1