Server and control method thereof

A server-side and client-side technology, which is applied in the field of data processing, can solve problems such as the incomplete circuit breaker downgrade mechanism and the failure of the server side, so as to ensure normal operation

Pending Publication Date: 2021-03-05
SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
4 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

However, the current circuit breaker downgrade mechanism is...
View more

Method used

Specifically, when an error occurs in the internal responder 10, the interceptor 30 can be controlled to perform degradation processing, and the interceptor 30 can also be controlled to perform fusing processing, and the interceptor 30 can also be controlled to perform degradation processing, and then the interceptor 30 can be controlled to perform fusing deal with. Degradation processing means that when the pressure on the server 100 increases sharply, the load of the overall architecture of the server 100 exceeds the preset upper threshold or the upcoming traffic is expected to exceed the preset threshold, for example: data access When the volume increases sharply, the response time of the server 100 is slow or does not respond, or other non-core data affects the request of the core data, it is still necessary to ensure that the server 100 is still available and can return corresponding data. The server 100 can be automatically downgraded according to some key data to ensure that the important...
View more

Abstract

The invention discloses a server and a control method thereof. And the server comprises an internal responder, a local memory and an interceptor. The internal responder is used for responding to the request; the local memory is used for storing degradation data and/or fusing data; and the interceptor is used for performing degradation processing and/or fusing processing when an error occurs in theinternal responder, acquiring the degradation data and/or the fusing data from the local memory and returning corresponding data. According to the server and the control method thereof provided by the embodiment of the invention, degradation processing and/or fusing processing can be carried out when the internal responder has an error, so that the server can work normally, and a micro-service system can work normally.

Application Domain

Interprogram communicationRelational databases +2

Technology Topic

Local memoriesService system +4

Image

  • Server and control method thereof
  • Server and control method thereof
  • Server and control method thereof

Examples

  • Experimental program(1)

Example Embodiment

