Flow control method, system, device and medium based on shared memory

By configuring flow control policies in shared memory and automatically determining and processing service flow, the problem of insufficient flow control in emergency situations in JAVA and C technology stack systems is solved, and automatic regulation of service flow and fault avoidance are achieved.

CN115801692BActive Publication Date: 2025-09-16PING AN BANK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211430822.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2025-09-16
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

Existing technologies lack effective traffic control methods when services are overloaded or backend services are unavailable. In particular, JAVA and C technology stack systems find it difficult to automatically regulate service traffic in emergencies, leading to avalanche-like system failures.

Method used

Configure traffic control policies based on shared memory. By traversing the policies in shared memory, determine whether the service traffic meets the degradation target and automatically perform degradation processing when the traffic exceeds the threshold, including circuit breaking or releasing. Use random number comparison strategy for flexible control.

Benefits of technology

It realizes automatic regulation of service traffic, avoids avalanche-like system failures, improves the results of failed payments in payment overload situations, reduces customers' emotions about failed services, and is flexible and scalable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801692B_ABST
    Figure CN115801692B_ABST
Patent Text Reader

Abstract

The present invention discloses a shared memory-based flow control method, system, device, and medium, comprising: configuring a flow control policy based on the shared memory; the flow control policy includes a degradation target; when receiving service flow of the policy target, traversing the flow control policy in the shared memory; determining whether a flow control policy corresponding to the policy target exists in the shared memory; if a flow control policy corresponding to the policy target exists, determining whether the flow information of the service flow meets the degradation target; if the flow information of the service flow meets the degradation target, determining whether the flow value of the service flow exceeds a preset flow threshold; if the flow value of the service flow exceeds the preset flow threshold, degrading the service flow. The shared memory-based flow control method of the present invention can be used to customize the flow control policy and realize automatic regulation of the service flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flow control, and in particular to a flow control method, system, computer device and non-volatile computer-readable storage medium based on shared memory. Background Art

[0002] Currently, flow control refers to the phenomenon of overload of an application service in a certain service area or module due to some unexpected factors, such as service failure or unexpected increase in service volume. The cause of this failure cannot be resolved within a tolerable period of time. The root cause of the failure may be unclear or definite, but it is difficult to solve due to technical and resource factors. Therefore, a temporary workaround is implemented to avoid avalanche-like system failures caused by a single point failure.

[0003] Currently, the JAVA technology stack mainly uses the Hystrix fault-tolerant system to control the avalanche effect of services. When it determines that the backend service is unavailable, it uses alternative response options to provide a workaround. However, each request is still sent to the backend service. Traditional C technology stack systems are often payment transaction systems. They are truly irreplaceable in payment and require direct results. However, traditional C technology stack systems often lack available middleware modules and are insufficient in their ability to control service traffic. In case of emergencies, manual traffic control is usually required.

[0004] Therefore, the existing technology still needs to be improved and enhanced. Summary of the Invention

[0005] In view of the above-mentioned shortcomings of the existing technology, the purpose of the present invention is to provide a shared memory-based flow control method, system, computer equipment and non-volatile computer-readable storage medium that can be used in financial technology or other related fields, which can customize the flow control strategy to achieve automatic regulation of service flow.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A flow control method based on shared memory, comprising:

[0008] Configuring a flow control strategy based on shared memory; the flow control strategy includes a degradation target;

[0009] When receiving service traffic of the policy target, traversing the traffic control policy in the shared memory;

[0010] Determine whether there is a flow control policy corresponding to the policy target in the shared memory;

[0011] If there is a flow control policy corresponding to the policy target, determining whether the flow information of the service flow meets the degradation target;

[0012] If the flow information of the service flow meets the degradation target, determining whether the flow value of the service flow exceeds a preset flow threshold;

[0013] If the flow value of the service flow exceeds a preset flow threshold, the service flow is downgraded.

[0014] In a further technical solution, the shared memory-based flow control method, wherein the flow control strategy further includes a degradation strategy;

[0015] If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes:

[0016] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0017] If so, the service traffic is downgraded.

[0018] In a further technical solution, the shared memory-based flow control method, wherein the determining whether the random number complies with the degradation strategy, includes:

[0019] If not, the service traffic will be released.

