CN114553786B - Network request fusing method and device, computer equipment and storage medium - Google Patents

Network request fusing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114553786B
CN114553786B CN202210426280.7A CN202210426280A CN114553786B CN 114553786 B CN114553786 B CN 114553786B CN 202210426280 A CN202210426280 A CN 202210426280A CN 114553786 B CN114553786 B CN 114553786B
Authority
CN
China
Prior art keywords
fusing
condition
network service
service request
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210426280.7A
Other languages
Chinese (zh)
Other versions
CN114553786A (en
Inventor
王飞雪
陈麒麟
刘亚平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Fengshang Wisdom Agriculture And Animal Husbandry Technology Co ltd
Original Assignee
Shenzhen Fengshang Wisdom Agriculture And Animal Husbandry Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Fengshang Wisdom Agriculture And Animal Husbandry Technology Co ltd filed Critical Shenzhen Fengshang Wisdom Agriculture And Animal Husbandry Technology Co ltd
Priority to CN202210426280.7A priority Critical patent/CN114553786B/en
Publication of CN114553786A publication Critical patent/CN114553786A/en
Application granted granted Critical
Publication of CN114553786B publication Critical patent/CN114553786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • H04L41/5019Ensuring fulfilment of SLA
    • H04L41/5025Ensuring fulfilment of SLA by proactively reacting to service quality change, e.g. by reconfiguration after service quality degradation or upgrade

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a network request fusing method, a network request fusing device, computer equipment and a storage medium. The method comprises the following steps: receiving a network service request for a target resource from a requestor; in response to the network service request, acquiring a fusing condition from a cache region of a condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform; judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester. By adopting the method, the whole micro-service cluster can be prevented from being unavailable, and the stability of the micro-service cluster is guaranteed.

Description

Network request fusing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for requesting fusing of a network, a computer device, and a storage medium.
Background
With the development of computer technology, micro services are widely applied, in a micro service cluster, all micro services are often interconnected, if a called micro service fails or a large number of requests are blocked due to an excessive number of requests, resource waste may be caused or the whole micro service cluster is unavailable, and how to ensure the stability of the whole micro service cluster becomes a crucial problem.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a network request fusing method, apparatus, computer device, and computer readable storage medium capable of ensuring stability of a microservice cluster.
In a first aspect, a method for network request fusing is provided. The method comprises the following steps:
receiving a network service request for a target resource from a requestor;
in response to the network service request, acquiring a fusing condition from a cache region of a condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to condition adjustment information received from the condition configuration platform;
judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result;
if the judgment result is yes, fusing the network service request;
if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In a second aspect, the application further provides a network request fusing device. The device comprises:
a receiving module for receiving a network service request for a target resource from a requester;
the acquisition module is used for responding to the network service request and acquiring the fusing condition from the cache region of the condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to condition adjustment information received from the condition configuration platform;
the judging module is used for judging whether to carry out fusing processing on the network service request according to the fusing condition to obtain a judging result;
the fusing module is used for fusing the network service request if the judgment result is yes;
and the calling module is used for calling the target resource according to the network service request if the judgment result is negative, and feeding back the calling result to the requester.
In one embodiment, the apparatus further comprises:
the creating module is used for reading the fusing condition from the condition configuration platform through the initializing component and creating a condition configuration component when receiving a starting instruction;
and the first storage module is used for storing the fusing condition into a cache region of the condition configuration component.
In one embodiment, the apparatus further comprises:
the obtaining module is further configured to obtain the adjusted fusing condition from the condition configuration platform through the condition configuration component when the condition adjustment information is received;
the second storage module is used for storing the adjusted fusing condition into a cache region of the condition configuration component;
the obtaining module is further configured to obtain, by a fuse control tool, the adjusted fuse condition from the cache region of the condition configuration component in response to the network service request.
In one embodiment, the fusing module is further configured to:
determining a weight value corresponding to each fusing condition;
judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain sub-judgment results;
and carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
In one embodiment, the apparatus further comprises:
the starting module is used for starting the timer to time;
and the recovery module is used for carrying out fusing recovery processing on the network service request received from the requester again when the timed duration reaches the preset duration.
In one embodiment, the target resource is a resource defined by way of annotations.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
receiving a network service request for a target resource from a requestor;
in response to the network service request, acquiring a fusing condition from a cache region of a condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to condition adjustment information received from the condition configuration platform;
judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result;
if the judgment result is yes, fusing the network service request;
if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a network service request for a target resource from a requestor;
in response to the network service request, acquiring a fusing condition from a cache region of a condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to condition adjustment information received from the condition configuration platform;
judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result;
if the judgment result is yes, fusing the network service request;
if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
The network request fusing method, the network request fusing device, the computer equipment and the storage medium receive a network service request aiming at a target resource from a requester, respond to the network service request, obtain a fusing condition from a cache region of a condition configuration component through a fusing control tool, judge whether to fuse the network service request according to the fusing condition, and obtain a judgment result. If the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester. Before calling a target resource according to a network service request, the computer equipment judges whether the network service request is fused or not, and fuses the network service request in time, so that the unavailability of the whole micro-service cluster is avoided, and the stability of the micro-service cluster is guaranteed.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a network request fusing method;
FIG. 2 is a flowchart illustrating a method for network request fusing in one embodiment;
FIG. 3 is a flowchart illustrating a step of obtaining a fusing condition in one embodiment;
FIG. 4 is a flowchart illustrating the step of determining the determination result in one embodiment;
FIG. 5 is a schematic diagram of a network request fusing method in one embodiment;
FIG. 6 is a flowchart illustrating a method for requesting fusing of a network in accordance with another embodiment;
FIG. 7 is a block diagram illustrating an exemplary network request fuse apparatus;
FIG. 8 is a block diagram of an alternative embodiment of a network request fusing apparatus;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The network request fusing method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 receives a network service request for a target resource from the requestor 104; in response to the network service request, acquiring a fusing condition from a cache region of the condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform; judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is no, the target resource is called according to the network service request, and the calling result is fed back to the requester 104. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like.
In one embodiment, as shown in fig. 2, a network request fusing method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
s202, receiving a network service request aiming at the target resource from the requester.
The requester is a sender of a network service request, and may be a server or a terminal, or may also be an application client or a microservice deployed in the terminal. The resource is an object to be fuse-controlled, and may be a code block, a service provided by the application client, a service provided by another application client called by the application client, or an RPC (Remote Procedure Call) interface. The web service request is a web request for calling a resource, and may be a request in an HTTP (Hyper Text Transfer Protocol) Protocol format.
In one embodiment, the target resource is a resource defined by way of annotations. Annotations (Annotation), also known as Java annotations, are annotations in the Java language that can be embedded into the bytecode when the Java compiler generates a class file.
And S204, responding to the network service request, and acquiring the fusing condition from the cache region of the condition configuration component through the fusing control tool. The fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform.
The fuse control means is a means for performing fuse control, and may be of the Class (Class) for performing fuse control, for example, the Class of tangent planes. The Aspect (Aspect) class is a class defined by a facet-oriented programming method, and codes for fusing control can be multiplexed through the facet class, so that the code amount is reduced. In one embodiment, the tangent plane class may be, for example, the sentinelResourceAssect class.
The condition configuration component is a component for updating the fuse condition in real time, and may be, for example, a multirelenacosusdatasource component. When the fusing condition in the condition configuration platform is changed, the condition configuration component acquires the changed fusing condition in real time and stores the changed fusing condition in a cache region. The fusing condition is a condition for determining whether to perform fusing processing on the request, and includes a flow control condition, a degradation control condition, a system protection control condition, an access control condition, or the like. For example, the fusing condition may be that fusing processing is performed when the time for responding to the request is longer than a preset time; for another example, the fusing condition may be that the fusing process is performed when the number of processing requests per unit time is smaller than a number threshold.
And S206, judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result.
The fusing process is a processing mode of stopping responding to the request or conditionally receiving the network service request under the condition of overtime or failure of the request. The judgment result is a result of judgment according to the fusing condition, and may be yes or no.
And the terminal judges whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result. For example, when the time for responding to the request is longer than a preset time, the determination result is yes. For example, when the number of processing requests per unit time is smaller than the number threshold, "1" is obtained as the judgment result.
In one embodiment, S206 specifically includes: and the terminal scores the network service request according to the fusing condition, and when the obtained score is greater than or equal to a preset value, the judgment result is yes, and when the obtained score is less than the preset value, the judgment result is no.
In one embodiment, a fusing control tool deployed in the terminal judges whether to perform fusing processing on the network service request according to a fusing condition, and obtains a judgment result. The fusing control means may be of the cut-out type, for example.
And S208, if the judgment result is yes, fusing the network service request.
And if so, the terminal performs fusing processing on the network service request. For example, the terminal may stop responding to the network service request and refuse to receive the network service request from the requestor. Alternatively, the terminal may perform flow control, system protection control, access control, or the like.
And S210, if the judgment result is negative, calling the target resource according to the network service request, and feeding back the calling result to the requester.
And the terminal calls the target resource according to the network service request to obtain a calling result. For example, when the target resource is data stored in the memory, the terminal reads the data from the content according to the network service request, and takes the read data as a calling result; and when the target resource is a section of program, the terminal operates the program code according to the network service request, and takes the code operation result as a calling result. And after the terminal obtains the calling result, feeding the calling result back to the requester.
In the above embodiment, a network service request for a target resource is received from a requester, and in response to the network service request, a fusing condition is obtained from a cache region of a condition configuration component by a fusing control tool, and whether to fuse the network service request is determined according to the fusing condition, so as to obtain a determination result. If the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester. Before calling a target resource according to a network service request, the computer equipment judges whether the network service request is fused or not, and fuses the network service request in time, so that the unavailability of the whole micro-service cluster is avoided, and the stability of the micro-service cluster is guaranteed.
In one embodiment, as shown in fig. 3, S204 further includes the following steps:
s302, when a starting instruction is received, the fusing condition is read from the condition configuration platform through the initialization component, and the condition configuration component is created.
The starting instruction is an instruction for instructing the terminal to start the application client. The application client may be any client deployed in the terminal, and is configured to receive the network service request sent by the requester and respond to the network service request. For example, the application client may be an applet, a microservice, or the like, deployed in the terminal. The initialization component is a component for initialization, and is deployed in the application client. For example, may be a NacosDataSourceInitialize component. The condition Configuration platform is a platform for configuring the fusing condition, and may be, for example, a Nacos (Dynamic Naming and Configuration Service, registered Configuration center).
In one embodiment, S302 further includes before: and the condition configuration platform receives the condition configuration instruction and configures the fusing condition according to the condition configuration instruction. The conditional configuration instruction is an instruction triggered in the conditional configuration platform, and may be an instruction triggered by a configuration control in the conditional configuration platform.
S304, storing the fusing condition into a buffer area of the condition configuration component.
The cache region is a storage region for caching the fusing condition. The terminal stores the fusing condition into a cache region of the condition configuration component through the initialization component, so that the application client side with the condition configuration component deployed obtains the fusing condition from the cache region when receiving the network service request, and judges whether to fuse the network service request according to the fusing condition.
In the above embodiment, after the terminal starts the application client, the fuse condition is read from the condition configuration platform and the condition configuration component is created by the initialization component, and then the fuse condition is stored in the cache region of the condition configuration component, so that when the network service request is received, whether to fuse the network service request is determined according to the fuse condition stored in the cache region. Therefore, the network service request can be fused in time, the unavailability of the whole micro-service cluster is avoided, and the stability of the micro-service cluster is guaranteed.
In one embodiment, S204 further includes before: when condition adjustment information is received, acquiring the adjusted fusing condition from the condition configuration platform through the condition configuration component; storing the adjusted fusing condition into a cache region of the condition configuration component; s204 specifically comprises: and in response to the network service request, acquiring the adjusted fusing condition from the cache region of the condition configuration component through a fusing control tool.
The condition adjustment information is information indicating that the fusing condition has been adjusted. The adjusted fusing condition is the fusing condition adjusted by the condition configuration platform according to the actual requirement of the user. The adjusted fusing conditions may be different from parameters in the fusing conditions, or new fusing conditions may be added based on the fusing conditions, or some fusing conditions may be deleted based on the original fusing conditions.
Because the network environment changes in real time, for example, the bandwidth, traffic, access amount, and response speed of the network may all change, a user may adjust the fusing condition configured in the condition configuration platform according to the actual demand and the current network environment, and when the fusing condition configured in the condition configuration platform changes, the condition configuration platform sends condition adjustment information to the condition configuration component to prompt the condition configuration component that the fusing condition has changed, so that the condition configuration component may adjust the fusing condition stored in the cache region in real time.
After the fusing condition in the condition configuration platform is adjusted, if the terminal receives a network service request, the adjusted fusing condition is obtained from the cache region of the condition configuration component through the fusing control tool in response to the network service request. Judging whether to perform fusing processing on the network service request according to the adjusted fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In the above embodiment, when the condition adjustment information is received, the adjusted fusing condition is acquired from the condition configuration platform through the condition configuration component; storing the adjusted fusing condition into a cache region of the condition configuration component; and responding to the network service request, acquiring the adjusted fusing condition from the cache region of the condition configuration component through a fusing control tool, and judging whether to perform fusing processing on the network service request according to the adjusted fusing condition. Therefore, when the network environment changes, the application client can synchronously adjust the fusing conditions in real time according to the adjusted fusing conditions configured in the condition configuration platform, and the accuracy of the judgment result is improved.
In one embodiment, as shown in fig. 4, S206 specifically includes the following steps:
s402, determining the weight value corresponding to each fusing condition.
The weight value is a numerical value for measuring the contribution of each fusing condition to the judgment result, and may be a decimal number, a percentage, a fraction, or the like. For example, the weight value may be 0.3, 1/3, etc. The weight values corresponding to the fusing conditions may be the same or different. For example, fusing condition 1 may have a weight value of 0.4, fusing condition 2 may have a weight value of 0.3, and so on.
S404, judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain a sub-judgment result.
And when the fusing conditions are multiple, the terminal judges whether to perform fusing processing on the network service request according to each fusing condition to obtain a sub-judgment result. For example, the terminal determines whether to perform fusing processing on the network service request according to the fusing condition a, and obtains a sub-determination result of "1"; and the terminal judges whether to perform fusing processing on the network service request according to the fusing condition B, and the obtained sub-judgment result is '0'.
In one embodiment, the terminal may express the sub-determination result by a numerical value, for example, the fusing condition is that "the response time to the network service request is greater than the preset time length", if the response time to the network service request is greater than the preset time length, the sub-determination result is 100, and if the response time to the network service request is greater than twice the preset time length, the sub-determination result is 200.
S406, carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
And the terminal carries out weighted summation on the sub-judgment results according to the weight values to obtain the judgment results. For example, the sub-determination results obtained by the terminal according to the fusing condition A, B, C, D are 1, 0, and 1, the weight values corresponding to the fusing conditions are 0.2, 0.3, 0.1, and 0.4, respectively, the sum obtained is 1 × 0.2+0 × 0.3+0 × 0.1+1 × 0.4=0.6, and since 0.6 is greater than the preset value (assumed to be 0.5), it is determined that the determination result is "yes," and the terminal performs the fusing process.
In the above embodiment, whether the network service request is fused is determined according to each fusing condition to obtain the sub-determination results, then the sub-determination results are weighted and summed according to the weight values corresponding to each fusing condition, and the determination result is determined according to the obtained sum. Therefore, whether fusing processing is carried out or not can be comprehensively judged according to the fusing conditions, and the judgment accuracy is improved.
In one embodiment, S208 is followed by: starting a timer to time; and when the timed duration reaches the preset duration, performing fusing recovery processing on the network service request received from the requester again.
The preset time period may be a time period set according to actual needs, for example, 10 minutes, 1 hour, or 1 day. The fusing recovery processing is to recover the receiving of the network service request and to respond to the network service request normally. The terminal starts the timer to time after fusing the network service request, and fusing and recovering the network service request received from the requester again when the timed duration reaches the preset duration, so that the dynamic fusing and automatic recovering of the network service request can be realized, and the efficiency of managing the network service request is improved.
In one embodiment, as shown in FIG. 5, the fusing condition is configured in a condition configuration platform (Nacos). After the application client is started, a condition configuration component (MultiRuleNacosDataSource) is created through an initialization component (NacosDataSource Initialize), a fusing condition is obtained from a condition configuration platform, and then the fusing condition is stored in a cache region of the condition configuration component. And when the fusing condition in the condition configuration platform is changed, the condition configuration component adjusts the fusing condition in the cache region in real time according to the changed fusing condition. Before executing the service logic, the fusing control tool (tangent plane class sentinel resource assignment) acquires the adjusted fusing condition from the cache region of the condition configuration component, and performs flow control, degradation control, system protection control and access control according to the adjusted fusing condition.
In one embodiment, as shown in fig. 6, the network request fusing method includes the following steps:
s602, when a starting instruction is received, the fusing condition is read from the condition configuration platform through the initialization component, and the condition configuration component is created.
S604, storing the fusing condition into a buffer area of the condition configuration component.
S606, when the condition adjustment information is received, the adjusted fusing condition is obtained from the condition configuration platform through the condition configuration component, and the adjusted fusing condition is stored in the cache region of the condition configuration component.
S608, a network service request for the target resource is received from the requester.
S610, in response to the network service request, obtaining the adjusted fusing condition from the buffer area of the condition configuration component through the fusing control tool.
And S612, determining a weight value corresponding to each adjusted fusing condition, and judging whether to fuse the network service request according to each adjusted fusing condition to obtain a sub-judgment result.
And S614, carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
S616, if the judgment result is yes, fusing the network service request; starting a timer to time; and when the timed duration reaches the preset duration, performing fusing recovery processing on the network service request received from the requester again.
And S618, if the judgment result is negative, calling the target resource according to the network service request, and feeding back the calling result to the requester.
The specific contents of the above S602 to S618 may refer to the specific implementation process described above.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a request fusing device for implementing the network request fusing method mentioned above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so that specific limitations in one or more embodiments of the network request fusing device provided below can be referred to the limitations of the network request fusing method in the foregoing, and details are not described herein again.
In one embodiment, as shown in fig. 7, there is provided a network request fusing apparatus, including: a receiving module 702, an obtaining module 704, a judging module 706, a fusing module 708, and a calling module 710, wherein:
a receiving module 702, configured to receive a network service request for a target resource from a requester;
an obtaining module 704, configured to, in response to the network service request, obtain, by the fusing control tool, a fusing condition from a cache region of the condition configuration component; the fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform;
the judging module 706 is configured to judge whether to perform fusing processing on the network service request according to the fusing condition, so as to obtain a judgment result;
a fusing module 708, configured to perform fusing processing on the network service request if the determination result is yes;
and the calling module 710 is configured to call the target resource according to the network service request if the determination result is negative, and feed back the call result to the requester.
In the above embodiment, a network service request for a target resource is received from a requester, and in response to the network service request, a fusing condition is obtained from a cache region of a condition configuration component by a fusing control tool, and whether to fuse the network service request is determined according to the fusing condition, so as to obtain a determination result. If the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester. Before calling a target resource according to a network service request, the computer equipment judges whether the network service request is fused or not, and fuses the network service request in time, so that the unavailability of the whole micro-service cluster is avoided, and the stability of the micro-service cluster is guaranteed.
In one embodiment, as shown in fig. 8, the apparatus further comprises:
a creating module 712, configured to, when receiving a start instruction, read a fusing condition from the conditional configuration platform through the initialization component and create a conditional configuration component;
the first storage module 714 is used for storing the fusing condition in a buffer area of the condition configuration component.
In one embodiment, the apparatus further comprises:
an obtaining module 704, configured to, when the condition adjustment information is received, obtain, by the condition configuration component, the adjusted fusing condition from the condition configuration platform;
a second storage module 716, configured to store the adjusted fusing condition in a buffer of the condition configuration component;
the obtaining module 704 is further configured to obtain, by the fuse control tool, the adjusted fuse condition from the cache of the condition configuration component in response to the network service request.
In one embodiment, the fuse module 708 is further configured to:
determining a weight value corresponding to each fusing condition;
judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain a sub-judgment result;
and carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
In one embodiment, the apparatus further comprises:
a starting module 718, configured to start a timer to perform timing;
and a recovery module 720, configured to perform fusing recovery processing on the network service request received from the requester again when the timed duration reaches a preset duration.
In one embodiment, the target resource is a resource defined by way of annotation.
The modules in the network request fusing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer apparatus includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected by a system bus, and the communication interface, the display unit and the input device are connected by the input/output interface to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a network request fusing method. The display unit of the computer equipment is used for forming a visual and visible picture, and can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: receiving a network service request for a target resource from a requestor; in response to the network service request, acquiring a fusing condition from a cache region of the condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform; judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when a starting instruction is received, reading a fusing condition from a condition configuration platform through an initialization component and creating a condition configuration component; and storing the fusing condition into a buffer area of the condition configuration component.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when condition adjustment information is received, acquiring the adjusted fusing condition from the condition configuration platform through the condition configuration component; storing the adjusted fusing condition into a cache region of the condition configuration component; and acquiring the adjusted fusing condition from the cache region of the condition configuration component through the fusing control tool in response to the network service request.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining a weight value corresponding to each fusing condition; judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain a sub-judgment result; and carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
In one embodiment, the processor, when executing the computer program, further performs the steps of: starting a timer to time; and when the timed duration reaches the preset duration, carrying out fusing recovery processing on the network service request received from the requester again.
In one embodiment, the target resource is a resource defined by way of annotations.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a network service request for a target resource from a requestor; in response to the network service request, acquiring a fusing condition from a cache region of the condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to the condition adjustment information received from the condition configuration platform; judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In one embodiment, the computer program when executed by the processor further performs the steps of: when a starting instruction is received, reading a fusing condition from a condition configuration platform through an initialization component and creating a condition configuration component; and storing the fusing condition into a buffer area of the condition configuration component.
In one embodiment, the computer program when executed by the processor further performs the steps of: when condition adjustment information is received, acquiring the adjusted fusing condition from the condition configuration platform through the condition configuration component; storing the adjusted fusing condition into a cache region of the condition configuration component; and in response to the network service request, acquiring the adjusted fusing condition from the cache region of the condition configuration component through a fusing control tool.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a weight value corresponding to each fusing condition; judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain a sub-judgment result; and carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
In one embodiment, the computer program when executed by the processor further performs the steps of: starting a timer to time; and when the timed duration reaches the preset duration, carrying out fusing recovery processing on the network service request received from the requester again.
In one embodiment, the target resource is a resource defined by way of annotations.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of: receiving a network service request for a target resource from a requestor; in response to the network service request, acquiring a fusing condition from a cache region of the condition configuration component through a fusing control tool; the fusing condition is a condition adjusted in real time according to the condition adjusting information received from the condition configuration platform; judging whether to perform fusing processing on the network service request according to the fusing condition to obtain a judgment result; if the judgment result is yes, fusing the network service request; if the judgment result is negative, the target resource is called according to the network service request, and the calling result is fed back to the requester.
In one embodiment, the computer program when executed by the processor further performs the steps of: when a starting instruction is received, reading a fusing condition from a condition configuration platform through an initialization component and creating a condition configuration component; and storing the fusing condition into a buffer area of the condition configuration component.
In one embodiment, the computer program when executed by the processor further performs the steps of: when condition adjustment information is received, acquiring the adjusted fusing condition from the condition configuration platform through the condition configuration component; storing the adjusted fusing condition into a cache region of the condition configuration component; and acquiring the adjusted fusing condition from the cache region of the condition configuration component through the fusing control tool in response to the network service request.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a weight value corresponding to each fusing condition; judging whether to perform fusing processing on the network service request according to each fusing condition respectively to obtain a sub-judgment result; and carrying out weighted summation on the sub-judgment results according to the weight values, and determining the judgment results according to the obtained sum values.
In one embodiment, the computer program when executed by the processor further performs the steps of: starting a timer to time; and when the timed duration reaches the preset duration, performing fusing recovery processing on the network service request received from the requester again.
In one embodiment, the target resource is a resource defined by way of annotations.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant country and region.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for network request fusing, the method comprising:
receiving a network service request for a target resource from a requestor; the target resource comprises a service provided by an application client or a service provided by other application clients invoked by the application client;
in response to the network service request, acquiring a fusing condition from a cache region of a condition configuration component through a fusing control tool; the fusing condition is obtained by adjusting the configured fusing condition according to the bandwidth, the flow, the access amount or the response speed of the network; the fusing control tool is a tangent plane class for multiplexing fusing control codes;
respectively scoring the network service requests according to each fusing condition to obtain scores;
carrying out weighted summation on the scores according to the weight values corresponding to the fusing conditions to obtain sum values;
if the sum is larger than or equal to a preset value, stopping responding to the network service request and refusing to receive the network service request from the requester; starting a timer for timing, and performing fusing recovery processing on the network service request received from the requester when the timing duration reaches a preset duration;
if the sum is smaller than a preset value, the target resource is called according to the network service request, and a calling result is fed back to the requester.
2. The method of claim 1, further comprising:
when a starting instruction is received, reading a fusing condition from a condition configuration platform through an initialization component and creating a condition configuration component;
and storing the fusing condition into a cache region of the condition configuration component.
3. The method of claim 1, further comprising:
when condition adjustment information is received, acquiring the adjusted fusing condition from the condition configuration platform through the condition configuration component;
storing the adjusted fusing condition into a cache region of the condition configuration component;
the obtaining, by the fuse control tool, the fuse condition from the buffer of the conditional configuration component in response to the network service request includes:
and in response to the network service request, acquiring the adjusted fusing condition from a cache region of the condition configuration component through a fusing control tool.
4. The method of claim 1, wherein the invoking the target resource according to the network service request and feeding back an invoking result to the requestor comprises:
when the network service request is a request for calling data in the memory, reading the data from the memory according to the network service request, and feeding back the read data serving as a calling result to the requester; alternatively, the first and second electrodes may be,
and when the network service request is a request for calling a program, running a program code according to the network service request, and feeding back a code running result serving as a calling result to the requester.
5. The method of claim 1, wherein the network service request is a hypertext transfer protocol formatted request.
6. The method of claim 1, wherein the target resource is a resource defined by way of an annotation.
7. A network request fusing apparatus, the apparatus comprising:
a receiving module for receiving a network service request for a target resource from a requester; the target resource comprises a service provided by an application client or a service provided by other application clients invoked by the application client;
the acquisition module is used for responding to the network service request and acquiring the fusing condition from the cache region of the condition configuration component through a fusing control tool; the fusing condition is obtained by adjusting the configured fusing condition according to the bandwidth, the flow, the access amount or the response speed of the network; the fusing control tool is a section class for multiplexing fusing control codes;
the judging module is used for respectively scoring the network service requests according to the fusing conditions to obtain scores;
the fusing module is used for carrying out weighted summation on the scores according to the weight values corresponding to the fusing conditions to obtain sum values; if the sum is larger than or equal to a preset value, stopping responding to the network service request and refusing to receive the network service request from the requester; starting a timer for timing, and performing fusing recovery processing on the network service request received from the requester when the timing duration reaches a preset duration;
and the calling module is used for calling the target resource according to the network service request and feeding back a calling result to the requester if the sum is smaller than a preset value.
8. The apparatus of claim 7, further comprising:
the creating module is used for reading the fusing condition from the condition configuration platform through the initializing component and creating a condition configuration component when receiving a starting instruction;
and the first storage module is used for storing the fusing condition into a cache region of the condition configuration component.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202210426280.7A 2022-04-22 2022-04-22 Network request fusing method and device, computer equipment and storage medium Active CN114553786B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210426280.7A CN114553786B (en) 2022-04-22 2022-04-22 Network request fusing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210426280.7A CN114553786B (en) 2022-04-22 2022-04-22 Network request fusing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114553786A CN114553786A (en) 2022-05-27
CN114553786B true CN114553786B (en) 2022-09-09

Family

ID=81666622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210426280.7A Active CN114553786B (en) 2022-04-22 2022-04-22 Network request fusing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114553786B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277820A (en) * 2022-08-02 2022-11-01 中国银行股份有限公司 Dubbo frame-based service fusing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014065784A1 (en) * 2012-10-23 2014-05-01 Hewlett-Packard Development Company. L.P. Controlling distribution and use of a developer application in a network environment
CN112448987A (en) * 2019-08-29 2021-03-05 北京京东尚科信息技术有限公司 Fusing degradation triggering method and system and storage medium
CN112584401A (en) * 2019-09-30 2021-03-30 中兴通讯股份有限公司 Network optimization method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10772062B1 (en) * 2019-04-15 2020-09-08 T-Mobile Usa, Inc. Network-function monitoring and control
CN111984310A (en) * 2020-09-16 2020-11-24 深圳市火星人互动娱乐有限公司 Method for persisting Sentinel based on Nacos push mode
CN112819631B (en) * 2021-02-10 2023-12-08 招联消费金融有限公司 Service data processing method, device, computer equipment and storage medium
CN113905091B (en) * 2021-09-15 2023-09-01 盐城天眼察微科技有限公司 Method and device for processing access request

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014065784A1 (en) * 2012-10-23 2014-05-01 Hewlett-Packard Development Company. L.P. Controlling distribution and use of a developer application in a network environment
CN112448987A (en) * 2019-08-29 2021-03-05 北京京东尚科信息技术有限公司 Fusing degradation triggering method and system and storage medium
CN112584401A (en) * 2019-09-30 2021-03-30 中兴通讯股份有限公司 Network optimization method and device

Also Published As

Publication number Publication date
CN114553786A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
US10972529B2 (en) Page jump method and apparatus
US11588653B2 (en) Blockchain-based smart contract call methods and apparatus, and electronic device
CN107491320B (en) Loading method and device based on mixed-mode mobile application
CN112000348A (en) Control method and device for service gray release and computer equipment
US9792623B2 (en) Advertisement processing method and apparatus
CN110943934A (en) Service request processing method, system, terminal and readable storage medium
CN109086158B (en) Abnormal cause analysis method and device and server
CN114553786B (en) Network request fusing method and device, computer equipment and storage medium
CN111597213A (en) Caching method, software server and storage medium
CN113821721A (en) User portrait based multi-channel message method and device and computer equipment
CN111159612A (en) Countdown method, system, device, computer equipment and storage medium
CN110688210A (en) Task priority determination method and device
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN113190229A (en) Method and device for generating government affair page
CN110569114B (en) Service processing method, device, equipment and storage medium
CN112035113A (en) Navigation bar loading method, device, equipment and medium of H5 page
CN112433779B (en) Application site preloading method, device and storage medium based on ERP system
CN115086194A (en) Data transmission method for cloud application, computing equipment and computer storage medium
US20130145013A1 (en) Communication terminal and content update method
CN114297552A (en) Form expansion method and device, computer equipment and storage medium
CN108021475B (en) Data recovery method and device
CN111913732A (en) Service updating method and device, management server and storage medium
CN114185845A (en) File management method and device, computer equipment and storage medium
CN111198986A (en) Information sending method and device, electronic equipment and storage medium
CN112861041B (en) Media content display method and device, electronic equipment and storage medium

Legal Events

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