CN110213155B - Communication processing method, communication processing device, related equipment and storage medium - Google Patents

Communication processing method, communication processing device, related equipment and storage medium Download PDF

Info

Publication number
CN110213155B
CN110213155B CN201910370780.1A CN201910370780A CN110213155B CN 110213155 B CN110213155 B CN 110213155B CN 201910370780 A CN201910370780 A CN 201910370780A CN 110213155 B CN110213155 B CN 110213155B
Authority
CN
China
Prior art keywords
communication
information
browser client
indication information
service
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
CN201910370780.1A
Other languages
Chinese (zh)
Other versions
CN110213155A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910370780.1A priority Critical patent/CN110213155B/en
Publication of CN110213155A publication Critical patent/CN110213155A/en
Application granted granted Critical
Publication of CN110213155B publication Critical patent/CN110213155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2416Real-time traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/046Interoperability with other network applications or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a communication processing method and device for a browser client, an intelligent terminal and a server, wherein the method comprises the following steps: receiving an access request sent by a browser client embedded with a communication tool; generating policy indication information for the web page communication tool according to load information and decision conditions of service side equipment providing communication services for the web page communication tool so as to inform the browser client to select a communication policy according to the policy indication information, and transmitting communication data for the web page communication tool according to the selected communication policy by the browser client. By adopting the embodiment of the invention, the data transmission of the webpage communication tool running on the browser client can be realized by flexibly selecting the communication strategy.

Description