[0012] Embodiments of the present application are described in detail below, embodiments of which are illustrated in the drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary, are only for explaining the present application, and should not be construed as limiting the present application.
[0013] Please also refer to figure 1 and figure 2 , the control method of the embodiment of the present application is used to control the server 100, the server 100 includes an internal responder 10, a local storage 20 and an interceptor 30, the internal responder 10 is used to respond to the request; the local storage 20 is used to store degraded data and/or fuse data. Control methods include:
[0014] 01: Control the interceptor 30 to perform degradation processing and/or fusing processing when an error occurs in the internal responder 10;
[0015] 02: The control interceptor 30 obtains the degradation data and/or fusing data from the local storage 20 and returns corresponding data.
[0016] The control method of the present application may be implemented by the server 100 in the embodiment of the present application, and the server 100 may include a processor. Wherein, both step 01 and step 02 can be implemented by the processor, that is to say, the processor is used to: control the interceptor 30 to perform degradation processing and/or fusing processing when the internal responder 10 has an error; control the interceptor 30 from the local The degradation data and/or fusing data are acquired from the memory 20 and the corresponding data is returned.
[0017] The processor may refer to a driver board. The driver board can be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gates Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0018] see again figure 1 , the server 100 in the embodiment of the present application includes an internal responder 10 , a local storage 20 and an interceptor 30 . The internal responder 10 is used to respond to the request, the local storage 20 is used to store degraded data and/or fusing data, and the interceptor 30 is used to perform degraded processing and/or fusing processing when an error occurs in the internal responder 10 and retrieve the data from the local storage 20. Obtain degradation data and/or circuit breaker data and return corresponding data.
[0019] The server 100 and its control method in the embodiment of the present application can perform downgrade processing and/or fusing processing when an error occurs in the internal responder 10, thereby ensuring that the server 100 can work normally, and then can ensure that the microservice system can work normally . In addition, obtaining degraded data and/or blown data from the local storage 20 and returning corresponding data can be used to respond to requests, thereby being able to resist the impact of short-term large-capacity requests.
[0020] Specifically, when an error occurs in the internal responder 10, the interceptor 30 can be controlled to perform downgrade processing, or the interceptor 30 can be controlled to perform fusing processing, or the interceptor 30 can be controlled to perform downgrade processing first, and then the interceptor 30 can be controlled to perform fusing processing. Degradation processing means that when the pressure on the server 100 increases sharply, the load of the overall architecture of the server 100 exceeds the preset upper threshold or the upcoming traffic is expected to exceed the preset threshold, for example: data access When the volume increases sharply, the response time of the server 100 is slow or does not respond, or other non-core data affects the request of the core data, it is still necessary to ensure that the server 100 is still available and can return corresponding data. The server 100 can be automatically downgraded according to some key data to ensure that the important or basic data of the server 100 can run normally, and the downgrade can be processed in a simple way, so as to avoid the situation where the server 100 fails and causes the entire system to avalanche appears to ensure that the server 100 can operate normally.
[0021] It is worth mentioning that fuse processing refers to the behavior that when the called party fails during the service call, for the purpose of self-protection, the caller will actively stop the call, and perform corresponding processing according to the data needs, and actively stop the call It is fusing treatment. In one example, when the first server fails, such as slow response or response timeout, if the second server continues to request the first server, the response time of the second server will also increase, causing the second server to Response is slow. If the second server does not perform fusing processing, the failure of the first server will be transmitted to the second server, and eventually the second server will also be unavailable, so it is necessary to perform fusing processing on the server.
[0022] In some implementations, the local storage 20 may be a storage pool RocksDB. RocksDB is an efficient database software capable of storing data on fast storage. RocksDB has superior performance under fast storage and high data pressure.
[0023] In some implementations, the interceptor 30 can be a Hystrix interception component, which can avoid the solution that the server 100 is unavailable due to resource exhaustion caused by dependency delays and exceptions through interception.
[0024] see image 3 , in some embodiments, the internal responder 10 includes a database 12, and the control method includes:
[0025] When an error occurs in the read operation of the database 12, the downgrade process is performed and the downgrade data is obtained from the local storage 20 and returned.
[0026] In some implementations, the internal responder 10 includes a database 12, and the interceptor 30 is configured to: perform downgrade processing when an error occurs in a read operation on the database 12, obtain degraded data from the local storage 20, and return the degraded data.
[0027] Specifically, when an error occurs in the read operation of the database 12 , the interceptor 20 may perform downgrade processing, and the interceptor 20 may also obtain degraded data from the local storage 20 and return the degraded data. It is worth mentioning that the degraded data may be degraded data written in the local storage 20 in advance, and the degraded data may also be prompt sentences pre-stored in the local storage 20 . In an example, when the interceptor 20 does not obtain the request data in the local storage 20, the degraded data obtained by the interceptor 20 may be a prompt sentence pre-stored in the internal responder, and the prompt sentence may be: "request error" Wait for prompts.
[0028] In some embodiments, the control method also includes:
[0029] Calculate the first error rate for the read operation of the database 12 and perform fusing processing when the first error rate exceeds the first preset error rate and obtain the fusing data from the local storage 20 and return the fusing data.
[0030] In some embodiments, the internal responder 10 includes a database 12, and the interceptor 30 is configured to: calculate a first error rate for a read operation of the database 12 and perform a fuse when the first error rate exceeds a first preset error rate Process and obtain the fusing data from the local storage 20 and return the fusing data.
[0031] Specifically, the interceptor 30 can be used to calculate the first error rate of the read operation of the database 12, and when the interceptor 30 calculates that the first error rate of the read operation of the database 12 exceeds the first preset error rate, it can Perform fusing processing, obtain fusing data from the local storage 20 and return the fusing data. The first preset error rate may be a threshold set by the server 100 in advance, for example, 50%. The first error rate may be obtained by real-time monitoring and calculation by the interceptor 30 during the request process. During the fusing period, the interceptor 30 can directly obtain the fusing data from the local storage 20 and return the fusing data, and the returned fusing data can be used for corresponding requests, thereby being able to resist the impact of short-term large-capacity requests. Wherein, the maintenance time during the fusing period can be determined by preset or user settings.
[0032] In some implementations, the internal responder 10 includes a secondary cache 14, and the control method includes:
[0033] When an error occurs in the read operation for the secondary cache 14, the downgrade process is performed, and the downgrade data is obtained from the local storage 20 and returned.
[0034] see again image 3, in some implementations, the internal responder 10 includes a secondary cache 14, and the interceptor 30 is configured to: perform downgrade processing when an error occurs in a read operation for the secondary cache 14 and obtain the degraded data from the local storage 20 and Return downgrade data.
[0035] Specifically, when an error occurs in the read operation of the secondary cache 14 , the interceptor 30 may perform downgrade processing, and may also acquire degraded data from the local storage 20 and return the degraded data. It is worth mentioning that the degraded data may be degraded data written in the local storage 20 in advance, and the degraded data may also be prompt sentences pre-stored in the local storage 20 . In an example, when the interceptor 20 does not obtain the request data in the local storage 20, the degraded data obtained by the interceptor 20 may be a prompt sentence pre-stored in the internal responder, and the prompt sentence may be: "request error" Wait for prompts.
[0036] It is worth mentioning that, in some embodiments, the secondary cache 14 can be a Redis database, and the Redis database is a key-value pair storage database that includes multiple data structures, supports the network, is based on memory, and has optional persistence, and the Redis database It has the characteristics of memory-based operation, high performance, and support for distribution, and can be better applied in the server 100.
[0037] In some implementations, the internal responder 10 includes a secondary cache 14, and the control method further includes:
[0038] Calculate the second error rate for the read operation of the L2 cache 14 and perform fusing processing when the second error rate exceeds the second preset error rate and obtain the fusing data from the local storage 20 and return the fusing data.
[0039] In some embodiments, the internal responder 10 includes a second-level cache 14, and the interceptor 30 is configured to: calculate a second error rate for a read operation of the second-level cache 14 and when the second error rate exceeds a second preset error When the rate is high, the fuse processing is performed, and the fuse data is obtained from the local memory 20 and the fuse data is returned.
[0040] Specifically, the interceptor 30 can be used to calculate the second error rate for the read operation of the secondary cache 14, when the interceptor 30 calculates that the second error rate of the read operation of the secondary cache 14 exceeds the second preset error rate When the rate is high, fuse processing can be performed. And obtain the fusing data from the local memory 20 and return the fusing data. The second preset error rate may be a threshold set by the server 100 in advance. The first preset error rate may be the same as or different from the second preset error rate. The second preset error rate is, for example, 50%. The second error rate may be obtained by real-time monitoring and calculation during the request process by the interceptor 30 . During the fusing process, the interceptor 30 can directly obtain the fusing data from the local storage 20 and return the fusing data, and the returned fusing data can be used to respond to requests, thereby being able to resist the impact of short-term large-capacity requests.
[0041] see again image 3 , in some implementations, the internal responder 10 also includes a first-level cache 16, and the control method includes:
[0042] When there is a write operation to the L1 cache 16 , the data of the write operation is stored in the local memory 20 .
[0043] In some implementations, the internal responder 10 further includes a first-level cache 16 , and the interceptor 30 is configured to: when there is a write operation for the first-level cache 16 , store the data of the write operation into the local memory 20 .
[0044] Specifically, the interceptor 30 stores the data of the write operation into the local memory 20 when there is a write operation to the L1 cache 16 . In this way, when an error occurs in the secondary cache 14 or the database 12 , corresponding data can be directly obtained from the local storage 20 .
[0045] It is worth mentioning that, in some implementation manners, the level 1 cache 16 may be a Cache2K database, and the Cache2K database is a Java cache library with high memory performance. When the internal responder 10 responds to the request, it may search in the Cache2K database preferentially.
[0046] In some implementations, the write operation to the L1 cache 16 and the data stored in the write operation into the local memory 20 are performed asynchronously. Asynchronously writing the write operation into the L1 cache 16 and storing the data of the write operation into the local memory 20 can ensure the integrity of the data. Compared with writing data asynchronously, the speed of writing data synchronously is slower than writing data asynchronously, and writing data synchronously may also cause data not to be written into the local storage 20 at last, resulting in data loss. Therefore, the write operation to the L1 cache 16 and the data stored in the write operation into the local memory 20 are performed asynchronously.
[0047] In some implementations, the internal responder 10 includes a remote procedure call client, and the interceptor 30 is used to perform downgrade processing and/or fusing processing when an error occurs in the remote procedure call client, and obtain downgrade data and /or Fuse the data and return the corresponding data.
[0048] Specifically, a remote procedure call client (Remote Procedure Call, RPC) refers to a protocol for requesting a service from a remote computer program through a network without knowing the underlying network technology. In an example, the two clients are respectively the first client and the second client, and the first client and the second client are not in the same memory space. A request response is deployed on the first client and wants to call the data of the second client. Since it is not in the same memory space, it cannot be called directly. It needs to express the semantics of the call and convey the called data through the network. In this way, the internal responder 10 can include a remote procedure call client, and the interceptor 30 can be used to perform downgrade processing and obtain degraded data from the local memory 20 when an error occurs in the remote procedure call client; the interceptor 30 can also be used for remote procedure call When an error occurs at the calling client, fuse processing is performed and corresponding data is returned; the interceptor 30 can also be used when an error occurs at the remote procedure call client, first performing downgrade processing, and then performing fuse processing and returning corresponding data. In this way, an avalanche of the entire system can be avoided.
[0049] In some implementations, the internal responder 10 includes an HTTP client, and the interceptor 30 is used to perform degradation processing and/or fusing processing and obtain the degradation from the local storage 20 when an error occurs in the HTTP client. data and/or fuse data and return the corresponding data.
[0050] Specifically, a hypertext transfer protocol client (Hyper Text Transfer Protocol, HTTP) is a protocol between a client and a server, and a request is usually initiated by a receiver. The internal responder 10 can include a hypertext transfer protocol client, and the interceptor 30 can be used to degrade when an error occurs in the hypertext transfer protocol client, and obtain degraded data from the local storage 20; the interceptor 30 can also be used to When an error occurs on the HTTP client side, fuse processing is performed and corresponding data is returned; the interceptor 30 can also be used to perform downgrade processing when an error occurs on the HTTP client side, and then perform fuse processing and return the corresponding data. The data. In this way, an avalanche of the entire system can be avoided.
[0051] It is worth mentioning that the internal responder 10 may include all external dependencies. The interceptor 30 is used to perform downgrade processing and/or fusing processing when an error occurs in an external dependency, obtain downgraded data and/or fusing data from the local storage 20, and return corresponding data.
[0052] In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. In addition, those skilled in the art can combine and combine different embodiments or examples and features of different embodiments or examples described in this specification without conflicting with each other.
[0053] In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0054] Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments or portions of code comprising one or more executable instructions for implementing specific logical functions or steps of the process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.
[0055] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limitations on the present application, and those skilled in the art can make the above-mentioned The embodiments are subject to changes, modifications, substitutions and variations.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Touch display panel and touch display device

ActiveCN110456942APrevent electrostatic breakdownGuaranteed to work
Owner:KUNSHAN GO VISIONOX OPTO ELECTRONICS CO LTD

Foreign body resistant washing machine inner tub structure

Owner:WUXI HONGCHENG PAPER MAKING MACHINERY

Version upgrading method and device, electronic equipment and storage medium

PendingCN111596940AGuaranteed to workGuaranteed normal processing
Owner:杭州视联动力技术有限公司

Classification and recommendation of technical efficacy words

Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products