[0020] In a further technical solution, the shared memory-based flow control method, wherein if there is a flow control policy corresponding to the policy target, determining whether the flow information of the service flow meets the degradation target includes:

[0021] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0022] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0023] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0024] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0025] In a further technical solution, the shared memory-based flow control method, wherein the determining whether there is a flow control policy corresponding to the policy target in the shared memory includes:

[0026] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0027] In a further technical solution, the shared memory-based traffic control method, wherein the determining whether the traffic information of the service traffic meets the degradation target, includes:

[0028] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0029] In a further technical solution, the shared memory-based flow control method, wherein the determining whether the flow value of the service flow exceeds a preset flow threshold, includes:

[0030] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0031] A shared memory-based flow control system, comprising:

[0032] A configuration module, configured to configure a flow control policy based on the shared memory; the flow control policy includes a degradation target;

[0033] A traversal module, configured to traverse the flow control policy in the shared memory when receiving service flow of a policy target;

[0034] A first judgment module is used to judge whether there is a flow control policy corresponding to the policy target in the shared memory;

[0035] A second judgment module is configured to judge whether the flow information of the service flow meets the degradation target if there is a flow control policy corresponding to the policy target;

[0036] a third judgment module, configured to judge whether the flow value of the service flow exceeds a preset flow threshold if the flow information of the service flow meets the degradation target;

[0037] The flow control module is configured to downgrade the service flow if the flow value of the service flow exceeds a preset flow threshold.

[0038] In a further technical solution, the shared memory-based flow control system, wherein the flow control strategy further includes a degradation strategy;

[0039] If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes:

[0040] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0041] If so, the service traffic is downgraded.

[0042] In a further technical solution, the shared memory-based traffic control system, wherein the determining whether the random number complies with the degradation strategy, includes:

[0043] If not, the service traffic will be released.

[0044] In a further technical solution, the shared memory-based traffic control system, wherein if there is a traffic control policy corresponding to the policy target, determining whether the traffic information of the service traffic meets the degradation target includes:

[0045] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0046] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0047] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0048] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0049] In a further technical solution, the shared memory-based flow control system, wherein the determining whether there is a flow control policy corresponding to the policy target in the shared memory includes:

[0050] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0051] In a further technical solution, the shared memory-based traffic control system, wherein the determining whether the traffic information of the service traffic meets the degradation target, includes:

[0052] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0053] In a further technical solution, the shared memory-based traffic control system, wherein the determining whether the traffic value of the service traffic exceeds a preset traffic threshold, includes:

[0054] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0055] A computer device, wherein the computer device comprises at least one processor; and

[0056] a memory communicatively connected to the at least one processor; wherein,

[0057] The memory stores a computer program executable by the at least one processor. When the computer program is executed by the at least one processor, the following can be achieved:

[0058] Configuring a flow control strategy based on shared memory; the flow control strategy includes a degradation target;

[0059] When receiving service traffic of the policy target, traversing the traffic control policy in the shared memory;

[0060] Determine whether there is a flow control policy corresponding to the policy target in the shared memory;

[0061] If there is a flow control policy corresponding to the policy target, determining whether the flow information of the service flow meets the degradation target;

[0062] If the flow information of the service flow meets the degradation target, determining whether the flow value of the service flow exceeds a preset flow threshold;

[0063] If the flow value of the service flow exceeds a preset flow threshold, the service flow is downgraded.

[0064] In a further technical solution, the computer device, wherein the flow control strategy further includes a degradation strategy;

[0065] If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes:

[0066] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0067] If so, the service traffic is downgraded.

[0068] In a further technical solution, the computer device, wherein the determining whether the random number complies with the degradation policy includes:

[0069] If not, the service traffic will be released.

[0070] In a further technical solution, the computer device, wherein if there is a traffic control policy corresponding to the policy target, determining whether the traffic information of the service traffic meets the degradation target includes:

[0071] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0072] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0073] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0074] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0075] In a further technical solution, the computer device, wherein the determining whether there is a flow control policy corresponding to the policy target in the shared memory includes:

[0076] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0077] In a further technical solution, the computer device, wherein the determining whether the flow information of the service flow meets the degradation target includes:

