CN107635010B - Traffic scheduling method and device, computer readable storage medium and electronic equipment - Google Patents

Traffic scheduling method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN107635010B
CN107635010B CN201710953261.9A CN201710953261A CN107635010B CN 107635010 B CN107635010 B CN 107635010B CN 201710953261 A CN201710953261 A CN 201710953261A CN 107635010 B CN107635010 B CN 107635010B
Authority
CN
China
Prior art keywords
machine room
scheduling
traffic
client
user request
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
CN201710953261.9A
Other languages
Chinese (zh)
Other versions
CN107635010A (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.)
Hangzhou Netease Shuzhifan Technology Co ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201710953261.9A priority Critical patent/CN107635010B/en
Publication of CN107635010A publication Critical patent/CN107635010A/en
Application granted granted Critical
Publication of CN107635010B publication Critical patent/CN107635010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a traffic scheduling method, a traffic scheduling device, a computer readable storage medium and electronic equipment, and relates to the technical field of big data, wherein the method comprises the following steps: identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time; analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end; and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet. The method improves the efficiency of flow scheduling.

Description

Traffic scheduling method and device, computer readable storage medium and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of big data, in particular to a traffic scheduling method, a traffic scheduling device, a computer-readable storage medium and an electronic device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
With the development of big data, when the deployment of a website with large user base and high availability requirement, such as financial service, e-commerce platform, or game application, is performed, the deployment of multiple computer rooms is generally required to avoid the problem that the network reliability is affected by the failure of a single computer room.
In the related art, when multi-machine-room deployment is performed, due to the fact that the bandwidth of a dedicated line between multiple machine rooms is limited, in order to save cost, only the processes of core data transmission such as database synchronization and core cache system synchronization are often guaranteed, and other data are processed and solved on the spot in the local machine room as much as possible. In the aspect of service, multiple website entries are deployed in multiple computer rooms, and then deep identification analysis is performed on user sources through a view mechanism in a Domain Name System (DNS) so as to determine which user sources access which computer room entries.
Disclosure of Invention
In the existing scheme, a DNS analysis system is relied on to identify a user source, and the change of the DNS analysis system is slow to take effect, so that the traffic switching efficiency of an equipment room is influenced, and the situation that the equipment room is temporarily unavailable to change when rapid capacity expansion switching is caused by low traffic switching efficiency is possible, and the user experience is poor; on one hand, a machine room entrance specifically accessed by a user depends on DNS analysis change, and for a plurality of systems which do not perform cross-machine room login state synchronization in the related technology, the change of the machine room entrance when the network of the client is switched from data to WiFi cannot be solved, so that the login state of the user is lost, and the reliability is poor. Therefore, in the prior art, it is a very annoying process to perform cross-room traffic scheduling quickly and efficiently.
For this reason, an improved traffic scheduling method is highly needed, so that the traffic between different machine rooms can be efficiently and reliably scheduled.
In this context, embodiments of the present invention are intended to provide a traffic scheduling method, a traffic scheduling apparatus, a computer-readable storage medium, and an electronic device.
In a first aspect of an embodiment of the present invention, a traffic scheduling method is provided, including:
identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time;
analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end;
and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet.
In an embodiment of the present invention, automatically scheduling the traffic of the computer room includes:
and scheduling the flow of the computer room according to the field identification in the user request.
In another embodiment of the present invention, automatically scheduling the traffic corresponding to the machine room further includes:
and scheduling the flow of the machine room according to a preset logic according to the application state of the rear end of the machine room.
In an embodiment of the present invention, the scheduling the flow of the machine room according to the application state of the back end of the machine room according to a preset logic includes:
when the application state of the rear end of a first machine room is abnormal, only the front end inlet of the first machine room is reserved;
when the client accesses the front-end entrance of the first machine room, traffic scheduling information in the field identification of the client is ignored and the traffic is led into a second machine room;
the front-end inlet of the second machine room stops dispatching the traffic to the back end of the first machine room.
In an embodiment of the present invention, scheduling the traffic of the computer room according to the field identifier in the user request includes:
and scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
In one embodiment of the present invention, determining the machine room that the client accesses for the first time includes:
and analyzing the user request through a DNS (domain name system), and determining the machine room accessed by the client for the first time according to an attribute field in a returned value of the user request.
In an embodiment of the present invention, the field identifier is set by JavaScript on a website page or by background of an application program.
In a second aspect of an embodiment of the present invention, there is provided a traffic scheduling apparatus including:
the flow identification module is used for identifying a user request of a client according to field identifications of a plurality of machine rooms and determining the machine room accessed by the client for the first time;
the request sending module is used for analyzing preset fields in all the user requests of the client and dynamically sending each user request to different machine room back ends;
and the automatic scheduling module is used for automatically scheduling the flow of the machine room through a front-end inlet of the machine room when detecting that the application state of the rear end of the machine room is abnormal.
In one embodiment of the present invention, the automatic scheduling module includes:
and the first scheduling module is used for scheduling the flow of the computer room according to the field identification in the user request.
In yet another embodiment of the present invention, the automatic scheduling module further comprises:
and the second scheduling module is used for scheduling the flow of the machine room according to preset logic according to the application state of the rear end of the machine room.
In one embodiment of the present invention, the second scheduling module includes:
the entrance reservation module is used for only reserving the front-end entrance of the first machine room when the application state of the rear end of the first machine room is abnormal;
the second scheduling control module is used for ignoring traffic scheduling information in the field identifier of the client and guiding the traffic into a second machine room when the client accesses the front-end entrance of the first machine room;
and the scheduling stopping module is used for stopping the front-end inlet of the second machine room from scheduling the flow to the rear end of the first machine room.
In one embodiment of the present invention, the first scheduling module includes:
and the first scheduling control module is used for scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
In one embodiment of the present invention, the traffic identification module includes:
and the flow analysis module is used for analyzing the user request through the DNS and determining the machine room accessed by the client for the first time according to the attribute field in the returned value of the user request.
In an embodiment of the present invention, the field identifier is set by JavaScript on a website page or by background of an application program.
In a third aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a traffic scheduling method according to the first aspect described above.
In a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the traffic scheduling method of the first aspect described above via execution of the executable instructions.
According to the traffic scheduling method and the traffic scheduling device provided by the embodiment of the invention, firstly, the machine room accessed by the client for the first time is determined according to the field identifications of a plurality of machine rooms; analyzing preset fields in all the user requests of the client, and dynamically sending each user request to different machine room back ends; and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet of the machine room. On one hand, the machine room accessed by the client for the first time is determined according to the field identifications of the plurality of machine rooms, so that the problem that the related technology relies on domain name resolution to identify the flow is avoided, and the flow switching efficiency is improved; on the other hand, when the abnormal condition of the application state at the rear end of the machine room is detected, the flow of the machine room is automatically scheduled through the front-end inlet of the machine room, so that the problem of user flow loss caused by the change of the inlet of the machine room is solved, the state maintenance of the cross-machine room is realized, the continuity of the service is ensured, and the reliability is improved.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates a framework diagram of an exemplary application scenario, according to an embodiment of the present invention;
fig. 2 schematically shows a flow chart of a traffic scheduling method according to an embodiment of the invention;
fig. 3 schematically shows a schematic block diagram of a traffic scheduling apparatus according to an embodiment of the present invention;
FIG. 4 schematically shows a block diagram of an electronic device according to an embodiment of the invention; and
fig. 5 schematically shows a program product for traffic scheduling according to an embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to an embodiment of the invention, a traffic scheduling method and a traffic scheduling device are provided.
In this document, any number of elements in the drawings is by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
The inventor finds that when the method in the prior art is used for flow scheduling, as the DNS analysis system is relied on to identify the user source, and the change of the DNS analysis system is slow to take effect, the switching between machine rooms is influenced, and long time is consumed, so that the efficiency of flow scheduling is low; when rapid capacity expansion switching is caused, experience of the whole flow scheduling process is poor due to the condition that the machine room is temporarily unavailable for change; for many systems that do not perform synchronization of login states across rooms, the problem that the login state of a user is lost and the reliability is poor due to the fact that a room entrance changes when a network of a client is switched from data to WiFi cannot be solved.
Based on the above, the basic idea of the invention is: identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time; analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end; and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet. Therefore, according to the embodiment of the invention, the traffic among different machine rooms can be rapidly and efficiently scheduled, the problem of user traffic loss caused by the change of machine room inlets is solved, the state maintenance of cross machine rooms is realized, the continuity of services is ensured, and the reliability is improved.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
Referring first to fig. 1, fig. 1 shows a block schematic diagram of an exemplary application scenario of an embodiment of the present invention. As shown in fig. 1, a client may send a user request to a room. Those skilled in the art will appreciate that the schematic framework shown in FIG. 1 is merely one example in which embodiments of the invention may be implemented. The scope of applicability of embodiments of the present invention is not limited in any way by this framework.
It should be noted that the exemplary drawings of the present invention take two computer rooms as an example, however, the application scenario of the present invention is not limited to two computer rooms. The application scenario of the present invention may also be applied to a cluster comprising any number of distributed servers.
It should be further noted that the computer rooms may be all composed of servers, where the servers may be local servers or remote servers, and may also be other products capable of providing a storage function or a processing function, such as a cloud server, and the embodiments of the present invention are not limited specifically herein.
It should be understood that, in the application scenario of the present invention, there is no limitation in the implementation subject as long as the actions disclosed in the embodiments of the present invention are performed.
Exemplary method
In the following, in connection with the application scenario of fig. 1, a method for traffic scheduling according to an exemplary embodiment of the present invention is described with reference to fig. 2. It should be noted that the above application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
Fig. 2 shows a flow chart of a traffic scheduling method according to an embodiment of the present invention. It should be noted that steps S210 to S230 shown in fig. 2 may be used for traffic scheduling between different rooms. Referring to fig. 2, the traffic scheduling method may include the following steps:
s210, identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time;
s220, analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end;
and S230, when the abnormal situation of the application state of the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front end inlet of the machine room.
According to the traffic scheduling method and the traffic scheduling device provided by the embodiment of the invention, on one hand, the machine room accessed by the client for the first time is determined according to the field identifiers of the plurality of machine rooms, so that the traffic identification depending on domain name resolution in the related technology is avoided, and the traffic switching efficiency is improved; on the other hand, when the abnormal condition of the application state of the rear end of the machine room is detected, the flow of the machine room is automatically scheduled through the front-end inlet of the machine room, so that the problem that the flow of a user is lost when the inlet of the machine room is changed is solved, the state maintenance of crossing the machine room is realized, the continuity of service is ensured, the reliability is improved, and better experience is brought to the user.
Next, a traffic scheduling method in the present exemplary embodiment will be further explained.
In step S210, a user request of a client is identified according to field identifiers of multiple computer rooms, and the computer room accessed by the client for the first time is determined.
In this exemplary embodiment, in order to solve and avoid the problem that a single machine room fails to affect the network reliability, multiple machine rooms may be deployed for a certain service. For a product such as an e-commerce system, many subsystems are needed to assist internally. Its multi-room deployment scenario can be described as: if the application a is deployed in the computer room 1, other applications in the computer room 1 can call the interface of the application a, then many subsystems are deployed in the computer room 2, and the application in the computer room 2 also needs to call the application a, then there is a problem of delay caused by crossing the computer rooms when the application a in the computer room 2 calls the application a in the computer room 1. If the query per second QPS requirement of the system is high, then application a should preferably also be deployed in the room 2, thus enabling multi-room deployment. Applications e and d both need to call application a, and then application a can be deployed in the computer room 2, so that the problem of cross-computer time delay can be avoided.
A plurality of machine rooms may be constructed according to actual requirements, and in this example, a flow scheduling process between two machine rooms is described as an example. A field identifier, which may be a cookie field identifier or http, for example, may be provided or configured for each room. A Cookie is a variable stored in the visitor's client that is sent whenever the same client requests a page through a browser. Cookies may be applied to save user login state. For example, the user id is stored in a cookie so that the user does not need to re-log in the next time he accesses the page. In addition, the cookie can set a login validity period, and the cookie automatically disappears after the login validity period is exceeded. Since the cookie is run on the client, the cookie field identifier can be set through a setcookie function in JavaScript of a specific website page, and can also be set through the background of an application program.
Because each machine room is provided with the unique corresponding field identification, the user request of a certain client can be analyzed and identified, and the machine room accessed by the client for the first time can be quickly determined according to the analysis result. The client may be, for example, a mobile phone, a computer, an IPAD, or other electronic devices that can be connected to a network.
The specific step of determining the machine room accessed by the client for the first time may include:
and analyzing the user request through a DNS (domain name system), and determining the machine room accessed by the client for the first time according to the attribute field in the user request.
For example, if a core application deploys Hadoop processing clusters in machine room 1 and machine room 2, respectively. When the client a accesses for the first time, it is determined that the machine room 1 is accessed through DNS resolution, and a client request corresponding to the client a, such as an http request header, may have the following contents: "Set-Cookie, CLUSTERENV ═ HZIDC; domain is. xx.163. com; path ═/; expires ═ Tue,15-Aug-201715:46:37GMT ". Then the client a will take this property cookie of CLUSTERENV when accessing, i.e. the client a will access the room 1 afterwards. For example, referring to the application scenario shown in fig. 1, if a user request cookie of a client that needs to perform a payment service includes HZIDC corresponding to a state machine room, even if the user request currently visits the state machine room, traffic is dispatched to the state machine room through an intranet to perform the payment service.
In this example, the machine room entry of the user request is identified by the cookie field in the user request, so that dependency on the DNS system in the related art is avoided, and thus, the inefficient effect caused by the slow DNS system is also reduced, which is a basis for realizing quick machine room switching and traffic scheduling.
In step S220, the field identifiers in all the user requests of the client are analyzed, and each user request is dynamically sent to the corresponding back end of the computer room.
In this exemplary embodiment, the field identifier may be understood as a field identifier configured for each machine room in the above steps, and the field identifiers in all the user requests of the client may be analyzed by the front-end web portal cluster, and all the user requests are sequentially and dynamically distributed to the corresponding machine rooms according to the attribute fields in the analysis result of the field identifiers, so that the back end of the machine room processes the received user requests. For example, each user request may be allocated to different backend servers one by one in a time sequence, or may be allocated to each user request according to a hash result of accessing an IP, or may be allocated according to a response time of the backend server, which is not limited in this example.
Specifically, the front-end web portal cluster can analyze each http request sent by the client through the DNS analysis system, find out the CLUSTERENV field in each http request analysis result cookie of the client, and dynamically distribute the http request of the client corresponding to the CLUSTERENV field to the corresponding machine room rear end according to the mapping relation between each machine room rear-end application cluster and each user request.
In step S230, when it is detected that the application state at the back end of the machine room is abnormal, the flow of the machine room is automatically scheduled through the front-end entrance.
In this exemplary embodiment, when an application state at the back end of a computer room is in an abnormal condition such as a dropped connection, the computer room generally needs to be switched in order to ensure continuity of services or applications, for example, a network of a mobile phone client may be switched from 4G data to WiFi. At the moment, deep customization can be carried out on the front-end web portal, so that the state maintenance of a user across a machine room is realized. For example, when a user makes an online purchase, and the user a logs in the machine room 1 and accesses the machine room 2 due to a network change, the machine room 2 may parse http request data of the user, so as to guide the traffic of the user a back to the application cluster at the back end of the machine room 1. Similarly, when the network of the computer room 2 is changed, the front-end web portal cluster can dynamically guide the user request originally processed by the computer room 2 cluster to the computer room 1, thereby ensuring the continuity of the whole service. Because the entrance of the computer room changes along with the network, the problem that the login state of the user is lost is avoided, and the reliability of the system is improved.
Specifically, the automatically scheduling the traffic of the machine room in step S230 may include:
and scheduling the flow of the computer room according to the field identification in the user request.
In this exemplary embodiment, the front-end portal may analyze a field identifier in a user request sent by a certain client, and schedule traffic to a machine room uniquely corresponding to the field identifier according to the field identifier, thereby implementing accurate scheduling of traffic.
The scheduling of the traffic of the computer room according to the field identifier in the client user request may specifically include:
and scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
For example, the CLUSTERENV field corresponding to the machine room 1 is GZIDC, the CLUSTERENV field corresponding to the machine room 2 is BJIDC, and the cookie of the http request sent by the client a contains GZIDC, so that the http request is distributed to the machine room 1 according to the mapping relationship between the field identifier and each machine room backend application cluster. Further, if a user request of a client currently accesses the Guangzhou computer lab, but the user request cookie contains the HZIDC corresponding to the Hangzhou computer lab, traffic is also dispatched to the Hangzhou computer lab through the intranet according to the mapping relationship between the field identifier and each computer lab backend application cluster. The method can not avoid the abnormal situation of the machine room, so the reliability of the flow scheduling can not be ensured.
In order to avoid the foregoing problem, the automatically scheduling the traffic corresponding to the machine room in step S230 in this example may further include:
and scheduling the flow of the machine room according to a preset logic according to the application state of the rear end of the machine room.
In this exemplary embodiment, the traffic of a certain machine room may be scheduled through the application state of the back end of the machine room. Whether the application state of the back end of the machine room is abnormal or not can be judged through a test program, and when the application of the back end is in an unavailable state, the flow corresponding to the machine room can be automatically scheduled through a front-end inlet according to preset logic which is set in advance. The preset logic can be set according to actual requirements, for example, when the machine room 1 is abnormal, the flow of the machine room 1 is scheduled to the machine room 2 or the machine room 3. In this example, the traffic of the machine room is scheduled through the front-end entrance of the machine room according to the application state of the rear end of the machine room, so that excessive dependence on a DNS analysis system is avoided, and the traffic scheduling efficiency when the machine room is switched is improved.
Specifically, in this example embodiment, scheduling the flow of the computer room according to the application state of the back end of the computer room according to the preset logic may include:
when the application state of the rear end of a first machine room is abnormal, only the front end inlet of the first machine room is reserved;
when the client accesses the front-end entrance of the first machine room, traffic scheduling information in the field identification of the client is ignored and the traffic is led into a second machine room;
the front-end inlet of the second machine room stops dispatching the traffic to the back end of the first machine room.
In this exemplary embodiment, if the application state of the back end of the first computer room is in an unavailable state or the whole change occurs and cannot be served, only the front-end web portal cluster of the first computer room may be reserved. When any client accesses the first machine room entrance, the front-end web entrance of the first machine room finds that the state of the rear end of the first machine room is abnormal, so that the information contained in the field identification in the user request can be ignored, the flow of the first machine room is automatically led in or dispatched to the second machine room, and meanwhile, the front-end entrance of the second machine room stops dispatching the flow to the rear end of the first machine room. In this example, the front-end web portal can implement traffic scheduling between different machine rooms according to the application state of the back end of the machine room, so that the continuity of the service is ensured.
For example, in the application scenario shown in fig. 1, the first machine room is a hangzhou machine room, and the corresponding cookie is HZIDC; the second machine room is Guangzhou machine room, and the corresponding cookie is GZIDC. When the business of the Hangzhou computer room is temporarily unavailable or the computer room is to be quitted, the flow scheduling can be carried out according to the application state of the rear end of the computer room. The specific process is as follows: when 2 computer rooms in the Hangzhou computer room and the Guangzhou computer room are operated on line, if the business of the Hangzhou computer room needs to be changed integrally and cannot be served, products or applications can be selected to drop all business clusters of the Hangzhou computer room, and only a front-end web entrance of the Hangzhou computer room is reserved.
If the user requests to access the Hangzhou computer room entrance, the information required to be dispatched to the Hangzhou computer room cluster in the user request cookie is actively ignored and traffic is actively led into the Guangzhou computer room as the front web entrance of the Hangzhou computer room finds that the rear end of the Hangzhou computer room is unavailable. The front end web entrance of the Guangzhou computer room can also find that the Hangzhou computer room cluster is unavailable, and actively stops dispatching the traffic to the rear end of the Hangzhou computer room, so that the function of instantly and smoothly switching the traffic of all services from the Hangzhou computer room to the Guangzhou computer room is realized.
In this example, the front-end web portal can perform cross-room scheduling of traffic according to the application state of the back end of the room, and compared with the prior art, the method has the advantages that the service fault tolerance is improved on the front-end web portal layer, the difficulty of multi-room application during back-end service development is reduced, and the efficiency of traffic scheduling between rooms is improved.
Furthermore, through flow scheduling among different computer rooms, mutual fault tolerance of services among a plurality of computer rooms can be realized, and each user request sent by a client is ensured not to be influenced by abnormal faults of a certain computer room cluster. For example, for an application that does not support cross-room session synchronization, when a mobile phone user requests access to a telecommunication room before and accesses to a mobile room after the former request, the problem that the user needs to log in repeatedly due to flow loss in the room switching process is avoided, so that the problem that part of services are interrupted and discontinuous due to a certain room fault is solved, and the reliability of the system is improved.
Exemplary device
Having introduced the method of the exemplary embodiment of the present invention, the traffic scheduler 300 according to an exemplary embodiment of the present invention will be described in detail with reference to fig. 3. As shown in fig. 3, the traffic scheduler 300 may include: a traffic identification module 301, a request sending module 302, and an automatic scheduling module 303. Wherein:
the traffic identification module 301 may be configured to identify a user request of a client according to field identifiers of multiple machine rooms, and determine the machine room that the client accesses for the first time;
the request sending module 302 may be configured to analyze preset fields in all the user requests of the client, and dynamically send each user request to different machine room back ends;
the automatic scheduling module 303 may be configured to automatically schedule the flow of the machine room through a front-end inlet of the machine room when detecting that the application state at the rear end of the machine room is abnormal.
In an embodiment of the present invention, the automatic scheduling module 303 may include:
and the first scheduling module is used for scheduling the flow of the computer room according to the field identification in the user request.
In another embodiment of the present invention, the automatic scheduling module 303 may further include:
and the second scheduling module is used for scheduling the flow of the machine room according to preset logic according to the application state of the rear end of the machine room.
In one embodiment of the present invention, the second scheduling module includes:
the entrance reservation module is used for only reserving the front-end entrance of the first machine room when the application state of the rear end of the first machine room is abnormal;
the second scheduling control module is used for ignoring traffic scheduling information in the field identifier of the client and guiding the traffic into a second machine room when the client accesses the front-end entrance of the first machine room;
and the scheduling stopping module is used for stopping the front-end inlet of the second machine room from scheduling the flow to the rear end of the first machine room.
In one embodiment of the present invention, the first scheduling module includes:
and the first scheduling control module is used for scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
In an embodiment of the present invention, the traffic identification module 301 may include:
and the flow analysis module is used for analyzing the user request through the DNS and determining the machine room accessed by the client for the first time according to the attribute field in the returned value of the user request.
In an embodiment of the present invention, the field identifier is set by JavaScript on a website page or by background of an application program.
Since each functional module of the traffic scheduling apparatus 300 in the exemplary embodiment of the present invention corresponds to each step of the traffic scheduling method, it will not be described herein again.
Exemplary device
Having described the method and apparatus of the exemplary embodiments of the present invention, an electronic device for traffic scheduling according to another exemplary embodiment of the present invention is described next.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, a traffic scheduling device according to the present invention may comprise at least one processing unit, and at least one memory unit. Wherein the storage unit stores program code which, when executed by the processing unit, causes the processing unit to perform the steps of the traffic scheduling method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of the present specification. For example, the processing unit may perform step S210 as shown in fig. 2: identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time; step S220: analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end; step S230: and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet of the machine room.
An electronic device 400 for traffic scheduling according to this embodiment of the invention is described below with reference to fig. 4. The traffic scheduling apparatus 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the traffic scheduling device 400 is in the form of a general purpose computing device. The components of the traffic scheduling device 400 may include, but are not limited to: the at least one processing unit 401, the at least one memory unit 402, and a bus 403 that connects the various system components (including the memory unit 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures.
The storage unit 402 may include readable media in the form of volatile memory, such as a Random Access Memory (RAM)4021 and/or a cache memory 4022, and may further include a Read Only Memory (ROM) 4023.
The storage unit 402 may also include a program/utility 4025 having a set (at least one) of program modules 4024, such program modules 4024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The traffic scheduling device 400 may also communicate with one or more external devices 404 (e.g., keyboard, pointing device, bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with the traffic scheduling device 400, and/or communicate with any devices (e.g., router, modem, etc.) that enable the traffic scheduling device 400 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 405. Also, the traffic scheduling device 400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 406. As shown, the network adapter 406 communicates with the other modules of the traffic scheduling device 400 over a bus 403. It should be appreciated that although not shown in fig. 4, other hardware and/or software modules may be used in conjunction with the traffic scheduling device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Exemplary program product
In some possible embodiments, the various aspects of the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform the steps in the traffic scheduling methods according to the various exemplary embodiments of the present invention described in the above section "exemplary methods" of this specification, when the program product is run on the terminal device, for example, the processing unit may perform step S210 as shown in fig. 2: identifying a user request of a client according to field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time; step S220: analyzing field identifications in all the user requests of the client, and dynamically sending each user request to a corresponding machine room rear end; step S230: and when the abnormal condition of the application state at the rear end of the machine room is detected, automatically scheduling the flow of the machine room through a front-end inlet of the machine room.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As shown in fig. 5, a program product 500 for traffic scheduling according to an embodiment of the present invention is depicted, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
It should be noted that although in the above detailed description several means or sub-means of the traffic scheduling device are mentioned, this division is only not mandatory. Indeed, the features and functions of two or more of the devices described above may be embodied in one device, according to embodiments of the invention. Conversely, the features and functions of one apparatus described above may be further divided into embodiments by a plurality of apparatuses.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

1. A traffic scheduling method, comprising:
identifying field identifications in a user request of a client according to the field identifications of a plurality of machine rooms, and determining the machine room accessed by the client for the first time;
according to the mapping relation between each machine room rear end and each user request, dynamically sending the user request to the machine room rear end of the machine room which is accessed for the first time and corresponds to the field identification;
when the front-end inlet of the machine room accessed for the first time detects that the application state of the rear end of the machine room accessed for the first time is abnormal, automatically scheduling the flow of the machine room accessed for the first time according to the application state of the rear end of the machine room accessed for the first time and preset logic through the machine room accessed for the first time and the front-end inlet of the changed machine room, and realizing the scheduling of the flow among different machine rooms;
the method comprises the following steps of automatically scheduling the flow of the machine room accessed for the first time according to the application state of the rear end of the machine room accessed for the first time according to preset logic, wherein the method comprises the following steps:
when the application state of the rear end of the machine room of the first machine room is abnormal, all the service clusters of the first machine room are offline, and only the front-end entrance of the first machine room is reserved;
when the client accesses the front-end entrance of the first machine room, traffic scheduling information in the field identification of the client is ignored and the traffic is led into a second machine room;
the front-end inlet of the second machine room stops dispatching the traffic to the machine room rear end of the first machine room.
2. The traffic scheduling method according to claim 1, wherein automatically scheduling the traffic of the machine room comprises:
and scheduling the flow of the computer room according to the field identification in the user request.
3. The traffic scheduling method of claim 2, wherein scheduling the traffic of the computer room according to the field identifier in the user request comprises:
and scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
4. The traffic scheduling method according to claim 1, wherein determining the machine room that the client accesses for the first time comprises:
and analyzing the user request through a DNS (domain name system), and determining the machine room accessed by the client for the first time according to an attribute field in a returned value of the user request.
5. The traffic scheduling method of claim 1, wherein the field identification is set by JavaScript on a website page or by an application background.
6. A traffic scheduling apparatus, comprising:
the flow identification module is used for identifying field identifications in a user request of a client according to the field identifications of a plurality of machine rooms and determining the machine room accessed by the client for the first time;
the request sending module is used for dynamically sending the user requests to the machine room rear end of the machine room which is accessed for the first time and corresponds to the field identification according to the mapping relation between each machine room rear end and each user request;
the automatic scheduling module is used for automatically scheduling the flow of the machine room accessed for the first time according to preset logic through the machine room accessed for the first time and the front-end inlet of the changed machine room when the front-end inlet of the machine room accessed for the first time detects that the application state of the rear end of the machine room accessed for the first time is abnormal, so that the scheduling of the flow among different machine rooms is realized;
wherein the automatic scheduling module comprises:
the entrance reservation module is used for offline all the service clusters of the first machine room when the application state of the rear end of the first machine room is abnormal, and only reserving the front-end entrance of the first machine room;
the second scheduling control module is used for ignoring traffic scheduling information in the field identifier of the client and guiding the traffic into a second machine room when the client accesses the front-end entrance of the first machine room;
and the scheduling stopping module is used for stopping the front-end inlet of the second machine room from scheduling the flow to the rear end of the first machine room.
7. The traffic scheduling device of claim 6, wherein the auto-scheduling module comprises:
and the first scheduling module is used for scheduling the flow of the computer room according to the field identification in the user request.
8. The traffic scheduling device of claim 7, wherein the first scheduling module comprises:
and the first scheduling control module is used for scheduling the flow of the machine room according to preset logic according to the mapping relation between the field identification in the user request and each machine room rear-end application cluster.
9. The traffic scheduling device of claim 6, wherein the traffic identification module comprises:
and the flow analysis module is used for analyzing the user request through the DNS and determining the machine room accessed by the client for the first time according to the attribute field in the returned value of the user request.
10. The traffic scheduling device of claim 6 wherein the field identification is set by JavaScript on a website page or by an application background.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the traffic scheduling method according to any one of claims 1 to 5.
12. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the traffic scheduling method of any of claims 1-5 via execution of the executable instructions.
CN201710953261.9A 2017-10-13 2017-10-13 Traffic scheduling method and device, computer readable storage medium and electronic equipment Active CN107635010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710953261.9A CN107635010B (en) 2017-10-13 2017-10-13 Traffic scheduling method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710953261.9A CN107635010B (en) 2017-10-13 2017-10-13 Traffic scheduling method and device, computer readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN107635010A CN107635010A (en) 2018-01-26
CN107635010B true CN107635010B (en) 2021-04-13

Family

ID=61105405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710953261.9A Active CN107635010B (en) 2017-10-13 2017-10-13 Traffic scheduling method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN107635010B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109327520B (en) * 2018-10-19 2021-04-30 中国银行股份有限公司 Method and device for establishing connection between terminal and server node
CN109508912B (en) * 2018-12-29 2021-05-28 广州虎牙信息科技有限公司 Service scheduling method, device, equipment and storage medium
CN110046092B (en) * 2019-03-12 2020-07-07 北京创鑫旅程网络技术有限公司 Experiment shunting method and device, electronic equipment and computer readable storage medium
CN110266747B (en) * 2019-04-12 2022-04-08 创新先进技术有限公司 Method and device for switching machine room of service request
CN110198346B (en) * 2019-05-06 2020-10-27 北京三快在线科技有限公司 Data reading method and device, electronic equipment and readable storage medium
CN113472687B (en) * 2021-07-15 2023-12-05 北京京东振世信息技术有限公司 Data processing method and device
CN116781947A (en) * 2022-03-11 2023-09-19 北京沃东天骏信息技术有限公司 Video stream data acquisition method, device, electronic equipment and computer readable medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103379130A (en) * 2012-04-13 2013-10-30 深圳市腾讯计算机系统有限公司 Network access system and method based on application layer data
EP2961124B1 (en) * 2014-06-23 2018-03-21 Alcatel Lucent Method for enhancing captive portal service
CN106060088B (en) * 2016-07-26 2020-11-06 新华三技术有限公司 Service management method and device
CN106961469A (en) * 2017-02-28 2017-07-18 北京致远互联软件股份有限公司 Unaware orientation Proxy Method and system based on http proxy servers

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104852934A (en) * 2014-02-13 2015-08-19 阿里巴巴集团控股有限公司 Method for realizing flow distribution based on front-end scheduling, device and system thereof

Also Published As

Publication number Publication date
CN107635010A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN107635010B (en) Traffic scheduling method and device, computer readable storage medium and electronic equipment
US9251040B2 (en) Remote debugging in a cloud computing environment
US10891560B2 (en) Supervised learning system training using chatbot interaction
US8863138B2 (en) Application service performance in cloud computing
US10505977B2 (en) Diffusing denial-of-service attacks by using virtual machines
US10904184B2 (en) Smart message delivery based on transaction processing status
US9497095B2 (en) Dynamic control over tracing of messages received by a message broker
CN111683139B (en) Method and device for balancing load
US10346291B2 (en) Testing web applications using clusters
EP3609134A1 (en) Bgp anycast cluster service quality detection method and detection apparatus
US8832215B2 (en) Load-balancing in replication engine of directory server
CN108093036B (en) Method and device for acquiring resources
US9471389B2 (en) Dynamically tuning server placement
US10255057B2 (en) Locale object management
US20150100973A1 (en) Intelligent High-Volume Cloud Application Programming Interface Request Caching
CN110247847B (en) Method and device for back source routing between nodes
CN114979286B (en) Access control method, device, equipment and computer storage medium for container service
CN108228359B (en) Method and system for integrating web program and R program to process data
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
CN113132447A (en) Reverse proxy method and system
CN112131095A (en) Pressure testing method and device
CN112559001A (en) Method and device for updating application
CN112968975B (en) Service request processing method and device
US11316765B2 (en) Load balancing across bandwidth carrying circuits
CN116431357B (en) Kernel allocation method, allocation component, working node and storage medium

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

Effective date of registration: 20231110

Address after: 310052 Room 301, Building No. 599, Changhe Street Network Business Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou NetEase Shuzhifan Technology Co.,Ltd.

Address before: 310052 Building No. 599, Changhe Street Network Business Road, Binjiang District, Hangzhou City, Zhejiang Province, 4, 7 stories

Patentee before: NETEASE (HANGZHOU) NETWORK Co.,Ltd.

TR01 Transfer of patent right