Abnormal processing method of signal relay device, target client and communication system

By implementing the exception handling method in the target client, detecting and forwarding it to a non-exceptional signal relay device, the problem of low processing efficiency of fault tolerance mechanism in the prior art is solved, and the stability of the distributed system is improved.

CN115733735BActive Publication Date: 2025-03-25中国邮政储蓄银行股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211435962.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2025-03-25
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

The processing efficiency of the fault tolerance mechanism in the prior art is low, resulting in poor stability of the distributed system. Especially when the signal relay device is abnormal, transaction requests are prone to access the abnormal nodes, causing avalanche effect and idempotence problems.

Method used

By implementing the exception handling method in the target client, the relevant information of all signal relay devices is obtained, and whether the closest first signal relay device is abnormal. If it is abnormal, other signal relay devices are detected until a non-exceptional second signal relay device is found, and the access request is forwarded to the device.

Benefits of technology

The processing efficiency of the fault tolerance mechanism is improved, communication is avoided on abnormal signal relay devices, and the occurrence of avalanche effect and idempotence problems is reduced, thereby improving the stability of the distributed system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115733735B_ABST
    Figure CN115733735B_ABST
Patent Text Reader

Abstract

The present application provides a signal relay device exception handling method, a target client, and a communication system. In this solution, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, an abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use a non-abnormal signal relay device to communicate, avoiding the use of an abnormal signal relay device for communication. Therefore, the fault-tolerant mechanism of this solution has a high processing efficiency, thereby improving the stability of the distributed system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communications, and in particular to an exception handling method for a signal relay device, a target client, a computer-readable storage medium, and a communication system. Background Art

[0002] In the microservice responsibility chain call mode, when a microservice processing request is abnormal, a fault tolerance mechanism is generally adopted. The fault tolerance mechanism includes isolation, timeout, current limiting, circuit breaking and degradation, etc., and the circuit breaking mechanism is generally adopted. However, in the general cluster fault tolerance mechanism, when the node (signal relay device) is abnormal, there will still be transaction requests that access the abnormal node (abnormal signal relay device), and in the case of node abnormality, an exception will be thrown immediately, and the request failure will be returned, which will cause an avalanche effect. If a request succeeds, the result will be returned immediately, which will also cause idempotence problems. Therefore, the current fault tolerance mechanism has low processing efficiency, resulting in poor stability of the distributed system. Summary of the invention

[0003] The main purpose of this application is to provide an exception handling method for a signal relay device, a target client, a computer-readable storage medium and a communication system to solve the problem that the current fault-tolerant mechanism in the prior art has low processing efficiency, resulting in poor stability of the distributed system.

[0004] According to one aspect of an embodiment of the present invention, a method for handling an exception of a signal relay device is provided, comprising: when an access request has been generated, a target client obtains relevant information of all signal relay devices, the signal relay device is used to send the access request sent by the target client to a target server, and the relevant information includes at least identification information; the target client determines a first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information; when the first signal relay device is not abnormal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server; when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server.

[0005] Optionally, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information until a second signal relay device that is not abnormal is determined, including: the target client obtains the relevant information of multiple signal relay devices other than the first signal relay device; the target client selects one signal relay device from the multiple signal relay devices as the signal relay device to be detected, and detects whether the signal relay device to be detected is abnormal based on the relevant information; when the signal relay device to be detected is not abnormal, the target client determines that the signal relay device to be detected is the second signal relay device; when the signal relay device to be detected is abnormal, the target client selects another signal relay device from the multiple signal relay devices and performs detection until the second signal relay device that is not abnormal is determined.

[0006] Optionally, the target client selects one of the signal relay devices from the multiple signal relay devices as the signal relay device to be detected, including: the target client adopts a random algorithm to randomly select one of the signal relay devices from the multiple signal relay devices other than the first signal relay device as the signal relay device to be detected.

[0007] Optionally, the target client selects one of the signal relay devices from the multiple signal relay devices as the signal relay device to be detected, including: the target client obtains weight information of performance parameters of each of the signal relay devices, the weight information refers to information about the importance of the performance parameters of the signal relay device in the score of the signal relay device, and the performance parameters include at least one of the following: delay duration of transmitted data, packet loss rate of transmitted data, bandwidth of transmitted data, rate of transmitted data, and distance between the signal relay device and the target client; the target client determines the scores corresponding to the multiple signal relay devices based on the weight information and the performance parameters; the target client determines that the signal relay device corresponding to the highest score is the signal relay device to be detected.

[0008] Optionally, the target client selects one of the signal relay devices from the multiple signal relay devices as the signal relay device to be detected, including: the target client obtains the first target parameter and the second target parameter of each of the signal relay devices, the first target parameter includes at least one of the following: the delay duration of the transmitted data, the packet loss rate of the transmitted data, and the second target parameter includes at least one of the following: the bandwidth of the transmitted data, the rate of the transmitted data; the target client sorts the multiple signal relay devices in ascending order according to the first target parameter to obtain a plurality of sorted signal relay devices, or the target client sorts the multiple signal relay devices in descending order according to the second target parameter to obtain a plurality of sorted signal relay devices; the target client determines that the signal relay device with the earliest sequence number among the multiple sorted signal relay devices is the signal relay device to be detected.

[0009] Optionally, the relevant information includes the number of transactions that are completed within the time limit, and detecting whether the first signal relay device is abnormal based on the relevant information includes: when the number of transactions that are completed within the time limit is greater than or equal to a first number threshold, the target client determines that the first signal relay device is abnormal; when the number of transactions that are completed within the time limit is greater than or equal to a second number threshold and less than the first number threshold, the target client determines that the first signal relay device is not abnormal, and the first number threshold is greater than the second number threshold; when the number of transactions that are completed within the time limit is greater than or equal to a third number threshold and less than the second number threshold, the target client determines that the first signal relay device is not abnormal, and the second number threshold is greater than the third number threshold.