[0078] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0079] In a further technical solution, the computer device, wherein the determining whether the flow value of the service flow exceeds a preset flow threshold, includes:

[0080] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0081] A non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it can implement:

[0082] Configuring a flow control strategy based on shared memory; the flow control strategy includes a degradation target;

[0083] When receiving service traffic of the policy target, traversing the traffic control policy in the shared memory;

[0084] Determine whether there is a flow control policy corresponding to the policy target in the shared memory;

[0085] If there is a flow control policy corresponding to the policy target, determining whether the flow information of the service flow meets the degradation target;

[0086] If the flow information of the service flow meets the degradation target, determining whether the flow value of the service flow exceeds a preset flow threshold;

[0087] If the flow value of the service flow exceeds a preset flow threshold, the service flow is downgraded.

[0088] In a further technical solution, the non-volatile computer-readable storage medium, wherein the flow control strategy further includes a degradation strategy;

[0089] If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes:

[0090] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0091] If so, the service traffic is downgraded.

[0092] In a further technical solution, the non-volatile computer-readable storage medium, wherein the determining whether the random number complies with the degradation policy includes:

[0093] If not, the service traffic will be released.

[0094] In a further technical solution, the non-volatile computer-readable storage medium, wherein if there is a traffic control policy corresponding to the policy target, determining whether the traffic information of the service traffic meets the degradation target includes:

[0095] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0096] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0097] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0098] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0099] In a further technical solution, the non-volatile computer-readable storage medium, wherein the determining whether there is a flow control policy corresponding to the policy target in the shared memory includes:

[0100] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0101] In a further technical solution, the non-volatile computer-readable storage medium, wherein the determining whether the flow information of the service flow meets the degradation target includes:

[0102] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0103] In a further technical solution, the non-volatile computer-readable storage medium, wherein the determining whether the flow value of the service flow exceeds a preset flow threshold, includes:

[0104] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0105] Compared with the prior art, the present invention provides a flow control method, system, device and medium based on shared memory, wherein the method includes: configuring a flow control policy based on shared memory; the flow control policy includes a degradation target; when receiving service flow of the policy target, traversing the flow control policy in the shared memory; judging whether there is a flow control policy corresponding to the policy target in the shared memory; if there is a flow control policy corresponding to the policy target, judging whether the flow information of the service flow meets the degradation target; if the flow information of the service flow meets the degradation target, judging whether the flow value of the service flow exceeds a preset flow threshold; if the flow value of the service flow exceeds the preset flow threshold, degrading the service flow. The flow control method based on shared memory of the present invention can be used to customize the configuration of the flow control policy to achieve automatic regulation of the service flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0106] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0107] Figure 1 A flow chart of a shared memory-based flow control method provided in an embodiment of the present invention.

[0108] Figure 2 A schematic diagram of the functional modules of a shared memory-based traffic control system provided by an embodiment of the present invention.

[0109] Figure 3 A schematic diagram of the hardware structure of the computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0110] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0111] In the description of the present invention, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.

[0112] Various non-limiting embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0113] See also Figure 1 , an embodiment of the present invention provides a flow control method based on shared memory, which includes the steps of:

[0114] S100, configuring a flow control policy based on shared memory; the flow control policy includes a degradation target;

[0115] S200, when receiving service traffic of a policy target, traversing the traffic control policy in the shared memory;

[0116] S300, determining whether there is a flow control policy corresponding to the policy target in the shared memory;

[0117] S400: If there is a flow control policy corresponding to the policy target, determine whether the flow information of the service flow meets the degradation target;

[0118] S500: If the flow information of the service flow meets the degradation target, determine whether the flow value of the service flow exceeds a preset flow threshold;

[0119] S600: If the traffic value of the service traffic exceeds a preset traffic threshold, degrade the service traffic.

[0120] Furthermore, in the shared memory-based flow control method, the flow control strategy further includes a degradation strategy;

[0121] In step S600, if the flow rate value of the service flow exceeds a preset flow rate threshold, downgrading the service flow includes:

[0122] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0123] If so, the service traffic is downgraded.

[0124] Specifically, in this embodiment, the degradation processing of the service traffic may also include fuse processing of the service traffic.

[0125] Furthermore, in the shared memory-based flow control method, the step of determining whether the random number complies with the degradation strategy comprises:

