CN116545840A - Communication mode determining method and device - Google Patents

Communication mode determining method and device Download PDF

Info

Publication number
CN116545840A
CN116545840A CN202310315504.1A CN202310315504A CN116545840A CN 116545840 A CN116545840 A CN 116545840A CN 202310315504 A CN202310315504 A CN 202310315504A CN 116545840 A CN116545840 A CN 116545840A
Authority
CN
China
Prior art keywords
request
protocol
client
communication
response
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.)
Pending
Application number
CN202310315504.1A
Other languages
Chinese (zh)
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.)
Yunzhilian Network Technology Beijing Co ltd
Original Assignee
Yunzhilian Network Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunzhilian Network Technology Beijing Co ltd filed Critical Yunzhilian Network Technology Beijing Co ltd
Priority to CN202310315504.1A priority Critical patent/CN116545840A/en
Publication of CN116545840A publication Critical patent/CN116545840A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/805QOS or priority aware

Abstract

The application relates to a method and a device for determining a communication mode, wherein the method is applied to a client and comprises the following steps: distributing available network protocols with highest priority and domain names corresponding to the available network protocols in network protocols appointed by a preset communication strategy for the request of the client; receiving a response result for the request; carrying out data statistics on the returned response result; and sending the data statistics to a server side, so that the server side updates the preset communication strategy according to the data statistics. According to the scheme of the application, the client communicates according to the communication mode issued by the server, the client can switch to a standby communication mode under the condition that the response of the current communication mode fails, and the client can feed back the response result of the request to the server, so that the server determines whether to update the communication mode set by the client according to the feedback of the client, and the updated communication mode is issued to the client under the condition that the communication mode is updated.

Description