[0010] Optionally, the method also includes: when the target client detects that the signal relay device is abnormal, the target client locks the abnormal signal relay device and generates an abnormal time of the abnormal signal relay device, wherein when the signal relay device is in a locked state, a non-target client does not communicate with the signal relay device, and the abnormal time refers to the current time when the signal relay device is detected to be abnormal; when the target client detects that the signal relay device is not abnormal, the target client determines that the non-abnormal signal relay device is the target signal relay device and locks the target signal relay device, wherein when the target signal relay device is in a locked state, the non-target client does not communicate with the target signal relay device.

[0011] According to another aspect of an embodiment of the present invention, a target client is also provided, including: an acquisition unit, used to acquire relevant information of all signal relay devices when an access request has been generated, the signal relay device being used to send the access request sent by the target client to a target server, and the relevant information including at least identification information; a first processing unit, used to determine a first signal relay device that is closest to the target client, and detect whether the first signal relay device is abnormal based on the relevant information; a second processing unit, used to send the access request to the first signal relay device when the first signal relay device is not abnormal, so that the first signal relay device sends the access request to the target server; a third processing unit, used to detect whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information when the first signal relay device is abnormal, until a non-abnormal second signal relay device is determined, and send the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server.

[0012] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the methods described.

[0013] According to another aspect of an embodiment of the present invention, a communication system is also provided, including: a client, a signal relay device and a target server, wherein the signal relay device communicates with the client and the target server respectively, and the client is used to execute any one of the methods described.

[0014] In an embodiment of the present invention, first, when an access request has been generated, the target client obtains relevant information of all signal relay devices, and then the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information. Then, if the first signal relay device is not abnormal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server. Finally, if the first signal relay device is abnormal, the target client detects whether signal relay devices other than the first signal relay device are abnormal based on the relevant information, until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0016] Figure 1 A schematic flow chart of an abnormality handling method of a signal relay device according to an embodiment of the present application is shown;

[0017] Figure 2 A schematic diagram of the structure of a client according to an embodiment of the present application is shown;

[0018] Figure 3 A flow chart of another method for handling an exception of a signal relay device is shown. DETAILED DESCRIPTION

[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0020] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.

[0023] In the microservice responsibility chain calling mode, when a microservice processes a request abnormally, a fault-tolerant mechanism is generally adopted. When the abnormal requests reach a certain threshold within a period of time, the circuit breaker will be triggered. The signal relay device will quickly reject the subsequent requests for a period of time. The target client will release a request at regular intervals to check whether the signal relay device has been restored. If the signal relay device has been restored, the circuit breaker state will be exited, otherwise the microservice will continue to maintain the circuit breaker state.

[0024] In the current solution, the fault tolerance mechanism still has the following shortcomings:

[0025] 1. Access request failure cannot automatically switch to other signal relay devices, so abnormal signal relay devices cannot be identified. During the abnormal period of signal relay devices, there will still be transaction access requests to abnormal signal relay devices;

[0026] 2. An exception is thrown immediately after the access request fails, which will cause all requests on the abnormal signal relay device to be returned as failures, reducing the user experience. In addition, each transaction on the abnormal signal relay device will go through the entire abnormal processing process. If the abnormality is a timeout or blockage, and the signal relay device is in an abnormal state for a long time, it is easy to cause an avalanche effect;

[0027] 3. Call multiple service providers in parallel. As long as one request returns successfully, the result will be returned immediately. This method will have idempotency problems. The application providing the service needs to handle idempotency, which increases the workload of development.

[0028] As mentioned in the background technology, the current fault-tolerant mechanism in the prior art has low processing efficiency, resulting in poor stability of the distributed system. In order to solve the above problem, in a typical implementation of the present application, a signal relay device exception handling method, a target client, a computer-readable storage medium and a communication system are provided.

[0029] According to an embodiment of the present application, a method for handling an exception of a signal relay device is provided.

[0030] Figure 1 FIG. 1 is a flowchart of a method for handling an abnormality of a signal relay device according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0031] Step S101, when an access request has been generated, the target client obtains relevant information of all signal relay devices, the signal relay devices are used to send the access request sent by the target client to the target server, and the relevant information includes at least identification information;

[0032] Specifically, the signal relay device is a device for communication between the target client and the target server, and may be a router, a repeater, a gateway, a switch, etc. The identification information may be ID information.

[0033] In the above step S101, the target client can first obtain relevant information of all signal relay devices, so that it can subsequently find the first signal relay device that is closest to the target client from multiple signal relay devices. At the same time, the target client can also detect whether the signal relay device is abnormal based on the relevant information of the signal relay device, and then determine whether abnormal transfer is needed based on the detected results.

[0034] Step S102, the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information;

[0035] Specifically, there are three signal relay devices, namely signal relay device A, signal relay device B and signal relay device C. Signal relay device A is located in area A, signal relay device B is located in area B, signal relay device C is located in area C, and the target client is located in area A. The target client obtains relevant information of signal relay device A, relevant information of signal relay device B and relevant information of signal relay device C. Signal relay device A is closest to the target client, so the target client determines that signal relay device A is the first signal relay device.

[0036] In the above step S102, the first signal relay device that is closest to the target client can be determined, so that when the target client subsequently sends an access request, it can be sent to the first signal relay device that is closest to the target client, which can ensure a faster signal transmission rate. In this step, it is also necessary to detect whether the first signal relay device is abnormal, and subsequently abnormal transfer can be performed when the first signal relay device is abnormal.