[0126] If not, the service traffic will be released.

[0127] Furthermore, in the shared memory-based traffic control method, in step S400, if there is a traffic control policy corresponding to the policy target, determining whether the traffic information of the service traffic meets the degradation target includes:

[0128] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0129] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0130] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0131] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0132] Furthermore, in the shared memory-based flow control method, the step of determining whether a flow control policy corresponding to the policy target exists in the shared memory includes:

[0133] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0134] Furthermore, in the shared memory-based traffic control method, the step of determining whether the traffic information of the service traffic meets the degradation target includes:

[0135] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0136] Furthermore, in the shared memory-based flow control method, the step of determining whether the flow value of the service flow exceeds a preset flow threshold comprises:

[0137] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0138] It can be seen from the above method embodiments that the shared memory-based flow control method provided by the present invention is implemented based on shared memory, and by using shared memory to configure policies (flow control policies) and make automatic policy decisions, an implementation policy is automatically adapted to the need for downgraded and fuse services according to the policy; wherein, for the implementation of the downgraded and fuse functions of the C technology stack, shared memory access within a single machine is adopted, and downgrade and fuse processing is based on configuration policies and automatic matching policies. Due to real-time access based on shared memory, it has strong scalability, and manual intervention can be performed through the operation platform to adjust the shared memory configuration to achieve downgrade or fuse policies. It is also possible to add and modify the automatic matching policy threshold in the memory, and flexibly apply downgrade and fuse processing, which can effectively avoid avalanche-type system failures caused by service overload or back-end service unavailability, improve the results obtained by customers who fail to pay during payment overload, and reduce the further brewing of customer emotions caused by failed services.

[0139] Of course, in the present invention, a mode can be reused and managed in multiple modules through shared memory, but in actual use, it is implemented through a non-absolute 100% fuse method. For example, 95% of the traffic can be fused, and 5% of the traffic continues to be sent to the backend to detect service recovery. Once the backend service is restored and available, the fuse is immediately released.

[0140] It should be understood that although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the order of the embodiments or flowcharts. The order of steps listed in the embodiments or flowcharts is only one way of executing the order of many steps and does not represent a unique execution order. Moreover, at least a portion of the steps in the embodiments or flowcharts may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be performed in sequence, but can be performed in turn, alternately or synchronously with other steps or at least a portion of the sub-steps or stages of other steps.

[0141] Based on the above examples, please refer to Figure 2 Another embodiment of the present invention further provides a shared memory-based flow control system, which includes:

[0142] A configuration module 11 is configured to configure a flow control policy based on a shared memory; the flow control policy includes a degradation target;

[0143] A traversal module 12 is configured to traverse the flow control policy in the shared memory when receiving service flow of a policy target;

[0144] A first judging module 13 is configured to judge whether there is a flow control policy corresponding to the policy target in the shared memory;

[0145] A second judgment module 14 is configured to judge whether the flow information of the service flow meets the degradation target if there is a flow control policy corresponding to the policy target;

[0146] A third judgment module 15 is configured to determine whether the flow value of the service flow exceeds a preset flow threshold if the flow information of the service flow meets the degradation target;

[0147] The flow control module 16 is configured to downgrade the service flow if the flow value of the service flow exceeds a preset flow threshold.

[0148] Furthermore, in the shared memory-based flow control system, the flow control strategy further includes a degradation strategy;

[0149] The flow control module 16 is configured to downgrade the service flow if the flow value of the service flow exceeds a preset flow threshold, including:

[0150] If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy;

[0151] If so, the service traffic is downgraded.

[0152] Specifically, in this embodiment, the degradation processing of the service traffic may also include fuse processing of the service traffic.

[0153] Furthermore, in the shared memory-based traffic control system, the step of determining whether the random number complies with the degradation strategy comprises:

[0154] If not, the service traffic will be released.

[0155] Furthermore, in the shared memory-based traffic control system, the second judgment module 14 is configured to judge whether the traffic information of the service traffic meets the degradation target if there is a traffic control policy corresponding to the policy target, including:

[0156] If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0% or 100% or 0<100%;

[0157] If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released;

[0158] If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing;