Communication mode determining method and device
Technical Field
The present disclosure relates to the field of computer communications technologies, and in particular, to a method and an apparatus for determining a communication manner.
Background
Currently, the network environment used by the user group is generally poor, resulting in unstable communication quality. In the case where there are relatively few network operators to be docked, there is a problem of high delay or no response in requesting services provided by the network operators across regions. Meanwhile, there is a problem in that a request for a part of domain name fails over a large area due to various reasons (e.g., being blocked).
In the prior art, in the case that the current communication mode (including the network protocol and the domain name) cannot be used normally, the client can only wait for the repair of the network protocol server or reassign a new communication mode by the server. This is time consuming and the user experience is poor.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a method and a device for determining a communication mode. According to the scheme of the application, the client communicates according to the communication mode (including the network protocol and the domain name) issued by the server, and can switch to a standby communication mode under the condition that the response of the current communication mode fails, and the client can feed back the response result of the request to the server, so that the server determines whether to update the communication mode set by the client according to the feedback of the client, and issues the updated communication mode to the client under the condition that the communication mode is updated.
According to a first aspect of the present application, there is provided a method for determining a communication manner, applied to a client, including:
distributing available network protocols with highest priority and domain names corresponding to the available network protocols in network protocols appointed by a preset communication strategy for the request of the client;
receiving a response result for the request;
carrying out data statistics on the returned response result; and
and sending the data statistics to a server side, so that the server side updates the preset communication strategy according to the data statistics.
According to a second aspect of the present application, there is provided a communication mode determining apparatus, comprising:
the first distribution module is used for distributing available network protocols with highest priority and domain names corresponding to the available network protocols in network protocols designated by a preset communication strategy for the request of the client;
a first receiving module, configured to receive a response result for the request;
the first statistics module is used for carrying out data statistics on the returned response result; and
and the sending module is used for sending the data statistics to a server side so that the server side updates the preset communication strategy according to the data statistics.
According to a third aspect of the present application, there is provided an electronic device comprising:
a processor; and
a memory storing computer instructions that, when executed by the processor, cause the processor to perform the method of the first aspect.
According to a fourth aspect of the present application there is provided a non-transitory computer storage medium storing a computer program which, when executed by a plurality of processors, causes the processors to perform the method of the first aspect.
According to the determination scheme of the communication mode, on one hand, the client communicates according to the communication mode appointed by the communication strategy issued by the server side, and feeds back the response result of the request to the server side, so that the server side determines whether to update the communication strategy according to the response result, and issues the updated communication strategy to the client side under the condition that the communication strategy is updated, so that the client side communicates according to the updated communication strategy; on the other hand, in the process of communicating according to the communication mode appointed by the communication strategy issued by the server, the client can automatically switch the communication mode into an alternative communication mode in the communication modes appointed by the communication strategy when the response of the request fails. Therefore, the client can automatically switch the alternative communication mode under the condition that the current communication mode fails, so that the problem of the communication mode can be solved in time, the communication quality is ensured, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art from these drawings without departing from the scope of protection of the present application.
Fig. 1 is a flow chart of a client-implemented communication process according to an embodiment of the present application.
Fig. 2 is a flowchart of a method for determining a communication manner implemented by a client according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a determining apparatus of a communication manner according to an embodiment of the present application.
Fig. 4 is a block diagram of an electronic device provided in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 is a flow chart of a client-implemented communication process according to an embodiment of the present application. The client may be various terminals including a mobile phone, a tablet computer, a personal computer, and the like. As shown in fig. 1, the client is divided into a service party and a policy processor, where the service party initiates a request, and before distributing a communication mode for the request, the request needs to be subjected to boundary processing to intercept a request with an abnormal boundary. For example, the current network is not available, the network environment is not connected, the network is unavailable, the server side issues error codes, and the like, and the request cannot be sent out and needs to be intercepted.
For requests processed by the boundary, the policy processor of the client distributes the communication means for the request, including the network protocol and domain name. Among other network protocols, the network protocols may include Http (Hyper Text Transfer Protocol ) protocol, IM (Instant Messaging, instant messaging protocol) protocol, TCP (Transmission Control Protocol ) protocol, and the like. In one embodiment, the policy processor receives a communication policy issued by the server, the communication policy typically being set according to the country or region in which the client is located. For a client's request, the communication policy specifies the network protocol and its corresponding domain name. Where the communication policy specifies more than one network protocol, and more than one domain name is typically associated with each network protocol. According to some embodiments, the communication policy may specify the priority of each network protocol, where the network protocol with the highest priority is a default network protocol and the other network protocols are standby network protocols, and for a plurality of domain names corresponding to the network protocols, the communication policy may also specify the default domain name and the standby domain name under the network protocol.
According to some embodiments, the communication policy specifies a network protocol and its corresponding domain name. The network protocols supported by a client are consistent with the network protocols specified by the communication policy, for example, the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, wherein the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include Http protocol, IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol. The available network protocol with the highest priority in the network protocols specified by the communication strategy is the Http protocol, and the network protocol for the client to request distribution is the Http protocol first.
According to other embodiments, the network protocols supported by a client may not be consistent with the network protocols specified by the communication policy, e.g., the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, where the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include only IM protocol and TCP protocol. Thus, even if the Http protocol has the highest priority, for the client, the available network protocol with the highest priority among the network protocols specified by the communication policy is the IM protocol, and the network protocol that the client distributes for the request is the IM protocol first.
When a request sent by a service party is received, a strategy processor distributes a default network protocol and a default domain name corresponding to the network protocol for the request according to a communication strategy issued by a server. After the request is sent out, the policy processor receives a response result of the request, wherein the response result comprises response success and response failure, and for the request with the response success, the policy processor counts response data, including counting a period from the initiation of the request to the return of the response, and then sends the counted result to the server. There may be various reasons for the failure of the response, for example, the duration of obtaining the response result exceeds a preset threshold value, etc. And for the request with failed response, the strategy processor counts the success rate in the current communication mode and sends the counting result to the server. For a request with a response failure, the policy processor also switches a communication mode, for example, the current communication mode is an Http protocol and a domain name corresponding to the Http protocol, after receiving the response failure, the policy processor switches the communication mode to a network protocol with a priority lower than that of the current network protocol and a domain name corresponding to the Http protocol, for example, to an IM protocol and a domain name corresponding to the IM protocol, distributes the switched communication mode for the request with the response failure, receives a response result of the request, and repeats the above processing procedures for the response success and the response failure.
According to some embodiments, the response success includes that the current network protocol has not reported errors, no anomalies are found, and the corresponding service can be accessed normally (successfully connected to the server and the request sent successfully). Accordingly, the response failure includes a current network protocol error or a status code returned by the current network protocol is not a value identified as "successful". Wherein, the current network protocol error includes connection timeout, SOCKET timeout, IO error, SOCKET error, etc., and the case that the status code returned by the protocol is not a "success" value includes an error indicating the client, an error indicating the server, etc.
For the server, after receiving the statistics result fed back by the client, the communication strategy is updated according to the statistics result when necessary. Generally, the communication policy of the server is determined according to the country or region in which the client is located, and is not generally changed at will. The network environments where the clients are located are different, and there are situations that the request response of the individual clients fails or takes a long time according to the communication mode specified by the communication policy, however, for the communication quality problem of the individual clients, the feedback of the server side to the individual clients will not change the communication policy. However, when a delay or a fault occurs in a network operation server or a domain name fails to request a large area due to various reasons, a situation that a request response fails is commonly existed in clients in a region, the server adjusts and updates a communication policy according to statistical results provided by a large number of clients, including response failure and/or long time consumption, and issues an updated communication policy to each client, and the clients distribute the request according to the updated communication policy.
When the communication adopting the current network protocol is unsuccessful, the client receives the indication of response failure, and the strategy processor switches the communication mode into the network protocol with the priority lower than that of the current network protocol and the domain name corresponding to the network protocol according to the indication, so that the client can switch the communication mode into a standby communication mode even if the communication strategy of the server is not updated in real time, the communication time delay is reduced, and the communication quality is ensured.
The client switches the standby communication mode for the request under the condition of failure of the request response. Under the condition that the response obtained according to all distributed available network protocols fails, switching the domain name corresponding to the available network protocol with the highest priority designated by the communication strategy from the default domain name to the standby domain name, traversing the domain name corresponding to the available network protocol with the highest priority, and checking whether the response is successful or not. And under the condition that the corresponding domain name of the available network protocol with the highest traversing priority still fails to respond, the client reports errors.
According to some embodiments, after the client sends a request and receives a corresponding response result, the format of the response result needs to be converted, the response result is converted into a unified format, and then judgment and processing of success or failure of the response are performed.
According to some embodiments, after the request sent by the service side of the client is distributed, for the next request, the policy processor repeats the above process for the request, including the available network protocol with the highest priority and the domain name corresponding to the available network protocol in the network protocol designated by the communication policy for distributing the request, and processing the response success or response failure respectively. In this process, the policy processor counts the number of response failures of each network protocol, especially the number of continuous response failures, and sets the corresponding network protocol as unavailable when the number of continuous response failures reaches a preset value, and after the policy processor sets one network protocol as unavailable, the policy processor does not re-distribute the network protocol for the subsequent request until receiving the updated communication policy of the server.
For example, the network protocols specified by the network protocols available to the client and the communication policies of the server include Http protocol, IM protocol and TCP protocol, where the Http protocol has a higher priority than the IM protocol, and the IM protocol has a higher priority than the TCP protocol. For the first request, adopting an Http protocol, responding to failure, and realizing the distribution of the first request by the client through an IM protocol; for the second request, the response fails by adopting the Http protocol, the client realizes the distribution of the second request through the IM protocol, and the response fails by adopting the Http protocol for a plurality of times, the number of times reaches a preset value (for example, five times), the policy processor sets the Http protocol to be unavailable, and then for the sixth request, the IM protocol is adopted for distribution.
Based on fig. 1, according to an aspect of the present application, a method for determining a communication manner implemented by a client is provided. As shown in fig. 2, the method includes the following steps.
Step S201, distributing, for the request of the client, the available network protocol with the highest priority and the domain name corresponding to the available network protocol with the highest priority in the network protocols specified by the preset communication policy.
For a request sent by a service party, a policy processor of the client distributes a communication mode for the request, including a network protocol and a domain name. The network protocol may include Http protocol, IM protocol, TCP protocol, and the like. In one embodiment, the policy processor receives a communication policy issued by the server, the communication policy typically being set according to the country or region in which the client is located. For a client's request, the communication policy specifies the network protocol and its corresponding domain name. Where the communication policy specifies more than one network protocol, and more than one domain name is typically associated with each network protocol. According to some embodiments, the communication policy may specify the priority of each network protocol, where the network protocol with the highest priority is a default network protocol and the other network protocols are standby network protocols, and for a plurality of domain names corresponding to the network protocols, the communication policy may also specify the default domain name and the standby domain name under the network protocol.
According to some embodiments, the communication policy specifies a network protocol and its corresponding domain name. The network protocols supported by a client are consistent with the network protocols specified by the communication policy, for example, the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, wherein the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include Http protocol, IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol. The available network protocol with the highest priority in the network protocols specified by the communication strategy is the Http protocol, and the network protocol for the client to request distribution is the Http protocol first.
According to other embodiments, the network protocols supported by a client may not be consistent with the network protocols specified by the communication policy, e.g., the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, where the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include only IM protocol and TCP protocol. Thus, even if the Http protocol has the highest priority, for the client, the available network protocol with the highest priority among the network protocols specified by the communication policy is the IM protocol, and the network protocol that the client distributes for the request is the IM protocol first.
Thus, before step S201, the policy processor of the client determines the available network protocols according to the network protocols specified by the communication policy and the network protocols supported by the client.
Step S202, receiving a response result for the request;
step S203, data statistics is carried out on the returned response result.
According to some embodiments, when a request sent by a service side is received, a policy processor distributes a default network protocol and a default domain name corresponding to the network protocol for the request according to a communication policy issued by a server side. After the request is sent out, the policy processor receives a response result of the request, wherein the response result comprises response success and response failure, and for the request with the response success, the policy processor counts response data, including counting a period from the initiation of the request to the return of the response, and then sends the counted result to the server. There may be various reasons for the failure of the response, for example, the duration of obtaining the response result exceeds a preset threshold value, etc. And for the request with failed response, the strategy processor counts the success rate in the current communication mode and sends the counting result to the server.
Thus, according to some embodiments, step S203 may comprise: and counting the response success rate and the response time of the request under the current network protocol and the corresponding domain name.
According to some embodiments, the response success includes that the current network protocol has not reported errors, no anomalies are found, and the corresponding service can be accessed normally (successfully connected to the server and the request sent successfully). Accordingly, the response failure includes a current network protocol error or a status code returned by the current network protocol is not a value identified as "successful". Wherein, the current network protocol error includes connection timeout, SOCKET timeout, IO error, SOCKET error, etc., and the case that the status code returned by the protocol is not a "success" value includes an error indicating the client, an error indicating the server, etc.
Step S204, the data statistics are sent to a server side, so that the server side updates the preset communication strategy according to the data statistics.
For the server, after receiving the statistics result fed back by the client, the communication strategy is updated according to the statistics result when necessary. Generally, the communication policy of the server is determined according to the country or region in which the client is located, and is not generally changed at will. The network environments where the clients are located are different, and there are situations that the request response of the individual clients fails or takes a long time according to the communication mode specified by the communication policy, however, for the communication quality problem of the individual clients, the feedback of the server side to the individual clients will not change the communication policy. However, when a delay or a fault occurs in a network operation server or a domain name fails to request a large area due to various reasons, a situation that a request response fails is commonly existed in clients in a region, the server adjusts and updates a communication policy according to statistical results provided by a large number of clients, including response failure and/or long time consumption, and issues an updated communication policy to each client, and the clients distribute the request according to the updated communication policy.
According to some embodiments, when updating the communication policy according to the statistics result, the server side generally considers the response success rate of each network protocol first, and considers the response time consumption. Generally, the priority of the network protocol with higher success rate is higher, and the time consumption of each network protocol is compared under the condition of the same success rate, and the priority is higher when the time consumption is shorter.
According to some embodiments, for a plurality of domain names corresponding to one network protocol, the success rate of the domain name corresponding to the domain name is bound to the success rate of the corresponding network protocol with time consumption. That is, the success rate and time consumption of the domain name employed is determined by counting the success rate and time consumption of the network protocol. And in service, counting the success rate and time consumption corresponding to the domain names adopted by different network protocols respectively, and sequencing the priority of the domain names. According to some embodiments, the higher success rate domain names may be prioritized higher, and the shorter the time-consuming time, the higher the priority of comparing the domain names again, with the same success rate.
According to some embodiments, for a request with a response failure, the policy processor further switches a communication mode, for example, the current communication mode is Http protocol and its corresponding domain name, after receiving the response failure, the policy processor switches the communication mode to a network protocol with a priority lower than that of the current network protocol and its corresponding domain name, for example, to IM protocol and its corresponding domain name, distributes the switched communication mode for the request with the response failure, and receives the response result of the request, and for the response success and the response failure, repeats the above-mentioned processing procedure.
When the communication adopting the current network protocol is unsuccessful, the client receives the indication of response failure, and the strategy processor switches the communication mode into the network protocol with the priority lower than that of the current network protocol and the domain name corresponding to the network protocol according to the indication, so that the client can switch the communication mode into a standby communication mode even if the communication strategy of the server is not updated in real time, the communication time delay is reduced, and the communication quality is ensured.
Thus, the method for determining a communication scheme shown in fig. 2 further includes:
step S205, receiving an indication of response failure in the case that the communication using the current network protocol is unsuccessful;
step S206, according to the indication, distributing available network protocols with priority lower than the current network protocol and the corresponding domain names for the request.
According to some embodiments, after the request sent by the service side of the client is distributed, for the next request, the policy processor repeats the above process for the request, including the available network protocol with the highest priority and the domain name corresponding to the available network protocol in the network protocol designated by the communication policy for distributing the request, and processing the response success or response failure respectively. In this process, the policy processor counts the number of response failures of each network protocol, especially the number of continuous response failures, and sets the corresponding network protocol as unavailable when the number of continuous response failures reaches a preset value, and after the policy processor sets one network protocol as unavailable, the policy processor does not re-distribute the network protocol for the subsequent request until receiving the updated communication policy of the server.
Thus, the method for determining a communication scheme shown in fig. 2 further includes:
step S207, counting the response failure times of a plurality of available network protocols designated by the preset network protocol;
in step S208, if the number of times reaches the preset value, the corresponding network protocol is set as unavailable.
According to some embodiments, the client switches the standby communication mode for the request in case the request response fails. Under the condition that the response obtained according to all distributed available network protocols fails, switching the domain name corresponding to the available network protocol with the highest priority designated by the communication strategy from the default domain name to the standby domain name, traversing the domain name corresponding to the available network protocol with the highest priority, and checking whether the response is successful or not. And under the condition that the corresponding domain name of the available network protocol with the highest traversing priority still fails to respond, the client reports errors.
Thus, the method for determining a communication scheme shown in fig. 2 further includes:
step S209, under the condition that the responses obtained according to all distributed available network protocols are failed, switching the domain name corresponding to the available network protocol with the highest priority designated by the preset communication strategy from a default domain name to a standby domain name;
And step S210, communicating the request according to the available network protocol with the highest priority specified by the preset communication strategy and the standby domain name.
According to some embodiments, a service party initiates a request that requires boundary processing to intercept a request for boundary anomalies before distributing the communication means for the request. For example, the current network is not available, the network environment is not connected, the network is unavailable, the server side issues error codes, and the like, and the request cannot be sent out and needs to be intercepted.
Thus, the method for determining a communication scheme shown in fig. 2 further includes:
step S211, performing boundary processing on the request to intercept a request with abnormal boundary.
According to some embodiments, after the client sends a request and receives a corresponding response result, the format of the response result needs to be converted, the response result is converted into a unified format, and then judgment and processing of success or failure of the response are performed.
Thus, the method for determining a communication scheme shown in fig. 2 further includes:
step S212, converting the response result into a preset format before the data statistics is performed on the returned response result.
According to the method for determining the communication mode, on one hand, the client communicates according to the communication mode appointed by the communication strategy issued by the server, and feeds back a response result of the request to the server, so that the server determines whether to update the communication strategy according to the response result, and issues the updated communication strategy to the client when the communication strategy is updated, so that the client communicates according to the updated communication strategy; on the other hand, in the process of communicating according to the communication mode appointed by the communication strategy issued by the server, the client can automatically switch the communication mode into an alternative communication mode in the communication modes appointed by the communication strategy when the response of the request fails. Therefore, the client can automatically switch the alternative communication mode under the condition that the current communication mode fails, so that the problem of the communication mode can be solved in time, the communication quality is ensured, and the user experience is improved.
On the basis of fig. 1, according to another aspect of the present application, a communication manner determining apparatus is provided. As shown in fig. 3, the method includes the following modules.
The first distributing module 301 is configured to distribute, for the request of the client, an available network protocol with the highest priority among network protocols specified by a preset communication policy and a domain name corresponding to the available network protocol.
For a request sent by a service party, a policy processor of the client distributes a communication mode for the request, including a network protocol and a domain name. The network protocol may include Http protocol, IM protocol, TCP protocol, and the like. In one embodiment, the policy processor receives a communication policy issued by the server, the communication policy typically being set according to the country or region in which the client is located. For a client's request, the communication policy specifies the network protocol and its corresponding domain name. Where the communication policy specifies more than one network protocol, and more than one domain name is typically associated with each network protocol. According to some embodiments, the communication policy may specify the priority of each network protocol, where the network protocol with the highest priority is a default network protocol and the other network protocols are standby network protocols, and for a plurality of domain names corresponding to the network protocols, the communication policy may also specify the default domain name and the standby domain name under the network protocol.
According to some embodiments, the communication policy specifies a network protocol and its corresponding domain name. The network protocols supported by a client are consistent with the network protocols specified by the communication policy, for example, the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, wherein the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include Http protocol, IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol. The available network protocol with the highest priority in the network protocols specified by the communication strategy is the Http protocol, and the network protocol for the client to request distribution is the Http protocol first.
According to other embodiments, the network protocols supported by a client may not be consistent with the network protocols specified by the communication policy, e.g., the network protocols specified by the communication policy include Http protocol, IM protocol and TCP protocol, where the Http protocol has a higher priority than the IM protocol, the IM protocol has a higher priority than the TCP protocol, and the network protocols supported by the client include IM protocol and TCP protocol, and then for the client, the available network protocols in the network protocols specified by the communication policy include only IM protocol and TCP protocol. Thus, even if the Http protocol has the highest priority, for the client, the available network protocol with the highest priority among the network protocols specified by the communication policy is the IM protocol, and the network protocol that the client distributes for the request is the IM protocol first.
In this way, before distributing the available network protocol with the highest priority and the domain name corresponding to the available network protocol in the network protocol specified by the preset communication policy to the request of the client, the apparatus of fig. 3 further provides a determining module, configured to determine the available network protocol according to the network protocol specified by the communication policy and the network protocol supported by the client.
A first receiving module 302, configured to receive a response result for the request;
and the first statistics module 303 is configured to perform data statistics on the returned response result.
According to some embodiments, when a request sent by a service side is received, a policy processor distributes a default network protocol and a default domain name corresponding to the network protocol for the request according to a communication policy issued by a server side. After the request is sent out, the policy processor receives a response result of the request, wherein the response result comprises response success and response failure, and for the request with the response success, the policy processor counts response data, including counting a period from the initiation of the request to the return of the response, and then sends the counted result to the server. There may be various reasons for the failure of the response, for example, the duration of obtaining the response result exceeds a preset threshold value, etc. And for the request with failed response, the strategy processor counts the success rate in the current communication mode and sends the counting result to the server.
Thus, according to some embodiments, the first statistics module 303 may be configured to: and counting the response success rate and the response time of the request under the current network protocol and the corresponding domain name.
According to some embodiments, the response success includes that the current network protocol has not reported errors, no anomalies are found, and the corresponding service can be accessed normally (successfully connected to the server and the request sent successfully). Accordingly, the response failure includes a current network protocol error or a status code returned by the current network protocol is not a value identified as "successful". Wherein, the current network protocol error includes connection timeout, SOCKET timeout, IO error, SOCKET error, etc., and the case that the status code returned by the protocol is not a "success" value includes an error indicating the client, an error indicating the server, etc.
And the sending module 304 is configured to send the data statistics to a server, so that the server updates the preset communication policy according to the data statistics.
For the server, after receiving the statistics result fed back by the client, the communication strategy is updated according to the statistics result when necessary. Generally, the communication policy of the server is determined according to the country or region in which the client is located, and is not generally changed at will. The network environments where the clients are located are different, and there are situations that the request response of the individual clients fails or takes a long time according to the communication mode specified by the communication policy, however, for the communication quality problem of the individual clients, the feedback of the server side to the individual clients will not change the communication policy. However, when a delay or a fault occurs in a network operation server or a domain name fails to request a large area due to various reasons, a situation that a request response fails is commonly existed in clients in a region, the server adjusts and updates a communication policy according to statistical results provided by a large number of clients, including response failure and/or long time consumption, and issues an updated communication policy to each client, and the clients distribute the request according to the updated communication policy.
According to some embodiments, when updating the communication policy according to the statistics result, the server side generally considers the response success rate of each network protocol first, and considers the response time consumption. Generally, the priority of the network protocol with higher success rate is higher, and the time consumption of each network protocol is compared under the condition of the same success rate, and the priority is higher when the time consumption is shorter.
According to some embodiments, for a plurality of domain names corresponding to one network protocol, the success rate of the domain name corresponding to the domain name is bound to the success rate of the corresponding network protocol with time consumption. That is, the success rate and time consumption of the domain name employed is determined by counting the success rate and time consumption of the network protocol. And in service, counting the success rate and time consumption corresponding to the domain names adopted by different network protocols respectively, and sequencing the priority of the domain names. According to some embodiments, the higher success rate domain names may be prioritized higher, and the shorter the time-consuming time, the higher the priority of comparing the domain names again, with the same success rate.
According to some embodiments, for a request with a response failure, the policy processor further switches a communication mode, for example, the current communication mode is Http protocol and its corresponding domain name, after receiving the response failure, the policy processor switches the communication mode to a network protocol with a priority lower than that of the current network protocol and its corresponding domain name, for example, to IM protocol and its corresponding domain name, distributes the switched communication mode for the request with the response failure, and receives the response result of the request, and for the response success and the response failure, repeats the above-mentioned processing procedure.
When the communication adopting the current network protocol is unsuccessful, the client receives the indication of response failure, and the strategy processor switches the communication mode into the network protocol with the priority lower than that of the current network protocol and the domain name corresponding to the network protocol according to the indication, so that the client can switch the communication mode into a standby communication mode even if the communication strategy of the server is not updated in real time, the communication time delay is reduced, and the communication quality is ensured.
Thus, the communication scheme determination device shown in fig. 3 further includes:
a second receiving module 305, configured to receive an indication of response failure in a case where communication using the current network protocol is unsuccessful;
and a second distributing module 306, configured to distribute, according to the indication, the available network protocols with priorities lower than the current network protocol and the domain names corresponding to the available network protocols for the request.
According to some embodiments, after the request sent by the service side of the client is distributed, for the next request, the policy processor repeats the above process for the request, including the available network protocol with the highest priority and the domain name corresponding to the available network protocol in the network protocol designated by the communication policy for distributing the request, and processing the response success or response failure respectively. In this process, the policy processor counts the number of response failures of each network protocol, especially the number of continuous response failures, and sets the corresponding network protocol as unavailable when the number of continuous response failures reaches a preset value, and after the policy processor sets one network protocol as unavailable, the policy processor does not re-distribute the network protocol for the subsequent request until receiving the updated communication policy of the server.
Thus, the communication scheme determination device shown in fig. 3 further includes:
a second statistics module 307, configured to count the number of times that the response of the plurality of available network protocols specified by the preset network protocol fails;
a setting module 308, configured to set the corresponding network protocol to be unavailable if the number of times reaches a preset value.
According to some embodiments, the client switches the standby communication mode for the request in case the request response fails. Under the condition that the response obtained according to all distributed available network protocols fails, switching the domain name corresponding to the available network protocol with the highest priority designated by the communication strategy from the default domain name to the standby domain name, traversing the domain name corresponding to the available network protocol with the highest priority, and checking whether the response is successful or not. And under the condition that the corresponding domain name of the available network protocol with the highest traversing priority still fails to respond, the client reports errors.
Thus, the communication scheme determination device shown in fig. 3 further includes:
a switching module 309, configured to switch, when the responses obtained by the request according to all the distributed available network protocols fail, a domain name corresponding to the available network protocol with the highest priority specified by the preset communication policy from a default domain name to a standby domain name;
And a communication module 310, configured to communicate the request according to the available network protocol with the highest priority specified by the preset communication policy and the standby domain name.
According to some embodiments, a service party initiates a request that requires boundary processing to intercept a request for boundary anomalies before distributing the communication means for the request. For example, the current network is not available, the network environment is not connected, the network is unavailable, the server side issues error codes, and the like, and the request cannot be sent out and needs to be intercepted.
Thus, the communication scheme determination device shown in fig. 3 further includes:
the boundary processing module 311 is configured to perform boundary processing on the request to intercept a request with a boundary exception.
According to some embodiments, after the client sends a request and receives a corresponding response result, the format of the response result needs to be converted, the response result is converted into a unified format, and then judgment and processing of success or failure of the response are performed.
Thus, the communication scheme determination device shown in fig. 3 further includes:
the format conversion module 312 is configured to convert the response result into a preset format before the data statistics is performed on the returned response result.
According to the determining device of the communication mode, on one hand, the client communicates according to the communication mode appointed by the communication strategy issued by the server side, and feeds back the response result of the request to the server side, so that the server side determines whether to update the communication strategy according to the response result, and issues the updated communication strategy to the client side under the condition that the communication strategy is updated, so that the client side communicates according to the updated communication strategy; on the other hand, in the process of communicating according to the communication mode appointed by the communication strategy issued by the server, the client can automatically switch the communication mode into an alternative communication mode in the communication modes appointed by the communication strategy when the response of the request fails. Therefore, the client can automatically switch the alternative communication mode under the condition that the current communication mode fails, so that the problem of the communication mode can be solved in time, the communication quality is ensured, and the user experience is improved.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, such as the division of the units, merely a logical function division, and there may be additional manners of dividing the actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
Referring to fig. 4, fig. 4 provides an electronic device including a processor and a memory. The memory stores computer instructions that, when executed by the processor, cause the processor to execute the computer instructions to implement the method and refinement as shown in fig. 2.
It should be understood that the above-described device embodiments are illustrative only and that the disclosed device may be implemented in other ways. For example, the division of the units/modules in the above embodiments is merely a logic function division, and there may be another division manner in actual implementation. For example, multiple units, modules, or components may be combined, or may be integrated into another system, or some features may be omitted or not performed.
In addition, unless specifically described, each functional unit/module in each embodiment of the present invention may be integrated into one unit/module, or each unit/module may exist alone physically, or two or more units/modules may be integrated together. The integrated units/modules described above may be implemented either in hardware or in software program modules.
The integrated units/modules, if implemented in hardware, may be digital circuits, analog circuits, etc. Physical implementations of hardware structures include, but are not limited to, transistors, memristors, and the like. The processor or chip may be any suitable hardware processor, such as CPU, GPU, FPGA, DSP and ASIC, etc., unless otherwise specified. The on-chip cache, off-chip Memory, memory may be any suitable magnetic or magneto-optical storage medium, such as resistive Random Access Memory RRAM (Resistive Random Access Memory), dynamic Random Access Memory DRAM (Dynamic Random Access Memory), static Random Access Memory SRAM (Static Random Access Memory), enhanced dynamic Random Access Memory EDRAM (Enhanced Dynamic Random Access Memory), high-Bandwidth Memory HBM (High-Bandwidth Memory), hybrid Memory cube HMC (Hybrid Memory Cube), and the like, unless otherwise indicated.
The integrated units/modules may be stored in a computer readable memory if implemented in the form of software program modules and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, comprising several instructions for causing a computer electronic device (which may be a personal computer, a server or a network electronic device, etc.) to perform all or part of the steps of the method described in the various embodiments of the disclosure. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Embodiments of the present application also provide a non-transitory computer storage medium storing a computer program that, when executed by a plurality of processors, causes the processors to perform the method and refinement as shown in fig. 2.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples have been provided herein to illustrate the principles and embodiments of the present application, and wherein the above examples are provided to assist in the understanding of the methods and concepts of the present application. Meanwhile, based on the ideas of the present application, those skilled in the art can make changes or modifications on the specific embodiments and application scope of the present application, which belong to the scope of the protection of the present application. In view of the foregoing, this description should not be construed as limiting the application.

