CN113014657A - Flow line switching method and device, storage medium and electronic equipment - Google Patents
Flow line switching method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN113014657A CN113014657A CN202110257209.6A CN202110257209A CN113014657A CN 113014657 A CN113014657 A CN 113014657A CN 202110257209 A CN202110257209 A CN 202110257209A CN 113014657 A CN113014657 A CN 113014657A
- Authority
- CN
- China
- Prior art keywords
- server
- pressure measurement
- request
- service end
- connection 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000009530 blood pressure measurement Methods 0.000 claims abstract description 98
- 238000001514 detection method Methods 0.000 claims description 50
- 238000012795 verification Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 14
- 238000012544 monitoring process Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 7
- 238000012546 transfer Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 14
- 238000012423 maintenance Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/08—Load balancing or load distribution
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a switching method and device of a flow line, a storage medium and electronic equipment, and belongs to the technical field of computers. The switching method of the flow line comprises the following steps: the method comprises the steps of receiving a pressure measurement connection request from a client, detecting the load state of a server, switching a flow line of a preset user in a main line server to a standby server based on the load state, and sending the pressure measurement connection request to the main line server. Therefore, the flow line of the user preset in the main line server is switched to the standby server in the pressure measurement process, the problems that in the prior art, the maintenance time of a server needs to be appointed by the user, the type of the user special for pressure measurement is increased and the like are solved, and the smooth pressure measurement is carried out without influencing the user experience.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for switching a flow line, a storage medium and electronic equipment.
Background
At present, in multimedia video services (such as video messages, video conferences, video sharing, online education and the like) of a mobile communication network, a method for measuring a pressure index of the performance of a video service system comprises the steps of pressurizing tested equipment, testing whether the tested equipment can reach a corresponding pressure value, judging whether the tested equipment can normally run when the tested equipment reaches a maximum preset value, and in an actual situation, after the tested equipment reaches the pressure, various situations possibly occur, namely, various situations exist in overvoltage strategy expression of the equipment. In online education, for example, since students take classes in a super class classroom all day long, it is guaranteed that the service is available for 24 hours. With the increase of the user quantity and the online of the system iteration, the system needs to be periodically tested to ensure the stability of the service. During the pressure survey, must produce great pressure to the system, also have real student at the class simultaneously, appear producing the problem such as influence to its experience.
Disclosure of Invention
The embodiment of the application provides a method and a device for switching a flow line, a storage medium and electronic equipment, solves the problems that in the prior art, a user needs to appoint the maintenance time of a server, the type of a special user for pressure measurement is increased, and the like, and does not influence the user experience to smoothly perform pressure measurement. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for switching a traffic line, including:
receiving a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
detecting a load state of a server, and switching a flow line of a preset user in a main line server to a standby server based on the load state; the service end comprises a main line service end and a standby service end;
sending the pressure measurement connection request to the main line service end; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
In a second aspect, an embodiment of the present application provides a device for switching a traffic line, where the device includes:
the receiving module is used for receiving a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
the switching module is used for detecting the load state of the service end and switching the flow line of a preset user in the main line service end to the standby service end based on the load state; the service end comprises a main line service end and a standby service end;
the sending module is used for sending the pressure measurement connection request to the mainline server; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
when the switching method, the switching device, the storage medium and the electronic equipment work, a pressure measurement connection request from a client is received, the load state of a server is detected, the flow line of a preset user in a main line server is switched to a standby server based on the load state, and the pressure measurement connection request is sent to the main line server. According to the embodiment of the application, the flow line of the preset user in the mainline server is switched to the standby server in the pressure measurement process, so that the problems that in the prior art, the maintenance time of a server needs to be appointed by a user, the type of the user special for pressure measurement is increased, and the like are solved, and the smooth pressure measurement is performed without influencing the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic architecture diagram of a switching system of a traffic line according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for switching a traffic line according to an embodiment of the present disclosure;
fig. 3 is another schematic flow chart of a method for switching a traffic line according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a switching device of a traffic line according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following description refers to the accompanying drawings in which like numerals refer to the same or similar elements throughout the different views, unless otherwise specified. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to solve the problem that the system is online along with the increase of the user quantity and the iteration of the system, the system needs to be periodically tested to ensure the stability of the service. During pressure measurement, relatively large pressure is inevitably generated on the system, and meanwhile, real students are in class and influence the experience of the students, and the like. The computer system can be a computer system of a smart phone, a notebook computer, a tablet computer and the like.
In the following method embodiments, for convenience of description, only the execution subject of each step is described as a gateway server.
The following describes in detail a method for switching a traffic line according to an embodiment of the present application with reference to fig. 2 to 3.
Fig. 1 is a schematic diagram of a switching system of a traffic line according to an embodiment of the present disclosure. As shown in fig. 1, the switching system of the traffic line mainly includes a plurality of clients including teacher clients and student clients for receiving and transmitting audio and video data, a gateway server for distinguishing user types and determining line selection of the audio and video data (traffic line), and a main line server and a standby server for loading corresponding audio and video data (traffic), where the main line server is responsible for traffic of all home and abroad users and the standby line server is idle. Only when the main line fails, the flow is switched to the standby line machine room in full.
Fig. 2 is a schematic flow chart of a method for switching a traffic line according to an embodiment of the present disclosure. The method may comprise the steps of:
s201, receiving a pressure measurement connection request from a client.
Generally, the pressure measurement connection request carries user type information. The method comprises the steps that a gateway server receives a verification request message from a client, wherein the verification request message carries account password information, the verification request is verified based on the account password information to generate a result message, the result message is sent to the client, and a pressure measurement connection request responding to the result message from the client is received.
S202, detecting the load state of the service end, and switching the flow line of a preset user in the main line service end to the standby service end based on the load state.
Generally, the service end includes a main line service end and a standby service end. The gateway server receives a pressure measurement connection request from a client, acquires the quantity information of the server, generates detection messages with corresponding quantity based on the quantity information, numbers the detection messages, respectively sends the numbered detection messages to each server, receives detection result messages from each server responding to the detection messages, and analyzes all the detection result messages to determine the load state. Then, the gateway server determines a preset user type, and generates a connection interruption request based on the preset user type, wherein the connection interruption request is used for indicating the main line service terminal to interrupt a traffic line with the client terminal, sending the connection interruption request to the corresponding main line service terminal, inquiring a historical connection request corresponding to the preset user type, and sending the historical connection request to the standby service terminal, wherein the historical connection request is used for indicating the client terminal and the standby service terminal to establish traffic connection under the condition that the load state is met. In an embodiment, when the load state meets a load condition, the gateway server switches the traffic lines of all users in the main line service end to the standby service end.
S203, sending the pressure measurement connection request to the mainline server.
Generally, the pressure measurement connection request is used to instruct the client to establish a traffic connection with the server. And after switching the flow line of a preset user in the main line service end to the standby service end, the gateway server needs to send the pressure measurement connection request to the main line service end. Then, in an embodiment, a gateway server receives a traffic task request, wherein the traffic task request includes a hypertext transfer protocol Http task request and a timing task request, parses the Http task request to determine a corresponding entry type, determines an inquiry data range of the timing task request, and sends the Http task request and the timing task request to corresponding servers based on the entry type and the inquiry data range. Then, in an embodiment, the gateway server receives the pressure measurement result information from the server, reports the pressure measurement result information to the monitoring system, and performs back-switching processing on the switched traffic line.
As can be seen from the above, the method includes receiving a pressure measurement connection request from a client, detecting a load state of a server, switching a traffic line of a preset user in a main line server to a standby server based on the load state, and sending the pressure measurement connection request to the main line server. According to the embodiment of the application, the flow line of the preset user in the mainline server is switched to the standby server in the pressure measurement process, so that the problems that in the prior art, the maintenance time of a server needs to be appointed by a user, the type of the user special for pressure measurement is increased, and the like are solved, and the smooth pressure measurement is performed without influencing the user experience.
Referring to fig. 3, another flow chart of a method for switching a traffic line is provided in an embodiment of the present application. The switching method of the flow line can comprise the following steps:
s301, receiving a verification request message from a client, verifying the verification request based on the account password information, and generating a result message.
Generally, the authentication request information carries account password information. The gateway server receives an authentication request message from the client, authenticates the authentication request based on the account password information, and generates a result message, for example: the gateway server analyzes and determines the account password information as follows: the account admin and the password 123456 are verified in pre-stored management information, a verification success result is generated if the preset conditions are met, and a verification failure result is generated if the preset conditions are not met.
S302, sending the result message to the client, and receiving a pressure measurement connection request from the client in response to the result message.
Generally, the pressure measurement connection request carries user type information, such as: domestic users and foreign users, such as Beijing time, focus on the class time from 9 am to 10 am. The class time of the foreign users is concentrated at 10 nights to 9 nights in the next day, the pressure measurement time is determined to be 10 nights later, and the server only switches the traffic of the foreign users to the standby line. Then, the pressure measurement personnel create a large amount of class data and flow in the manner of domestic users. Therefore, the main line can be tested under pressure, and the standby line provides normal class service for real students. After the pressure measurement is finished, the flow of foreign users is switched back to the main line. After the gateway server generates a result message, the result message is sent to the client, and a pressure measurement connection request from the client in response to the result message is received, for example: and the gateway server generates a successful verification result to the client a and a failed verification result to the client b, and then receives a pressure measurement connection request of the client a responding to the successful verification result for carrying out flow connection with the server.
S303, acquiring the quantity information of the service terminals, generating detection messages with corresponding quantity based on the quantity information, numbering the detection messages, and respectively sending the numbered detection messages to each service terminal.
Generally, the service end includes a main line service end and a standby service end. After receiving the pressure measurement connection request from the client in response to the result message, the gateway server obtains the quantity information of the server, and generates a corresponding quantity of detection messages based on the quantity information, for example: the gateway server determines that the server has 3 mainline servers and 5 standby servers, and generates 8 detection messages, where the detection messages carry internet interconnection protocol address information, number information, and the like of the corresponding server, and then the gateway server numbers the detection messages and sends the numbered detection messages to each server, for example: numbering 8 detection messages as numbers 1-8, and respectively sending the detection messages to the server with the corresponding numbers, for example: and a-h service end.
S304, receiving detection result messages from each server responding to the detection messages, and analyzing all the detection result messages to determine the load state.
Generally, after sending the numbered detection messages to each server, the gateway server receives the detection result messages from each server in response to the detection messages, and analyzes all the detection result messages to determine the load status, for example: the gateway server determines that the load state of the main line server a is the current flow line loading 50 clients, the load state of the main line server b is the current flow line loading 40 clients, and the load state of the standby server c is the current flow line loading 3 clients.
S305, determining a preset user type, generating a connection interruption request based on the preset user type, and sending the connection interruption request to the corresponding mainline service terminal.
Generally, the connection interruption request is used to instruct the main line service end to interrupt a traffic line with the client. After analyzing all the detection result messages and determining the load state, the gateway server determines a preset user type, generates a connection interruption request based on the preset user type, and sends the connection interruption request to the corresponding main line server, for example: the gateway server determines that the preset user type is a foreign user, then generates 2 connection interruption requests, and sends the 2 connection interruption requests to the main line service end a and the main line service end b respectively, so as to be used for pressure measurement of connection of a flow line between the user and the main line service end and detection of the main line service end. In one embodiment, the gateway server switches the traffic lines of all users on the main line service end to the standby service end, and can perform balanced distribution and the like according to the load state of the standby service end.
S306, inquiring a historical connection request corresponding to the preset user type, sending the historical connection request to the standby service end, and sending the pressure measurement connection request to the main line service end.
Generally, the historical connection request is used to instruct the client and the standby server to establish a traffic connection under the condition that the load state is satisfied. After sending the connection interruption request to the corresponding main line server, the gateway server queries a historical connection request corresponding to the preset user type, and sends the historical connection request to the standby server, for example: determining a historical connection request of a client side 1 and a main line service side a before 10 minutes, selecting the most appropriate standby service side according to the load states of all the standby service sides, sending the historical connection request to a standby service side c for connection of a flow line, ensuring normal use of a user who is in connection during a pressure test period, and finally sending the pressure test connection request to the main line service side to test the main line service side.
S307, receiving a flow task request, analyzing the Http task request to determine a corresponding entry type, and determining a query data range of the timing task request.
Generally, the traffic task requests include hypertext transfer protocol Http task requests and timed task requests. After the gateway server sends the historical connection request to the backup server to establish traffic connection, it also receives traffic access, for example: an external Http interface and internal timing tasks. The gateway server receives the traffic task request, analyzes the Http task request to determine a corresponding entry type, and determines a query data range of the timing task request, for example: the gateway server analyzes the file header or the access parameter carrying the foreign user access parameter type of the Http task request, determines that the Http task request is a request of the foreign user, determines that the query data range of the timing task request is a mark for querying data of the domestic user only, determines that the timing task request is a request of the domestic user, and determines that the timing task request is a request of the foreign user if the data of the foreign user is queried only.
S308, the Http task request and the timing task request are sent to corresponding servers based on the parameter entering type and the query data range.
Generally, after determining the query data range of the timing task request, the gateway server sends the Http task request and the timing task request to corresponding servers based on the entry type and the query data range, for example: the gateway server sends the Http task request of the foreign user to the standby server, sends the timing task request of the domestic user to the main line server, and sends the timing task request of the foreign user to the standby server.
S309, receiving pressure measurement result information from the server.
Generally, after the pressure measurement connection request is sent to the main line server, the gateway server receives pressure measurement result information from the server, for example: traffic line signal quality, delay rate, picture sharpness, etc.
And S310, reporting the pressure measurement result information to a monitoring system, and carrying out back-switching processing on the switched flow line.
Generally, after receiving the pressure measurement result information from the server, the gateway server reports the pressure measurement result information to the monitoring system, and performs a back-switching process on the switched traffic line, for example: and finally, switching back the switched flow line, and switching back the flow line of a foreign user to a main line server.
When the scheme of the embodiment of the application is executed, a verification request message from a client is received, the verification request is verified based on the account password information to generate a result message, the result message is sent to the client, a pressure test connection request responding to the result message from the client is received, the quantity information of the service ends is obtained, a corresponding quantity of detection messages are generated based on the quantity information, the detection messages are numbered, the numbered detection messages are respectively sent to each service end, the detection result message responding to the detection message from each service end is received, all the detection result messages are analyzed to determine the load state, the preset user type is determined, a connection interruption request is generated based on the preset user type, and the connection interruption request is sent to the corresponding mainline service end, inquiring a historical connection request corresponding to the preset user type, sending the historical connection request to the standby server, sending the pressure measurement connection request to the mainline server, receiving a flow task request, analyzing the Http task request to determine a corresponding entry type, determining an inquiry data range of the timing task request, sending the Http task request and the timing task request to the corresponding server based on the entry type and the inquiry data range, receiving pressure measurement result information from the server, reporting the pressure measurement result information to a monitoring system, and carrying out back switching processing on a switched flow line. According to the embodiment of the application, the flow line of the preset user in the mainline server is switched to the standby server in the pressure measurement process, so that the problems that in the prior art, the maintenance time of a server needs to be appointed by a user, the type of the user special for pressure measurement is increased, and the like are solved, and the smooth pressure measurement is performed without influencing the user experience.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 4, a schematic structural diagram of a switching device for a traffic line according to an exemplary embodiment of the present application is shown, and hereinafter referred to as the switching device 4. The switching means 4 may be implemented as all or part of the terminal by software, hardware or a combination of both. The method comprises the following steps:
a receiving module 401, configured to receive a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
a switching module 402, configured to detect a load state of a service end, and switch a traffic line of a preset user in a main line service end to a standby service end based on the load state; the service end comprises a main line service end and a standby service end;
a sending module 403, configured to send the pressure measurement connection request to the main line server; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
Optionally, the receiving module 401 further includes:
the authentication unit is used for receiving an authentication request message from a client; the authentication request information carries account password information; verifying the verification request based on the account password information to generate a result message; sending the result message to the client; receiving a pressure measurement connection request from the client in response to the result message.
Optionally, the switching module 402 further includes:
the detection unit is used for acquiring the quantity information of the service terminals and generating detection messages with corresponding quantity based on the quantity information; numbering the detection messages, and respectively sending the numbered detection messages to each server; receiving detection result messages from the server terminals responding to the detection messages; and analyzing all the detection result messages to determine the load state.
The device comprises a query unit, a processing unit and a processing unit, wherein the query unit is used for determining a preset user type and generating a connection interruption request based on the preset user type; the connection interruption request is used for indicating the mainline service terminal to interrupt a flow line with the client terminal; sending the connection interruption request to the corresponding mainline service terminal; querying a historical connection request corresponding to the preset user type, and sending the historical connection request to the standby server; the historical connection request is used for indicating the client and the standby server to establish flow connection under the condition that the load state is met; and when the load state meets the load condition, switching the flow lines of all the users in the main line service end to the standby service end.
Optionally, the sending module 403 further includes:
the analysis unit is used for receiving a flow task request; the flow task request comprises a hypertext transfer protocol (Http) task request and a timing task request; analyzing the Http task request to determine a corresponding parameter entry type; determining a query data range of the timing task request; and sending the Http task request and the timing task request to corresponding servers based on the participation type and the query data range.
The reporting unit is used for receiving the pressure measurement result information from the server; and reporting the pressure measurement result information to a monitoring system, and carrying out back switching processing on the switched flow line.
The embodiment of the present application and the method embodiments of fig. 2 to 3 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the method embodiments of fig. 2 to 3, and will not be described again here.
The device 4 may be a field-programmable gate array (FPGA), an application-specific integrated chip, a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips.
When the scheme of the embodiment of the application is executed, a pressure measurement connection request from a client is received, the load state of a server is detected, a flow line of a preset user in a main line server is switched to a standby server based on the load state, and the pressure measurement connection request is sent to the main line server. According to the embodiment of the application, the flow line of the preset user in the mainline server is switched to the standby server in the pressure measurement process, so that the problems that in the prior art, the maintenance time of a server needs to be appointed by a user, the type of the user special for pressure measurement is increased, and the like are solved, and the smooth pressure measurement is performed without influencing the user experience.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the above method steps, and a specific execution process may refer to specific descriptions of the embodiment shown in fig. 2 or fig. 3, which is not described herein again.
The present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the template control method according to the above embodiments.
Please refer to fig. 5, which is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 5 may include: at least one processor 501, at least one network interface 504, a user interface 503, memory 505, at least one communication bus 502.
Wherein a communication bus 502 is used to enable connective communication between these components.
The user interface 503 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 503 may also include a standard wired interface and a wireless interface.
The network interface 504 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
The Memory 505 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable medium. The memory 505 may be used to store instructions, programs, code sets, or instruction sets. The memory 505 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 505 may alternatively be at least one memory device located remotely from the processor 501. As shown in fig. 5, the memory 505, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a switching application program of a traffic line.
In the electronic device 500 shown in fig. 5, the user interface 503 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 501 may be configured to invoke a switching application of the traffic line stored in the memory 505, and specifically perform the following operations:
receiving a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
detecting a load state of a server, and switching a flow line of a preset user in a main line server to a standby server based on the load state; the service end comprises a main line service end and a standby service end;
sending the pressure measurement connection request to the main line service end; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
In one embodiment, the processor 501 performs the receiving of the pressure measurement connection request from the client, including:
receiving a verification request message from a client; the authentication request information carries account password information;
verifying the verification request based on the account password information to generate a result message;
sending the result message to the client;
receiving a pressure measurement connection request from the client in response to the result message.
In one embodiment, the processor 501 performs the detecting of the load status of the server, including:
acquiring quantity information of the server sides, and generating detection messages with corresponding quantity based on the quantity information;
numbering the detection messages, and respectively sending the numbered detection messages to each server;
receiving detection result messages from the server terminals responding to the detection messages;
and analyzing all the detection result messages to determine the load state.
In an embodiment, the performing, by the processor 501, switching a traffic line of a preset user in the main line service end to the standby service end based on the load status includes:
determining a preset user type, and generating a connection interruption request based on the preset user type; the connection interruption request is used for indicating the mainline service terminal to interrupt a flow line with the client terminal;
sending the connection interruption request to the corresponding mainline service terminal;
querying a historical connection request corresponding to the preset user type, and sending the historical connection request to the standby server; the historical connection request is used for indicating the client and the standby server to establish flow connection under the condition that the load state is met.
In an embodiment, the processor 501 performs the switching of the traffic line of the preset user in the main line service end to the standby service end based on the load status, and further includes:
and when the load state meets the load condition, switching the flow lines of all the users in the main line service end to the standby service end.
In one embodiment, after the processor 501 performs the sending of the pressure measurement connection request to the mainline server, the method further includes:
receiving a flow task request; the flow task request comprises a hypertext transfer protocol (Http) task request and a timing task request;
analyzing the Http task request to determine a corresponding parameter entry type;
determining a query data range of the timing task request;
and sending the Http task request and the timing task request to corresponding servers based on the participation type and the query data range.
In one embodiment, after the processor 501 performs the sending of the pressure measurement connection request to the mainline server, the method further includes:
receiving pressure measurement result information from the server;
and reporting the pressure measurement result information to a monitoring system, and carrying out back switching processing on the switched flow line.
The technical concept of the embodiment of the present application is the same as that of fig. 2 or fig. 3, and the specific process may refer to the method embodiment of fig. 2 or fig. 3, which is not described herein again.
In the embodiment of the application, a pressure measurement connection request from a client is received, a load state of a server is detected, a flow line of a preset user in a main line server is switched to a standby server based on the load state, and the pressure measurement connection request is sent to the main line server. According to the embodiment of the application, the flow line of the preset user in the mainline server is switched to the standby server in the pressure measurement process, so that the problems that in the prior art, the maintenance time of a server needs to be appointed by a user, the type of the user special for pressure measurement is increased, and the like are solved, and the smooth pressure measurement is performed without influencing the user experience.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.
Claims (10)
1. A method for switching a traffic line, the method comprising:
receiving a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
detecting a load state of a server, and switching a flow line of a preset user in a main line server to a standby server based on the load state; the service end comprises a main line service end and a standby service end;
sending the pressure measurement connection request to the main line service end; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
2. The method of claim 1, wherein receiving a pressure measurement connection request from a client comprises:
receiving a verification request message from a client; the authentication request information carries account password information;
verifying the verification request based on the account password information to generate a result message;
sending the result message to the client;
receiving a pressure measurement connection request from the client in response to the result message.
3. The method of claim 1, wherein the detecting a load status of the server comprises:
acquiring quantity information of the server sides, and generating detection messages with corresponding quantity based on the quantity information;
numbering the detection messages, and respectively sending the numbered detection messages to each server;
receiving detection result messages from the server terminals responding to the detection messages;
and analyzing all the detection result messages to determine the load state.
4. The method of claim 1, wherein switching a traffic line of a preset subscriber in the main line service end to a standby service end based on the load status comprises:
determining a preset user type, and generating a connection interruption request based on the preset user type; the connection interruption request is used for indicating the mainline service terminal to interrupt a flow line with the client terminal;
sending the connection interruption request to the corresponding mainline service terminal;
querying a historical connection request corresponding to the preset user type, and sending the historical connection request to the standby server; the historical connection request is used for indicating the client and the standby server to establish flow connection under the condition that the load state is met.
5. The method of claim 1, wherein switching a traffic line of a preset subscriber in the main line service end to a standby service end based on the load status further comprises:
and when the load state meets the load condition, switching the flow lines of all the users in the main line service end to the standby service end.
6. The method of claim 5, wherein after sending the pressure measurement connection request to the mainline service end, further comprising:
receiving a flow task request; the flow task request comprises a hypertext transfer protocol (Http) task request and a timing task request;
analyzing the Http task request to determine a corresponding parameter entry type;
determining a query data range of the timing task request;
and sending the Http task request and the timing task request to corresponding servers based on the participation type and the query data range.
7. The method of claim 6, wherein after sending the pressure measurement connection request to the mainline service end, further comprising:
receiving pressure measurement result information from the server;
and reporting the pressure measurement result information to a monitoring system, and carrying out back switching processing on the switched flow line.
8. A switching device for a flow line, comprising:
the receiving module is used for receiving a pressure measurement connection request from a client; wherein, the pressure measurement connection request carries user type information;
the switching module is used for detecting the load state of the service end and switching the flow line of a preset user in the main line service end to the standby service end based on the load state; the service end comprises a main line service end and a standby service end;
the sending module is used for sending the pressure measurement connection request to the mainline server; and the pressure measurement connection request is used for indicating the client to establish flow connection with the server.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. An electronic device, comprising: a memory and a processor; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110257209.6A CN113014657A (en) | 2021-03-09 | 2021-03-09 | Flow line switching method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110257209.6A CN113014657A (en) | 2021-03-09 | 2021-03-09 | Flow line switching method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113014657A true CN113014657A (en) | 2021-06-22 |
Family
ID=76403343
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110257209.6A Pending CN113014657A (en) | 2021-03-09 | 2021-03-09 | Flow line switching method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113014657A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116723195A (en) * | 2023-08-11 | 2023-09-08 | 腾讯科技(深圳)有限公司 | Data transmission method, device, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101388800A (en) * | 2007-09-12 | 2009-03-18 | 百度在线网络技术(北京)有限公司 | Method, device and system for pressed test to network performance of server |
US20140298101A1 (en) * | 2013-03-29 | 2014-10-02 | Inventec Corporation | Distributed pressure testing system and method |
CN108710565A (en) * | 2018-03-05 | 2018-10-26 | 聚好看科技股份有限公司 | A kind of method for testing pressure, apparatus and system |
CN109871320A (en) * | 2019-01-21 | 2019-06-11 | 上海德启信息科技有限公司 | A kind of data processing method, device, application server and storage medium |
CN109918275A (en) * | 2019-01-17 | 2019-06-21 | 珠海金山网络游戏科技有限公司 | It is a kind of to realize the method, apparatus and system that pressure test is carried out to server performance |
CN110895498A (en) * | 2018-09-13 | 2020-03-20 | 深圳市蓝灯鱼智能科技有限公司 | Data storage method and device |
CN111966556A (en) * | 2020-08-18 | 2020-11-20 | 腾讯音乐娱乐科技(深圳)有限公司 | Performance pressure measurement method and device, server and computer readable storage medium |
-
2021
- 2021-03-09 CN CN202110257209.6A patent/CN113014657A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101388800A (en) * | 2007-09-12 | 2009-03-18 | 百度在线网络技术(北京)有限公司 | Method, device and system for pressed test to network performance of server |
US20140298101A1 (en) * | 2013-03-29 | 2014-10-02 | Inventec Corporation | Distributed pressure testing system and method |
CN108710565A (en) * | 2018-03-05 | 2018-10-26 | 聚好看科技股份有限公司 | A kind of method for testing pressure, apparatus and system |
CN110895498A (en) * | 2018-09-13 | 2020-03-20 | 深圳市蓝灯鱼智能科技有限公司 | Data storage method and device |
CN109918275A (en) * | 2019-01-17 | 2019-06-21 | 珠海金山网络游戏科技有限公司 | It is a kind of to realize the method, apparatus and system that pressure test is carried out to server performance |
CN109871320A (en) * | 2019-01-21 | 2019-06-11 | 上海德启信息科技有限公司 | A kind of data processing method, device, application server and storage medium |
CN111966556A (en) * | 2020-08-18 | 2020-11-20 | 腾讯音乐娱乐科技(深圳)有限公司 | Performance pressure measurement method and device, server and computer readable storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116723195A (en) * | 2023-08-11 | 2023-09-08 | 腾讯科技(深圳)有限公司 | Data transmission method, device, electronic equipment and storage medium |
CN116723195B (en) * | 2023-08-11 | 2023-10-20 | 腾讯科技(深圳)有限公司 | Data transmission method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10805380B2 (en) | Data transmission method and device | |
CN105099811A (en) | Interface testing method and device | |
JP2007534076A (en) | System and method for chat load management in a network chat environment | |
US10795744B2 (en) | Identifying failed customer experience in distributed computer systems | |
CN111818121A (en) | Live broadcast communication method and device, computer equipment and storage medium | |
CN112988013B (en) | Information interaction method and device and storage medium | |
WO2022028124A1 (en) | Screen projection state determination method, apparatus and device, and computer readable storage medium | |
CN105653597A (en) | Method and device for synchronously playing files at multiple ends | |
US20220171011A1 (en) | Positioning method and device, server, storage medium and terminal | |
CN112286723A (en) | Computer room disaster recovery control method, terminal and storage medium | |
EP3754998A1 (en) | Streaming media quality monitoring method and system | |
CN113377312A (en) | Same-screen interaction method and device, computer equipment and computer readable storage medium | |
CN113014657A (en) | Flow line switching method and device, storage medium and electronic equipment | |
CN109788251B (en) | Video processing method, device and storage medium | |
CN105471674A (en) | Method and system for testing performance of server | |
CN113849356A (en) | Equipment testing method and device, electronic equipment and storage medium | |
CN113434384B (en) | Pressure testing method and device | |
CN105721231B (en) | A kind of quality of service perception detection method and device | |
CN108462897A (en) | A kind of method of data capture and device of network failure | |
CN110990275B (en) | Page display test method and device for mobile banking | |
CN109412931B (en) | Method, device and terminal equipment for performing knowledge question answering by using instant messaging mode | |
CN102790780A (en) | Method and system for distance multimedia network education services | |
CN111552572A (en) | Task processing method, readable storage medium and electronic device | |
CN111930276B (en) | Page interaction method and device, storage medium and electronic equipment | |
CN112036819B (en) | Interaction method and device based on task image, medium and electronic equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210622 |
|
RJ01 | Rejection of invention patent application after publication |