[0159] If the corresponding degradation policy in the traffic control policy is 0<100%, it is determined whether the traffic information of the service traffic meets the degradation target.

[0160] Furthermore, in the shared memory-based traffic control system, the step of determining whether a traffic control policy corresponding to the policy target exists in the shared memory includes:

[0161] If there is no traffic control policy corresponding to the policy target, the service traffic is released.

[0162] Furthermore, in the shared memory-based traffic control system, the step of determining whether the traffic information of the service traffic meets the degradation target includes:

[0163] If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

[0164] Furthermore, in the shared memory-based traffic control system, the step of determining whether the traffic value of the service traffic exceeds a preset traffic threshold comprises:

[0165] If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

[0166] It can be seen from the above system embodiments that the shared memory-based flow control system provided by the present invention is implemented based on shared memory, and uses shared memory to configure policies (flow control policies) and make automatic policy decisions, and automatically adapts to the implementation policy of services that need to be downgraded and fuse-broken according to the policy; wherein, for the implementation of the downgrade and fuse function of the C technology stack, shared memory access within a single machine is adopted, and downgrade and fuse processing is based on configuration policies and automatic matching policies. Due to real-time access based on shared memory, it has strong scalability, and manual intervention can be performed through the operation platform to adjust the shared memory configuration to achieve downgrade or fuse policies. It can also add and modify the automatic matching policy threshold in the memory, and flexibly apply downgrade and fuse processing, which can effectively avoid avalanche-type system failures caused by service overload or back-end service unavailability, improve the results obtained by customers who fail to pay during payment overload, and reduce the further brewing of customer emotions caused by failed services.

[0167] Of course, in the present invention, a mode can be reused and managed in multiple modules through shared memory, but in actual use, it is implemented through a non-absolute 100% fuse method. For example, 95% of the traffic can be fused, and 5% of the traffic continues to be sent to the backend to detect service recovery. Once the backend service is restored and available, the fuse is immediately released.

[0168] Based on the above examples, please refer to Figure 3 Another embodiment of the present invention further provides a computer device, wherein the computer device 10 includes:

[0169] Memory 120 and one or more processors 110, Figure 3 In the description, a processor 110 is used as an example. The processor 110 and the memory 120 may be connected via a communication bus or other means. Figure 3 The example of connection via a communication bus is taken here.

[0170] The processor 110 is used to implement various control logics of the computer device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor, or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0171] Memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as the computer program corresponding to the shared memory-based flow control method in the embodiments of the present invention. Processor 110 executes the non-volatile software programs, instructions, and units stored in memory 120 to execute various functional applications and data processing of computer device 10, thereby implementing the shared memory-based flow control method in the above-mentioned method embodiments.

[0172] The memory 120 may include a program storage area and a data storage area. The program storage area may store application programs required for operating the device or at least one function; the data storage area may store data created based on the use of the computer device 10. Furthermore, the memory 120 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 120 may optionally include a memory remotely located relative to the processor 110, and such remote memory may be connected to the computer device 10 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0173] One or more units are stored in the memory 120, and when executed by one or more processors 110, the shared memory-based flow control method in any of the above method embodiments can be implemented, for example, the above described flow control method can be implemented. Figure 1 Method steps S100 to S600.

[0174] Those skilled in the art will understand that Figure 3 The hardware structure diagram shown in the figure is only a schematic diagram of a partial structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more components than shown in the figure, or combine certain components, or have a different component arrangement.

[0175] Based on the above embodiments, the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the shared memory-based flow control method in any of the above method embodiments can be implemented, for example, the above-described Figure 1 Method steps S100 to S600 in.

[0176] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0177] Another embodiment of the present invention provides a computer program product, the computer program product including a computer program stored on a non-volatile computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a processor, can implement the shared memory-based flow control method in any of the above method embodiments, for example, can implement the above described Figure 1 Method steps S100 to S600 in.

[0178] The embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the objectives of the present embodiments as needed.

[0179] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, can also be implemented by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the relevant technology can be embodied in the form of a software product. This computer software product can be present in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or certain parts of the embodiment.