Communication processing method, communication processing device, related equipment and storage medium
Technical Field
The invention relates to the technical field of computer application, in particular to a communication processing method and device for a browser client, an intelligent terminal, a server and a storage medium.
Background
The browser client is a commonly used application program for searching and presenting internet information, and the browser client can request corresponding webpage data according to user operation and display the webpage data in a tab page. With the development of technology, tools can be built on a browser client, such as an Instant Messaging web IM (Instant Messaging) tool built on the basis of the browser client, a web game tool built on the basis of the browser client, and the like, wherein the web IM is most widely applied to an Instant Messaging customer service implemented on the browser client.
When a browser client performs data interaction with a service-side device, the browser client generally accesses the service-side device by using a hypertext Transfer Protocol (http) to obtain corresponding data. At present, two access modes, namely a websocket protocol and a polling access mode, are adopted for realizing real-time communication in web communication tools such as web IM and web games.
The websocket protocol is a new protocol defined by hypertext markup language HTML5, and can implement full-duplex communication (full-duplex) between the browser client and the service-side device, and implement bidirectional communication between the browser client and the service-side device. The polling access mode is that a browser client periodically initiates an http request to a service-side device to acquire data.
In the current design process of web communication tools such as web IM and web games, research and development personnel generally design a communication mode based on a websocket protocol to realize data transmission of the web communication tools or design a communication mode based on a polling access mode to realize data transmission of the web communication tools according to specific communication requirements of the web communication tools. This makes data transmission for the web page communication tool inflexible enough, and the resource utilization of the corresponding service-side device is low.
Disclosure of Invention
The embodiment of the invention provides a communication processing method and device for a browser client, an intelligent terminal, a server and a storage medium, which can flexibly select a communication strategy to realize data transmission of a webpage communication tool running on the browser client.
In one aspect, an embodiment of the present invention provides a method for processing communication of a browser client, where the method includes:
receiving an access request sent by a browser client embedded with a webpage communication tool, wherein the access request is generated after the browser client detects that a communication event is generated on the embedded webpage communication tool;
acquiring load information of service side equipment for providing communication service for a webpage communication tool;
generating strategy indicating information for the webpage communication tool according to the load information and the judgment condition, and generating a response message carrying the strategy indicating information;
and sending the response message to the browser client, wherein the response message is used for informing the browser client to select a communication strategy according to the strategy indication information so as to transmit communication data for the webpage communication tool according to the selected communication strategy.
On the other hand, an embodiment of the present invention further provides another communication processing method for a browser client, including:
if a communication event is detected to be generated on a webpage communication tool embedded in a browser client, an access request is sent to a service side device;
receiving a response message returned by the service side equipment, wherein the response message carries policy indication information, and the policy indication information is generated by the service side equipment according to the acquired load information and the judgment condition;
and selecting a communication strategy according to the strategy indication information carried by the response message, and transmitting communication data for the webpage communication tool according to the selected communication strategy.
Correspondingly, an embodiment of the present invention further provides a communication processing apparatus for a browser client, including:
the communication module is used for receiving an access request sent by a browser client embedded with a webpage communication tool, wherein the access request is generated after the browser client detects that a communication event is generated on the embedded webpage communication tool;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring load information of service side equipment for providing communication service for a webpage communication tool;
the generating module is used for generating strategy indicating information for the webpage communication tool according to the load information and the judgment condition and generating a response message carrying the strategy indicating information;
and the sending module is used for sending the response message to the browser client, and the response message is used for informing the browser client to select a communication strategy according to the strategy indication information so as to transmit communication data for the webpage communication tool according to the selected communication strategy.
Correspondingly, another communication processing apparatus for a browser client is further provided in an embodiment of the present invention, including:
the request module is used for sending an access request to the service side equipment when detecting that a communication event is generated on a webpage communication tool embedded in the browser client;
a receiving module, configured to receive a response message returned by the service-side device, where the response message carries policy indication information, and the policy indication information is generated by the service-side device according to the obtained load information and the decision condition;
and the processing module is used for selecting a communication strategy according to the strategy indication information carried by the response message and transmitting communication data for the webpage communication tool according to the selected communication strategy.
Accordingly, an embodiment of the present invention further provides a communication server, including a storage device and a processor, where the storage device stores program instructions, and the processor is configured to call the program instructions stored in the storage device, so as to perform the method in the foregoing aspect.
Correspondingly, the embodiment of the present invention further provides an intelligent terminal, which includes a storage device and a processor, wherein the storage device stores program instructions, and the processor is configured to call the program instructions stored in the storage device, so as to execute the method in the above another aspect.
Accordingly, embodiments of the present invention also provide a computer storage medium, in which program instructions are stored, and when the program instructions are executed by a processor, the method in the above aspect is implemented.
Accordingly, the embodiment of the present invention further provides a computer program product, which when running on a processor implements the above mentioned method.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, and is used for determining whether the load of the service side equipment is too high, if so, the browser client can be informed to access the service side equipment in a polling access mode, and the polling access mode is to periodically access the port of the service side equipment according to a certain time interval, so that the communication port can be flexibly utilized, and the requirement of high access capacity can be met. If the load is low, the browser client can be informed to select a two-way communication protocol to establish a two-way communication connection with the service side equipment so as to transmit communication data for the webpage communication tool on the two-way communication connection, so that the requirement of higher timeliness can be met, and the communication quality is ensured; for the browser client, different communication strategies can be flexibly selected to access the service side equipment to transmit data for the webpage communication tool based on the notification of the service side equipment, and the requirement of high access amount or the requirement of timeliness is met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a communication system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a user interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another user interface according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a communication processing method for a browser client according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating another communication processing method for a browser client according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for handling a communication indication to a browser client according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a communication processing method for a browser client according to another embodiment of the present invention;
fig. 8 is a flowchart illustrating a communication processing method for a browser client according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of a communication processing apparatus for a browser client according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another communication processing apparatus for a browser client according to an embodiment of the present invention;
FIG. 11 is a block diagram of a server according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention takes the load information of the service side equipment which provides communication service for the webpage communication tool on the browser client as a reference basis, and dynamically instructs the browser client to select different communication strategies to realize the data transmission of the webpage communication tool opened on the browser client. In the embodiment of the present invention, the communication policy supported by the browser client includes at least two types, one type is a policy that can implement bidirectional communication between the browser client and the service-side device, and the bidirectional communication policy can ensure more accurate and timely communication between the web communication tool on the browser client and the service-side device providing the communication service, and ensure the communication quality of the web communication tool, and the other type is a manner in which the browser client acquires data from the service-side device in a polling manner, and the polling manner cannot better ensure the timeliness of communication, but can ensure access of more users.
In an embodiment, on one hand, for the service-side device, the load information may be determined according to consumption conditions of hardware resources of each node of the service-side device, so as to determine whether the load of the service-side device is too high, and if so, the browser client may be notified to access the service-side device in a polling access manner, where the polling access manner initiates access to the service-side device at a certain periodic interval, so that, in the periodic interval, other web communication tools may also access the service-side device, and a requirement for a high access amount may be met. If the load is low, the browser client can be informed to select a two-way communication protocol to establish a two-way communication connection with the service side equipment so as to transmit communication data for the webpage communication tool on the two-way communication connection, so that the requirement of higher timeliness can be met, and the communication quality is ensured; on the other hand, for the browser client, different communication strategies can be flexibly selected to access the service side equipment to transmit data for the webpage communication tool based on the notification of the service side equipment, so that the requirement of high access amount or the requirement of timeliness is met. In one embodiment, the browser client supports socket.io, and at least a websocket supporting a two-way communication protocol and a polling mode capable of realizing a polling access mode are packaged in the socket.io.
In an embodiment, please refer to fig. 1, which is a schematic structural diagram of a communication system according to an embodiment of the present invention. The communication system of the embodiment of the invention can be a distributed system for providing communication services for web page communication tools such as web IM (a tool for realizing online customer service on a web page of a browser client), web games and the like, the system comprises service side equipment, the service side equipment further comprises a proxy server and a communication server, and the browser client communicates with the service side equipment to transmit data for the web page communication tools and provide a web page communication function for users.
In the structure shown in fig. 1, the browser client corresponds to a smart terminal with a network function, such as a smart phone, a tablet computer, a personal computer, a smart wearable device, and the like, the proxy server is a proxy server that provides high-performance http and reverse proxy services nginx (engine x), and the node providing socket.io service shown in fig. 1 is a communication server. Io service integrates interface service based on websocket protocol (a two-way communication protocol) and interface transmission service based on polling access. Where a proxy server is an optional server, in some embodiments, the browser client may also connect directly to the communication server without going through an intermediate proxy server.
The data transmission process of providing services for the webpage communication tools operated on each browser client by the service side equipment comprises the following steps: the webpage communication tool sends data or an access request to the proxy server through the ports provided by the browser client and the proxy server, the proxy server forwards the data or the access request to the communication server, the communication server can send the data to the proxy server when acquiring the data required to be sent to the webpage communication tool, the proxy server sends the data to the browser client through the port connected with the browser client, the data are output to the webpage communication tool by the browser client, and the webpage communication tool presents corresponding data or executes corresponding data on a user interface.
In fig. 2, a browser client 201 and a user interface 202 of a web IM displayed in the browser client 201 are shown, in the web IM, after a user clicks an immediate consultation button 203 in fig. 2 on the browser client, a session interface 301 as shown in fig. 3 may be opened, and the user may click the immediate consultation button 203 through a mouse or a touch screen or the like. A user may input information, for example, the information 302 therein, on the session interface 301 shown in fig. 3, the input information may be transmitted to a browser client of a customer service person or a client in another form after passing through the browser client at the user side, a proxy server connected to the browser client at the user side, and a communication server, whereas information entered by the customer service person in an automatic or manual manner is also transmitted to the browser client at the user side successively through the browser client at the customer service side, the proxy server connected to the browser client at the customer service side, the communication server, and the proxy server at the user side, and is finally presented to the user through the session interface 301 shown in fig. 3. The session interface 301 in fig. 3 further includes other function buttons, for example, a button 303 for sending an emoticon, a button 304 for sending a video or triggering the shooting of a video, and the like.
In the embodiment of the invention, in the process that the service side device formed by the proxy server and the communication server provides the communication service for the embedded webpage communication tool on each browser client, each proxy server notifies the communication server connected with the proxy server of the number of occupied ports (or the port ratio of the number of occupied ports to the total number of the ports), and meanwhile, each communication server counts the occupied hardware resources in the process of providing the communication service, including the occupancy rate of a CPU (central processing unit), the occupancy rate of a memory and the like. In addition, the communication servers connected with each other can share the CPU occupancy rate, the memory occupancy rate and the acquired port number which are respectively counted, so that each communication server can know the resource occupancy information in the whole distributed system after information sharing, and the resource occupancy information can be used as load information and respectively stored in each communication server. In one embodiment, each communication server may also count the number of users accessed as user access information, and store the user access information as load information in the communication server.
After the communication server obtains the load information, when a subsequent user initiates an access request through a browser client embedded with a web page communication tool, for example, when it is detected that the user has clicked a button for immediate consultation on a browser client page shown in fig. 2 to initiate the access request or generates new data to be transmitted on an interface shown in fig. 3, the communication server may instruct the browser client to select an appropriate communication policy based on the load information. In an embodiment, fig. 2 and fig. 3 show a user interaction interface provided by the web page communication tool to facilitate user interaction, for example, a user interaction interface for instant messaging between a user and a certain customer service person, and in other embodiments, a user interaction interface for instant messaging between two general users (e.g., an instant messaging friend), where a browser client opening the web page communication tool on a certain tab page shown in fig. 2 or fig. 3 is considered to be a browser client embedded with the web page communication tool.
Fig. 4 is a schematic flow chart illustrating a communication processing method for a browser client according to an embodiment of the present invention. The method may be performed by a communication server that receives an access request of a browser client as in any of fig. 1. In S401, the communication server receives an access request sent by a browser client embedded with a web page communication tool, where the access request is generated by the browser client after detecting that a communication event is generated on the embedded web page communication tool; the communication event may be, for example, clicking a button on the interface shown in fig. 2 to consult immediately, or entering and clicking a piece of data such as text, voice, etc. on the interface of fig. 3 to send. The access request may be an http request which may be based on hypertext transfer protocol access to a proxy server and to one of the communication servers shown in fig. 1.
After receiving the access request, the communication server acquires load information of a service-side device for providing a communication service for the web communication tool in S402; the load information comprises resource occupation information and/or user access information, and based on the information sharing mode, the communication server can determine the load information of the whole system, and can quickly and accurately determine a communication strategy for a webpage communication tool of the browser client which needs to be accessed currently. In other embodiments, load information may also be counted and obtained from each service-side device after receiving the access request, and since the counting process needs to be time-consuming, this manner may be applied to a web page communication tool with a lower requirement on timeliness.
After determining the load information, the communication server may generate policy instruction information for the web page communication tool according to the load information and the decision condition in S403, and generate a response message carrying the policy instruction information; the policy indication information is mainly used for indicating which communication policy should be selected by the browser client in the transmission policies supported by the browser client to implement data transmission on the web page communication tool. The policy indication information may include two-way communication indication information, polling communication indication information, shared communication indication information, and the like. In an embodiment, according to the indication of the policy indication information, the browser client may select a communication policy in which a bidirectional communication protocol establishes a bidirectional communication connection with the service-side device, for example, a communication policy in which a websocket protocol indicated by the policy indication information and supported by the browser client performs bidirectional communication, or, according to the indication of the policy indication information, the browser client may select a communication policy in which a polling access manner periodically accesses the service-side device, for example, a communication policy in which a polling access manner indicated by the policy indication information and supported by the browser client performs polling access.
In one embodiment, for the browser client, the two-way communication indication information is used for instructing the browser client to select a websocket protocol to transmit data of the web page communication tool, the polling communication indication information is used for instructing the browser client to select a polling transmission mode to periodically initiate an http request to transmit data of the web page communication tool, and the shared communication indication information is used for instructing the browser client to select a shareworker transmission mode to transmit data of the web page communication tool.
In one embodiment, the S403 may include: if the load information meets a preset judgment condition, generating bidirectional communication indication information for the webpage communication tool as strategy indication information; generating a response message carrying the two-way communication indication information; the response message carrying the two-way communication indication information is used for informing the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
Further, the S403 may further include: if the load information does not meet the preset judgment condition, generating polling communication indication information for the webpage communication tool as strategy indication information; generating a response message carrying polling communication indication information; the response message carrying the polling communication indication information is used for informing the browser client to select a polling access mode to periodically access the service side equipment according to the indication of the polling communication indication information, so that the browser client transmits communication data for the webpage communication tool. In an embodiment, the generated polling communication indication information may instruct the browser client to perform polling access according to a specific periodic interval value, for example, instruct the browser client to periodically initiate http requests at a periodic interval of 1 second or at a periodic interval of 2 seconds, in addition to instructing the browser client to select a polling access manner such as polling.
In an embodiment, the load information may be compared with one or more set interval value adjustment conditions to determine how long a period interval is to initiate a request, and when the load information does not satisfy the preset decision condition and the load value indicated by the load information is smaller than a first threshold in the interval value adjustment condition, a first polling period value is set, and the response message carries the first polling period value in addition to the polling communication indication information, so as to notify the browser client to select a polling access mode according to an indication of the polling communication indication information, and periodically access the service-side device with the first polling period value as the period interval. Further, when the load information does not satisfy the preset decision condition and the load value indicated by the load information is greater than a second threshold in the interval value adjustment condition, a second polling period value is set, and the response message carries the polling communication indication information and also carries the second polling period value, so as to notify the browser client to select a polling access mode according to the indication of the polling communication indication information, and periodically access the service-side device with the second polling period value as a period interval, wherein the first polling period value is different from the second polling period value, and the first threshold may be less than or equal to the second threshold. The threshold set in the interval value adjustment condition may also be dynamically changed as needed, for example, dynamically adjusted by a server administrator according to actual conditions.
In an embodiment, after the browser client selects the polling access mode to periodically access the service-side device, the communication server may further obtain load information newly shared by the service-side device as load update information again, if the load update information meets a preset interval value adjustment condition, an update message carrying interval value adjustment indication information is generated, and the update message is sent to the browser client, where the update message is used to notify the browser client to adjust the cycle interval of the polling access mode according to the interval value adjustment indication information, so as to periodically access the service-side device according to a new cycle interval. The update message is mainly used for adjusting the period interval, and the adjusted period interval is larger than the period interval before adjustment. The load update information satisfying the preset interval value adjustment condition may be: the resource occupation information included in the load updating information is larger than a preset resource updating threshold value, and/or the user access information is larger than a preset access number updating threshold value. The resource update threshold is greater than the aforementioned resource threshold, and the access number update threshold is greater than the aforementioned access number threshold.
The judgment condition is used for measuring whether the current software and hardware processing resources of the service side equipment are sufficient or not, if the software and hardware processing resources of the current service side equipment are determined to be sufficient according to the load information and the judgment condition, and the load information meets the judgment condition, bidirectional communication indication information is generated for the webpage communication tool to serve as strategy indication information; and if the load of the current service side equipment is determined to be insufficient according to the load information and the judgment condition, and the load information is determined not to meet the judgment condition, generating polling communication indication information for the webpage communication tool as strategy indication information.
In one embodiment, the decision condition may be set based on a resource threshold of one or more hardware and software processing resources. The load information comprises resource occupation information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the resource occupation information and a preset resource threshold value; and/or the load information comprises user access information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the user access information and a preset access number threshold.
When the value corresponding to the resource occupation information in the load information is smaller than or equal to the preset resource threshold value, determining that the load information meets the judgment condition, and when the value corresponding to the resource occupation information in the load information is larger than the preset resource threshold value, determining that the load information does not meet the judgment condition. In one embodiment, the values corresponding to the resource occupation information include: in a distributed system formed by the proxy server and the communication servers, the port occupation ratio of the occupied ports of the proxy server to the total port amount and the total CPU occupancy rate and the total memory occupancy rate of all the communication servers are compared with a preset occupation ratio threshold value, the total CPU occupancy rate is compared with a preset first occupancy rate threshold value, the total memory occupancy rate is compared with a preset second occupancy rate threshold value to determine whether the load information meets the judgment condition or not, when one or more than one corresponding threshold value is smaller than or equal to the corresponding threshold value, the judgment condition is determined to be met, the communication quality can be ensured by using bidirectional communication, when one or more than one corresponding threshold value is larger than the corresponding threshold value, the judgment condition is determined not to be met, and a polling access mode can be used to ensure the number of accessed users as much as possible. In other embodiments, if the browser client is not connected to the communication server through the proxy server but is directly connected to the communication server, the port data of the proxy server is not included in the load information, but only the related hardware resource information of the communication server, for example, only the resource occupancy information such as CPU occupancy, internal parameter occupancy, and the like of the communication server is included.
The user access information may also reflect to some extent whether the processing resources of the service-side device are sufficient. A threshold may be set in advance according to the port number that the proxy server can provide, for example, an amount of 90% of the port number is used as an access number threshold, so that when the number of users accessed is too large, the communication policy can be determined in time.
The communication server may send the response message to the browser client in S404, where the response message is used to notify the browser client to select a communication policy according to the policy indication information, so as to transmit communication data for the web page communication tool according to the selected communication policy. After receiving the response message, the browser client selects a communication strategy according to the indication of the strategy indication information in the response message, and transmits communication data for the webpage communication tool according to the selected communication strategy.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that the requirement of high access amount and the requirement of higher timeliness can be met under different load conditions, and the communication quality is ensured. Therefore, data support can be better provided for communication tools such as web games and web IM of web customer service, and the data interaction requirements of service providers such as common users, game operators or merchants are met.
Referring to fig. 5, a flowchart of another communication processing method for a browser client according to an embodiment of the present invention is shown. The method may be performed by a communication server that receives an access request of a browser client. The method of an embodiment of the present invention includes the following steps.
S501: receiving an access request sent by a browser client embedded with a webpage communication tool, wherein the access request is generated after the browser client detects that a communication event is generated on the embedded webpage communication tool. The web page communication tool provides communication functions for users.
S502: load information of a service-side device for providing a communication service for a web communication tool is acquired.
S503: and if the load information does not meet the preset judgment condition, generating polling communication indication information as strategy indication information for the webpage communication tool. The load information comprises resource occupation information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the resource occupation information and a preset resource threshold value; and/or the load information comprises user access information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the user access information and a preset access number threshold. The polling communication indication information may be a preset flag, for example, preset 1 indicates bidirectional communication indication information, and preset 2 indicates polling communication indication information.
In one embodiment, the S503 may include: if the load information does not meet the preset judgment condition, determining a polling access mode for the webpage communication tool; determining a periodic interval value of the polling access mode according to the load information; and generating polling communication indication information according to the polling access mode and the periodic interval value. That is, when determining the polling communication indication information, the content of the periodic interval value, for example, the periodic interval value such as 1 second or 2 seconds, may be added to indicate that the browser client initiates an http request every 1 second or every 2 seconds when selecting the polling communication method to communicate with the service-side device. Of course, the polling communication indication information may also include only a polling access mode and does not need to include a periodic interval value, and the browser client may initiate the polling access according to the default periodic interval value.
S504: and generating a response message carrying the polling communication indication information. The format of the generated response message is the format agreed by the service-side device and the browser client, in one embodiment, the response message may include a plurality of fields, and the fields may include, for example, a tag field, a value of the tag field is used to indicate that the message is a special message for instructing the browser client to select a communication policy, but not other messages, a policy field, when the field value is 1, the policy field indicates that bidirectional communication indication information is carried, the browser client needs to select a bidirectional communication protocol to establish a bidirectional communication connection between the browser client and the service-side device, when the field value is 2, the policy field indicates that polling communication indication information is carried, the browser client needs to select a polling access mode to periodically access the service-side device, and a period interval field, when the value of the policy field is 1, the period interval field is 0, when the value of the policy field is 2, the value of the period interval field is a specific value, for example, 1, 2, which indicates that the period interval is 1 second, 2 seconds, respectively. The response message may also include an extension field to facilitate subsequent assignment of the extension field as needed.
S505: sending the response message carrying the polling communication indication information to the browser client; the response message carrying the polling communication indication information is used for informing the browser client to select a polling access mode to periodically access the service side equipment according to the indication of the polling communication indication information, so that the browser client transmits communication data for the webpage communication tool. After receiving the response message, the browser client selects a polling interface service in socket.io supported by the browser client, and periodically sends an http request to the service-side device to transmit data to the web communication tool on the browser client.
In another embodiment, if the load information meets a preset judgment condition, generating bidirectional communication indication information for the web page communication tool as policy indication information; generating a response message carrying the two-way communication indication information; the response message carrying the two-way communication indication information is used for informing the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection. At this time, the response message sent to the browser client carries the two-way communication indication information. The two-way communication protocol comprises the above mentioned websocket protocol, and the browser client establishes a two-way communication connection with the service-side device by selecting an interface service of the websocket protocol in socket.
Further, in the embodiment of the present invention, after determining that the load information does not satisfy the preset decision condition, S506 may be further executed: carrying out capacity expansion processing on the service side equipment to access new service side equipment; the expansion processing of the service-side device mainly refers to accessing a newly configured or standby service-side device into a distributed system constructed by the current service-side device, and may newly access a proxy server, a communication server, and the like. After accessing the proxy server and/or the communication server newly configured or standby by the user, the hardware processing resource information is supplemented in general, and a notification of switching the communication policy may be initiated to the browser client selecting the polling access mode.
S507: acquiring capacity expansion load information of the service side equipment after capacity expansion; that is, new load information in the distributed system to which the new service-side device is added is acquired. After the newly configured and/or standby service-side device is successfully accessed to the system, all proxy servers in the expanded system upload port occupation data (for example, the occupied port number or the occupied port number in the proportion of the total port number), and the communication servers in the system start sharing information (the shared information includes the above-mentioned resource occupation information such as port occupation data, CPU occupancy, memory occupancy, and the like), so that new load information can be obtained.
S508: if the capacity expansion load information meets the preset judgment condition, generating bidirectional communication indication information for the webpage communication tool; for example, the port occupation ratio of the occupied ports of the proxy server in the distributed system is less than or equal to a preset occupation ratio threshold, and/or the total CPU occupation rate of the communication servers in the distributed system is less than or equal to a preset first occupation rate threshold, and/or the total memory occupation rate of the communication servers in the distributed system is less than or equal to a preset second occupation rate threshold. Wherein the first occupancy threshold may or may not be the same as the second occupancy threshold.
S509: generating a switching message carrying two-way communication indication information, and sending the switching message to the browser client; the switching message is used for indicating the browser client to switch the polling access mode used when the load information does not meet the judgment condition to the two-way communication mode corresponding to the two-way communication protocol. That is, the switching message is used to instruct the browser client to select a bidirectional communication protocol to establish a bidirectional communication connection with the service-side device according to the instruction of the bidirectional communication instruction information in the switching message, so that the browser client transmits communication data for the web page communication tool over the bidirectional communication connection.
In one embodiment, as shown in fig. 6, in consideration of the time consumption for accessing a new or standby proxy server or communication server in the distributed system, the method may further include the following steps during the process of expanding the service-side device.
S601: detecting whether the capacity expansion is completed; determining whether the capacity expansion is completed may include various manners, for example, the time for capacity expansion may be estimated in advance, and after the capacity expansion is initiated to a preset time, the capacity expansion may be considered to be completed, otherwise, the capacity expansion is not completed. For another example, in the distributed system according to the embodiment of the present invention, the newly accessed proxy server and the communication server also upload the resource occupancy information, and when it is detected that the change of the load information of the distributed system satisfies the condition indicating the increase of the resource, for example, the change amplitude of the load information is greater than a preset threshold, it may be considered that the capacity expansion is completed, otherwise, the capacity expansion is not completed. The expansion may be performed as S602 described below if the expansion is not completed, and as S507 described above if the expansion is completed.
S602: if the capacity expansion is not finished, acquiring the load information of the service side equipment again to obtain load updating information; and when the capacity expansion is not finished, continuously acquiring the load information of the service side equipment to perform subsequent judgment.
S603: and if the load updating information meets the preset interval value adjusting condition, generating an updating message carrying interval value adjusting indication information. The load update information satisfying the preset interval value adjustment condition may be: the resource occupation information included in the load updating information is larger than a preset resource updating threshold value, and/or the user access information is larger than a preset access number updating threshold value. The resource update threshold is greater than the resource threshold mentioned in S503, and the access number update threshold is greater than the access number threshold mentioned in S503, for example, the resource threshold is 90%, the resource update threshold at this time may be 95%, the access number threshold at this time is 3 thousands, and the access number update threshold at this time may be 4 thousands. These thresholds may be set based on the capabilities of the proxy server and the communication server in the distributed system.
S604: and sending the update message to the browser client, wherein the update message is used for informing the browser client to adjust the periodic interval of the polling access mode according to the interval value adjustment indication information so as to periodically access the service side equipment according to the new periodic interval. The update message is mainly used to adjust the period interval, where the adjusted period interval is greater than the period interval before the adjustment, for example, if the period interval value is 1 second in the response message sent in S505, the browser client notified by the update message adjusts the interval value to 2 seconds. The interval value adjustment may be only information of amplitude, for example, the adjustment amplitude is 1 second at the existing period interval, or may be a specific time interval value, for example, the adjustment amplitude is adjusted to 2 second period interval. After the periodic interval is adjusted, more users can be accessed on the current distributed system providing communication service for the web page communication tool.
It should be noted that, after the browser client selects the polling access method, the period interval of the polling access method may be adjusted based on new load information in the process of accessing the service-side device according to the polling access method or in the process of capacity expansion and capacity expansion. For the purpose of distinguishing, in the process that the browser client side accesses in a polling access mode, the first load updating information is acquired, the first interval value adjusting condition is adopted, and the first updating message is generated. And in the process of capacity expansion processing, second load updating information is acquired, a second interval value adjusting condition is adopted, and a second updating message is generated. The first interval value adjusting condition and the second interval value adjusting condition may be the same or different.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that the browser client side can be flexibly instructed to select the communication strategy under different load conditions. And after the polling access mode is selected, the periodic time interval of the polling access can be further increased when the load continues to increase and deteriorate so as to further increase the user access amount, and whether the polling access mode is switched to the two-way communication mode is selected based on the load information after capacity expansion is successful through capacity expansion processing, so that the communication mode of the webpage communication tool is more flexible, and the communication efficiency is higher.
Fig. 7 is a flowchart illustrating a communication processing method for a browser client according to an embodiment of the present invention. The communication processing method for the browser client according to the embodiment of the present invention is described by taking a browser client, two proxy servers, and two communication servers as examples. In the actual use process, a large number of proxy servers and a large number of communication servers may be actually included to provide services for web communication tools such as web IM, web games, etc., and a plurality of actually accessed browser clients are also included, fig. 7 is merely an example, and the specific flow of the method according to the embodiment of the present invention is described below.
S701: the proxy server sends resource occupation information to the associated communication server, wherein the proxy resource occupation information mainly comprises hardware resource information such as the number of currently occupied ports of the proxy server.
S702: the communication server shares the resource occupation information with the communication server. The shared resource occupation information includes hardware resources such as CPU occupation information, internal reference occupation information, and the like of the communication server, and proxy resource occupation information of the proxy server received by the communication server, such as hardware resource information such as the number of occupied ports. In the embodiment of the present invention, the first communication server in fig. 7 corresponds to the communication server in the embodiment corresponding to fig. 4 and 5.
Based on S701 and S702, each communication server records load information of the service-side device, including resource occupancy information of the proxy server and resource occupancy information of the communication server. The process of sending the proxy resource occupation information in step S701 and the process of sending the shared resource occupation information in step S702 are periodically executed, or may be dynamically triggered and executed when the corresponding proxy server and communication server detect that the resource occupation changes.
S703: the browser client initiates an access request. The access request is generated by the browser client after detecting a communication event generated on the embedded webpage communication tool. The access request may be triggered by a user sending and receiving information via a web communication tool opened on the browser client. For example, the user clicks the immediate consultation button shown in fig. 2. The browser client sends an access request to the first proxy server based on the http protocol.
S704: the first proxy server forwards the access request to the corresponding first communication server.
S705: the first communication server obtains load information.
S706: the first communication server generates policy indication information according to the load information.
S707: and the first communication server generates a response message carrying the strategy indication information and sends the response message to the first proxy server.
S708: the first proxy server forwards the response message to the browser client.
S709: and the browser client selects a communication strategy according to the strategy indication information in the response message.
S710: and transmitting communication data for the webpage communication tool according to the selected communication strategy. In one embodiment, the browser client supporting socket.io may select a bidirectional transmission policy websocket or a polling access polling method to transmit data for a web communication tool opened on a browser client page.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, and is used for determining whether the load of the service side equipment is too high, if so, the browser client can be informed to access the service side equipment in a polling access mode, the polling access mode periodically occupies a port of the service side equipment at a certain time interval, the port can be flexibly utilized, and the requirement of high access capacity can be met. If the load is low, the browser client can be informed to select a two-way communication protocol to establish a two-way communication connection with the service side equipment so as to transmit communication data for the webpage communication tool on the two-way communication connection, so that the requirement of higher timeliness can be met, and the communication quality is ensured; for the browser client, different communication strategies can be flexibly selected to access the service side equipment to transmit data for the webpage communication tool based on the notification of the service side equipment, and the requirement of high access amount or the requirement of timeliness is met.
Referring to fig. 8, it is a flowchart of another communication processing method for a browser client according to an embodiment of the present invention, where the method according to the embodiment of the present invention may be executed at the browser client. The method comprises the following steps.
S801: and if the communication event generated on the webpage communication tool embedded in the browser client is detected, sending an access request to the service side equipment. The web communication tool can be an instant communication tool or a game tool constructed by some basic web browser clients, such as the above-mentioned web IM and web games, etc. A communication event may be detected on the web page communication tool when the user opens the interface or needs to send or receive data. The web page communication tool may be displayed on a user browser client page as in fig. 2 and 3, and the user provides a web page communication interface for the user, receives and transmits data, and displays data.
S802: receiving a response message returned by the service side equipment, wherein the response message carries policy indication information, and the policy indication information is generated by the service side equipment according to the acquired load information and the judgment condition; the process of returning the production policy indication information and the production response message to the browser client by the service-side device based on the load information and the decision condition may refer to the description of the foregoing embodiments, which is not described herein again.
S803: and selecting a communication strategy according to the strategy indication information carried by the response message, and transmitting communication data for the webpage communication tool according to the selected communication strategy. The browser client in the embodiment of the invention supports socket.io, and the browser client can select a two-way communication strategy websocket therein to transmit data for a communication tool or select a polling mode to poll and access service side equipment according to the indication of the response message.
In an embodiment, the policy indication information includes bidirectional communication indication information, and the S803 may specifically include: according to the indication of the two-way communication indication information, selecting a communication strategy based on a two-way communication protocol; establishing a bidirectional communication connection with the service side equipment according to a communication strategy based on a bidirectional communication protocol; communicating communication data for the web communication instrument over the bi-directional communication connection.
In an embodiment, the policy indication information includes polling communication indication information, and the S803 may specifically include: selecting a communication strategy of a polling access mode according to the indication of the polling communication indication information; and periodically accessing the service side equipment according to a polling access mode so as to facilitate the browser client to transmit communication data for the webpage communication tool. The specific implementation of each step in the embodiments of the present invention may further refer to the description of the related content in the foregoing embodiments, which is not repeated herein.
In the embodiment of the invention, the browser client can flexibly select different communication strategies to access the service side equipment to transmit data for the webpage communication tool based on the notification of the service side equipment, thereby meeting the requirement of high access amount or the requirement of timeliness.
Referring to fig. 9, it is a schematic structural diagram of a communication processing apparatus for a browser client according to an embodiment of the present invention, and the apparatus according to an embodiment of the present invention may be disposed in some communication servers capable of providing communication services for a page communication tool constructed based on the browser client, for example, the communication server mentioned in the foregoing embodiment. In an embodiment of the invention, the apparatus comprises the following junction module.
A communication module 901, configured to receive an access request sent by a browser client embedded with a web page communication tool, where the access request is generated by the browser client after detecting that a communication event is generated on the embedded web page communication tool; an obtaining module 902, configured to obtain load information of a service-side device that is used to provide a communication service for a web communication tool; a generating module 903, configured to generate policy indication information for the web page communication tool according to the load information and the decision condition, and generate a response message carrying the policy indication information; a sending module 904, configured to send the response message to the browser client, where the response message is used to notify the browser client to select a communication policy according to the policy indication information, so as to transmit communication data for the web page communication tool according to the selected communication policy.
In an embodiment, the generating module 903 is specifically configured to generate bidirectional communication indication information as policy indication information for the web page communication tool if the load information meets a preset decision condition; generating a response message carrying the two-way communication indication information; the response message carrying the two-way communication indication information is used for informing the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
In an embodiment, the generating module 903 is specifically configured to generate polling communication indication information as policy indication information for the web page communication tool if the load information does not meet a preset decision condition; generating a response message carrying polling communication indication information; the response message carrying the polling communication indication information is used for informing the browser client to select a polling access mode to periodically access the service side equipment according to the indication of the polling communication indication information, so that the browser client transmits communication data for the webpage communication tool.
In an embodiment, the generating module 903 is configured to, when the generating module is configured to generate polling communication indication information as policy indication information for the web page communication tool if the load information does not meet a preset decision condition, specifically, determine a polling access mode for the web page communication tool if the load information does not meet the preset decision condition; determining a periodic interval value of the polling access mode according to the load information; and generating polling communication indication information according to the polling access mode and the periodic interval value.
In one embodiment, the apparatus may further include: the first capacity expansion processing module 905 is configured to perform capacity expansion processing on the service-side device to access a new service-side device. Further, the obtaining module 902 is further configured to obtain capacity expansion load information of the service-side device after capacity expansion; the generating module 903 is further configured to generate bidirectional communication indication information for the web page communication tool if the capacity expansion load information meets a preset decision condition; generating a switching message carrying two-way communication indication information, and sending the switching message to the browser client; the sending module 904 is further configured to send the switching message to the browser client; the switching message is used for indicating the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information in the switching message, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
In one embodiment, the apparatus may further include: a second capacity expansion processing module 906, configured to perform capacity expansion processing on the service-side device, and detect whether capacity expansion is completed; further, the obtaining module 902 is further configured to obtain load information of the service-side device again to obtain load update information if capacity expansion is not completed; the generating module 903 is further configured to generate an update message carrying interval value adjustment indication information if the load update information meets a preset interval value adjustment condition; the sending module 904 is further configured to send the update message to the browser client, where the update message is used to notify the browser client to adjust a periodic interval of a polling access manner according to the interval value adjustment indication information, so as to periodically access the service-side device according to a new periodic interval.
In one embodiment, the load information includes resource occupation information of the service-side device, and whether the load information satisfies a preset judgment condition is determined according to the resource occupation information and a preset resource threshold; and/or the load information comprises user access information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the user access information and a preset access number threshold.
For the specific implementation of each module of the apparatus in the embodiments of the present invention, reference may be made to the description of related contents in the foregoing embodiments, which is not repeated herein.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that when the load is too high, the browser client accesses the service side equipment in a polling access mode to meet the requirement of high access amount, and when the load is lower, the browser client selects a bidirectional communication protocol to establish bidirectional communication connection with the service side equipment to meet the requirement of higher timeliness and ensure the communication quality; in addition, the dynamic capacity expansion operation can be realized, and when the load is further expanded or before the capacity expansion is not completed, the periodic interval of the polling access mode can be further adjusted according to the load information so as to further access a new user.
Referring to fig. 10, a schematic structural diagram of another communication processing apparatus for a browser client according to an embodiment of the present invention is shown, where the apparatus according to the embodiment of the present invention may be disposed in an intelligent terminal with a network function, such as a smart phone, a tablet computer, a personal computer, and an intelligent wearable device, and the apparatus according to the embodiment of the present invention includes the following modules.
A request module 1001, configured to send an access request to a service-side device when a communication event is detected to be generated on a web page communication tool embedded in a browser client; a receiving module 1002, configured to receive a response message returned by the service-side device, where the response message carries policy indication information, and the policy indication information is generated by the service-side device according to the obtained load information and the decision condition; the processing module 1003 is configured to select a communication policy according to the policy indication information carried in the response message, and transmit communication data to the web page communication tool according to the selected communication policy.
In an embodiment, the policy indication information includes two-way communication indication information, and the processing module 1003 is specifically configured to select a communication policy based on a two-way communication protocol according to the indication of the two-way communication indication information; establishing a bidirectional communication connection with the service side equipment according to a communication strategy based on a bidirectional communication protocol; communicating communication data for the web communication instrument over the bi-directional communication connection.
In an embodiment, the policy indication information includes polling communication indication information, and the processing module 1003 is specifically configured to select a communication policy of a polling access manner according to an indication of the polling communication indication information; and periodically accessing the service side equipment according to a polling access mode so as to facilitate the browser client to transmit communication data for the webpage communication tool.
For the specific implementation of each module of the apparatus in the embodiments of the present invention, reference may be made to the description of related contents in the foregoing embodiments, which is not repeated herein.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that when the load is too high, the browser client accesses the service side equipment in a polling access mode to meet the requirement of high access amount, and when the load is lower, the browser client selects a bidirectional communication protocol to establish bidirectional communication connection with the service side equipment to meet the requirement of higher timeliness and ensure the communication quality.
Referring to fig. 11 again, it is a schematic structural diagram of a server according to an embodiment of the present invention, where the server according to an embodiment of the present invention includes the above-mentioned communication server, and the server can provide communication services for communication tools constructed based on a browser client, for example, communication tools such as web IM and web games. The server includes a storage device 1102 and a processor 1101, and further includes a network interface 1103, and other structures such as a power supply. Data may be transferred between the various structures of the server via bus 1104.
The network interface 1103 is configured to receive data transmitted by devices such as the intelligent terminal through a computer network and a mobile communication network. The storage device 1102 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the storage device 1102 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the storage 1102 may also comprise a combination of memories of the kind described above.
The processor 1101 may be a Central Processing Unit (CPU). The processor 1101 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or the like. The PLD may be a field-programmable gate array (FPGA), a General Array Logic (GAL), or the like.
Optionally, the storage device 1102 is also used for storing program instructions. The processor 1101 may call the program instructions to implement the relevant method as shown in the corresponding embodiments of fig. 4, fig. 5 and fig. 6 of the present application.
Specifically, in one embodiment, the processor 1101 calls a program instruction stored in the storage device 1102 to receive an access request sent by a browser client embedded with a web page communication tool, where the access request is generated by the browser client after detecting a communication event generated on the embedded web page communication tool; acquiring load information of service side equipment for providing communication service for a webpage communication tool; generating strategy indicating information for the webpage communication tool according to the load information and the judgment condition, and generating a response message carrying the strategy indicating information; and sending the response message to the browser client, wherein the response message is used for informing the browser client to select a communication strategy according to the strategy indication information, so that the browser client transmits communication data for the webpage communication tool according to the selected communication strategy.
In an embodiment, the processor 1101 is specifically configured to generate bidirectional communication indication information as policy indication information for the web page communication tool if the load information meets a preset decision condition; generating a response message carrying the two-way communication indication information; the response message carrying the two-way communication indication information is used for informing the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
In an embodiment, the processor 1101 is specifically configured to generate polling communication indication information for the web page communication tool as policy indication information if the load information does not meet a preset decision condition; generating a response message carrying polling communication indication information; the response message carrying the polling communication indication information is used for informing the browser client to select a polling access mode to periodically access the service side equipment according to the indication of the polling communication indication information, so that the browser client transmits communication data for the webpage communication tool.
In an embodiment, the processor 1101 is specifically configured to determine a polling access manner for the web page communication tool if the load information does not meet a preset decision condition; determining a periodic interval value of the polling access mode according to the load information; and generating polling communication indication information according to the polling access mode and the periodic interval value.
In an embodiment, the processor 1101 is further configured to perform capacity expansion processing on a service-side device, so as to access a new service-side device; acquiring capacity expansion load information of the service side equipment after capacity expansion; if the capacity expansion load information meets the preset judgment condition, generating bidirectional communication indication information for the webpage communication tool; generating a switching message carrying two-way communication indication information, and sending the switching message to the browser client; the switching message is used for indicating the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information in the switching message, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
In an embodiment, the processor 1101 is further configured to perform capacity expansion processing on the service-side device, and detect whether capacity expansion is completed; if the capacity expansion is not finished, acquiring the load information of the service side equipment again to obtain load updating information; if the load updating information meets the preset interval value adjusting condition, generating an updating message carrying interval value adjusting indication information; and sending the update message to the browser client, wherein the update message is used for informing the browser client to adjust the periodic interval of the polling access mode according to the interval value adjustment indication information so as to periodically access the service side equipment according to the new periodic interval.
In one embodiment, the load information includes resource occupation information of the service-side device, and whether the load information satisfies a preset judgment condition is determined according to the resource occupation information and a preset resource threshold; and/or the load information comprises user access information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the user access information and a preset access number threshold.
For specific implementation of the processor 1101 in the server in the embodiment of the present invention, reference may be made to the description of relevant contents in the foregoing embodiments, which is not described herein again.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that when the load is too high, the browser client accesses the service side equipment in a polling access mode to meet the requirement of high access amount, and when the load is lower, the browser client selects a bidirectional communication protocol to establish bidirectional communication connection with the service side equipment to meet the requirement of higher timeliness and ensure the communication quality; in addition, the dynamic capacity expansion operation can be realized, and when the load is further expanded or before the capacity expansion is not completed, the periodic interval of the polling access mode can be further adjusted according to the load information so as to further access a new user.
Referring to fig. 12, a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention is shown, where the intelligent terminal according to the embodiment of the present invention may be a terminal with a network function, such as a smart phone, a tablet computer, an intelligent wearable device, and the like. The intelligent terminal comprises a storage device 1202 and a processor 1201, and comprises a user interface 1203, a communication interface 1204 and other peripheral equipment interfaces configured according to needs, and data transmission can be carried out between the structures through a bus 1205. A browser client application is installed in the intelligent terminal, and when executed, the method shown in the corresponding embodiment of fig. 8 is implemented.
The storage device 1202 may also be a volatile memory (volatile memory), such as a RAM; the storage device 1202 may also include a non-volatile memory (non-volatile memory), such as a flash memory (SSD); the storage means 1202 may also comprise a combination of memories of the kind described above. The processor 1201 may be a CPU. The processor 1201 may further include a hardware chip. Such as ASICs, PLDs, etc. The PLD may be an FPGA, GAL, or the like.
The user interface 1203 is used for interacting with an end user, for receiving user input, e.g., information such as user operations and text entered in a browser client application, such as the interfaces of fig. 2 and 3, and may present the corresponding information to the user. The communication interface 1204 is used for sending or receiving related data information to a service-side device, and the communication interface 1204 may be a mobile communication interface 1204 or a computer network communication interface 1204.
In this embodiment of the present invention, the processor 1201 invokes a program instruction stored in the storage device 1202, to send an access request to a service-side device if a communication event is detected to be generated on a web page communication tool embedded in a browser client; receiving a response message returned by the service side equipment, wherein the response message carries policy indication information, and the policy indication information is generated by the service side equipment according to the acquired load information and the judgment condition; and selecting a communication strategy according to the strategy indication information carried by the response message, and transmitting communication data for the webpage communication tool according to the selected communication strategy.
In an embodiment, the policy indication information includes bidirectional communication indication information, and the processor 1201 is specifically configured to select a communication policy based on a bidirectional communication protocol according to the indication of the bidirectional communication indication information; establishing a bidirectional communication connection with the service side equipment according to a communication strategy based on a bidirectional communication protocol; communicating communication data for the web communication instrument over the bi-directional communication connection.
In an embodiment, the policy indication information includes polling communication indication information, and the processor 1201 is specifically configured to select a communication policy of a polling access manner according to an indication of the polling communication indication information; and periodically accessing the service side equipment according to a polling access mode so as to facilitate the browser client to transmit communication data for the webpage communication tool.
For the specific implementation of the processor 1201 in the intelligent terminal in the embodiment of the present invention, reference may be made to the description of related contents in the foregoing embodiments, which is not described herein again.
In the embodiment of the invention, the load information can be determined according to the consumption condition of the hardware resources of each node of the service side equipment, so that when the load is too high, the browser client accesses the service side equipment in a polling access mode to meet the requirement of high access amount, and when the load is lower, the browser client selects a bidirectional communication protocol to establish bidirectional communication connection with the service side equipment to meet the requirement of higher timeliness and ensure the communication quality.
An embodiment of the present invention further provides a computer program product, which, when running on a processor, implements the methods of the embodiments corresponding to fig. 4 to 6. The embodiment of the present invention further provides another computer program product, and when the another computer program product runs on a processor, the method according to the embodiment corresponding to fig. 8 is implemented.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a number of embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (15)

