CN110213319B - Access method and device, terminal, server and storage medium - Google Patents

Access method and device, terminal, server and storage medium Download PDF

Info

Publication number
CN110213319B
CN110213319B CN201811167511.7A CN201811167511A CN110213319B CN 110213319 B CN110213319 B CN 110213319B CN 201811167511 A CN201811167511 A CN 201811167511A CN 110213319 B CN110213319 B CN 110213319B
Authority
CN
China
Prior art keywords
access service
service module
terminal
access
module
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
CN201811167511.7A
Other languages
Chinese (zh)
Other versions
CN110213319A (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 CN201811167511.7A priority Critical patent/CN110213319B/en
Publication of CN110213319A publication Critical patent/CN110213319A/en
Application granted granted Critical
Publication of CN110213319B publication Critical patent/CN110213319B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/08Load balancing or load distribution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

The embodiment of the invention discloses an access method and device, a terminal, a server and a storage medium; the terminal and the server in the embodiment of the invention acquire load information after establishing current connection, the load information comprises at least one low-load access service module and attribute information of the low-load access service module, a target access service module is selected from the low-load access service modules according to the attribute information, and finally connection is established again with the server based on the target access service module; because the terminal establishes connection with the server again based on the target access service module, the used access service module is not the access service module solidified in the terminal but the low-load access service module, so that the access load is not concentrated on a plurality of specific access service modules, the problem of overhigh access load of the specific access service modules is solved, and the technical problem of overhigh access load of the specific access service modules in the server in the existing server access technology is solved.

Description

Access method and device, terminal, server and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to an access method and apparatus, a terminal, a server, and a storage medium.
Background
The server provides various service services for users through external interfaces, such as an access service module of a switching route and the like, and the users access the server to obtain the service services through various terminals, such as a client terminal in a mobile terminal of a mobile phone and the like, a special fixed terminal of an inquiry machine and the like, and the like.
The server needs to provide access services for tens of or millions, even hundreds of millions, or even hundreds of millions of terminals at the same time, and in order to reduce the load of the access service modules, various modes are often adopted, for example, a plurality of access service modules are deployed in a distributed mode, so that the load of a single access service module is reasonable, and the problems of downtime and the like are not easy to occur.
In the prior art, when a terminal is deployed, a configuration file in the terminal is written into an access address or an access domain name of a fixed access service module, and the terminal can be connected to a corresponding access service module based on the access address or the access domain name after being started, so that connection with a server is established, and server access is completed.
However, this approach often results in the terminal accessing the server through several fixed access service modules, i.e. the access load is concentrated on several specific access service modules, resulting in an excessively high access load for these several access service modules.
Namely, the existing server access technology has the technical problem that the access load of a specific access service module in a server is too high.
Disclosure of Invention
The embodiment of the invention provides an access method and device, a terminal, a server and a storage medium, which are used for solving the technical problem that the access load of a specific access service module in the server is too high in the server access technology.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
the embodiment of the invention provides an access method, which comprises the following steps:
selecting a current access service module from a plurality of access service modules of a server;
establishing a current connection with the server based on the current access service module;
acquiring load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and re-establishing connection with the server based on the target access service module.
The embodiment of the invention provides an access method, which comprises the following steps:
the server establishes current connection with the terminal based on a current access service module selected by the terminal;
an access service module management module of the server sends load information to the terminal through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module; the load information is used for triggering the terminal to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and the server establishes connection with the terminal again based on the target access service module selected by the terminal.
The embodiment of the invention provides an access method, which comprises the following steps:
the server provides access service for the terminal through a plurality of access service modules;
the terminal selects a current access service module from a plurality of access service modules of a server, and establishes current connection with the server based on the current access service module;
the terminal acquires load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
and the terminal selects a target access service module from the low-load access service module list based on the attribute information of the low-load access service module, and reestablishes connection with the server based on the target access service module.
An embodiment of the present invention provides an access apparatus, including:
the server comprises a first selection module, a second selection module and a third selection module, wherein the first selection module is used for selecting a current access service module from a plurality of access service modules of the server;
the first access module is used for establishing current connection with the server based on the current access service module;
an obtaining module, configured to obtain load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
the second selection module is used for selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and the second access module is used for reestablishing connection with the server based on the target access service module.
The embodiment of the invention provides a terminal, which comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the instructions are suitable for the processor to load so as to execute the steps in the access method.
An embodiment of the present invention provides a server, which includes a processor and a memory, where the memory stores a plurality of instructions, and the instructions are suitable for the processor to load so as to execute the steps in the above access method.
An embodiment of the present invention provides a storage medium, where a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute the steps in the access method.
The embodiment of the invention provides a new server access method, a terminal firstly selects a current access service module from a plurality of access service modules of a server, acquires load information from an access service module management module of the server after establishing current connection with the server based on the current access service module, the load information comprises at least one low-load access service module and attribute information of the low-load access service module, selects a target access service module from the low-load access service module according to the attribute information, and finally establishes connection with the server again based on the target access service module; because the terminal establishes connection with the server again based on the target access service module, the used access service module is not the access service module solidified in the terminal but the low-load access service module, so that the access load is not concentrated on a plurality of specific access service modules, the problem of overhigh access load of the specific access service modules is solved, and the technical problem of overhigh access load of the specific access service modules in the server in the existing server access technology is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a first networking schematic diagram of a communication system provided by an embodiment of the invention;
fig. 2 is a first flowchart of an access method according to an embodiment of the present invention;
fig. 3 is a second flowchart of an access method according to an embodiment of the present invention;
fig. 4 is a third flowchart of an access method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a second networking of the communication system provided by the embodiment of the invention;
fig. 6 is a fourth flowchart of an access method according to an embodiment of the present invention;
fig. 7 is a third networking schematic diagram of the communication system provided by the embodiment of the invention;
fig. 8 is a fifth flowchart of an access method according to an embodiment of the present invention;
fig. 9 is a sixth flowchart of an access method according to an embodiment of the present invention;
fig. 10 is a fourth networking schematic diagram of the communication system provided by the embodiment of the invention;
fig. 11 is a seventh flowchart of an access method according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an access device provided in an embodiment of the present invention;
FIG. 13 is a schematic diagram of a user interface provided by an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a communication system according to an embodiment of the present invention, where the system may include a user-side device and a service-side device, and the user-side device and the service-side device are connected through an internet formed by various gateways, which is not described again, where the user-side device includes a plurality of terminals 11 and an access gateway 12, and the service-side device (collectively referred to as a server) includes a plurality of service modules 13, a plurality of access service modules 14, an access service module management module 15, a terminal configuration management module 16, and a control module 17; wherein:
the terminal 11 includes, but is not limited to, a portable terminal provided with an APP, such as a mobile phone and a tablet, and a fixed terminal, such as a computer, an inquiry machine and an advertisement machine, and is a service port that can be used by a user, hereinafter referred to as a client; for example, a mobile phone carrying a chat application, a map query machine, etc., wherein a portable terminal is different from a fixed terminal in terms of mobile portability, and the following description is separately provided for the home clusters of the two types of terminals;
the access gateway 12 includes devices such as a mobile AP, a router, a base station, etc., and is used for accessing the terminal to the internet, and the relationship with the present invention is not large, and is not described again;
the business service module 13 is a module for providing various business services for users, and comprises a conventional server and the like;
the access service module 14 is a module for providing an access service for a terminal, and is used to connect the terminal and a service module, the number of the access service modules is often many, and the access service modules include a conventional router, a switch, or a routing board based on resource sharing, and the setting manner is also various, for example, a distributed setting manner shown in fig. 7, which will be described in detail below. The access service module 14 needs to report an access load to the control module 17 at regular time or at irregular time (the access load changes, for example, a new access terminal, or a terminal exits), where the access load refers to the number of terminals accessing the access service module;
the access service module management module 15 is configured to manage the access service modules 14, for example, determine a low-load access service module and determine an affiliation cluster of each access service module according to access loads of each access service module 14; it is typically implemented on a software or single board basis;
the terminal configuration management module 16 is configured to determine a home cluster of the terminal, and the like, and is usually implemented based on software or a single board;
the control module 17 is used for managing registration and deregistration (equipment failure off-line and the like) of the access service module 14, the access service module management module 15 and the terminal configuration management module 16; acquiring an access load of the access service module 14, and the like; and controlling data interaction among the access service module 14, the access service module management module 15, and the terminal configuration management module 16.
In the embodiment of the invention, a terminal firstly selects a current access service module from a plurality of access service modules of a server, acquires load information from an access service module management module of the server after establishing current connection with the server based on the current access service module, the load information comprises at least one low-load access service module and attribute information of the low-load access service module, selects a target access service module from the low-load access service modules according to the attribute information, and finally establishes connection with the server again based on the target access service module; because the terminal establishes connection with the server again based on the target access service module, the used access service module is not the access service module solidified in the terminal but the low-load access service module, so that the access load is not concentrated on a plurality of specific access service modules, the problem of overhigh access load of the specific access service modules is solved, and the technical problem of overhigh access load of the specific access service modules in the server in the existing server access technology is solved.
It should be noted that the system scenario diagram shown in fig. 1 is only an example, and the server and the scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention.
The following is a detailed description of the access method.
Now, the present invention is described with reference to the embodiment of the present invention during system interaction, fig. 2 is a first flowchart of an access method provided in an embodiment of the present invention, please refer to fig. 2, where the access method includes the following steps:
s201: the server provides access service for the terminal through a plurality of access service modules.
In this embodiment, the server usually deploys a plurality of access service modules, such as one hundred thousand access service modules (numbered 00000-.
In order to facilitate the terminal to determine the low-load access service module, in some embodiments, the method further includes: the server acquires an access load of an access service module; and determining a low-load access module according to the access service module of the access module and the load threshold.
The low-load access service module refers to an access service module with an access load lower than a load threshold in a server, for example, the load threshold may be fixed to 100, and when the access load (the number of terminals establishing connection with the server through the access service module) is lower than 100, the access service module is the low-load access service module, or all the access service modules are sorted from large to small according to the corresponding access load, and then 500 access service modules with the minimum access load are used as the low-load access service modules, and at this time, the load threshold corresponds to the access load corresponding to the maximum access service module in the 500 access service modules with the minimum access load, and so on.
S202: the terminal selects a current access service module from a plurality of access service modules of the server, and establishes current connection with the server based on the current access service module.
For fixed terminals such as advertisement popularizing machines, when deploying, access addresses or access domain names of several specific access service modules are already solidified in the terminals, for example, 10 access service modules with numbers of 00000-00009, and in this step, one access service module with number of 00000 is selected, for example, and is determined as the current access service module.
For a portable terminal such as a mobile phone, the downloaded application installation package is also solidified with access addresses or access domain names of several specific access service modules, for example, 10 access service modules with numbers of 00000 and 00009, and in this step, one access service module with number of 00000 is selected, for example, and is determined as the current access service module.
The current connection established between the terminal and the server through the current access service module is a conventional process, the current connection is composed of the terminal, the access gateway, the current access service module and the server, and based on the current connection, the terminal and the server can perform data interaction, such as load information interaction, service data interaction and the like.
In some embodiments of the present invention, the current connection is only used for the interaction of the load information, and after the interaction of the load information is completed, the connection is interrupted because the duration of the current connection is short, so that the access load of the specific access service modules is relatively small, and the specific access service modules are used for establishing the current connection.
In some embodiments of the present invention, the current connection is used for performing interaction of load information and also for performing interaction of service data, after the interaction of load information is completed, the terminal determines (for example, according to a packet loss rate, etc.) whether to re-access the server through another access service module, and if not, continues to use the current connection for performing interaction of subsequent service data.
S203: the terminal acquires load information from an access service module management module of the server through the current connection; the load information includes at least one low-load access service module and attribute information of the low-load access service module.
This step is information interaction, and will be described with emphasis hereinafter.
S204: and the terminal selects a target access service module from the low-load access service module list based on the attribute information of the low-load access service module, and reestablishes connection with the server based on the target access service module.
After the terminal obtains the low-load access service module, it may arbitrarily select one low-load access service module as the target access service module according to the attribute information of the low-load access service module, such as the access load, and the like, or may select the low-load access service module with the minimum access load as the target access service module, or select the low-load access service module with the maximum access load as the target access service module, and the like.
After the target access service module is determined, the target access service module can be accessed based on the access address or the access domain name of the target access service module, a service data connection is established with the server, and interaction of service data such as video, audio, text and the like is carried out with the server through the service data connection.
The embodiment provides an access method, a server provides access service through a plurality of access service modules, a terminal firstly selects one as a current access service module, then establishes current connection with the server through the current access service module, then performs information interaction with the server through the current connection to determine a low-load access service module, selects one from the low-load access service modules as a target access service module, and finally establishes service data connection with the server through the target access service module to perform service data interaction with the server through the service data connection to complete the whole process of accessing the server; the access service module used by the terminal and the server for establishing the connection for the business data interaction is not the access service module solidified in the terminal but the low-load access service module, so that the access load is not concentrated on a plurality of specific access service modules, and the problem of overhigh access load of the specific access service modules does not exist.
Now, the present invention is described with reference to the embodiment at the terminal side, fig. 3 is a second flowchart of the access method according to the embodiment of the present invention, please refer to fig. 3, where the access method includes the following steps:
s301: a current access service module is selected from a plurality of access service modules of the server.
S302: and establishing current connection with the server based on the current access service module.
The specific implementation of steps S301 and S302 has already been described in step S202 in the embodiment shown in fig. 2, and is not described again.
S303: acquiring load information from an access service module management module of the server through the current connection; the load information includes at least one low-load access service module and attribute information of the low-load access service module.
In a general direction, there are 2 implementation manners of obtaining the load information, one is that the server performs broadcasting in a broadcasting manner, and the other is that the terminal and the server complete interaction through a specific message.
For the broadcast mode, the server may broadcast the access service module load message periodically (for example, periodically at 0.1 second) or at irregular time, where the load information includes the access service module load message, and step S303 includes: the terminal receives the access service module load message broadcasted by the server through the current connection; and analyzing the access service module load message to obtain the low-load access service module. In some embodiments, the broadcast may also be triggered by the access service module, e.g., the access service module triggers the server to broadcast an access service module load message once upon detecting the presence of a new terminal. For the broadcasting mode, the implementation is simple and is not described in detail.
The method for interacting through a specific message is generally initiated by a terminal, and in this case, step S303 includes:
adding cluster information of a terminal attributive cluster to an access service module selection request;
sending the access service module selection request to the access service module management module through the current connection; and the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle.
Receiving an access service module selection request response fed back by the access service module management module through the current connection; the access service module selects the request response to carry the load information
With respect to this mode, description will be made below.
S304: and selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module.
S305: and re-establishing connection with the server based on the target access service module.
The specific implementation of steps S304 and S305 has already been described in step S204 in the embodiment shown in fig. 2, and is not described again.
In some embodiments, in order to avoid frequent switching of the access service module by the terminal, before step S304, the method further includes: acquiring the packet loss rate of service data interaction with the server through the current connection; judging whether an access service module needs to be switched or not according to the packet loss rate and the switching condition; if so, interrupting the current connection, and establishing service data connection with the server through the target access service module.
The packet loss rate a is a ratio of a difference (m-n) between the number m of the transmitted data packets and the number n of the received data packets to the number m of the transmitted data packets in unit time, that is, a is (m-n) ÷ m, which reflects the access load of the access service module to a certain extent. If the switching condition is that the packet loss rate a is greater than 20%, switching is performed, and if the packet loss rate a of the current connection is greater than 20%, the judgment result is that switching to the low-load access service module is required, interrupting the current connection, and establishing service data connection with the server through the target access service module.
In some embodiments, the terminal may directly obtain the access load of the current access service module through the current connection, determine that the current access service module is not the low-load access service module when the access load is greater than the load threshold, and need to switch to the low-load access service module, interrupt the current connection, and establish a service data connection with the server through the target access service module.
In some embodiments, for a terminal supporting multiple connections, the current connection and the service data connection may be maintained simultaneously without interrupting the current connection, which is simple to implement and is not described in detail.
Now, the embodiment of the present invention on the server side is described, fig. 4 is a schematic flow chart of an access method provided in an embodiment of the present invention, please refer to fig. 4, where the access method includes the following steps:
s401: and the server establishes current connection with the terminal based on the current access service module selected by the terminal.
S402: and the access service module management module of the server sends load information to the terminal through the current connection.
The load information comprises at least one low-load access service module and attribute information of the low-load access service module; the load information is used for triggering the terminal to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module.
In some embodiments, step S402 includes:
the access service module management module receives the access service module selection request through the current connection; the access service module selects a request to carry cluster information for a terminal attribution cluster;
determining a low-load access service module meeting a proximity principle with a terminal attribution cluster according to cluster information of the access service module attribution cluster and cluster information of the terminal attribution cluster;
feeding back an access service module selection request response to the terminal through the current connection; and the access service module selects a request response to carry the load information.
S403: and the server establishes connection with the terminal again based on the target access service module selected by the terminal.
In some embodiments, before step S402, the method further includes: the access service module management module acquires an access load of an access service module; and determining a low-load access module according to the access service module of the access module and the load threshold.
In some embodiments, the present invention may also implement load balancing of access service modules in a cluster, that is, allocating access service modules in a cluster to terminals located in a certain cluster range. At this time, before step S402, the method shown in fig. 4 further includes: the access service module management module acquires an access service module identifier of an access service module; and determining the attribution cluster of the access service module according to the access service module identifier of the access module.
The method shown in fig. 3 further comprises: sending an affiliation cluster acquisition request carrying a terminal identifier to a terminal configuration management module of the server through the current connection; the home cluster acquisition request is used for triggering the terminal configuration management module to determine a home cluster of the terminal; receiving an affiliation cluster acquisition request response fed back by the terminal configuration management module through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal; and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster.
At this time, the method illustrated in fig. 4 further includes: a terminal configuration management module of the server receives an attribution cluster acquisition request carrying a terminal identifier through the current connection; determining an attribution cluster of the terminal according to the terminal identification; obtaining a request response to the attribution cluster fed back to the terminal through the current connection; and the attribution cluster acquires the cluster information of the request response carrying the terminal attribution cluster.
As shown in fig. 7, the cluster is divided into A, B, C levels, where the cluster a may include a plurality of clusters B, and the cluster B may include a plurality of clusters C, for example, the cluster a corresponds to a province level, the cluster B corresponds to a city level, the cluster C corresponds to a district level, and a plurality of machine rooms are arranged in the district level. After the access service modules are deployed in a distributed manner by taking a machine room as a unit, the cluster corresponding to each machine room can be determined according to the deployment plan, the access service module identifiers, such as unique codes, MAC addresses and the like, of the access service modules in the machine rooms can be determined, and further the home cluster of each access service module can also be determined, for example, the home cluster of the access service module in the machine room 1 is a cluster A1-a cluster B1-a cluster C1.
In some embodiments, the present invention may also implement load balancing of access service modules within a cluster, that is, allocating an access service module within a cluster to a terminal located within a certain cluster range, for example, allocating an access service module within cluster a1 to terminal 1.
For a fixed terminal, after the fixed terminal is deployed, a cluster corresponding to each terminal can be determined according to a deployment plan, a terminal identifier is an equipment MAC, a unique code, and the like, a corresponding relationship between the terminal identifier and a home cluster is stored in a server, for example, an inquiry machine located in an area corresponding to cluster B1, and the corresponding home cluster is cluster a 1-cluster B1.
For a portable terminal, a home cluster needs to be determined according to a terminal position, at this time, a terminal identifier may be a mobile phone number of a mobile phone to which a client belongs, and the like, and a server may obtain the mobile phone position according to the mobile phone number, and further determine the home cluster of the terminal according to the mobile phone position, for example, a mobile phone located in an area corresponding to cluster B2, where the corresponding home cluster is cluster a 1-cluster B2.
In some embodiments, the terminal may directly upload the location information to the server, and at this time, the method shown in fig. 3 further includes: sending an attribution cluster acquisition request carrying the terminal position information to the server through the current connection; the home cluster acquisition request is used for triggering the server to determine a home cluster of the terminal; receiving a home cluster acquisition request response fed back by the server through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal; and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster. The method for determining attribution based on the location information is essentially the same as the method for determining attribution cluster based on the terminal identifier, and is not described again.
For the broadcast mode, the access service module load message further includes home cluster information of the low-load access service module, and step S304 includes: analyzing the load message of the access service module to obtain the attribution cluster information of the low-load access service module; acquiring cluster information of a terminal attribution cluster; and selecting one low-load access service module meeting the principle of proximity from the low-load access service modules according to the cluster information of the terminal and the attribution cluster information of the low-load access service modules, and determining the low-load access service module as the target access service module.
In order to reduce the path length of the connection, for example, for the query engine in the cluster a 1-cluster B1, the low-load access service module in the cluster a 1-cluster B1 is first allocated, if no low-load access service module exists in the cluster a 1-cluster B1, the low-load access service module in the cluster a1 is allocated, and if no low-load access service module still exists in the cluster a1, the low-load access service module in the cluster a2 that is closer in physical location is selected.
Based on the above description, in this embodiment, the terminal first selects one of the multiple access service modules of the server as a current access service module, then establishes a current connection with the server through the current access service module, then performs load information interaction with the server through the current connection to determine a low-load access service module, and selects one of the low-load access service modules as a target access service module, and finally establishes a service data connection with the server through the target access service module to perform service data interaction with the server through the service data connection, thereby completing the whole process of accessing the server; the access service module used for establishing the connection for the business data interaction between the terminal and the server is not the access service module solidified in the terminal but the low-load access service module, so that the access load is not concentrated on a plurality of specific access service modules, the problem of overhigh access load of the specific access service modules is solved, and the technical problem of overhigh access load of the specific access service modules in the server in the existing server access technology is solved.
The present invention will be further described with reference to the example of implementing load balancing of access service modules only.
As shown in fig. 5, the exemplary communication system provided by the present invention illustratively includes a terminal 11, the server includes 10 access service modules (14-0 to 14-9, only the access service module 14-0 and the access service module 14-4 are schematically illustrated), an access service module management module 15 and a control module 17, and the terminal 11 is internally fixed with the mode address of the access service module 14-0.
At this time, as shown in fig. 6, the access method provided in this embodiment includes the following steps:
s601: the access service module registers with the control module.
After the 10 access service modules (14-0 to 14-9) are on line, they are registered with the control module 17.
S602: the access service module management module registers to the control module.
After the access service module management module 15 is on line, it registers with the control module 17.
S603: and the access service module reports the access load to the control module.
The access service module uploads the access load periodically or when the access load occurs, and the step always exists in the whole method flow.
S604: the terminal accesses the access service module 14-0.
The terminal reads the solidified data to obtain the mode address of the access service module 14-0, the access service module 14-0 is used as the current access service module, the access service module 14-0 is accessed, the current connection is established, and then the server is accessed through the access service module 14-0.
S605: the terminal sends a selection request to the access service module 14-0.
The terminal sends a selection request to the access service module 14-0 over the current connection.
S606: the access service module 14-0 sends an address request to the control module.
The access service module 14-0 sends an address request to the control module requesting the access service module management module to access the address.
S607: the control module sends an address request response to the access service module 14-0.
The control module determines the access address of the management module of the access service module according to the registration information of the management module of the access service module, and sends an address request response to the access service module 14-0.
S608: the access service module 14-0 forwards the selection request to the access service module management ticket.
S609: the access service module management module acquires the access load of the access service module from the control module.
The step relates to one-time data interaction, the control module stores the access load reported by the access service module, and the access service module management module acquires the parameter from the control module.
S610: the access service module management module returns a selection request response to the access service module 14-0.
For example, the access service module management module determines that the access service module 14-4 and the access service module 14-8 are low-load access service modules according to the access load of the access service module, and then adds the low-load access service modules to the selection request response and sends the selection request response to the access service module 14-0.
S611: the access service module 14-0 forwards the selection request response to the terminal.
S612: the terminal accesses the access service module 14-4.
The terminal selects one of the low-load access service module 14-4 and the access service module 14-8, for example, selects the access service module 14-4 as a target access service module, and establishes a service data connection with the server through the target access service module so as to perform service data interaction with the server through the service data connection.
The present invention will be further described with reference to an example of implementing load balancing of access service modules in a cluster.
As shown in fig. 7, the exemplary communication system provided by the present invention exemplarily includes 2 terminals 11 (i.e., a handset and an interrogator), the server includes 10 access service modules (14-0 to 14-9), an access service module management module 15, a terminal configuration management module 16, and a control module 17, and the mode address of the access service module 14-0 is fixed in the terminal 11 (i.e., the handset and the interrogator).
In fig. 7, the access service module 14-0 and the access service module 14-1 are located within the scope of cluster A3, the access service module 14-2 and the access service module 14-3 are located within the scope of cluster a 1-cluster B1-cluster C1, the access service module 14-4 and the access service module 14-5 are located within the scope of cluster a 1-cluster B1-cluster C2, the access service module 14-6 and the access service module 14-7 are located within the scope of cluster a 1-cluster B2, and the access service module 14-8 and the access service module 14-9 are located within the scope of cluster a 2.
The query engine is located within the range of cluster A1-cluster B1, and the handset is located within the range of cluster A1-cluster B2.
At this time, as shown in fig. 8, for the query machine, the access method provided by this embodiment includes the following steps:
s801: the access service module registers with the control module.
After the 10 access service modules (14-0 to 14-9) are on line, they are registered with the control module 17.
S802: the access service module management module registers to the control module.
After the access service module management module 15 is on line, it registers with the control module 17.
S803: and the terminal configuration management module registers to the control module.
After the terminal configuration management module 16 is online, it registers with the control module 17.
S804: and the access service module reports the access load to the control module.
The access service module uploads the access load periodically or when the access load occurs, and the step always exists in the whole method flow.
S805: the access service module 14-0 is accessed by the querier.
The inquiry machine reads the solidified data to obtain the mode address of the access service module 14-0, the access service module 14-0 is used as the current access service module, the access service module 14-0 is accessed, the current connection is established, and then the server is accessed through the access service module 14-0.
S806: and the inquiry machine sends an attribution cluster acquisition request.
After the inquiry machine is successfully connected, an attribution cluster acquisition request is initiated, the attribution cluster acquisition request carries the MAC address of the inquiry machine, and the attribution cluster acquisition request is mainly used for acquiring the attribution cluster information of the inquiry machine and the like.
S807: and the access service module acquires the access address of the terminal configuration management module from the control module.
After receiving the home cluster acquisition request, the access service module acquires an address of an available terminal configuration management module from the control module.
S808: the access service module forwards the home cluster acquisition request to the terminal configuration management module.
And the access service module forwards the home cluster acquisition request to the terminal configuration management module.
S809: and the terminal configuration management module returns a home cluster acquisition request response to the query machine.
And the terminal configuration management module determines that the home cluster of the inquiry machine is a cluster A1-a cluster B1 according to the MAC address and the deployment plan of the inquiry machine, adds the home cluster into the home cluster acquisition request response, and forwards the home cluster acquisition request response to the inquiry machine through the access service module.
S810: the query engine sends an access service module selection request to the access service module 14-0.
The terminal sends an access service module selection request to the access service module 14-0 through the current connection, and the access service module selection request carries the home cluster information cluster A1-cluster B1.
S811: the access service module acquires the access address of the access service module management module from the control module.
And after receiving an access service module selection request of the inquiry machine, the access service module acquires the address of the online access service module management module from the control module.
S812: the access service module forwards the access service module selection request to the access service module management module.
S813: the access service module management module returns an access service module selection request response to the inquiry machine.
The access service module management module acquires the information of all the access service modules from the control module at regular time, and according to the attribution cluster of the inquiring machine and the load condition of the access service module, allocating the same cluster or low-load access service modules in the nearby cluster according to the nearby principle, because the low-load modules include the access service module 14-4 (home cluster is cluster a 1-cluster B1-cluster C2) and the access service module 14-8 (home cluster is cluster a2), the home cluster of the inquiry machine is a cluster A1-a cluster B1, a low-load access service module in the cluster A1-a cluster B1 is an access service module 14-4, and the access service module 14-4 is the low-load access service module and is used as an access service module selection request response to return to the access service module; after receiving the response of the access service module selection request, the access service module forwards the response to the inquiring machine, so that the inquiring machine acquires the available low-load access service module.
S814: the access service module 14-4 is accessed by the querier.
The inquiring machine selects the access service module 14-4 as a target access service module, and establishes a service data connection with the server through the target access service module so as to perform service data interaction with the server through the service data connection.
Meanwhile, for the mobile phone, as shown in fig. 9, the access method provided by the embodiment includes the following steps:
s901: the access service module registers with the control module.
After the 10 access service modules (14-0 to 14-9) are on line, they are registered with the control module 17.
S902: the access service module management module registers to the control module.
After the access service module management module 15 is on line, it registers with the control module 17.
S903: the terminal management module registers to the control module.
After being on line, the terminal management module 16 registers with the control module 17.
S904: and the access service module reports the access load to the control module.
The access service module uploads the access load periodically or when the access load occurs, and the step always exists in the whole method flow.
S905: the handset accesses the access service module 14-0.
Reading the solidified data by the application APP in the mobile phone to obtain the mode address of the access service module 14-0, taking the access service module 14-0 as the current access service module, accessing the access service module 14-0, establishing the current connection, and then accessing the server through the access service module 14-0.
S906: the mobile phone sends an attribution cluster acquisition request.
After the mobile phone is successfully connected, an affiliation cluster acquisition request is initiated, and the mobile phone number is carried, and the method is mainly used for acquiring the affiliation cluster information of the mobile phone.
S907: the access service module acquires the access address of the terminal management module from the control module.
After receiving the home cluster acquisition request, the access service module acquires the address of the available terminal management module from the control module.
S908: the access service module forwards the home cluster acquisition request to the terminal management module.
And the access service module forwards the attribution cluster acquisition request to the terminal management module.
S909: and the terminal management module returns a home cluster acquisition request response to the mobile phone.
The terminal management module determines the position of the mobile phone from other servers according to the mobile phone number, further determines that the home cluster of the mobile phone is a cluster A1-a cluster B2, adds the home cluster into the home cluster acquisition request response, and forwards the home cluster acquisition request response to the mobile phone through the access service module.
S910: the handset sends an access service module selection request to the access service module 14-0.
The terminal sends an access service module selection request to the access service module 14-0 through the current connection, and the access service module selection request carries the home cluster information cluster A1-cluster B2.
S911: the access service module acquires the access address of the access service module management module from the control module.
And after receiving an access service module selection request of the mobile phone, the access service module acquires the address of the online access service module management module from the control module.
S912: the access service module forwards the routing access service module selection request to the access service module management module.
S913: the access service module management module returns an access service module selection request response to the mobile phone.
The access service module management module acquires the information of all the access service modules from the control module at regular time, and according to the attribution cluster of the mobile phone and the load condition of the access service module, allocating the same cluster or low-load access service modules in the nearby cluster according to the nearby principle, because the low-load modules include the access service module 14-4 (home cluster is cluster a 1-cluster B1-cluster C2) and the access service module 14-8 (home cluster is cluster a2), the mobile phone is attributed to the cluster A1-cluster B2, no low-load access service module exists in the cluster A1-cluster B2, the access service module 14-4 meets the principle of proximity, and the access service module 14-4 is a low-load access service module and is used as an access service module selection request response to return to the access service module.
After receiving the response of the access service module selection request, the access service module forwards the response to the mobile phone, so that the mobile phone obtains an available low-load access service module.
S914: the handset accesses the access service module 14-4.
The mobile phone selects the access service module 14-4 as a target access service module, and establishes a service data connection with the server through the target access service module so as to perform service data interaction with the server through the service data connection.
In some embodiments, the method shown in fig. 5 to 9 may further include the step of determining whether to switch from the access service module 14-0 to the access service module 14-4, and the implementation thereof is already described above and is not described again.
The present invention will be further described with reference to specific implementation scenarios.
As shown in fig. 10, the present embodiment provides a zookeeper-based system, which includes a zookeeper cluster 101 (i.e., the control module 17 in the above), a route management module 102 (i.e., the access service module management module 15 in the above), an agent configuration management module 103 (i.e., the terminal configuration management module 16 in the above), and an access service module 104 (i.e., the access service module 14 in the above), where:
the zookeeper cluster is used for recording the registration of the access service module, the routing management module and the agent configuration management module and maintaining the online and attribute information (load condition, belonging set and the like) of the modules;
the agent configuration management module is mainly used for managing configuration information of the agent of the client, such as a cluster set to which the agent client belongs, such as a cluster set divided according to cities and the like.
The route management module is responsible for acquiring online information and load conditions of the access service module from the zookeeper cluster, calculating and nearby allocating access services with lower load in a set same as the client agent according to a route request (containing set information) of the client agent, and allocating the access services in the nearby set if the set to which the client agent belongs has no rear-end access services, so as to ensure that the client agent is successfully online;
the access service module receives the agent end connection and forwards various instruction requests (agent configuration acquisition, routing selection) of the agent, a data reporting request and the like;
due to the fact that services for receiving massive agents need to be efficiently and stably received, a plurality of different sets exist in the client agent and the access service module, and the routing management module and the agent configuration management module exist in the form of the only set.
Specifically, as shown in fig. 11, the access method provided in this embodiment includes the following steps:
s1101: the access service module registers with the zookeeper cluster.
After all the access service modules are on line, registering the access service modules with the zookeeper cluster.
S1102: the route management module registers with the zookeeper cluster.
After all the route management modules are on-line, registering the route management modules with the zookeeper cluster.
S1103: and the agent configuration management module registers to the zookeeper cluster.
And after all agent configuration management modules are online, registering the agent configuration management modules with the zookeeper cluster.
After a background service module (including a routing management module, an agent configuration module, an access module and the like) is started, service registration is initiated to a zookeeper at the first time, and the successful online of the service is marked.
S1104: and the access service module reports the load information to the zookeeper cluster.
After all the access service modules are registered, reporting load information to the zookeeper cluster periodically or irregularly.
S1105: and selecting one access service module for connection by the agent.
agent preferentially fixes a batch of available access service addresses in the agent through a hard coding mode, and randomly selects an access service which can be successfully connected and initiates connection when the agent is started.
S1106: and the agent sends a configuration acquisition request to request configuration.
after the agent is successfully connected, a configuration acquisition request for acquiring the agent configuration is initiated, and the configuration acquisition request is mainly used for acquiring the attribute information of the agent, such as the set information of the agent.
S1107: and the access service module acquires the access address of the agent configuration management module from the zookeeper cluster.
After receiving the configuration acquisition request, the access service module acquires the address of the available agent configuration management module from the zookeeper cluster.
S1108: the access service module forwards the configuration acquisition request to the agent configuration management module.
The access service module forwards the request to the agent configuration management module.
S1109: and the agent configuration management module returns a configuration acquisition response.
after determining the attribution cluster according to the terminal identification, the agent configuration management module organizes a response and returns the response to the access service module in the original way; after receiving the response, the access service module forwards the request to the agent, and the agent acquires the identity information (such as the set) of the agent.
S1110: agent sends a routing request.
after the agent acquires the configuration, the agent starts to initiate a routing request to the back end at regular time, so as to dynamically acquire the address of the back end low-load access service module, and be convenient for reselecting a proper access service module to be online subsequently when high load is accessed or the access service is abnormal.
S1111: and the access service module acquires the access address of the routing management module from the zookeeper cluster.
After receiving the routing request of the agent, the access service module acquires the address of the online routing management module from the zookeeper.
S1112: the access service module forwards the routing request to the route management module.
The access service module forwards the routing request to the route management module.
S1113: the route management module returns a routing response.
And the routing management module allocates the same set or a low-load access service module list in the nearby set (when the set to which the agent belongs has no access service module) as a routing response to the access service module according to the information of all the access service modules acquired from the zookeeper at regular time, the set of the request agent and the load condition of the access service module and according to the nearby principle.
S1114: the access service module forwards the routing response to the agent.
And after receiving the routing response, the access service module forwards the routing response to the agent, so that the agent acquires the available low-load access service module.
S1115: agent reconnects to the low load access service module.
The agent can judge whether to reconnect to the new access service module according to the packet loss rate and other self conditions, and if the packet loss rate is too high, the agent reconnects to the low-load access service module.
In some embodiments, the method is repeatedly executed at regular time, so that dynamic load balance of the agent access service module can be realized under the condition of a large number of agents. Specifically, the client agent can quickly sense the survival condition and the on-line and off-line conditions of the rear access service module through the untimely routing request, automatically remove the address of the access service module to be off-line, and update the address of the newly on-line access service module; the newly online client or the running client agent can quickly acquire the address list of the access service module which is more suitable for the client to access and is obtained by the back end through load balancing calculation through an irregular routing request, so that the load balancing of the back end access service module is realized.
The above embodiment is an implementation manner based on zookeeper, and may also be implemented in a manner based on db or the like.
Correspondingly, fig. 12 is a schematic structural diagram of an access device according to an embodiment of the present invention, please refer to fig. 12, where the access device includes the following modules:
a first selecting module 121, configured to select a current access service module from multiple access service modules of a server;
a first access module 122, configured to establish a current connection with the server based on the current access service module;
an obtaining module 123, configured to obtain load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
a second selecting module 124, configured to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
a second access module 125, configured to re-establish a connection with the server based on the target access service module.
In an embodiment, the obtaining module 123 may specifically be configured to: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; and the access service module selects a request response to carry the load information.
In an embodiment, the obtaining module 123 may further be configured to: sending an affiliation cluster acquisition request carrying a terminal identifier to a terminal configuration management module of the server through the current connection; the home cluster acquisition request is used for triggering the terminal configuration management module to determine a home cluster of the terminal; receiving an affiliation cluster acquisition request response fed back by the terminal configuration management module through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal; and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster.
In an embodiment, the obtaining module 123 may further be configured to: acquiring the packet loss rate of service data interaction with the server through the current connection; judging whether an access service module needs to be switched or not according to the packet loss rate and the switching condition; and if so, establishing connection with the server again through the target access service module.
The method and the device provided by the invention can be realized by only a server, or only a terminal such as a mobile phone, or the terminal and the server.
The steps in the method provided by the invention can be sequentially operated, and also can be simultaneously operated in a multi-thread mode, and the description is given by taking the simultaneous operation in the multi-thread mode as an example.
Each module in the embodiments of the present invention may be implemented by a physical device, or may be implemented by software.
Fig. 13 is a diagram of a user interface of a terminal according to an embodiment of the present invention, in which a user can select one of the following 3 modes to be effective:
the conventional mode is as follows: after the terminal accesses the current access service module, the terminal stops the operation of subsequent switching to the low-load access service module, namely the load balance of the access service module can not be carried out;
single equalization mode: after accessing the current access service module, the terminal switches to any low-load access service module, that is, only performs load balancing of the access service module, that is, the method shown in fig. 6;
cluster equalization mode: after accessing the current access service module, the terminal switches to the low-load access service module in the cluster, so that load balancing of the access service module in the cluster can be performed, that is, the method shown in fig. 8 or fig. 9.
Accordingly, an embodiment of the present invention also provides a terminal, as shown in fig. 14, which may include Radio Frequency (RF) circuit 1401, memory 1402 including one or more computer-readable storage media, input unit 1403, display unit 1404, sensor 1405, audio circuit 1406, Wireless Fidelity (WiFi) module 1407, processor 1408 including one or more processing cores, and power supply 1409. Those skilled in the art will appreciate that the terminal structure shown in fig. 14 is not intended to be limiting and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
RF circuit 1401 may be used for receiving and transmitting signals during a message transmission or communication process, and in particular, for receiving downlink information from a base station and then processing the received downlink information by one or more processors 1408; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 1401 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 1401 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 1402 may be used to store software programs and modules, and the processor 1408 may execute various functional applications and data processing by operating the software programs and modules stored in the memory 1402. The memory 1402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal, etc. Further, the memory 1402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1402 may also include a memory controller to provide access to the memory 1402 by the processor 1408 and the input unit 1403.
The input unit 1403 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in a particular embodiment, input unit 1403 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. In an embodiment, the touch sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1408, and can receive and execute commands sent from the processor 1408. In addition, touch sensitive surfaces may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 1403 may include other input devices in addition to a touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1404 may be used to display information input by or provided to the user, as well as various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 1404 may include a Display panel, and in one embodiment, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation may be communicated to the processor 1408 to determine the type of touch event, and the processor 1408 may then provide a corresponding visual output on the display panel based on the type of touch event. Although in FIG. 14 the touch sensitive surface and the display panel are two separate components to implement input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 1405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
Audio circuitry 1406, a speaker, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 1406 can transmit the electrical signal converted from the received audio data to the speaker, and the electrical signal is converted into a sound signal by the speaker and output; on the other hand, the microphone converts a collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 1406, and then processes the audio data by the audio data output processor 1408, and then passes through the RF circuit 1401 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 1402 for further processing. The audio circuitry 1406 may also include an earbud jack to provide peripheral headset communication with the terminal.
WiFi belongs to short-range wireless transmission technology, and the terminal can help the user send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1407, which provides wireless broadband internet access for the user. Although fig. 14 shows the WiFi module 1407, it is understood that it does not belong to the essential constitution of the terminal and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1408 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 1402 and calling data stored in the memory 1402, thereby performing overall monitoring of the handset. In an embodiment, processor 1408 may include one or more processing cores; preferably, processor 1408 may integrate an application processor that handles primarily operating system, user interface, and applications, etc. and a modem processor that handles primarily wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1408.
The terminal also includes a power supply 1409 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1408 via a power management system that provides management of charging, discharging, and power consumption via the power management system. The power supply 1409 can also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, and the like, which will not be described herein. Specifically, in this embodiment, the processor 1408 in the terminal loads an executable file corresponding to a process of one or more application programs into the memory 1402 according to the following instructions, and the processor 1408 runs the application programs stored in the memory 1402, thereby implementing various functions:
selecting a current access service module from a plurality of access service modules of a server;
establishing a current connection with the server based on the current access service module;
acquiring load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and re-establishing connection with the server based on the target access service module.
In one embodiment, the functions are implemented: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; and the access service module selects a request response to carry the load information.
In one embodiment, the functions are implemented: sending an affiliation cluster acquisition request carrying a terminal identifier to a terminal configuration management module of the server through the current connection; the home cluster acquisition request is used for triggering the terminal configuration management module to determine a home cluster of the terminal; receiving an affiliation cluster acquisition request response fed back by the terminal configuration management module through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal; and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster.
In one embodiment, the functions are implemented: acquiring the packet loss rate of service data interaction with the server through the current connection; judging whether an access service module needs to be switched or not according to the packet loss rate and the switching condition; and if so, establishing connection with the server again through the target access service module.
Accordingly, an embodiment of the present invention further provides a server, as shown in fig. 15, which shows a schematic structural diagram of the server according to the embodiment of the present invention, specifically:
the server may include components such as a processor 1501 of one or more processing cores, memory 1502 of one or more computer-readable storage media, a power source 1503, and an input unit 1504. Those skilled in the art will appreciate that the server architecture shown in FIG. 15 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 1501 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 1502 and calling data stored in the memory 1502, thereby performing overall monitoring of the server. Optionally, processor 1501 may include one or more processing cores; preferably, the processor 1501 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1501.
The memory 1502 may be used to store software programs and modules, and the processor 1501 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1502. The memory 1502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the server, and the like. Further, the memory 1502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 1502 may also include a memory controller to provide the processor 1501 access to the memory 1502.
The server further includes a power source 1503 for supplying power to each component, and preferably, the power source 1503 may be logically connected to the processor 1501 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system. The power supply 1503 may also include any component such as one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The server may also include an input unit 1504 that may be used to receive entered numeric or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the server may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 1501 in the server loads an executable file corresponding to a process of one or more application programs into the memory 1502 according to the following instructions, and the processor 1501 runs the application programs stored in the memory 1502, thereby implementing various functions as follows:
the server establishes current connection with the terminal based on a current access service module selected by the terminal;
an access service module management module of the server sends load information to the terminal through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module; the load information is used for triggering the terminal to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and the server establishes connection with the terminal again based on the target access service module selected by the terminal.
In one embodiment, the functions are implemented: the access service module management module receives the access service module selection request through the current connection; the access service module selects a request to carry cluster information for a terminal attribution cluster; determining a low-load access service module meeting a proximity principle with a terminal attribution cluster according to cluster information of the access service module attribution cluster and cluster information of the terminal attribution cluster; feeding back an access service module selection request response to the terminal through the current connection; and the access service module selects a request response to carry the load information.
In one embodiment, the functions are implemented: the access service module management module acquires an access load of an access service module; and determining a low-load access module according to the access service module of the access module and the load threshold.
In one embodiment, the functions are implemented: the access service module management module acquires an access service module identifier of an access service module; and determining the attribution cluster of the access service module according to the access service module identifier of the access module.
In one embodiment, the functions are implemented: a terminal configuration management module of the server receives an attribution cluster acquisition request carrying a terminal identifier through the current connection; determining an attribution cluster of the terminal according to the terminal identification; obtaining a request response to the attribution cluster fed back to the terminal through the current connection; and the attribution cluster acquires the cluster information of the request response carrying the terminal attribution cluster.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the resource management method, and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps of any one of the methods provided by the present invention. For example, the instructions may perform the steps of:
selecting a current access service module from a plurality of access service modules of a server;
establishing a current connection with the server based on the current access service module;
acquiring load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and re-establishing connection with the server based on the target access service module.
In one embodiment, the functions are implemented: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; and the access service module selects a request response to carry the load information.
In one embodiment, the functions are implemented: sending an affiliation cluster acquisition request carrying a terminal identifier to a terminal configuration management module of the server through the current connection; the home cluster acquisition request is used for triggering the terminal configuration management module to determine a home cluster of the terminal; receiving an affiliation cluster acquisition request response fed back by the terminal configuration management module through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal; and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster.
In one embodiment, the functions are implemented: acquiring the packet loss rate of service data interaction with the server through the current connection; judging whether an access service module needs to be switched or not according to the packet loss rate and the switching condition; and if so, establishing connection with the server again through the target access service module.
Meanwhile, the invention also provides a storage medium, wherein a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any method provided by the embodiment of the invention. For example, the instructions may perform the steps of:
the server establishes current connection with the terminal based on a current access service module selected by the terminal;
an access service module management module of the server sends load information to the terminal through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module; the load information is used for triggering the terminal to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and the server establishes connection with the terminal again based on the target access service module selected by the terminal.
In one embodiment, the functions are implemented: the access service module management module receives the access service module selection request through the current connection; the access service module selects a request to carry cluster information for a terminal attribution cluster; determining a low-load access service module meeting a proximity principle with a terminal attribution cluster according to cluster information of the access service module attribution cluster and cluster information of the terminal attribution cluster; feeding back an access service module selection request response to the terminal through the current connection; and the access service module selects a request response to carry the load information.
In one embodiment, the functions are implemented: the access service module management module acquires an access load of an access service module; and determining a low-load access module according to the access service module of the access module and the load threshold.
In one embodiment, the functions are implemented: the access service module management module acquires an access service module identifier of an access service module; and determining the attribution cluster of the access service module according to the access service module identifier of the access module.
In one embodiment, the functions are implemented: a terminal configuration management module of the server receives an attribution cluster acquisition request carrying a terminal identifier through the current connection; determining an attribution cluster of the terminal according to the terminal identification; obtaining a request response to the attribution cluster fed back to the terminal through the current connection; and the attribution cluster acquires the cluster information of the request response carrying the terminal attribution cluster.
Meanwhile, the invention also provides a storage medium, wherein a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any method provided by the embodiment of the invention. For example, the instructions may perform the steps of:
the server provides access service for the terminal through a plurality of access service modules;
the terminal selects a current access service module from a plurality of access service modules of a server, and establishes current connection with the server based on the current access service module;
the terminal acquires load information from an access service module management module of the server through the current connection; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
and the terminal selects a target access service module from the low-load access service module list based on the attribute information of the low-load access service module, and reestablishes connection with the server based on the target access service module.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any method provided by the embodiment of the present invention, the beneficial effects that can be achieved by any method provided by the embodiment of the present invention can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The above detailed description is provided for an access method, an access device, a terminal, a server and a storage medium according to the embodiments of the present invention, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. An access method, comprising:
selecting a current access service module from a plurality of access service modules of a server;
establishing a current connection with the server based on the current access service module;
acquiring load information from an access service module management module of the server through the current connection, including: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; the access service module selects a request response to carry the load information; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
when the server needs to be accessed again through other access service modules, connection is established again with the server based on the target access service module;
and when the server does not need to be accessed again through other access service modules, the current connection is continuously maintained.
2. The access method according to claim 1, further comprising, after the step of establishing a current connection with the server based on the current access service module:
sending an affiliation cluster acquisition request carrying a terminal identifier to a terminal configuration management module of the server through the current connection; the home cluster acquisition request is used for triggering the terminal configuration management module to determine a home cluster of the terminal;
receiving an affiliation cluster acquisition request response fed back by the terminal configuration management module through the current connection; the attribution cluster acquires cluster information requesting to respond to the attribution cluster of the portable terminal;
and extracting and processing the attribution cluster acquisition request response to obtain the cluster information of the terminal attribution cluster.
3. The access method according to claim 1 or 2, further comprising, before the step of reestablishing a connection with the server based on the target access service module:
acquiring the packet loss rate of service data interaction with the server through the current connection;
judging whether an access service module needs to be switched or not according to the packet loss rate and the switching condition;
and if so, establishing connection with the server again through the target access service module.
4. An access method, comprising:
the server establishes current connection with the terminal based on a current access service module selected by the terminal;
the method for sending the load information to the terminal by the access service module management module of the server through the current connection comprises the following steps: the access service module management module receives the access service module selection request through the current connection; the access service module selects a request to carry cluster information for a terminal attribution cluster; determining a low-load access service module meeting a proximity principle with a terminal attribution cluster according to cluster information of the access service module attribution cluster and cluster information of the terminal attribution cluster; feeding back an access service module selection request response to the terminal through the current connection; the access service module selects a request response to carry the load information; the load information comprises at least one low-load access service module and attribute information of the low-load access service module; the load information is used for triggering the terminal to select a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
when the terminal needs to re-access the server through other access service modules, the server re-establishes connection with the terminal based on a target access service module selected by the terminal;
and when the terminal does not need to access the server again through other access service modules, the server continues to keep the current connection with the terminal through the current access service module.
5. The access method according to claim 4, further comprising:
the access service module management module acquires an access load of an access service module;
and determining the low-load access service module according to the access load of the access service module and the load threshold.
6. The access method according to claim 4, further comprising:
the access service module management module acquires an access service module identifier of an access service module;
and determining the attribution cluster of the access service module according to the access service module identification of the access service module.
7. The access method according to any one of claims 4 to 6, further comprising:
a terminal configuration management module of the server receives an attribution cluster acquisition request carrying a terminal identifier through the current connection;
determining an attribution cluster of the terminal according to the terminal identification;
obtaining a request response to the attribution cluster fed back to the terminal through the current connection; and the attribution cluster acquires the cluster information of the request response carrying the terminal attribution cluster.
8. An access method, comprising:
the server provides access service for the terminal through a plurality of access service modules;
the terminal selects a current access service module from a plurality of access service modules of a server, and establishes current connection with the server based on the current access service module;
the terminal obtains load information from an access service module management module of the server through the current connection, and the method comprises the following steps: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; the access service module selects a request response to carry the load information; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
when the terminal needs to re-access the server through other access service modules, the terminal selects a target access service module from the low-load access service module list based on the attribute information of the low-load access service module, and re-establishes connection with the server based on the target access service module;
and when the terminal needs to re-access the server through other access service modules, the server continues to keep current connection with the terminal through the current access service module.
9. An access device, comprising:
the server comprises a first selection module, a second selection module and a third selection module, wherein the first selection module is used for selecting a current access service module from a plurality of access service modules of the server;
the first access module is used for establishing current connection with the server based on the current access service module;
an obtaining module, configured to obtain load information from an access service module management module of the server through the current connection, where the obtaining module includes: adding cluster information of a terminal attributive cluster to an access service module selection request; sending the access service module selection request to the access service module management module through the current connection; the access service module selection request is used for triggering the access service module management module to determine a low-load access service module of which the home cluster and the terminal home cluster meet the proximity principle; receiving an access service module selection request response fed back by the access service module management module through the current connection; the access service module selects a request response to carry the load information; the load information comprises at least one low-load access service module and attribute information of the low-load access service module;
the second selection module is used for selecting a target access service module from the low-load access service module list based on the attribute information of the low-load access service module;
and the second access module is used for reestablishing connection with the server based on the target access service module when the server needs to be accessed again through other access service modules, or continuously maintaining the current connection when the server does not need to be accessed again through other access service modules.
10. A terminal, characterized in that it comprises a processor and a memory, said memory storing a plurality of instructions adapted to be loaded by the processor to perform the steps of the access method according to any one of claims 1 to 3.
11. A server, comprising a processor and a memory, said memory storing a plurality of instructions adapted to be loaded by the processor to perform the steps of the access method of any of claims 4 to 7.
12. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the access method according to any one of claims 1 to 3, or to perform the steps in the access method according to any one of claims 4 to 7, or to perform the steps in the access method according to claim 8.
CN201811167511.7A 2018-10-08 2018-10-08 Access method and device, terminal, server and storage medium Active CN110213319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811167511.7A CN110213319B (en) 2018-10-08 2018-10-08 Access method and device, terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811167511.7A CN110213319B (en) 2018-10-08 2018-10-08 Access method and device, terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN110213319A CN110213319A (en) 2019-09-06
CN110213319B true CN110213319B (en) 2022-03-08

Family

ID=67779984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811167511.7A Active CN110213319B (en) 2018-10-08 2018-10-08 Access method and device, terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN110213319B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI415501B (en) * 2010-07-20 2013-11-11 Gemtek Technology Co Ltd Wireless network system and wireless access point device thereof
CN102571782B (en) * 2011-12-29 2014-10-01 浙江大学 Novel load balancing server cluster system
WO2014194492A1 (en) * 2013-06-05 2014-12-11 华为技术有限公司 Access point selection method and device
CN103902735B (en) * 2014-04-18 2017-02-22 中国人民解放军理工大学 Application perception data routing method oriented to large-scale cluster deduplication and system

Also Published As

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

Similar Documents

Publication Publication Date Title
US10834237B2 (en) Method, apparatus, and storage medium for controlling cooperation of multiple intelligent devices with social application platform
CN107094294B (en) Network connection method and device
CN106851654B (en) Pseudo base station identification method, pseudo base station identification device and terminal
JP6511541B2 (en) Message updating method, apparatus and terminal
CN108040091B (en) Data processing method, device and storage medium
CN107231159B (en) Radio frequency interference processing method, device, storage medium and terminal
CN107786424B (en) Audio and video communication method, terminal and server
CN110474841B (en) Service request routing processing method and terminal equipment
CN109495769B (en) Video communication method, terminal, smart television, server and storage medium
CN112269842A (en) Information processing method and device, storage medium and computer equipment
CN106470234B (en) Equipment discovery method and device
CN105376761B (en) Establish the method, apparatus and phone system of call connection
EP3805938A1 (en) Server node selection method and terminal device
CN105306244B (en) Router management method, system and equipment
WO2014183439A1 (en) Method, apparatus and system for switching function mode
US10979895B2 (en) Network system with request redirect capability for MSISDN header enrichment
CN110213319B (en) Access method and device, terminal, server and storage medium
CN112188586B (en) Network access method and device
KR102596801B1 (en) PC5 link establishment methods, equipment and systems
CN111144845B (en) Mobile terminal meeting reminding method and device
CN110798444B (en) Data synchronization method and device based on Internet of things
CN105681723B (en) Audio and video call method and device
CN107371212B (en) Method and device for sending data
CN114915511A (en) Control method and device of split device
EP3518513A1 (en) Streaming data acquisition method, device, and system

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