Claims (11)

1. The method for determining the communication mode is applied to the client and is characterized by comprising the following steps:
distributing available network protocols with highest priority and domain names corresponding to the available network protocols in network protocols appointed by a preset communication strategy for the request of the client;
receiving a response result for the request;
carrying out data statistics on the returned response result; and
and sending the data statistics to a server side, so that the server side updates the preset communication strategy according to the data statistics.
2. The method as recited in claim 1, further comprising:
receiving an indication of a failure in the response in the event that communication using the current network protocol is unsuccessful;
And distributing available network protocols with lower priorities than the current network protocol and the corresponding domain names for the requests according to the indication.
3. The method as recited in claim 2, further comprising:
counting the response failure times of a plurality of available network protocols appointed by the preset network protocol;
and setting the corresponding network protocol as unavailable under the condition that the times reach a preset value.
4. The method of claim 1, wherein the data statistics of the returned response results comprise:
and counting the response success rate and the response time of the request under the current network protocol and the corresponding domain name.
5. The method as recited in claim 2, further comprising:
under the condition that the responses obtained by the request according to all distributed available network protocols fail, switching the domain name corresponding to the available network protocol with the highest priority designated by the preset communication strategy from a default domain name to a standby domain name;
and communicating the request according to the available network protocol with the highest priority specified by the preset communication strategy and the standby domain name.
6. The method of claim 1 or 2, further comprising:
And carrying out boundary processing on the request before distributing the available network protocol with the highest priority and the domain name corresponding to the available network protocol in the network protocols appointed by the preset communication strategy for the request of the client so as to intercept the request with abnormal boundary.
7. The method of claim 1 or 2, further comprising:
and before the data statistics is carried out on the returned response result, converting the response result into a preset format.
8. The method of claim 1 or 2, further comprising:
and before distributing the available network protocol with the highest priority and the corresponding domain name in the network protocols specified by the preset communication strategy for the request of the client, determining the available network protocol according to the network protocols specified by the preset communication strategy and the network protocols supported by the client.
9. A communication method determining apparatus, comprising:
the first distribution module is used for distributing available network protocols with highest priority and domain names corresponding to the available network protocols in network protocols designated by a preset communication strategy for the request of the client;
a first receiving module, configured to receive a response result for the request;
The first statistics module is used for carrying out data statistics on the returned response result; and
and the sending module is used for sending the data statistics to a server side so that the server side updates the preset communication strategy according to the data statistics.
10. An electronic device comprising at least a memory and a processor, the memory having stored thereon a computer program, the processor, when executing the computer program on the memory, implementing the steps of the method of any of claims 1 to 8.
11. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
CN202310315504.1A 2023-03-28 2023-03-28 Communication mode determining method and device Pending CN116545840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310315504.1A CN116545840A (en) 2023-03-28 2023-03-28 Communication mode determining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310315504.1A CN116545840A (en) 2023-03-28 2023-03-28 Communication mode determining method and device

