CN112583926B - Short-link switching method, system, computer equipment and storage medium - Google Patents

Short-link switching method, system, computer equipment and storage medium Download PDF

Info

Publication number
CN112583926B
CN112583926B CN202011538868.9A CN202011538868A CN112583926B CN 112583926 B CN112583926 B CN 112583926B CN 202011538868 A CN202011538868 A CN 202011538868A CN 112583926 B CN112583926 B CN 112583926B
Authority
CN
China
Prior art keywords
long
connection
server
short
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
CN202011538868.9A
Other languages
Chinese (zh)
Other versions
CN112583926A (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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202011538868.9A priority Critical patent/CN112583926B/en
Publication of CN112583926A publication Critical patent/CN112583926A/en
Application granted granted Critical
Publication of CN112583926B publication Critical patent/CN112583926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions

Abstract

The invention relates to the technical field of Internet, and provides a short-link switching method, which comprises the following steps: generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result; judging whether a long communicating channel exists or not; if the long communication channel exists, switching the short connection request into a long connection request, and sending the long connection request to a long connection server based on the long communication channel, so that the long connection server switches the long connection request into the short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request; and if the long communication channel does not exist, sending the short connection request to a target server so that the target server returns a corresponding calling result according to the short connection request. The invention improves the communication efficiency between the servers, solves the problem of additional time consumption easily caused by channel non-reuse, and improves the communication efficiency and safety.

Description

Short-link switching method, system, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a short-link switching method, a short-link switching system, computer equipment and a computer readable storage medium.
Background
The HTTP protocol is a unidirectional protocol, i.e. a client can only request resources from a server, the server can only transmit data to a browser, and the server cannot actively transmit data to the client. The client requests a server for resources once through an http request, and processes such as three-way handshake for establishing connection, four-way waving for disconnecting connection, certificate verification and the like exist; and only when 3-way handshake is successful, data transmission can be performed without multiplexing channels, additional time consumption is easily caused, and the http requests cannot be uniformly managed when the number of the http requests is large. Therefore, how to solve the problem that additional time is easily consumed when the channels are not multiplexed and how to uniformly manage the http request so as to further improve the stability of data transmission becomes one of the technical problems that needs to be solved at present.
Disclosure of Invention
In view of the above, there is a need to provide a method, a system, a computer device and a computer readable storage medium for short-range switching, so as to solve the technical problems that additional time consumption is easily caused when the current channel is not reused, and the http request cannot be uniformly managed.
In order to achieve the above object, an embodiment of the present invention provides a short connection handover method, where the method includes:
generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result;
judging whether a long communicating channel exists or not;
if the long communication channel exists, the short connection request is switched into a long connection request, and the long connection request is sent to a long connection server based on the long communication channel, so that the long connection server switches the long connection request into the short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request; and
and if the long communication channel does not exist, sending the short connection request to the target server so that the target server can return a corresponding calling result according to the short connection request.
Illustratively, the method further comprises the step of establishing the long communication channel:
sending an access request to a long-connection routing server so that the long-connection routing server returns a corresponding long-connection server IP according to the access request; and
and establishing a long communication channel according to the long connection server IP and the corresponding long connection server.
Illustratively, the step of sending an access request to a long-connection routing server to enable the long-connection routing server to return a corresponding long-connection server IP according to the access request includes:
judging whether a normally running long connection server exists in a long connection server cluster associated with the long connection route server through the long connection route server; and
and if the long-connection server cluster has the normally-operated long-connection server, selecting the corresponding long-connection server from the normally-operated long-connection servers through the long-connection routing server according to the access request, and returning the corresponding long-connection server IP of the long-connection server.
Exemplary, also include:
monitoring whether a long connection server corresponding to the IP of the long connection server normally operates or not through the long connection route server; and
and if the long-connection server does not normally run, selecting a new long-connection server from the long-connection server cluster through the long-connection routing server according to the access request, and returning a corresponding new long-connection server IP of the new long-connection server.
For example, the step of switching the short connection request to a long connection request if the long connection channel exists, and sending the long connection request to a long connection server based on the long connection channel, so that the long connection server switches the long connection request to a short connection request and sends the short connection request to the target server, so that the target server returns a corresponding call result according to the short connection request includes:
monitoring whether a long-connection server cluster corresponding to the long-connection server normally operates or not through the long-connection routing server;
if the long-connection server group does not normally run, generating and returning degradation information through the long-connection routing server; and
and sending the short connection request to the target server according to the degradation information so that the target server returns a corresponding calling result according to the short connection request.
Illustratively, the step of switching the short connection request to a long connection request includes;
and configuring a corresponding sequence ID for each long connection request according to the request sequence of each short connection request so that the long connection server returns a corresponding calling result according to the sequence ID.
Exemplary, also include: and uploading the calling result to a block chain.
To achieve the above object, an embodiment of the present invention further provides a short connection switching system, including:
the generation module is used for generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result;
the judging module is used for judging whether a long communicating channel exists or not;
the switching module is used for switching the short connection request into a long connection request if the long connection channel exists, and sending the long connection request to a long connection server based on the long connection channel, so that the long connection server switches the long connection request into a short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request; and
and the sending module is used for sending the short connection request to the target server if the long connection channel does not exist, so that the target server returns a corresponding calling result according to the short connection request.
To achieve the above object, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the computer program implements the steps of the short-range switching method as described above.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and the computer program is executable by at least one processor, so that the at least one processor executes the steps of the short connection handover method as described above.
According to the short link switching method, the short link switching system, the computer equipment and the computer readable storage medium, the communication efficiency between the servers is improved by switching the short link to the long link, and the problem that extra time is easily consumed when channels are not multiplexed is solved; the long connection server has a unified control channel for all requests and data by establishing the long connection channel, so that the communication efficiency and safety are improved.
Drawings
Fig. 1 is a flowchart illustrating a short-range handover method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of program modules of a second embodiment of a short-range handover system according to the present invention.
Fig. 3 is a schematic diagram of a hardware structure of a third embodiment of the computer device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between the embodiments may be combined with each other, but must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory to each other or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In the following embodiments, the computer device 2 will be exemplarily described as an execution subject.
Example one
Referring to fig. 1, a flowchart of steps of a method for performing a short-range handover according to an embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by taking the computer device 2 as an execution subject. The details are as follows.
And S100, generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result.
When a user browses a web page through the computer device (target client) 2, the computer device 2 may generate the sms according to a script statement of the web page, an event (such as a click) triggered by the user on the web page, or a user instruction input by the user on the web page. The short connection request may be an http request, and is used to request the target server to return a corresponding call result.
Step S102, judging whether a long communication channel exists.
After obtaining the short connection request, the computer device 2 may determine whether a long connection channel exists between the long connection server and the computer device, where the long connection channel may be pre-established. The specific establishment steps of the long connecting channel are as follows.
In an exemplary embodiment, the short connection switching method may further include a step S200 to a step S202 of establishing a long connection channel, where: step S200, sending an access request to a long-connection routing server so that the long-connection routing server returns a corresponding long-connection server IP according to the access request; and step S202, establishing a long communication channel according to the long connection server IP and the corresponding long connection server.
After being started, the computer device 2 may generate an access request for accessing the long-connection routing server, and send the access request to the long-connection routing server, where the access request carries target information corresponding to the computer device 2, and the target information includes target client information associated with the computer device 2. After receiving the access request, the long-connection routing server may match a corresponding long-connection server for the computer device 2 according to the target information, and send the long-connection server IP corresponding to the long-connection server to the computer device 2. After obtaining the long connection server IP, the computer device 2 may establish a long connection channel with the corresponding long connection server according to the long connection server IP.
It should be noted that, each time the computer device 2 sends a request to the server through the http request, there are three handshakes for establishing a connection, four waving for disconnecting a connection, certificate verification, and the like, and extra time consumption is caused because the channels are not multiplexed; in order to solve these problems, the existing method switches the HTTP protocol to the websocket protocol (long link), that is, switches from the short link to the long link, when the client requests a resource from the server. The WebSocket protocol is a simple Socket simulation protocol established on the basis of Web and can be used for solving the problem that a client initiates a plurality of http requests to a server resource browser and extra time consumption is caused by long-time polling. However, most of the methods adopt a domain name connection method, and the connection method is low in power and efficiency. In order to solve the above problem, the embodiment establishes the long communication channel with the long connection server, thereby solving the problem of channel non-reuse and the problem of easily causing additional time consumption; the long connecting channel is established by the long connecting server IP and the corresponding long connecting server, so that the problems of low connecting power and low connecting efficiency are solved.
In an exemplary embodiment, the step S200 may further include a step S300 to a step S302, where: step S300, judging whether a normally running long connection server exists in a long connection server cluster associated with the long connection route server through the long connection route server; and step S302, if the long-connection server cluster has the normally running long-connection server, selecting the corresponding long-connection server from the normally running long-connection servers through the long-connection routing server according to the access request, and returning the corresponding long-connection server IP of the long-connection server.
For example, the long connection route server may pre-configure a preset load threshold for the long connection server cluster, and when a load value of a long connection server in the long connection server cluster is lower than the preset load threshold, the long connection server is a normally operating long connection server. It should be noted that the long-connection routing server may also configure preset thresholds corresponding to other parameters of the long-connection server for the long-connection server cluster, and determine whether the long-connection server is operating normally according to a plurality of preset thresholds.
After receiving the access request sent by the computer device 2, the long connection route server may determine, according to the access request, whether a long connection server that normally operates exists in a long connection server cluster currently associated with the long connection route server. If a normally-operated long connection server exists, the long connection routing server can obtain long connection server cluster information in advance according to the target information and the long connection routing server, select a corresponding long connection server from the normally-operated long connection servers for the computer equipment 2, and send a long connection server IP of the long connection server to the computer equipment 2, so that the computer equipment 2 establishes a long connection channel with the long connection server according to the long connection server IP. The long-connection routing server can acquire long-connection server cluster information in advance, wherein the long-connection server cluster information comprises information of load, fault report, double activities and the like of a long-connection server cluster; the long communication channel is used for transmitting a long connection request, namely a websocket request. In this embodiment, the transmission efficiency of the long communication channel is improved by matching the normally operating long connection server with the computer device 2.
In an exemplary embodiment, the method for short connection handover may further include steps S400 to S402, where: step S400, monitoring whether a long connection server corresponding to the IP of the long connection server normally runs or not through the long connection route server; and step S402, if the long-connection server does not normally operate, selecting a new long-connection server from the long-connection server cluster through the long-connection routing server according to the access request, and returning a new long-connection server IP corresponding to the new long-connection server.
After the computer device 2 establishes a long communication channel with the long connection server, the long connection routing server monitors whether the long connection server normally operates. For example, after the long-connection server is connected to the computer device 2, if the load of the long-connection server is too large or another fault occurs, the long-connection routing server may select a new long-connection server from the long-connection server cluster according to the access request, and return a new long-connection server IP corresponding to the new long-connection server. In this embodiment, whether the long connection server operates normally is monitored to ensure that the request sent by the computer device 2 can be transmitted normally, so as to further improve the transmission efficiency of the long connection channel.
And step S104, if the long communication channel exists, switching the short connection request into a long connection request, and sending the long connection request to a long connection server based on the long communication channel, so that the long connection server switches the long connection request into a short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request.
In this embodiment, in order to solve the problem that when a request is sent to a target server through the http request, a channel is not multiplexed and additional time is consumed, the computer device 2 may switch the short connection request to the long connection request, where switching the short connection request to the long connection request means that a protocol between the computer device 2 and the server is switched from the http protocol to the websocket protocol, that is, the short connection request is switched to the long connection request. It will be appreciated that, originally, the computer device 2 only had to communicate with the target server, the short-connection request is now switched to the long-connection request, and the computer device 2 only has to communicate with the long-connection server, i.e. the computer device 2 is switched from communicating with the target server to communicating with the long-connection server.
In the embodiment, the short connection request is switched to the long connection request mode, and the computer device 2 only needs to use the http mode when communicating for the first time (sending the access request to the long connection route server), so that the time consumption is reduced; after the long communication channel is established, the processes of handshaking, certificate verification, waving hands and the like are omitted in each communication between the server and the long communication channel, and performance consumption is reduced.
In an exemplary embodiment, the step S104 may further include a step S500 to a step S504, where: 500, monitoring whether a long-connection server cluster corresponding to the long-connection server normally operates or not through the long-connection routing server; step S502, if the long-connection server group does not normally run, generating and returning degradation information through the long-connection route server; and step S504, sending the short connection request to the target server according to the degradation information, so that the target server returns a corresponding calling result according to the short connection request.
Illustratively, when all short connection requests are switched to long connection requests, the long connection routing server can monitor the long connection server cluster, so that monitoring of the buried points and performance of all data is realized; the security mechanism of the application dispersed at the back end is unified in the security specification of the long-connection routing server; the method also realizes the combing of request parameter formats, extracts common parameters as basic information, reduces flow, improves communication efficiency and the like.
When the long-connection routing server monitors that the long-connection server cluster is subjected to collective shutdown upgrading or all the long-connection servers have faults, and the like, it indicates that the long-connection server cluster does not normally operate, and in order to ensure that the service (short-connection request) of the computer equipment 2 is normally performed, the computer equipment 2 can switch the long-connection request into a short-connection request mode, that is, directly send the short-connection request to the target server, so that the target server returns a corresponding calling result according to the short-connection request.
In an exemplary embodiment, the step S104 may further include: and configuring a corresponding sequence ID for each long connection request according to the request sequence of each short connection request so that the long connection server can return a corresponding calling result according to the sequence ID.
For example, the computer device 2 may configure a corresponding sequence id (serial number) for each long connection request according to the request sequence of each short connection request, and switch the short connection request carrying the sequence id into a long connection request to be sent to the long connection server. After the long connection server obtains the long connection request, the long connection request is switched to a short connection request carrying a sequence ID, the short connection request carrying the sequence ID is sent to a target server, so that the target server returns a corresponding calling result, and after the long connection server obtains the calling result, the calling result can be sent to the computer device 2 according to the sequence ID of the calling result pair. In the prior art, a client needs to send a request a and a request B, and then the request B needs to wait for the request data and data of the request a to be returned before requesting the data. In this embodiment, the sequence id is added so that each request carries its own serial number, and when the server returns data, it can know which request data is based on the serial number and then process the data. For example, the sequence and sequence number of the request are A:1, B:2, C:3, respectively, the sequence number returned by the server is 3, 1, 2, and then the server knows that the sequence returned is C, A, B, and the data can be processed correctly.
In some embodiments, the target server configuration may also be configured in a duplex mode, so that the target server actively pushes data to the computer device 2, which saves traffic and increases efficiency. According to the embodiment, the data interaction design between the ends is more flexible through a duplex mode, and more service scenes are met.
And step S106, if the long communication channel does not exist, the short connection request is sent to the target server, so that the target server returns a corresponding calling result according to the short connection request.
For example, if the long connection channel does not exist, it indicates that the current operation of the long connection server is abnormal, for example, a long connection server cluster has a shutdown upgrade, a complete fault, and the like, and in order to ensure that the service is normally performed by the computer device 2, the computer device 2 may send the short connection request to the server in a polling manner, so that the server returns a corresponding substitute result according to the short connection request.
According to the scheme, the communication efficiency between the computer equipment 2 and the server is improved by switching short connection to long connection; the long connection channel is established, so that the long connection server has a channel and a method for uniformly controlling all requests and data, and the communication efficiency and safety are improved.
Exemplarily, the method for short-range handover further includes: and uploading the calling result to a block chain.
For example, uploading the call result to the blockchain can ensure the security and fair transparency. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Example two
Fig. 2 is a schematic diagram of program modules of a second embodiment of a short-range handover system. The short-range switching system 20 may include or be divided into one or more program modules that are stored in a storage medium and executed by one or more processors to implement the present invention and implement the short-range switching method described above. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the short-circuit switching system 20 in the storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
the generating module 200 is configured to generate a short connection request according to a user instruction, where the short connection request is used to request a target server to return a corresponding call result.
And the judging module is used for judging whether a long communicating channel exists or not.
Illustratively, the short-range handover system 20 further includes an establishing module, configured to: sending an access request to a long-connection routing server so that the long-connection routing server returns a corresponding long-connection server IP according to the access request; and establishing a long communication channel according to the long connection server IP and the corresponding long connection server.
Illustratively, the establishing module is further configured to: judging whether a normally-operated long connection server exists in a long connection server cluster associated with the long connection route server or not through the long connection route server; and if the long-connection server cluster has the normally-operated long-connection server, selecting the corresponding long-connection server from the normally-operated long-connection servers through the long-connection routing server according to the access request, and returning the corresponding long-connection server IP of the long-connection server.
Illustratively, the establishing module is further configured to: monitoring whether a long connection server corresponding to the IP of the long connection server normally operates or not through the long connection route server; and if the long-connection server does not normally run, selecting a new long-connection server from the long-connection server cluster through the long-connection routing server according to the access request, and returning a corresponding new long-connection server IP of the new long-connection server.
And the switching module is used for switching the short connection request into a long connection request if the long connection channel exists, and sending the long connection request to a long connection server based on the long connection channel, so that the long connection server switches the long connection request into a short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request.
Illustratively, the switching module 204 is further configured to: monitoring whether a long-connection server cluster corresponding to the long-connection server normally operates or not through the long-connection routing server; if the long-connection server group does not normally run, generating and returning degradation information through the long-connection routing server; and sending the short connection request to the target server according to the degradation information so that the target server returns a corresponding calling result according to the short connection request.
Illustratively, the switching module 204 is further configured to: and configuring a corresponding sequence ID for each long connection request according to the request sequence of each short connection request so that the long connection server can return a corresponding calling result according to the sequence ID.
And the sending module is used for sending the short connection request to the target server if the long connection channel does not exist, so that the target server returns a corresponding calling result according to the short connection request.
Illustratively, the short-circuit switching system 20 further includes an uploading module, where the uploading module is configured to upload the calling result to the block chain.
EXAMPLE III
Fig. 3 is a schematic diagram of a hardware architecture of a computer device according to a third embodiment of the present invention. In this embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a cabinet server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown, the computing device 2 includes at least, but is not limited to, a memory 21, a processor 22, a network interface 23, and a short-circuit switching system 20 communicatively coupled to each other via a system bus.
In this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed in the computer device 2 and various application software, such as the program code of the short-circuit switching system 20 in the second embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the short-circuit switching system 20, so as to implement the short-circuit switching method according to the first embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the computer device 2 and other electronic apparatuses. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be an Intranet (Intranet), the Internet (Internet), a Global System for Mobile communications i/On (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, a Bluetooth (Bluetooth), a Wi-Fi, or other wireless or wired network.
It is noted that fig. 3 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the short-circuit switching system 20 stored in the memory 21 can also be divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 2 is a schematic diagram illustrating program modules for implementing the short-circuit switching system 20 according to a second embodiment of the present invention, in this embodiment, the short-circuit switching system 20 may be divided into a generating module 200, a determining module 202, a switching module 204, and a sending module 206. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the short-circuit switching system 20 in the computer device 2. The specific functions of the program modules 200-206 have been described in detail in the second embodiment, and are not described herein again.
Example four
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used in the short-range handover system 20, and when executed by a processor, the computer-readable storage medium implements the short-range handover method of the first embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A method for short-range handover, the method comprising:
generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result;
judging whether a long communicating channel exists or not; wherein the long connecting channel is pre-established;
if the long communication channel exists, the short connection request is switched into a long connection request, and the long connection request is sent to a long connection server based on the long communication channel, so that the long connection server switches the long connection request into the short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request; and
if the long communication channel does not exist, the short connection request is sent to the target server, so that the target server returns a corresponding calling result according to the short connection request;
wherein, the method also comprises the step of establishing the long connecting channel:
sending an access request to a long-connection routing server so that the long-connection routing server returns a corresponding long-connection server IP according to the access request; and
and establishing a long communication channel according to the long connection server IP and the corresponding long connection server.
2. The method for switching short connection according to claim 1, wherein the step of sending an access request to a long connection route server so that the long connection route server returns a corresponding long connection server IP according to the access request comprises:
judging whether a normally running long connection server exists in a long connection server cluster associated with the long connection route server through the long connection route server; and
and if the long-connection server cluster has the normally-operated long-connection server, selecting the corresponding long-connection server from the normally-operated long-connection servers through the long-connection routing server according to the access request, and returning the corresponding long-connection server IP of the long-connection server.
3. The method for short-range handover as claimed in claim 2, further comprising:
monitoring whether a long connection server corresponding to the IP of the long connection server normally operates or not through the long connection route server; and
and if the long-connection server does not normally operate, selecting a new long-connection server from the long-connection server cluster through the long-connection routing server according to the access request, and returning a new long-connection server IP corresponding to the new long-connection server.
4. The method for switching short connection according to claim 1, wherein the step of switching the short connection request to a long connection request if the long connection channel exists, and sending the long connection request to a long connection server based on the long connection channel, so that the long connection server switches the long connection request to the short connection request and sends the short connection request to the target server, so that the target server returns a corresponding call result according to the short connection request, comprises:
monitoring whether a long-connection server cluster corresponding to the long-connection server normally operates or not through the long-connection routing server;
if the long-connection server group does not normally run, generating and returning degradation information through the long-connection routing server; and
and sending the short connection request to the target server according to the degradation information so that the target server returns a corresponding calling result according to the short connection request.
5. The method for switching short connection according to claim 1, wherein the step of switching the short connection request to a long connection request comprises;
and configuring a corresponding sequence ID for each long connection request according to the request sequence of each short connection request so that the long connection server can return a corresponding calling result according to the sequence ID.
6. The method of claim 1, further comprising: and uploading the calling result to a block chain.
7. A short-range switching system, comprising:
the generation module is used for generating a short connection request according to a user instruction, wherein the short connection request is used for requesting a target server to return a corresponding calling result;
the judging module is used for judging whether a long communicating channel exists or not; wherein the long connecting channel is pre-established;
the switching module is used for switching the short connection request into a long connection request if the long connection channel exists, and sending the long connection request to a long connection server based on the long connection channel, so that the long connection server switches the long connection request into a short connection request and sends the short connection request to the target server, and the target server returns a corresponding calling result according to the short connection request; and
a sending module, configured to send the short connection request to the target server if the long connection channel does not exist, so that the target server returns a corresponding call result according to the short connection request;
wherein, the system further comprises an establishing module for: sending an access request to a long-connection routing server so that the long-connection routing server returns a corresponding long-connection server IP according to the access request; and establishing a long communication channel according to the long connection server IP and the corresponding long connection server.
8. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program, when executed by the processor, carries out the steps of the method of short handover as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored which is executable by at least one processor to cause the at least one processor to perform the steps of the method for short-range handover as claimed in any one of claims 1 to 6.
CN202011538868.9A 2020-12-23 2020-12-23 Short-link switching method, system, computer equipment and storage medium Active CN112583926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011538868.9A CN112583926B (en) 2020-12-23 2020-12-23 Short-link switching method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011538868.9A CN112583926B (en) 2020-12-23 2020-12-23 Short-link switching method, system, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112583926A CN112583926A (en) 2021-03-30
CN112583926B true CN112583926B (en) 2023-04-07

Family

ID=75139046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011538868.9A Active CN112583926B (en) 2020-12-23 2020-12-23 Short-link switching method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112583926B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015140908A1 (en) * 2014-03-17 2015-09-24 三菱電機株式会社 Management system, gateway apparatus, server apparatus, management method, gateway method, management process execution method, and program
CN107547484A (en) * 2016-06-29 2018-01-05 上海连尚网络科技有限公司 Message obtains, method, equipment and the system of push
CN109525624A (en) * 2017-09-20 2019-03-26 腾讯科技(深圳)有限公司 A kind of container login method, device and storage medium
CN109525853A (en) * 2018-11-29 2019-03-26 北京字节跳动网络技术有限公司 Direct broadcasting room cover methods of exhibiting, device, terminal, server and readable medium
CN109922053A (en) * 2019-02-22 2019-06-21 北京三快在线科技有限公司 Data transmission method, device, electronic equipment and readable storage medium storing program for executing
CN111225010A (en) * 2018-11-27 2020-06-02 北京京东尚科信息技术有限公司 Data processing method, data processing system and device
CN111262779A (en) * 2020-01-21 2020-06-09 香港乐蜜有限公司 Method, device, server and system for acquiring data in instant messaging
CN111428225A (en) * 2020-02-26 2020-07-17 深圳壹账通智能科技有限公司 Data interaction method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9143550B2 (en) * 2012-12-01 2015-09-22 Qualcomm Innovation Center, Inc. Graceful degradation of websocket connections to nonpersistent HTTP-based communications

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015140908A1 (en) * 2014-03-17 2015-09-24 三菱電機株式会社 Management system, gateway apparatus, server apparatus, management method, gateway method, management process execution method, and program
CN106134217A (en) * 2014-03-17 2016-11-16 三菱电机株式会社 Management system, gateway apparatus, server unit, management method, gateway approach, management process execution method and program
CN107547484A (en) * 2016-06-29 2018-01-05 上海连尚网络科技有限公司 Message obtains, method, equipment and the system of push
CN109525624A (en) * 2017-09-20 2019-03-26 腾讯科技(深圳)有限公司 A kind of container login method, device and storage medium
CN111225010A (en) * 2018-11-27 2020-06-02 北京京东尚科信息技术有限公司 Data processing method, data processing system and device
CN109525853A (en) * 2018-11-29 2019-03-26 北京字节跳动网络技术有限公司 Direct broadcasting room cover methods of exhibiting, device, terminal, server and readable medium
CN109922053A (en) * 2019-02-22 2019-06-21 北京三快在线科技有限公司 Data transmission method, device, electronic equipment and readable storage medium storing program for executing
CN111262779A (en) * 2020-01-21 2020-06-09 香港乐蜜有限公司 Method, device, server and system for acquiring data in instant messaging
CN111428225A (en) * 2020-02-26 2020-07-17 深圳壹账通智能科技有限公司 Data interaction method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一个典型的XSS框架注入攻击的分析和预防;查杭等;《通信技术》;20200110(第01期);全文 *

Also Published As

Publication number Publication date
CN112583926A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN109951514B (en) File processing method and system based on cloud storage and computer equipment
CN111756674B (en) Network communication method, system, device and computer readable storage medium
CN110971703B (en) Service request method, device, server and storage medium based on connection pool
CN112688907B (en) Combined equipment remote proof mode negotiation method, related equipment and storage medium
CN109600769B (en) Communication method and device
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN113364795B (en) Data transmission method and proxy server
CN113190778A (en) Business data pushing method, system, computer equipment and computer storage medium
CN111585805B (en) Smooth release upgrading method and device, computer system and readable storage medium
CN111614548A (en) Message pushing method and device, computer equipment and storage medium
CN111885197A (en) Data transmission method and device based on Internet of things, cloud platform and computer equipment
CN105933271B (en) Data processing method and device based on encryption machine
CN108289041B (en) Server information processing method and related device
CN112583926B (en) Short-link switching method, system, computer equipment and storage medium
CN107301053B (en) Picture configuration method and device and electronic terminal
CN112511621A (en) Data transmission method and device, storage medium, and electronic device
CN114257632B (en) Method and device for reconnecting broken wire, electronic equipment and readable storage medium
CN112039882B (en) Message transmission processing method, system, device and storage medium
CN115150162A (en) Root certificate updating method and device
CN111064636B (en) Control method, device and system for connection of front-end processor and computer equipment
CN113691510A (en) Cross-domain access control method, system, storage medium and equipment
CN110581861B (en) Outdoor networking method, acquisition server, acquisition system and storage medium
CN113535402A (en) Load balancing processing method and device based on 5G MEC and electronic equipment
CN113326333A (en) Data processing method, system, computer device and computer storage medium
CN110635927B (en) Node switching method, network node and network system

Legal Events

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