[0037] Step S103, the target client sends the access request to the first signal relay device when the first signal relay device is normal, so that the first signal relay device sends the access request to the target server;

[0038] In the above step S103, if the target client determines that the first signal relay device is in a non-abnormal state, then the access request can be sent directly to the first signal relay device, so that the first signal relay device closest to the target client can be used for communication, and the access request is sent to the target server via the first signal relay device, and the target server can process based on the access request.

[0039] Step S104, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information until a normal second signal relay device is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server.

[0040] Specifically, if the target client determines that the first signal relay device is in an abnormal state, it may select again from a plurality of signal relay devices and perform detection until a second signal relay device without abnormality is determined.

[0041] Optionally, the target client can also modify the accessible identifier of the first signal relay device to the first identifier when the first signal relay device is normal. The target client can also modify the accessible identifier of the first signal relay device to the second identifier when the first signal relay device is abnormal. The first identifier can be true and the second identifier can be false.

[0042] In the above step S104, when the target client accesses the first signal relay device, if the first signal relay device is abnormal and cannot process the request, it will cause the subsequent transactions on the first signal relay device to fail to proceed normally. In this solution, the abnormality is transferred, that is, when the first signal relay device is abnormal, the target client can transfer the access request to the second signal relay device that can process the transaction normally (transfer the access request to the non-abnormal second signal relay device). And when there is no abnormality in the first relay device, the subsequent target client can continue to send the access request to the first signal relay device.

[0043] In the above method, first, when an access request has been generated, the target client obtains relevant information of all signal relay devices, and then the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information. Then, if the first signal relay device is not abnormal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server. Finally, if the first signal relay device is abnormal, the target client detects whether signal relay devices other than the first signal relay device are abnormal based on the relevant information, until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system.

[0044] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0045] In the process of abnormal transfer, a signal relay device can be first selected as the signal relay device to be detected, and then the signal relay device to be detected can be detected. If the signal relay device to be detected is abnormal, abnormal transfer is performed again until a second signal relay device that is not abnormal is found. In order to further accurately determine the second signal relay device, further perform abnormal transfer more efficiently, and further improve the stability of the distributed system, in an embodiment of the present application, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal according to the relevant information until a second signal relay device that is not abnormal is determined, which specifically includes the following steps:

[0046] Step S401, the target client obtains the relevant information of the plurality of signal relay devices except the first signal relay device;

[0047] Step S402, the target client selects one of the signal relay devices as a signal relay device to be detected from the plurality of signal relay devices, and detects whether the signal relay device to be detected is abnormal according to the relevant information;

[0048] Specifically, there are many ways to select the signal relay device, such as selecting according to a random algorithm, selecting according to a weight strategy, selecting according to a sequential algorithm, and the like.

[0049] In a specific embodiment of the present application, the target client selects one of the signal relay devices as the signal relay device to be detected from the multiple signal relay devices, including: the target client uses a random algorithm to randomly select one of the signal relay devices from the multiple signal relay devices other than the first signal relay device as the signal relay device to be detected. In this embodiment, the signal relay device can be selected by a random algorithm, which can ensure that the randomness of the selected signal relay device is good, and the selection anomaly caused by selecting the same signal relay device in multiple selections will not occur, which can ensure that the transaction load capacity of the selected signal relay device is relatively balanced.

[0050] For example, there are three signal relay devices, namely signal relay device A, signal relay device B and signal relay device C. The first time a random algorithm is used to select signal relay device A, the second time a random algorithm is used to select signal relay device C, and the third time a random algorithm is used, signal relay device C may still be selected. This is to avoid the situation where, during multiple selections, signal relay device A is selected because it is close to the target client. In this way, the transaction load capacity of signal relay device A will be reduced.

[0051] In another specific embodiment of the present application, the target client selects one of the signal relay devices as the signal relay device to be detected from the multiple signal relay devices, including: the target client obtains the weight information of the performance parameters of each of the signal relay devices, the weight information refers to the information of the importance of the performance parameters of the signal relay device in the score of the signal relay device, and the performance parameters include at least one of the following: the delay time of the transmitted data, the packet loss rate of the transmitted data, the bandwidth of the transmitted data, the rate of the transmitted data, and the distance between the signal relay device and the target client; the target client determines the scores corresponding to the multiple signal relay devices according to the weight information and the performance parameters; the target client determines the signal relay device corresponding to the highest score as the signal relay device to be detected. In this embodiment, the signal relay device can be selected by the weight strategy, so that the performance of the selected signal relay device can be guaranteed to be the best, and the target client can use the best signal relay device to communicate with the target server, thereby ensuring good communication efficiency.

[0052] For example, there are three signal relay devices, namely signal relay device A, signal relay device B and signal relay device C. The three signal relay devices are scored using delay duration and packet loss rate. The weight information of packet loss rate is 80%, and the weight information of delay duration is 20%. As a result, the score of signal relay device A is 85 points, the score of signal relay device B is 70 points, and the score of signal relay device C is 90 points. Therefore, signal relay device C is determined to be the optimal communication device.