1. A communication processing method for a browser client is characterized by comprising the following steps:
receiving an access request sent by a browser client embedded with a webpage communication tool, wherein the access request is generated after the browser client detects that a communication event is generated on the embedded webpage communication tool, and the communication event is detected when a consultation button is clicked or data sending is clicked on an interface of the browser client;
acquiring load information of service side equipment for providing communication service for the webpage communication tool, wherein the load information comprises resource occupation information and/or user access information, the load of each service side equipment is interacted among the service side equipment in the system in an information sharing mode, and each service side equipment stores the load information of the whole system;
generating strategy indicating information for the webpage communication tool according to the load information and the judgment condition, and generating a response message carrying the strategy indicating information;
and sending the response message to the browser client, wherein the response message is used for informing the browser client to select a communication strategy according to the strategy indication information, so that the browser client transmits communication data for the webpage communication tool according to the selected communication strategy.
2. The method of claim 1, wherein the generating policy indication information for the web communication tool according to the load information and the decision condition and generating a response message carrying the policy indication information comprises:
if the load information meets a preset judgment condition, generating bidirectional communication indication information for the webpage communication tool as strategy indication information;
generating a response message carrying the two-way communication indication information;
the response message carrying the two-way communication indication information is used for informing the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
3. The method of claim 1, wherein the generating policy indication information for the web communication tool according to the load information and the decision condition and generating a response message carrying the policy indication information comprises:
if the load information does not meet the preset judgment condition, generating polling communication indication information for the webpage communication tool as strategy indication information;
generating a response message carrying polling communication indication information;
the response message carrying the polling communication indication information is used for informing the browser client to select a polling access mode to periodically access the service side equipment according to the indication of the polling communication indication information, so that the browser client transmits communication data for the webpage communication tool.
4. The method of claim 3, wherein if the load information does not satisfy a predetermined decision condition, generating polling communication indication information as policy indication information for the web communication tool comprises:
if the load information does not meet the preset judgment condition, determining a polling access mode for the webpage communication tool;
determining a periodic interval value of the polling access mode according to the load information;
and generating polling communication indication information according to the polling access mode and the periodic interval value.
5. The method of claim 3, wherein the method further comprises:
carrying out capacity expansion processing on the service side equipment to access new service side equipment;
acquiring capacity expansion load information of the service side equipment after capacity expansion;
if the capacity expansion load information meets the preset judgment condition, generating bidirectional communication indication information for the webpage communication tool;
generating a switching message carrying two-way communication indication information, and sending the switching message to the browser client;
the switching message is used for indicating the browser client to select a two-way communication protocol to establish a two-way communication connection with the service-side device according to the indication of the two-way communication indication information in the switching message, so that the browser client transmits communication data for the webpage communication tool on the two-way communication connection.
6. The method of claim 3, wherein the method further comprises:
carrying out capacity expansion processing on the service side equipment and detecting whether the capacity expansion is finished or not;
if the capacity expansion is not finished, acquiring the load information of the service side equipment again to obtain load updating information;
if the load updating information meets the preset interval value adjusting condition, generating an updating message carrying interval value adjusting indication information;
and sending the update message to the browser client, wherein the update message is used for informing the browser client to adjust the periodic interval of the polling access mode according to the interval value adjustment indication information so as to periodically access the service side equipment according to the new periodic interval.
7. The method of any one of claims 1 to 6,
the load information comprises resource occupation information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the resource occupation information and a preset resource threshold value; and/or the presence of a gas in the gas,
the load information comprises user access information of the service side equipment, and whether the load information meets the preset judgment condition is determined according to the user access information and a preset access quantity threshold.
8. A communication processing method for a browser client is characterized by comprising the following steps:
if a communication event is detected to be generated on a webpage communication tool embedded in a browser client, sending an access request to service side equipment, wherein the communication event is detected when a consultation button is clicked or data sending is clicked on an interface of the browser client;
receiving a response message returned by the service-side device, wherein the response message carries policy indication information, the policy indication information is generated by the service-side device according to the obtained load information and the judgment condition, the load information comprises resource occupation information and/or user access information, the load of each service-side device is interacted among the service-side devices in the system in an information sharing manner, and each service-side device stores the load information of the whole system;
and selecting a communication strategy according to the strategy indication information carried by the response message, and transmitting communication data for the webpage communication tool according to the selected communication strategy.
9. The method of claim 8, wherein the policy indication information comprises two-way communication indication information, and the selecting a communication policy according to the policy indication information carried in the response message and transmitting communication data for the web communication tool according to the selected communication policy comprises:
according to the indication of the two-way communication indication information, selecting a communication strategy based on a two-way communication protocol;
establishing a bidirectional communication connection with the service side equipment according to a communication strategy based on a bidirectional communication protocol;
communicating communication data for the web communication instrument over the bi-directional communication connection.
10. The method of claim 8, wherein the policy indication information comprises polling communication indication information, and the selecting a communication policy according to the policy indication information carried in the response message and transmitting communication data for the web communication tool according to the selected communication policy comprises:
selecting a communication strategy of a polling access mode according to the indication of the polling communication indication information;
and periodically accessing the service side equipment according to a polling access mode so as to facilitate the browser client to transmit communication data for the webpage communication tool.
11. A communication processing apparatus for a browser client, comprising:
the communication module is used for receiving an access request sent by a browser client embedded with a webpage communication tool, wherein the access request is generated after the browser client detects that a communication event is generated on the embedded webpage communication tool, and the communication event is detected when a consultation button is clicked or data sending is clicked on an interface of the browser client;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring load information of service side equipment for providing communication service for a webpage communication tool, the load information comprises resource occupation information and/or user access information, the load of each service side equipment is interacted among the service side equipment in the system in an information sharing mode, and each service side equipment stores the load information of the whole system;
the generating module is used for generating strategy indicating information for the webpage communication tool according to the load information and the judgment condition and generating a response message carrying the strategy indicating information;
and the sending module is used for sending the response message to the browser client, and the response message is used for informing the browser client to select a communication strategy according to the strategy indication information so as to transmit communication data for the webpage communication tool according to the selected communication strategy.
12. A communication processing apparatus for a browser client, comprising:
the system comprises a request module, a service side device and a service side device, wherein the request module is used for sending an access request to the service side device when detecting that a communication event is generated on a webpage communication tool embedded in a browser client, and the communication event is detected when determining that a consultation button is clicked on an interface of the browser client or data sending is clicked;
a receiving module, configured to receive a response message returned by the service-side device, where the response message carries policy indication information, the policy indication information is generated by the service-side device according to acquired load information and a decision condition, the load information includes resource occupancy information and/or user access information, a load of each service-side device is interacted between service-side devices in the system in an information sharing manner, and each service-side device stores load information of the entire system;
and the processing module is used for selecting a communication strategy according to the strategy indication information carried by the response message and transmitting communication data for the webpage communication tool according to the selected communication strategy.
13. A server comprising a storage device having stored therein program instructions and a processor for invoking the program instructions stored in the storage device for performing the method of any of claims 1-7.
14. An intelligent terminal, comprising a storage device having stored therein program instructions and a processor for invoking the program instructions stored in the storage device for performing the method of any of claims 8-10.
15. A computer storage medium, characterized in that the computer storage medium has stored therein program instructions which, when executed by a processor, implement the method according to any one of claims 8-10.
CN201910370780.1A 2019-05-06 2019-05-06 Communication processing method, communication processing device, related equipment and storage medium Active CN110213155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910370780.1A CN110213155B (en) 2019-05-06 2019-05-06 Communication processing method, communication processing device, related equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910370780.1A CN110213155B (en) 2019-05-06 2019-05-06 Communication processing method, communication processing device, related equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110213155A CN110213155A (en) 2019-09-06
CN110213155B true CN110213155B (en) 2022-02-22