Publications (1)

Publication Number Publication Date
CN116545840A true CN116545840A (en) 2023-08-04

Family

ID=87451365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310315504.1A Pending CN116545840A (en) 2023-03-28 2023-03-28 Communication mode determining method and device

Country Status (1)

Country Link
CN (1) CN116545840A (en)

Similar Documents

Publication Publication Date Title
US10063599B2 (en) Controlling registration floods in VOIP networks via DNS
US8504675B2 (en) Email server system and method
US9191439B2 (en) Method and system for data synchronization in content delivery network
EP3544232B1 (en) Processing method, device and system for nf component abnormality
CN102387069B (en) Method and system for connecting clients with server and clients as well as server
CN102177690A (en) Methods, systems, and computer readable media for providing sedation service in a telecommunications network
CN112398689B (en) Network recovery method and device, storage medium and electronic equipment
CN112532452B (en) Method, device, equipment and storage medium for switching main server and standby server of communication terminal
US11102319B2 (en) Method, system and server for stream-pushing
CN107689878A (en) TCP length connection SiteServer LBSs based on name scheduling
EP3496432A1 (en) Communication method and device
WO2020252724A1 (en) Log processing method and device, and computer-readable storage medium
WO2017000625A1 (en) Dynamic host configuration protocol (dhcp) server management method and apparatus
CN106790610B (en) Cloud system message distribution method, device and system
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN106708881B (en) Interaction method and device based on network file system
CN116545840A (en) Communication mode determining method and device
CN110661836B (en) Message routing method, device and system, and storage medium
EP3435615B1 (en) Network service implementation method, service controller, and communication system
CN110572290B (en) Master device determination method, master device determination device, electronic device, storage medium, and network system
CN115514698A (en) Protocol calculation method, switch, cross-device link aggregation system and storage medium
WO2015196769A1 (en) Method for processing data in iptv system, and network element device
CN110995890A (en) Domain name request scheduling method and device
CN111371573B (en) Message interaction method and device
CN115396444A (en) Access control method, server and client

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