[0053] In another embodiment of the present application, the target client selects one of the signal relay devices as the signal relay device to be detected from the multiple signal relay devices, including: the target client obtains the first target parameter and the second target parameter of each of the signal relay devices, the first target parameter includes at least one of the following: the delay duration of the transmitted data, the packet loss rate of the transmitted data, and the second target parameter includes at least one of the following: the bandwidth of the transmitted data, the rate of the transmitted data; the target client sorts the multiple signal relay devices in ascending order according to the first target parameter to obtain the sorted multiple signal relay devices, or the target client sorts the multiple signal relay devices in descending order according to the second target parameter to obtain the sorted multiple signal relay devices; the target client determines that the signal relay device with the frontmost sequence number among the sorted multiple signal relay devices is the signal relay device to be detected. In this embodiment, multiple signal relay devices can be sorted according to the first target parameter and the second target parameter, and the optimal signal relay device can be found through a sequential algorithm. For the first target parameter, the smaller the better, for example, the smaller the packet loss rate, the better, and for the second target parameter, the larger the better, for example, the faster the rate, the better. In this way, the sorting algorithm can ensure that the performance of the selected signal relay device is optimal, ensuring that the target client can use the optimal signal relay device to communicate with the target server, thereby ensuring good communication efficiency.

[0054] For example, there are three signal relay devices, namely signal relay device A, signal relay device B and signal relay device C. The first target parameter is packet loss rate, and the second target parameter is rate. The three signal relay devices are sorted using the first target parameter and the second target parameter respectively. The packet loss rate of signal relay device A is 10%, and the rate is 80KB / S, the packet loss rate of signal relay device B is 2%, and the rate is 150MB / S, and the packet loss rate of signal relay device C is 15%, and the rate is 200KB / S. The three signal relay devices are sorted according to the packet loss rate, and the order obtained is signal relay device B, signal relay device A and signal relay device C. The three signal relay devices are sorted according to the rate, and the order obtained is signal relay device B, signal relay device C and signal relay device A. In both sortings, signal relay device B has the earliest sequence number, so signal relay device B is determined to be the signal relay device to be detected.

[0055] Step S403, the target client determines that the signal relay device to be detected is the second signal relay device when the signal relay device to be detected is normal;

[0056] Step S404: when the signal relay device to be detected is abnormal, the target client selects another signal relay device from the plurality of signal relay devices and performs detection until the second signal relay device without abnormality is determined.

[0057] Specifically, if the signal relay device selected for the first time is abnormal, then a second selection is performed. If the signal relay device selected for the second time is still abnormal, then a third selection is performed, and so on, until the signal relay device selected for the Nth time is normal.

[0058] In the above-mentioned steps S401 to S404, when the first signal relay device is abnormal, a signal relay device is selected from multiple relay devices other than the first signal relay device as the signal relay device to be detected, and the signal relay device to be detected is detected. If the signal relay device selected for the first time is abnormal, then a second selection is performed. If the signal relay device selected for the second time is abnormal, then a third selection is performed, until the signal relay device selected for the Nth time is normal, then the signal relay device without abnormality is the second relay device.

[0059] In addition, if all signal relay devices are abnormal and no non-abnormal signal relay devices are detected, the target client will directly block the transaction and generate abnormal information to prompt the user that all signal relay devices are in an abnormal state.

[0060] In order to further accurately determine whether the first signal relay device is abnormal, in another embodiment of the present application, the above-mentioned relevant information includes the number of transactions completed in timeout, and detecting whether the above-mentioned first signal relay device is abnormal according to the above-mentioned relevant information specifically includes the following steps:

[0061] Step S201, when the number of transactions completed in timeout by the target client is greater than or equal to a first number threshold, determining that the first signal relay device is abnormal;

[0062] Specifically, when the total transaction quantity is 100, the first quantity threshold may be 80, and of course, may also be any other feasible value.

[0063] When the number of transactions completed within the timeout period is greater than or equal to the first quantity threshold, the target client may also generate first alarm information to prompt that the first signal relay device is currently in an abnormal situation.

[0064] Step S202, when the number of transactions completed by the target client within the timeout period is greater than or equal to the second number threshold and less than the first number threshold, it is determined that the first signal relay device is normal and the first number threshold is greater than the second number threshold;

[0065] Specifically, when the total transaction quantity is 100, the second quantity threshold may be 60, and of course, may also be any other feasible value.

[0066] When the number of transactions completed in timeout is greater than or equal to the second number threshold and less than the first number threshold, the target client can also generate a second alarm message to prompt the first signal relay device that the current transaction load capacity is poor and the number of transactions is too large.

[0067] Step S203: When the number of transactions completed within the timeout period of the target client is greater than or equal to the third number threshold and less than the second number threshold, it is determined that the first signal relay device is normal and the second number threshold is greater than the third number threshold.

[0068] Specifically, when the total transaction quantity is 100, the third quantity threshold may be 0, or, of course, any other feasible value.

[0069] Of course, in actual applications, whether the first signal relay device is abnormal can be determined not only based on the number of transactions that have timed out, but also based on the network connection status, the heartbeat of the first signal relay device and any other feasible parameters.

[0070] In the above steps S201 to S203, the number of transactions completed by the first signal relay device in timeout can be used to further accurately determine whether the first signal relay device is abnormal, thereby further ensuring that the detection accuracy of this solution is high.

[0071] In another practical application, the first signal relay device may be directly frozen or down. In this case, if the target client cannot receive a reply from the first signal relay device within the target time, it is directly determined that the first signal relay device is abnormal.

[0072] In another embodiment of the present application, the above method further includes the following steps:

[0073] Step S105, when the target client detects that the signal relay device is abnormal, the target client locks the abnormal signal relay device and generates an abnormal time of the abnormal signal relay device, wherein when the signal relay device is in a locked state, the non-target client does not communicate with the signal relay device, and the abnormal time refers to the current time when the abnormality of the signal relay device is detected;

[0074] Step S106, when the target client detects that the signal relay device is normal, it determines that the signal relay device that is not abnormal is the target signal relay device, and locks the target signal relay device, wherein when the target signal relay device is in a locked state, the non-target client does not communicate with the target signal relay device.