Family

ID=67786873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910370780.1A Active CN110213155B (en) 2019-05-06 2019-05-06 Communication processing method, communication processing device, related equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110213155B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110650202B (en) * 2019-09-26 2021-02-19 支付宝(杭州)信息技术有限公司 Communication interaction method and device and electronic equipment
CN111401994A (en) * 2020-03-06 2020-07-10 五八有限公司 House resource safety selection label adding method and house resource safety selection label adding device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945003A (en) * 2014-05-06 2014-07-23 北京邮电大学 Dynamic self-adapting method for connection of Web RTC (Real Time Communication) client
CN105407149A (en) * 2015-10-29 2016-03-16 广州酷狗计算机科技有限公司 Message pushing method and device
CN108965365A (en) * 2017-05-27 2018-12-07 腾讯科技(北京)有限公司 A kind of data processing method and terminal, computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203541B (en) * 2016-03-17 2020-04-14 台达电子企业管理(上海)有限公司 Page loading method and page loading device thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945003A (en) * 2014-05-06 2014-07-23 北京邮电大学 Dynamic self-adapting method for connection of Web RTC (Real Time Communication) client
CN105407149A (en) * 2015-10-29 2016-03-16 广州酷狗计算机科技有限公司 Message pushing method and device
CN108965365A (en) * 2017-05-27 2018-12-07 腾讯科技(北京)有限公司 A kind of data processing method and terminal, computer storage medium