[0180] Conditional language such as "can," "may," or "might," unless specifically stated otherwise or otherwise understood within the context in which it is used, is generally intended to convey, among other things, that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0181] What has been described herein in this specification and the accompanying drawings includes examples of methods, systems, computer devices, and non-volatile computer-readable storage media that can provide flow control based on shared memory. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it is recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure, but all of these various modifications should fall within the scope of protection of the claims appended hereto. In addition, or in the alternative, other embodiments of the present disclosure may be apparent from consideration of this specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples set forth in this specification and the accompanying drawings be considered in all respects to be illustrative and not restrictive. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A flow control method based on shared memory, characterized in that: include: Configure flow control strategies based on shared memory; The flow control strategy includes a degradation target; When receiving service traffic of the policy target, traversing the traffic control policy in the shared memory; Determine whether there is a flow control policy corresponding to the policy target in the shared memory; If there is a flow control policy corresponding to the policy target, determining whether the flow information of the service flow meets the degradation target; If the flow information of the service flow meets the degradation target, determining whether the flow value of the service flow exceeds a preset flow threshold; If the flow rate value of the service flow exceeds a preset flow rate threshold, the service flow is downgraded; The flow control strategy also includes a degradation strategy; If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes: If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy; If it meets the requirements, the service traffic is downgraded; wherein the downgrade includes fusing the service traffic; If a traffic control policy corresponding to the policy target exists, determining whether the traffic information of the service traffic meets the degradation target includes: If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0%, 100%, or greater than 0% and less than 100%; If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released; If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing; If the corresponding degradation policy in the traffic control policy is greater than 0% and less than 100%, it is determined whether the traffic information of the service traffic meets the degradation target.

2. The shared memory-based flow control method according to claim 1, wherein: The determining whether the random number complies with the degradation strategy includes: If not, the service traffic will be released.

3. The shared memory-based flow control method according to claim 2, wherein: The determining whether there is a flow control policy corresponding to the policy target in the shared memory includes: If there is no traffic control policy corresponding to the policy target, the service traffic is released.

4. The shared memory-based flow control method according to claim 3, wherein: The determining whether the flow information of the service flow meets the degradation target includes: If the traffic information of the service traffic does not meet the degradation target, the service traffic is released.

5. The shared memory-based flow control method according to claim 4, characterized in that: The determining whether the flow value of the service flow exceeds a preset flow threshold includes: If the flow value of the service flow does not exceed the preset flow threshold, the service flow is released.

6. A traffic control system based on shared memory, characterized in that: include: Configuration module, used to configure flow control strategy based on shared memory; The flow control strategy includes a degradation target; A traversal module, configured to traverse the flow control policy in the shared memory when receiving service flow of a policy target; A first judgment module is used to judge whether there is a flow control policy corresponding to the policy target in the shared memory; A second judgment module is configured to judge whether the flow information of the service flow meets the degradation target if there is a flow control policy corresponding to the policy target; a third judgment module, configured to judge whether the flow value of the service flow exceeds a preset flow threshold if the flow information of the service flow meets the degradation target; a flow control module, configured to downgrade the service flow if the flow value of the service flow exceeds a preset flow threshold; The flow control strategy also includes a degradation strategy; If the flow value of the service flow exceeds a preset flow threshold, degrading the service flow includes: If the traffic value of the service traffic exceeds a preset traffic threshold, the random number is compared with the degradation policy to determine whether the random number is consistent with the degradation policy; If it meets the requirements, the service traffic is downgraded; wherein the downgrade includes fusing the service traffic; If a traffic control policy corresponding to the policy target exists, determining whether the traffic information of the service traffic meets the degradation target includes: If there is a flow control policy corresponding to the policy target, determining whether the degradation policy in the corresponding flow control policy is 0%, 100%, or greater than 0% and less than 100%; If the degradation policy in the corresponding traffic control policy is 0%, the service traffic is released; If the degradation policy in the corresponding flow control policy is 100%, the service flow is subjected to fuse processing; If the corresponding degradation policy in the traffic control policy is greater than 0% and less than 100%, it is determined whether the traffic information of the service traffic meets the degradation target.

7. A computer device, characterized in that: The computer device includes at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the shared memory-based flow control method according to any one of claims 1 to 5 can be implemented.

8. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it can implement the shared memory-based flow control method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Traffic control method and device capable of real-time automatic regulation based on custom rules

    CN108712350A