[0075] In the above-mentioned steps S105 to S106, when the signal relay device is abnormal, the abnormal signal relay device can be locked, so that non-target clients will not communicate with the abnormal signal relay device, avoiding the non-target clients from accessing the abnormal signal relay device. When the signal relay device is not abnormal, the non-abnormal signal relay device can be determined as the target signal relay device, and the target signal relay device can be locked. In this way, during the communication between the target client and the target signal relay device, the non-target client will not communicate with the target signal relay device, avoiding the avalanche problem caused by multiple clients sending access requests to the target signal relay device at the same time.

[0076] Specifically, when the abnormal signal relay device subsequently returns to normal, the signal relay device can be unlocked. After the target client completes communication with the target signal relay device, the target signal relay device can also be unlocked. This is to ensure that the client and the signal relay device are communicating one-to-one at the same time.

[0077] The embodiment of the present application also provides a target client. It should be noted that the target client of the embodiment of the present application can be used to execute the abnormality handling method for the signal relay device provided in the embodiment of the present application. The target client provided in the embodiment of the present application is introduced below.

[0078] Figure 2 is a schematic diagram of a target client according to an embodiment of the present application. Figure 2 As shown, the target client includes:

[0079] The acquisition unit 10 is used to acquire relevant information of all signal relay devices when an access request has been generated, the signal relay devices being used to send the access request sent by the target client to the target server, the relevant information at least including identification information;

[0080] The above-mentioned acquisition unit can first obtain the relevant information of all signal relay devices, so that subsequently it can find the first signal relay device that is closest to the target client from multiple signal relay devices. At the same time, it can also detect whether the signal relay device is abnormal based on the relevant information of the signal relay device. Subsequently, it can determine whether abnormal transfer is needed based on the detection results.

[0081] The first processing unit 20 is used to determine the first signal relay device that is closest to the target client, and detect whether the first signal relay device is abnormal according to the relevant information;

[0082] The above-mentioned first processing unit can determine the first signal relay device that is closest to the target client, so that when the subsequent target client sends an access request, it can be sent to the first signal relay device that is closest to the target client, which can ensure a faster signal transmission rate. In this step, it is also necessary to detect whether the first signal relay device is abnormal, and subsequently abnormal transfer can be performed when the first signal relay device is abnormal.

[0083] The second processing unit 30 is used to send the access request to the first signal relay device when the first signal relay device is normal, so that the first signal relay device sends the access request to the target server;

[0084] The above-mentioned second processing unit, if it is determined that the first signal relay device is in a non-abnormal state, can directly send the access request to the first signal relay device, so that the first signal relay device closest to the target client can be used for communication, and the access request can be sent to the target server via the first signal relay device, and the target server can process based on the access request.

[0085] The third processing unit 40 is used for detecting whether the above-mentioned signal relay devices other than the above-mentioned first signal relay device are abnormal according to the above-mentioned relevant information when the above-mentioned first signal relay device is abnormal, until a non-abnormal second signal relay device is determined, and sending the above-mentioned access request to the above-mentioned second signal relay device, so that the above-mentioned second signal relay device sends the above-mentioned access request to the above-mentioned target server.

[0086] When the third processing unit accesses the first signal relay device, if the first signal relay device is abnormal and cannot process the request, subsequent transactions on the first signal relay device cannot proceed normally. In this solution, the abnormality is transferred, that is, when the first signal relay device is abnormal, the target client can transfer the access request to the second signal relay device that can process the transaction normally (transfer the access request to the non-abnormal second signal relay device). And when there is no abnormality in the first relay device, the subsequent target client can continue to send the access request to the first signal relay device.

[0087] In the above-mentioned target client, the acquisition unit obtains relevant information of all signal relay devices when an access request has been generated. The first processing unit determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information. The second processing unit sends the access request to the first signal relay device when the first signal relay device is not abnormal, so that the first signal relay device sends the access request to the target server. The third processing unit detects whether signal relay devices other than the first signal relay device are abnormal based on the relevant information when the first signal relay device is abnormal, until a non-abnormal second signal relay device is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system.

[0088] In the process of abnormal transfer, a signal relay device can be first selected as the signal relay device to be detected, and then the signal relay device to be detected can be detected. If the signal relay device to be detected is abnormal, then the abnormal transfer is performed again until a non-abnormal second signal relay device is found. In order to further accurately determine the second signal relay device, further perform abnormal transfer more efficiently, and further improve the stability of the distributed system, in an embodiment of the present application, the third processing unit includes an acquisition module, a first processing module, a first determination module, and a second processing module. The functions of each module are as follows:

[0089] An acquisition module, used to acquire the above-mentioned relevant information of the plurality of the above-mentioned signal relay devices except the above-mentioned first signal relay device;

[0090] A first processing module is used to select one of the above signal relay devices as the signal relay device to be detected from the multiple signal relay devices, and detect whether the above signal relay device to be detected is abnormal according to the above relevant information;

[0091] In a specific embodiment of the present application, the first processing module includes a first processing submodule, and the first processing submodule is used to use a random algorithm to randomly select one of the above-mentioned signal relay devices from the above-mentioned multiple signal relay devices other than the above-mentioned first signal relay device as the above-mentioned signal relay device to be detected. In this embodiment, the signal relay device can be selected by a random algorithm, which can ensure that the randomness of the selected signal relay device is good, and the selection anomaly caused by selecting the same signal relay device in multiple selections will not occur, which can ensure that the transaction load capacity of the selected signal relay device is relatively balanced.

[0092] In another specific embodiment of the present application, the first processing module includes a first acquisition submodule, a first determination submodule and a second determination submodule, the first acquisition submodule is used to obtain the weight information of the performance parameters of each of the above-mentioned signal relay devices, the above-mentioned weight information refers to the information of the importance of the above-mentioned performance parameters of the above-mentioned signal relay devices in the score of the above-mentioned signal relay devices, and the above-mentioned performance parameters include at least one of the following: the delay time of the transmission data, the packet loss rate of the transmission data, the bandwidth of the transmission data, the rate of the transmission data, and the distance between the above-mentioned signal relay device and the above-mentioned target client; the first determination submodule is used to determine the above-mentioned scores corresponding to the above-mentioned multiple signal relay devices according to the above-mentioned weight information and the above-mentioned performance parameters; the second determination submodule is used to determine that the above-mentioned signal relay device corresponding to the highest score is the above-mentioned signal relay device to be detected. In this embodiment, the signal relay device can be selected by the weight strategy, so that the performance of the selected signal relay device can be guaranteed to be the best, and the target client can use the best signal relay device to communicate with the target server, thereby ensuring good communication efficiency.

[0093] In another embodiment of the present application, the first processing module includes a second acquisition submodule, a third processing submodule and a third determination submodule, the second acquisition submodule is used to acquire the first target parameter and the second target parameter of each of the above-mentioned signal relay devices, the above-mentioned first target parameter includes at least one of the following: the delay duration of the transmission data, the packet loss rate of the transmission data, and the above-mentioned second target parameter includes at least one of the following: the bandwidth of the transmission data, the rate of the transmission data; the third processing submodule is used to sort the multiple above-mentioned signal relay devices in ascending order according to the above-mentioned first target parameter to obtain the multiple sorted signal relay devices, or, sort the multiple above-mentioned signal relay devices in descending order according to the above-mentioned second target parameter to obtain the multiple sorted signal relay devices; the third determination submodule is used to determine that the above-mentioned signal relay device with the frontmost sequence number among the multiple sorted signal relay devices is the above-mentioned signal relay device to be detected. In this embodiment, multiple signal relay devices can be sorted according to the first target parameter and the second target parameter, and the optimal signal relay device can be found through a sequential algorithm. For the first target parameter, the smaller the better, for example, the smaller the packet loss rate, the better, and for the second target parameter, the larger the better, for example, the faster the rate, the better. In this way, the sorting algorithm can ensure that the performance of the selected signal relay device is optimal, ensuring that the target client can use the optimal signal relay device to communicate with the target server, thereby ensuring good communication efficiency.

[0094] A first determination module is used to determine that the signal relay device to be detected is the second signal relay device when the signal relay device to be detected is normal;

[0095] The second processing module is used to select another signal relay device from the plurality of signal relay devices and perform detection when the signal relay device to be detected is abnormal, until the second signal relay device without abnormality is determined.

[0096] The above-mentioned acquisition module, first processing module, first determination module and second processing module, when the first signal relay device is abnormal, select a signal relay device from multiple relay devices other than the first signal relay device as the signal relay device to be detected, and detect the signal relay device to be detected. If the signal relay device selected for the first time is abnormal, then a second selection is performed. If the signal relay device selected for the second time is abnormal, then a third selection is performed, until the signal relay device selected for the Nth time is normal, then the signal relay device without abnormality is the second relay device.

[0097] In order to further accurately determine whether the first signal relay device is abnormal, in another embodiment of the present application, the above-mentioned relevant information includes the number of transactions completed in timeout, and the first processing unit includes a second determination module, a third determination module and a fourth determination module, and the functions of each module are as follows:

[0098] A second determination module is used to determine that the first signal relay device is abnormal when the number of transactions completed within the timeout period is greater than or equal to a first number threshold;

[0099] A third determination module is used to determine that the first signal relay device is not abnormal, and the first quantity threshold is greater than the second quantity threshold, when the transaction quantity of the timed-out transaction is greater than or equal to the second quantity threshold and less than the first quantity threshold;

[0100] The fourth determination module is used to determine that the first signal relay device is not abnormal and the second quantity threshold is greater than the third quantity threshold when the transaction quantity of the timed-out transactions is greater than or equal to the third quantity threshold and less than the second quantity threshold.

[0101] The second determination module, the third determination module and the fourth determination module can further accurately determine whether the first signal relay device is abnormal by the number of transactions completed by the first signal relay device in timeout, thereby further ensuring that the detection accuracy of this solution is high.

[0102] In another embodiment of the present application, the target client further includes a fourth processing unit and a fifth processing unit, and the functions are as follows:

[0103] a fourth processing unit, configured to lock the abnormal signal relay device when an abnormality is detected in the signal relay device, and generate an abnormal time of the abnormal signal relay device, wherein when the signal relay device is in a locked state, the non-target client does not communicate with the signal relay device, and the abnormal time refers to the current time when the abnormality of the signal relay device is detected;

[0104] The fifth processing unit is used to, when it is detected that the above-mentioned signal relay device is not abnormal, determine that the above-mentioned signal relay device that is not abnormal is the target signal relay device, and lock the above-mentioned target signal relay device, wherein, when the above-mentioned target signal relay device is in a locked state, the above-mentioned non-target client does not communicate with the above-mentioned target signal relay device.

[0105] The above-mentioned fourth processing unit and fifth processing unit can lock the abnormal signal relay device when the signal relay device is abnormal, so that non-target clients will not communicate with the abnormal signal relay device, avoiding the non-target clients from accessing the abnormal signal relay device; and when the signal relay device is not abnormal, it can be determined that the non-abnormal signal relay device is the target signal relay device, and the target signal relay device can be locked, so that during the communication between the target client and the target signal relay device, the non-target client will not communicate with the target signal relay device, avoiding the avalanche problem caused by multiple clients sending access requests to the target signal relay device at the same time.

[0106] The client includes a processor and a memory. The acquisition unit, the first processing unit, the second processing unit and the third processing unit are all stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions.

[0107] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the stability of the distributed system can be improved by adjusting the kernel parameters.

[0108] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0109] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned exception handling method of the signal relay device is implemented.

[0110] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the exception handling method of the signal relay device is executed when the program is running.

[0111] The present invention also provides a communication system, including a client, a signal relay device and a target server, wherein the signal relay device communicates with the client and the target server respectively, and the client is used to execute any one of the above methods.

[0112] In the above-mentioned system, since it includes any one of the above-mentioned methods, in this method, first, when an access request has been generated, the target client obtains relevant information of all signal relay devices, and then the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information. Then, when the first signal relay device is not abnormal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server. Finally, when the first signal relay device is abnormal, the target client detects whether signal relay devices other than the first signal relay device are abnormal based on the relevant information, until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system.

[0113] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:

[0114] Step S101, when an access request has been generated, the target client obtains relevant information of all signal relay devices, the signal relay devices are used to send the access request sent by the target client to the target server, and the relevant information includes at least identification information;

[0115] Step S102, the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information;

[0116] Step S103, the target client sends the access request to the first signal relay device when the first signal relay device is normal, so that the first signal relay device sends the access request to the target server;

[0117] Step S104, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information until a normal second signal relay device is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server.

[0118] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0119] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:

[0120] Step S101, when an access request has been generated, the target client obtains relevant information of all signal relay devices, the signal relay devices are used to send the access request sent by the target client to the target server, and the relevant information includes at least identification information;

[0121] Step S102, the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information;

[0122] Step S103, the target client sends the access request to the first signal relay device when the first signal relay device is normal, so that the first signal relay device sends the access request to the target server;

[0123] Step S104, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information until a normal second signal relay device is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server.

[0124] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the technical solution and technical effects of the present application will be explained below in conjunction with specific embodiments.

[0125] Example

[0126] This embodiment relates to a method for handling abnormalities in a signal relay device, such as Figure 3 As shown, the method includes:

[0127] The target client starts to access the first signal relay device. If the first signal relay device has an abnormality, the transaction will directly return an error. After adding abnormal transfer, if the first signal relay device has an abnormality, the target client can access the non-abnormal signal relay device;

[0128] First, the target client accesses the first signal relay device, determines the state of the accessible identifier of the first signal relay device, and accesses the first signal relay device when the accessible identifier of the first signal relay device is true. When the first signal relay device is abnormal, the target client terminates the access request, modifies the accessible identifier of the first signal relay device to false, and stores the accessible identifier of the first signal relay device in redis.

[0129] When the accessible flag of the first signal relay device is false, the target client queries whether the first signal relay device is in a locked state from redis, and when the first signal relay device is in an unlocked state, the accessible flag of the first signal relay device is forcibly changed to true;

[0130] When the first signal relay device is in a locked state, a signal relay device is randomly selected as the signal relay device to be detected. The target client queries redis whether the signal relay device to be detected is in a locked state. When the signal relay device to be detected is in a locked state, a signal relay device is reselected as the signal relay device to be detected and detected until an unlocked signal relay device is found.

[0131] When the signal relay device to be detected is in an unlocked state, determining that the signal relay device to be detected is a second signal relay device, and when the second signal relay device is not abnormal, the target client sends an access request to the second signal relay device;

[0132] In the case that the second signal relay device is abnormal, a new signal relay device is selected and tested until a signal relay device without abnormality is found.

[0133] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0134] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above-mentioned units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0135] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0136] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0137] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0138] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0139] 1) The abnormality handling method of the signal relay device of the present application, first, when an access request has been generated, the target client obtains the relevant information of all the signal relay devices, and then the target client determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information, and then, when the first signal relay device is not abnormal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server, and finally, when the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal based on the relevant information, until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system.

[0140] 2) For the target client of the present application, the acquisition unit acquires relevant information of all signal relay devices when an access request has been generated, the first processing unit determines the first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information, the second processing unit sends the access request to the first signal relay device when the first signal relay device is not abnormal, so that the first signal relay device sends the access request to the target server, and the third processing unit detects whether signal relay devices other than the first signal relay device are abnormal based on the relevant information when the first signal relay device is abnormal, until a non-abnormal second signal relay device is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server. In this scheme, the target client first determines whether the first signal relay device closest to the target client is abnormal. If the first signal relay device is abnormal, abnormal transfer can be performed. The target client does not use the abnormal first signal relay device to communicate with the target server, and can select a non-abnormal second relay device from multiple signal relay devices to communicate with the target server. In this way, the target client and the target server can use non-abnormal signal relay devices to communicate, avoiding the use of abnormal signal relay devices for communication. Therefore, the fault-tolerant mechanism of this scheme has a high processing efficiency, thereby improving the stability of the distributed system.

[0141] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for handling abnormalities of a signal relay device, characterized in that: include: In the case where an access request has been generated, the target client obtains relevant information of all signal relay devices, the signal relay devices being used to send the access request sent by the target client to the target server, the relevant information including at least identification information; The target client determines a first signal relay device that is closest to the target client, and detects whether the first signal relay device is abnormal based on the relevant information; When the first signal relay device is normal, the target client sends the access request to the first signal relay device, so that the first signal relay device sends the access request to the target server; When the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal according to the relevant information until a second signal relay device that is not abnormal is determined, and sends the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server; The relevant information includes the number of transactions that are completed in timeout, and detecting whether the first signal relay device is abnormal based on the relevant information includes: when the number of transactions that are completed in timeout is greater than or equal to a first number threshold, the target client determines that the first signal relay device is abnormal; when the number of transactions that are completed in timeout is greater than or equal to a second number threshold and less than the first number threshold, the target client determines that the first signal relay device is not abnormal, and the first number threshold is greater than the second number threshold; when the number of transactions that are completed in timeout is greater than or equal to a third number threshold and less than the second number threshold, the target client determines that the first signal relay device is not abnormal, and the second number threshold is greater than the third number threshold; When the target client detects that the signal relay device is abnormal, it locks the abnormal signal relay device and generates an abnormal time of the abnormal signal relay device, wherein when the signal relay device is in a locked state, the non-target client does not communicate with the signal relay device, and the abnormal time refers to the current time when the abnormality of the signal relay device is detected; When the target client detects that the signal relay device is not abnormal, it determines that the non-abnormal signal relay device is the target signal relay device and locks the target signal relay device. When the target signal relay device is in the locked state, the non-target client does not communicate with the target signal relay device.

2. The method according to claim 1, characterized in that When the first signal relay device is abnormal, the target client detects whether the signal relay devices other than the first signal relay device are abnormal according to the relevant information until a non-abnormal second signal relay device is determined, including: The target client obtains the relevant information of the plurality of signal relay devices except the first signal relay device; The target client selects one of the signal relay devices as the signal relay device to be detected from the multiple signal relay devices, and detects whether the signal relay device to be detected is abnormal according to the relevant information; The target client determines, when the signal relay device to be detected is normal, that the signal relay device to be detected is the second signal relay device; When the signal relay device to be detected is abnormal, the target client selects another signal relay device from the plurality of signal relay devices and performs detection until it is determined that the second signal relay device is normal.

3. The method according to claim 2, characterized in that The target client selects one of the signal relay devices as the signal relay device to be detected from the plurality of signal relay devices, including: The target client adopts a random algorithm to randomly select one of the signal relay devices from the plurality of signal relay devices except the first signal relay device as the signal relay device to be detected.

4. The method according to claim 2, characterized in that: The target client selects one of the signal relay devices as the signal relay device to be detected from the plurality of signal relay devices, including: The target client obtains weight information of performance parameters of each of the signal relay devices, where the weight information refers to information on the importance of the performance parameters of the signal relay device in the score of the signal relay device, and the performance parameters include at least one of the following: delay duration of transmission data, packet loss rate of transmission data, bandwidth of transmission data, rate of transmission data, and distance between the signal relay device and the target client; The target client determines the scores corresponding to the plurality of signal relay devices according to the weight information and the performance parameter; The target client determines that the signal relay device corresponding to the highest score is the signal relay device to be detected.

5. The method according to claim 2, characterized in that: The target client selects one of the signal relay devices as the signal relay device to be detected from the plurality of signal relay devices, including: The target client obtains a first target parameter and a second target parameter of each of the signal relay devices, wherein the first target parameter includes at least one of the following: a delay duration of transmission data and a packet loss rate of transmission data, and the second target parameter includes at least one of the following: a bandwidth of transmission data and a rate of transmission data; The target client sorts the plurality of signal relay devices in ascending order according to the first target parameter to obtain a plurality of sorted signal relay devices, or, The target client sorts the plurality of signal relay devices in descending order according to the second target parameter to obtain a plurality of sorted signal relay devices; The target client determines that the signal relay device with the earliest sequence number among the sorted plurality of signal relay devices is the signal relay device to be detected.

6. A target client, characterized in that: include: an acquisition unit, configured to acquire relevant information of all signal relay devices when an access request has been generated, the signal relay devices being configured to send the access request sent by the target client to the target server, the relevant information including at least identification information; A first processing unit, configured to determine a first signal relay device that is closest to the target client, and detect whether the first signal relay device is abnormal according to the relevant information; a second processing unit, configured to send the access request to the first signal relay device when the first signal relay device is not abnormal, so that the first signal relay device sends the access request to the target server; a third processing unit, configured to, in the case where the first signal relay device is abnormal, detect whether the signal relay devices other than the first signal relay device are abnormal according to the relevant information, until a second signal relay device that is not abnormal is determined, and send the access request to the second signal relay device, so that the second signal relay device sends the access request to the target server; The first processing unit includes a second determining module, a third determining module and a fourth determining module, the second determining module being used to determine that the first signal relay device is abnormal when the number of transactions completed in timeout is greater than or equal to a first number threshold; The third determination module is used to determine that the first signal relay device is not abnormal, and the first quantity threshold is greater than the second quantity threshold, when the transaction quantity of the timed-out transactions is greater than or equal to the second quantity threshold and less than the first quantity threshold; The fourth determination module is used to determine that the first signal relay device is not abnormal, and the second number threshold is greater than the third number threshold, when the number of transactions completed in timeout is greater than or equal to the third number threshold and less than the second number threshold; The target client also includes a fourth processing unit and a fifth processing unit. The fourth processing unit is used to lock the abnormal signal relay device when the signal relay device is detected to be abnormal, and generate an abnormal time of the abnormal signal relay device, wherein when the signal relay device is in a locked state, a non-target client does not communicate with the signal relay device, and the abnormal time refers to the current time when the signal relay device is detected to be abnormal; the fifth processing unit is used to determine that the non-abnormal signal relay device is a target signal relay device when the signal relay device is detected to be non-abnormal, and lock the target signal relay device, wherein when the target signal relay device is in a locked state, the non-target client does not communicate with the target signal relay device.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 5.

8. A communication system, characterized in that: include: A client, a signal relay device and a target server, wherein the signal relay device communicates with the client and the target server respectively, and the client is used to execute the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Internet of things data transmission method and system based on virtual node

    CN107529196A