Also Published As

Publication number Publication date
CN110213155A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
KR101077739B1 (en) User initiated invite for automatic conference participation by invitee
JP6885009B2 (en) How to provide meeting feedback
JP5931034B2 (en) Method and system for intelligently processing requests for real-time online interaction
CN109660607A (en) A kind of service request distribution method, method of reseptance, device and server cluster
KR101902948B1 (en) Information sharing method and apparatus
JP6501919B2 (en) Voice chat mode self-adaptation method and apparatus
RU2498520C2 (en) Method of providing peer-to-peer communication on web page
US10917374B2 (en) Techniques to visualize messaging flow
CN108153768A (en) Method for page jump, data processing method, device and page jump control system
CN101137079B (en) Method and apparatus for combining web page browsing and instant communication based on mobile terminal
WO2021237433A1 (en) Message pushing method and apparatus, and electronic device and computer-readable medium
CN104253741A (en) Information sending method and device and system thereof
CN105024913B (en) Method, device and system for carrying out instant messaging session
CN110213155B (en) Communication processing method, communication processing device, related equipment and storage medium
CN104333598A (en) Two-dimension code and network adaption based mobile terminal and web terminal interconnection method
WO2015017482A1 (en) Messaging over http protocol for data exchange
US9998885B2 (en) Method of and system for processing an electronic message destined for an electronic device
RU2580437C2 (en) Method of handling incoming electronic message and server
TW201839624A (en) Method for transmitting information, method for displaying information, terminal, server, system and storage medium
CN112838980B (en) Message processing method, system, device, electronic equipment and storage medium
CN107294911A (en) A kind of packet monitor method and device, RPC system, equipment
CN109768918B (en) Method and apparatus for implementing instant messaging
CN111831513A (en) Log query method and device, electronic equipment and storage medium
CN105306338B (en) Message reminding method and device
CN103974023A (en) System and method for adjusting video pictures

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant