A method and device for downgrading hotspot data considering the relationship between servers
Through the analysis of the relationship between servers and the generation of processing strategies, the problem in the existing technology of being unable to effectively cope with the pressure of cross-server hotspot data is solved. Reasonable responses and early responses between servers are achieved, and the system's high-load processing capability is improved. .
Patent Information
- Application Number
- CN202410962714.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing hot data identification methods only consider the control strategy of a single server and cannot effectively cope with the pressure of cross-server hot data that may occur in global applications such as global shopping websites.
By obtaining the client's service request, determining whether it is hot data, and generating different processing methods based on the relationship between servers, including query instructions, short-term delay circuit breaker instructions and migration instructions, the processing strategy of each server is optimized.
It enables different servers to respond reasonably and respond in advance when facing hot data, and improves the system's processing capability and stability under high load conditions.
Smart Images

Figure CN118509490B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hotspot data processing, and in particular to a method for downgrading hotspot data taking into account the relationship between service terminals and a device for downgrading hotspot data taking into account the relationship between service terminals. Background Art
[0002] Hot Data: refers to data that is frequently accessed in a distributed system.
[0003] Auto Degradation: Automatically taking measures to reduce system performance requirements when the system load is too high.
[0004] The demand for large-capacity storage in practical applications has led to the birth of RAID technology and the formation of disk array products. With the continuous development of cloud computing, cloud storage and other technologies, the capacity of information storage has exploded, and the demand for disk arrays has expanded day by day. As a shared resource, the storage system needs to provide services to many different types of applications at the same time. These different types of applications have different load characteristics and performance requirements. Many applications have high requirements for random IO concurrency when accessing the storage system. In order to meet the requirements of applications and improve the storage system's ability to process IO requests per second (I / O persecond, IOPS), new technologies such as hot data migration and secondary cache have been introduced, but these technologies all rely on hot data identification technology.
[0005] In the existing hot data identification process, only the control strategy of a single server is considered when hot data breaks out. However, for any global shopping website, it will deploy a considerable number of servers across the country or even the world to store and support data. If only the server where the hot data appears is considered, it will not be possible to respond in advance to other servers that may occur regarding the hot data. Summary of the invention
[0006] The purpose of the present invention is to provide a hotspot data degradation method considering the relationship between servers to solve at least one of the above-mentioned technical problems.
[0007] One aspect of the present invention provides a method for downgrading hotspot data considering the relationship between servers, the method for downgrading hotspot data considering the relationship between servers comprising:
[0008] Obtain service requests issued by the client within a preset time period;
[0009] Determine whether the service request is hot data based on the customer service request. If so,
[0010] Get the relationship between other servers and the server that initiates the request based on the service request;
[0011] Generate a processing method for each server based on the relationship between the other servers and the server that initiated the request, and at least one server's processing method is different from the other servers;
[0012] The processing methods are sent to the corresponding servers respectively, so that the servers perform different processing according to the received processing methods.
[0013] Optionally, judging whether the service request is hot data according to the customer service request includes:
[0014] It is determined whether the number of service requests sent by any client exceeds a first preset threshold within a preset time period. If so, the service request is the first hotspot data.
[0015] Optionally, judging whether the service request is hot data according to the customer service request further includes:
[0016] It is determined whether within a preset time period, the sum of the number of identical service requests sent by any plurality of clients exceeds a second preset threshold; if so, the service request is determined to be second hotspot data.
[0017] Optionally, obtaining the relationship between the other server and the server initiating the request according to the service request includes:
[0018] Obtain a service request knowledge graph, wherein a server has multiple service request knowledge graphs, and a service request knowledge graph under a server indicates a connection score between the server and other servers in a service request, wherein each of the service request indication graphs includes a primary server and multiple secondary servers, each secondary server is connected to the primary server, and a connection distance between a primary server and a secondary server indicates a connection score between the primary server and the secondary server for the service request, and a higher connection score indicates a longer connection distance;
[0019] According to the service request knowledge graph, the connection scores between the server initiating the request and each server in the service request knowledge graph corresponding to the hot data under the server initiating the request are obtained;
[0020] Acquire a server whose contact score is higher than a first preset threshold as a first relationship server;
[0021] Acquire a server whose contact score is equal to the first preset threshold as a second relationship server;
[0022] A server whose contact score is lower than a first preset threshold is obtained as a third relationship server.
[0023] Optionally, the connection score is obtained by the following method:
[0024] Respectively obtain a historical database of each server, wherein the historical database includes each historical service request obtained within a historical time period and basic information of each historical service request obtained;
[0025] Perform the following operations on the server that initiates the request:
[0026] Obtain basic information of a historical service request that is the same as the service request in the historical database, where the basic information of the historical service request of the server that initiates the request is referred to as first basic information;
[0027] Perform the following operations for each server:
[0028] Obtain basic information of the historical service request that is the same as the service request in the historical database. The basic information of the historical service request on the server side is called second basic information.
[0029] The relationship between the server and the server initiating the request is obtained according to the first basic information and the second basic information.
[0030] Optionally, the basic information includes the name of the historical service request and the time point of each acquisition of the historical service request;
[0031] The obtaining of the connection score between the server and the server initiating the request according to the first basic information and the second basic information includes:
[0032] Obtain the time point of each historical service request in the first basic information;
[0033] Setting a first grace time, a second grace time, and a third grace time for each time point of the historical service request in the first basic information;
[0034] Eliminate the historical service requests in the second basic information whose time points do not fall within any of the first grace period and the second grace period;
[0035] Get the number of historical service requests belonging to the first grace period;
[0036] Get the number of historical service requests that belong to the second grace period;
[0037] Get the number of historical service requests that fall within the third grace period;
[0038] Acquire a historical service request scoring database of the historical service request, wherein the historical service request scoring database includes a single score of a first grace period, a single score of a second grace period, and a single score of a third grace period;
[0039] Obtaining a first grace time score according to the individual score of the first grace time and the number of historical service requests belonging to the first grace time;
[0040] Obtaining a second grace time score according to the individual score of the second grace time and the number of historical service requests belonging to the second grace time;
[0041] Obtaining a third grace time score according to the individual score of the third grace time and the number of historical service requests belonging to the third grace time;
[0042] The sum of the first grace time score, the second grace time score and the third grace time score is obtained as a connection score between the server and the server initiating the request.
[0043] Optionally, when the hotspot data is the first hotspot data, generating a processing method for each server according to the relationship between the other servers and the server initiating the request includes:
[0044] If the relationship information between the server that obtains the first hotspot data and other servers includes a first relationship server, a second relationship server, and a third relationship server, then
[0045] Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each first relationship server, wherein the inquiry instruction is used to enable each first relationship server to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and wherein the short-time delay fuse instruction is used to enable each first relationship server with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases;
[0046] Generate a first migration instruction, where the first migration instruction is used to send to each second relationship server, so that each second relationship server that obtains the second migration instruction performs cache migration;
[0047] A second migration instruction is generated, where the second migration instruction is used to be sent to each third-relationship server end, so that each third-relationship server end that obtains the second migration instruction performs cache migration.
[0048] Optionally, when the hotspot data is second hotspot data, generating a processing method for each server according to the relationship between the other server and the server initiating the request includes:
[0049] Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each second relationship server end, wherein the inquiry instruction is used to enable each first relationship server end to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and the short-time delay fuse instruction is used to enable each first relationship server end with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases;
[0050] A first migration instruction is generated, where the first migration instruction is sent to each second relationship server and the third relationship server, so that each second relationship server or the third relationship server that obtains the first migration instruction performs cache migration.
[0051] Optionally, the first migration instruction includes:
[0052] storing at least a portion of cache data in the first-level cache into the second-level cache;
[0053] The second migration instruction includes:
[0054] Migrate at least part of the cached data in the secondary cache to the data pool, wherein:
[0055] The first-level cache uses a memory-type cache;
[0056] The secondary cache is stored using a document-based database.
[0057] The present application also provides a hotspot data degradation device considering the relationship between the servers, and the hotspot data degradation device considering the relationship between the servers includes:
[0058] A service request acquisition module, which is used to acquire service requests issued by the client within a preset time period;
[0059] A hot data determination module, the hot data determination module is used to determine whether the service request is hot data according to the customer service request;
[0060] A server relationship acquisition module, the server relationship acquisition module is used to obtain the relationship between other servers and the server initiating the request according to the service request when the hot data judgment module determines that it is yes;
[0061] A processing method generation module, the processing method generation module is used to generate a processing method for each server according to the relationship between the other servers and the server initiating the request, and the processing method of at least one server is different from that of the other servers;
[0062] The distribution module is used to send the processing methods to the corresponding service ends respectively, so that the service ends can perform different processing according to the received processing methods.
[0063] Beneficial Effects
[0064] The hotspot data degradation method of the present application that considers the relationship between servers generates different processing strategies after determining the occurrence of hotspot data by obtaining the relationship between different servers and the server that initiates the request, so that different servers can make the most reasonable response when facing the same hotspot data, thereby enabling other servers to respond in advance. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flowchart of a hotspot data degradation method that takes into account the relationship between servers according to an embodiment of the present application.
[0066] Figure 2 It is used to realize Figure 1 A schematic diagram of an electronic device showing a method for downgrading hotspot data taking into account the relationship between servers is shown.
[0067] Figure 3 It is a structural diagram of a service request knowledge graph in a hot data degradation method that considers the relationship between servers in an embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical scheme and advantages of the implementation of this application clearer, the technical scheme in the embodiment of this application will be described in more detail below in conjunction with the drawings in the embodiment of this application. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of this application, not all of them. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain this application, and should not be construed as limitations on this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The embodiments of this application are described in detail below in conjunction with the drawings.
[0069] Figure 1 It is a flowchart of a hotspot data degradation method that takes into account the relationship between servers according to an embodiment of the present application.
[0070] like Figure 1 The hotspot data degradation method considering the relationship between servers shown includes:
[0071] Step 1: Obtain service requests issued by the client within a preset time period;
[0072] Step 2: Determine whether the service request is hot data based on the customer service request. If so,
[0073] Step 3: Obtain the relationship between other servers and the server that initiates the request based on the service request;
[0074] Step 4: Generate a processing method for each server based on the relationship between the other servers and the server that initiated the request. The processing method of at least one server is different from that of the other servers.
[0075] Step 5: Send the processing methods to the corresponding servers respectively, so that the servers can perform different processing according to the received processing methods.
[0076] The hotspot data degradation method of the present application that considers the relationship between servers generates different processing strategies after determining the occurrence of hotspot data by obtaining the relationship between different servers and the server that initiates the request, so that different servers can make the most reasonable response when facing the same hotspot data, thereby enabling other servers to respond in advance.
[0077] In this embodiment, judging whether the service request is hot data according to the customer service request includes:
[0078] It is determined whether the number of service requests sent by any client exceeds a first preset threshold within a preset time period. If so, the service request is the first hotspot data.
[0079] In this embodiment, judging whether the service request is hot data according to the customer service request further includes:
[0080] It is determined whether within a preset time period, the sum of the number of identical service requests sent by any plurality of clients exceeds a second preset threshold; if so, the service request is determined to be second hotspot data.
[0081] For example, the data heat can be set to hot_spot according to the number of accesses. The data heat will continue to decrease over time. When the heat drops to a certain value, the data becomes cold data. The data heat is variable. For example, the data heat of a service request is set to 10 according to the number of accesses. After that, each time the data is accessed, the data heat of the data increases by 1. If the data exceeds the first preset threshold, the service request is considered to be hot data.
[0082] For example, in an online shopping platform, if a service request (such as entering a product interface homepage) surges within a certain period of time and exceeds a certain value, then the service request may be hot data.
[0083] In this embodiment, obtaining the relationship between the other server and the server initiating the request according to the service request includes:
[0084] Obtain a service request knowledge graph, wherein a server has multiple service request knowledge graphs, and a service request knowledge graph under a server indicates a connection score between the server and other servers in a service request, wherein each of the service request indication graphs includes a primary server and multiple secondary servers, each secondary server is connected to the primary server, and a connection distance between a primary server and a secondary server indicates a connection score between the primary server and the secondary server for the service request, and a higher connection score indicates a longer connection distance;
[0085] According to the service request knowledge graph, the connection scores between the server initiating the request and each server in the service request knowledge graph corresponding to the hot data under the server initiating the request are obtained;
[0086] Acquire a server whose contact score is higher than a first preset threshold as a first relationship server;
[0087] Acquire a server whose contact score is equal to the first preset threshold as a second relationship server;
[0088] A server whose contact score is lower than a first preset threshold is obtained as a third relationship server.
[0089] For example, a service request knowledge graph can be Figure 3 As shown, from Figure 3 It can be seen that in the service request knowledge graph, it is assumed that the client server that issues the service request is server A, and the service request knowledge graph is based on a service request (assuming that the service request is a request to visit a store). Servers B, C, and D are respectively connected to server A and the lengths of the connecting lines are different. Assuming that the first preset threshold is set to 4 cm, and assuming that the length of the connecting line between server A and server B is 4 cm, then server B is the second relationship server, the length of the connecting line between server D and server A is 8 cm, which is higher than the first preset distance, then server D is the first relationship server, and the length of the connecting line between server C and the service request is 3 cm, which is lower than the first preset distance, then server D is the first relationship server.
[0090] In this embodiment, the connection score is obtained by the following method:
[0091] Respectively obtain a historical database of each server, wherein the historical database includes each historical service request obtained within a historical time period and basic information of each historical service request obtained;
[0092] Perform the following operations on the server that initiates the request:
[0093] Obtain basic information of a historical service request that is the same as the service request in the historical database, where the basic information of the historical service request of the server that initiates the request is referred to as first basic information;
[0094] Perform the following operations for each server:
[0095] Obtain basic information of the historical service request that is the same as the service request in the historical database. The basic information of the historical service request on the server side is called second basic information.
[0096] The relationship between the server and the server initiating the request is obtained according to the first basic information and the second basic information.
[0097] In this embodiment, the basic information includes the name of the historical service request and the time point of each acquisition of the historical service request;
[0098] The obtaining of the connection score between the server and the server initiating the request according to the first basic information and the second basic information includes:
[0099] Obtain the time point of each historical service request in the first basic information;
[0100] Setting a first grace time, a second grace time, and a third grace time for each time point of the historical service request in the first basic information;
[0101] Eliminate the historical service requests in the second basic information whose time points do not fall within any of the first grace period and the second grace period;
[0102] Get the number of historical service requests belonging to the first grace period;
[0103] Get the number of historical service requests that belong to the second grace period;
[0104] Get the number of historical service requests that fall within the third grace period;
[0105] Acquire a historical service request scoring database of the historical service request, wherein the historical service request scoring database includes a single score of a first grace period, a single score of a second grace period, and a single score of a third grace period;
[0106] Obtaining a first grace time score according to the individual score of the first grace time and the number of historical service requests belonging to the first grace time;
[0107] Obtaining a second grace time score according to the individual score of the second grace time and the number of historical service requests belonging to the second grace time;
[0108] Obtaining a third grace time score according to the individual score of the third grace time and the number of historical service requests belonging to the third grace time;
[0109] The sum of the first grace time score, the second grace time score and the third grace time score is obtained as a connection score between the server and the server initiating the request.
[0110] For example, obtain the historical database of each server separately, for example, obtain the historical database A of server A, the historical database B of server B, the historical database C of server C, and the historical database D of server D. It is assumed that each historical database has historical service request records. For example, they all have service request records from January 1, 2023 to the day before the current time point (assuming it is January 1, 2024). For the sake of convenience of example, only one service request is taken as an example. For example, the service request is a request to visit a specific store. It can be understood that there will be many service requests in the actual historical database.
[0111] Assume that in the historical database A of server A, the number of requests to access the specific store is 800,000 times, then there are 800,000 basic information of historical service requests, of which the names of these 800,000 are the same (for example, they are all requests to access a specific store), and each of them corresponds to a time point (for the convenience of subsequent examples, only 8 of them are taken as an example. If there are 8, there are 8 time points. Assume that the 8 are request 1, request 2, request 3, request 4, request 5, request 6, request 7, and request 8, then request 1 corresponds to a time point 1, request 2 corresponds to a time point 2, request 3 corresponds to a time point 3, and so on).
[0112] At this time, a first grace time, a second grace time and a third grace time are set for the time point of each historical service request in the first basic information. For example, taking request 1 as an example, assuming that the time point 1 corresponding to request 1 is 11:00 on March 4, 2023, the first grace time, the second grace time and the third grace time can be set with every 5 minutes as a time period. The first grace time is from 11:00 on March 4, 2023 to 11:05 on March 4, 2023, the second grace time is from 11:05 on March 4, 2023 to 11:10 on March 4, 2023, and the third grace time is from 11:10 on March 4, 2023 to 11:15 on March 4, 2023.
[0113] Taking request 2 as an example, assuming that the time point 1 corresponding to request 2 is 12:00 on March 4, 2023, the first grace time, the second grace time, and the third grace time can be set with every 5 minutes as a time period. The first grace time is from 12:00 on March 4, 2023 to 12:05 on March 4, 2023, the second grace time is from 12:05 on March 4, 2023 to 12:10 on March 4, 2023, and the third grace time is from 12:10 on March 4, 2023 to 12:15 on March 4, 2023.
[0114] Set the first grace time, second grace time, and third grace time for each request, that is, request 1 has three grace times, request 2 has three grace times, request 3 has three grace times, and so on.
[0115] In this embodiment, the historical service requests in the second basic information whose time points do not belong to any of the first grace period and the second grace period are eliminated. Taking server B as an example, there are also many records of the historical service requests in the historical database B of server B (for the convenience of example, it is assumed that there are 10 records of server B). Among them, it is assumed that the basic information time point of a historical service request (hereinafter referred to as server B request 1) is 12:10 on May 4, 2023. For example, the first grace period of request 1 is March 4, 2023. The first grace period is from 11:00 on March 4, 2023 to 11:05 on March 4, 2023, the second grace period is from 11:05 on March 4, 2023 to 11:10 on March 4, 2023, and the third grace period is from 11:10 on March 4, 2023 to 11:15 on March 4, 2023. It is obvious that the time point of server B's request 1 is not within these three grace periods. Assuming that among the 8 requests in the above historical database A, none of the three grace periods of any request include 12:10 on May 4, 2023, then server B's request 1 is eliminated.
[0116] For another example, suppose there is a historical service request (hereinafter referred to as server B request 2) whose basic information time point is 12:09 on March 4, 2023. It is obviously within the third grace period of request 1, so it will not be eliminated, and server B request 2 belongs to the historical service request within the third grace period.
[0117] Get the number of historical service requests belonging to the first grace period;
[0118] Get the number of historical service requests that belong to the second grace period;
[0119] Get the number of historical service requests that fall within the third grace period;
[0120] Assume that the number of historical service requests belonging to the first grace period in server B obtained through the above method is 3, the number of historical service requests belonging to the second grace period is 2, and the number of historical service requests belonging to the third grace period is 1, that is, 5 are eliminated.
[0121] Obtain a historical service request scoring database for the historical service request, where the historical service request is the above-mentioned request to visit a specific store. Obtain a historical service request scoring database for the historical service request. For example, in the historical service request scoring database, the individual score for the first grace period is set to 3 points, the individual score for the second grace period is set to 2 points, and the individual score for the third grace period is set to 1 point. It can be understood that the scores here can be set as needed, for example, they can also be 0.3 points, 0.2 points, or 0.1 points.
[0122] In this embodiment, the first grace time score is obtained according to the individual score of the first grace time and the number of historical service requests belonging to the first grace time;
[0123] Obtaining a second grace time score according to the individual score of the second grace time and the number of historical service requests belonging to the second grace time;
[0124] Obtaining a third grace time score according to the individual score of the third grace time and the number of historical service requests belonging to the third grace time;
[0125] The sum of the first grace time score, the second grace time score and the third grace time score is obtained as a connection score between the server and the server initiating the request.
[0126] Taking the above embodiment as an example, assuming that the number of historical service requests belonging to the first grace period in the server B obtained by the above method is 3, each with 3 points, the total score is 9 points;
[0127] The number of historical service requests that fall within the second grace period is 2, 2 points each, for a total of 4 points;
[0128] The number of historical service requests that fall within the third grace period is 1, and 1 point is awarded for each request, that is, the total score is 14 points.
[0129] In this embodiment, the relationship between the connection score and the length of the connecting line can be set according to one's own needs. For example, if the score is high, each point can be converted to 0.1 cm or 0.1 mm. If the score is low, each point can be converted to 1 cm. It can be set according to one's own needs.
[0130] In this embodiment, the contact score obtained by the above method reflects the relationship between two servers (for example, server A and server B) in history regarding a specific service request (for example, the above-mentioned visit to a specific store), that is, if server A has the request at a certain time point, there is a probability that server B will have the request. The higher the probability, the higher the contact score (that is, it is considered that there is a strong correlation between the two), and the lower the probability, the higher the contact score (that is, there is little relationship between the two). By setting different scores for the first grace time, the second grace time, and the third grace time, the correlation with a longer delay can be separated from the correlation with a shorter delay. For example, server B and server C are both relatively related to server A. For example, when server A has a service request, generally server B and server C will have the service request. However, server B generally has a delay of about 10 minutes, while server C basically has a delay of less than 5 minutes. At this time, although server B and server C are both related to server A, that is, both need to be adjusted, the adjustment methods may be different due to the different delay times (reflected in the contact score).
[0131] In this embodiment, when the hotspot data is the first hotspot data, generating a processing method for each server according to the relationship between the other servers and the server initiating the request includes:
[0132] If the relationship information between the server that obtains the first hotspot data and other servers includes a first relationship server, a second relationship server, and a third relationship server, then
[0133] Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each first relationship server, wherein the inquiry instruction is used to enable each first relationship server to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and wherein the short-time delay fuse instruction is used to enable each first relationship server with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases;
[0134] Generate a first migration instruction, where the first migration instruction is used to send to each first relationship server, so that each second relationship server that obtains the first migration instruction performs cache migration;
[0135] A second migration instruction is generated, where the second migration instruction is used to be sent to each third-relationship server end, so that each third-relationship server end that obtains the second migration instruction performs cache migration.
[0136] For example, taking a certain shopping platform as an example, the shopping platform will hold a special event for a product with the nature of a regional specialty on a certain day. At this time, the search for keywords related to the products with the nature of regional specialties (for example, embroidery) will increase significantly, and hot information may appear. However, since products with the nature of regional specialties have certain limitations (for example, for people in the area where the specialty is located, the desire to buy is stronger, while for people in other places, the desire to buy is not so strong), at this time, there will be a situation where the pressure on several service ends that are mainly used to serve the area where the specialty is located increases, while the service ends that mainly serve other areas may not appear. At this time, the service ends that serve the area where the specialty is located may be first-relationship service ends, and the service ends that serve other areas and the service ends that serve the area where the specialty is located are third-relationship service ends. If some service ends are between the two, they may be second-relationship service ends.
[0137] By adopting this method, not only can we quickly process and respond to hot data on a server, but we can also make advance arrangements based on the congestion of other servers that may occur in the future.
[0138] In this embodiment, the reason why the query instruction and the short-time delay fuse instruction are used at the first relationship server is that, on the one hand, the first relationship server has a strong correlation with the server that issues the request (i.e., the server that obtains the first hot data), that is, it is very likely that the hot data will appear in the future. However, on the other hand, since the first hot data appears on the server that issues the request, the server with strong correlation does not appear at the same time, so there are three possibilities. The first possibility is that the request service for the hot data on the server actually begins to increase, but the growth is not particularly rapid and has not reached the situation of the hot data on the server (if the hot data on the server is reached). According to the data, it should belong to the type of second hot data, because it means that hot data appears on more than one server), but it is possible to reach the hot data later, that is, relative to the server that issues the request, it will delay reaching the hot data. Then, through the above-mentioned inquiry and delay processing, on the one hand, it can be understood that the related request service of the server is indeed increasing, and the fuse can be blown after a delay of a period of time. The delay time can be set by yourself. It can be understood that the short-term delayed fuse instruction here means that after the delay time, the server is allowed to blow when it reaches a certain amount of visits (the amount of visits exceeding the carrying capacity), but it does not mean that the fuse must be blown after the delay time.
[0139] In this embodiment, the first migration instruction includes: storing at least part of cache data in the first-level cache into the second-level cache;
[0140] The second migration instruction includes: migrating at least part of the cache data in the secondary cache to the data pool, wherein:
[0141] The first-level cache uses a memory-type cache; the second-level cache uses a document-type database for storage.
[0142] In this embodiment, the reason why the present application sets up a first-level cache and a second-level cache, and uses them in different relationships (second relationship server, third relationship server), is that, by storing part of the cache data in the first-level cache into the second-level cache, and modifying the value of the part of the cache data in the first-level cache to the key value of the part of the cache data in the second-level cache, the technical problem of performance degradation caused by the cache degradation strategy under large data volume and long-term requirements in the prior art is solved. The present application layers the cache, with the memory cache as the first-level cache and the document cache as the second-level cache. At the same time, the computing resources of the first-level cache and the second-level cache are separated, and the hits to the first-level cache are only retrieved in the memory cache, and the hits to the second-level cache are mainly calculated in the document cache, avoiding intensive calculations on the same node.
[0143] In particular, the present application sets the relationship as the second relationship server and the third relationship server, believing that if it is a close relationship, it is believed that if hot information appears in one of the servers in the close relationship, it is very likely that other servers in the close relationship will also have hot information, which will cause these servers to be under pressure in the future and thus require data migration to prevent the sudden influx of large amounts of data from paralyzing the server.
[0144] If the relationship is a general server, it means that the pressure may not appear in a short time. At this time, no special operation is actually required. However, since some servers have already had hot data, it is uncertain whether these general servers may appear in the future. In this case, the cached data in the second-level cache is first migrated to the data pool to free up the second-level cache. In this way, once the pressure increases, it can prevent the second-level cache from being insufficient and unable to migrate data for the first-level cache.
[0145] In this embodiment, the data pool may be composed of Shingled Magnetic Recording (SMR) disks, so as to increase the storage capacity of the distributed storage system with the same number of storage nodes and reduce the latency of the cache pool.
[0146] In this embodiment, the capacity of the secondary cache and the data pool is monitored in real time. Once the secondary cache reaches a storage upper limit or a threshold, part of the data in the secondary cache is put into the data pool regardless of whether hot data appears.
[0147] When the hotspot data is the second hotspot data, generating a processing method for each server according to the relationship between the other servers and the server initiating the request includes:
[0148] Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each first relationship server, wherein the inquiry instruction is used to enable each first relationship server to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and wherein the short-time delay fuse instruction is used to enable each first relationship server with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases;
[0149] A first migration instruction is generated, where the first migration instruction is sent to each second relationship server and the third relationship server, so that each second relationship server or the third relationship server that obtains the first migration instruction performs cache migration.
[0150] When the hotspot data is the second hotspot data, it means that the hotspot data has appeared in multiple clients, which means that the hotspot data appears generally rather than being concentrated in one or several servers. In other words, most servers may be under heavy load. At this time, there is no second migration instruction.
[0151] In this embodiment, when the data pool reaches an upper limit or a threshold, space can be made by deleting data.
[0152] The present application also provides a hotspot data degradation device considering the relationship between servers, the hotspot data degradation device considering the relationship between servers includes a service request acquisition module, a hotspot data judgment module, a server relationship acquisition module, a processing method generation module and a distribution module, wherein:
[0153] The service request acquisition module is used to acquire the service requests issued by the client within a preset time period;
[0154] The hot data judgment module is used to judge whether the service request is hot data according to the customer service request;
[0155] The server relationship acquisition module is used to acquire the relationship between other servers and the server initiating the request according to the service request when the hot data judgment module determines that it is yes;
[0156] The processing method generation module is used to generate a processing method for each server according to the relationship between other servers and the server initiating the request, and the processing method of at least one server is different from that of other servers;
[0157] The distribution module is used to send the processing methods to the corresponding server ends respectively, so that different processing methods are sent respectively.
[0158] It should be noted that the above explanations of the method embodiment are also applicable to the device of this embodiment and will not be repeated here.
[0159] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the hotspot data degradation method that considers the relationship between servers as described above is implemented.
[0160] The present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the above-mentioned hotspot data degradation method that considers the relationship between servers.
[0161] Figure 2 It is an exemplary structural diagram of an electronic device that can implement a hotspot data degradation method that takes into account the relationship between service terminals provided according to an embodiment of the present application.
[0162] like Figure 2 As shown, the electronic device includes an input device 501, an input interface 502, a central processor 503, a memory 504, an output interface 505, and an output device 506. The input interface 502, the central processor 503, the memory 504, and the output interface 505 are interconnected through a bus 507, and the input device 501 and the output device 506 are connected to the bus 507 through the input interface 502 and the output interface 505, respectively, and then connected to other components of the electronic device. Specifically, the input device 501 receives input information from the outside, and transmits the input information to the central processor 503 through the input interface 502; the central processor 503 processes the input information based on the computer executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 through the output interface 505; the output device 506 outputs the output information to the outside of the electronic device for use by the user.
[0163] That is to say, Figure 2 The electronic device shown can also be implemented as comprising: a memory storing computer executable instructions; and one or more processors, which can implement the combination when executing the computer executable instructions. Figure 1 Described is a hotspot data degradation method that considers the relationship between servers.
[0164] In one embodiment, Figure 2The electronic device shown can be implemented to include: a memory 504 configured to store executable program code; one or more processors configured to run the executable program code stored in the memory 504 to execute the hotspot data degradation method considering the relationship between servers in the above embodiment.
[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0166] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0167] Computer readable media include permanent and non-permanent, removable and non-removable, and the media can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), data versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0168] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code includes one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes identified in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or the total flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0169] The processor referred to in this embodiment may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0170] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the device / terminal equipment by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0171] In this embodiment, if the module / unit integrated in the device / terminal equipment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. Although the present application is disclosed as above in terms of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0172] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0173] In addition, it is obvious that the word "comprising" does not exclude other units or steps. Multiple units, modules or devices stated in the device claim can also be implemented by one unit or the overall device through software or hardware.
[0174] Although the present invention has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements may be made thereto based on the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.
Claims
1. A method for downgrading hotspot data considering the relationship between servers, characterized in that: The hotspot data degradation method considering the relationship between servers includes: Obtain service requests issued by the client within a preset time period; Determine whether the service request is hot data based on the customer service request. If so, Get the relationship between other servers and the server that initiates the request based on the service request; Generate a processing method for each server based on the relationship between the other servers and the server that initiated the request, and at least one server's processing method is different from the other servers; Send the processing methods to the corresponding servers respectively, so that the servers can perform different processing according to the received processing methods; The step of determining whether the service request is hot data according to the customer service request includes: Determine whether the number of service requests sent by any client exceeds a first preset threshold within a preset time period, and if so, the service request is the first hotspot data; The step of determining whether the service request is hot data according to the customer service request further includes: Determine whether the sum of the number of identical service requests sent by any plurality of clients exceeds a second preset threshold value within a preset time period, and if so, determine that the service request is second hotspot data; The obtaining of the relationship between the other server and the server initiating the request according to the service request includes: Obtain a service request knowledge graph, wherein a server has multiple service request knowledge graphs, and a service request knowledge graph under a server indicates a connection score between the server and other servers in a service request, wherein each of the service request indication graphs includes a primary server and multiple secondary servers, each secondary server is connected to the primary server, and a connection distance between a primary server and a secondary server indicates a connection score between the primary server and the secondary server for the service request, and a higher connection score indicates a longer connection distance; According to the service request knowledge graph, the connection scores between the server initiating the request and each server in the service request knowledge graph corresponding to the hot data under the server initiating the request are obtained; Acquire a server whose contact score is higher than a first preset threshold as a first relationship server; Acquire a server whose contact score is equal to the first preset threshold as a second relationship server; Acquire a server whose contact score is lower than a first preset threshold as a third relationship server; The contact score is obtained by the following method: Obtaining a history database of each server respectively, wherein the history database includes each history service request obtained in a history time period and basic information of each history service request obtained; Perform the following operations on the server that initiates the request: Obtain basic information of a historical service request that is the same as the service request in the historical database, where the basic information of the historical service request of the server that initiates the request is referred to as first basic information; Perform the following operations for each server: Obtain basic information of the historical service request that is the same as the service request in the historical database. The basic information of the historical service request on the server side is called second basic information. The relationship between the server and the server initiating the request is obtained according to the first basic information and the second basic information.
2. The hotspot data degradation method considering the relationship between servers as claimed in claim 1 is characterized in that: The basic information includes the name of the historical service request and the time point of each acquisition of the historical service request; The obtaining of the connection score between the server and the server initiating the request according to the first basic information and the second basic information includes: Obtain the time point of each historical service request in the first basic information; Setting a first grace time, a second grace time, and a third grace time for each time point of the historical service request in the first basic information; Eliminate the historical service requests in the second basic information whose time points do not fall within any of the first grace period and the second grace period; Get the number of historical service requests belonging to the first grace period; Get the number of historical service requests that belong to the second grace period; Get the number of historical service requests that fall within the third grace period; Acquire a historical service request scoring database of the historical service request, wherein the historical service request scoring database includes a single score of a first grace period, a single score of a second grace period, and a single score of a third grace period; Obtaining a first grace time score according to the individual score of the first grace time and the number of historical service requests belonging to the first grace time; Obtaining a second grace time score according to the individual score of the second grace time and the number of historical service requests belonging to the second grace time; Obtaining a third grace time score according to the individual score of the third grace time and the number of historical service requests belonging to the third grace time; The sum of the first grace time score, the second grace time score and the third grace time score is obtained as a connection score between the server and the server initiating the request.
3. The method for downgrading hotspot data considering the relationship between servers as claimed in claim 2, characterized in that: When the hotspot data is the first hotspot data, generating a processing method for each server according to the relationship between the other servers and the server initiating the request includes: If the relationship information between the server that obtains the first hotspot data and other servers includes a first relationship server, a second relationship server, and a third relationship server, then Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each first relationship server, wherein the inquiry instruction is used to enable each first relationship server to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and wherein the short-time delay fuse instruction is used to enable each first relationship server with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases; Generate a first migration instruction, where the first migration instruction is used to send to each second relationship server, so that each second relationship server that obtains the second migration instruction performs cache migration; A second migration instruction is generated, where the second migration instruction is used to be sent to each third-relationship server end, so that each third-relationship server end that obtains the second migration instruction performs cache migration.
4. The method for downgrading hotspot data considering the relationship between servers as claimed in claim 3, characterized in that: When the hotspot data is the second hotspot data, generating a processing method for each server according to the relationship between the other servers and the server initiating the request includes: Generate an inquiry instruction and a short-time delay fuse instruction, wherein the inquiry instruction and the short-time delay fuse instruction are used to be sent to each second relationship server end, wherein the inquiry instruction is used to enable each first relationship server end to feedback whether the request amount of service requests within a preset time period has increased after receiving the inquiry instruction, and the short-time delay fuse instruction is used to enable each first relationship server end with an increased request amount to perform a delayed fuse according to the short-time delay fuse instruction when the request amount of service requests within the preset time period increases; A first migration instruction is generated, where the first migration instruction is sent to each second relationship server and the third relationship server, so that each second relationship server or the third relationship server that obtains the first migration instruction performs cache migration.
5. The hotspot data degradation method considering the relationship between servers as claimed in claim 3 or 4, characterized in that: The first migration instruction includes: storing at least a portion of cache data in the first-level cache into the second-level cache; The second migration instruction includes: Migrate at least part of the cached data in the secondary cache to the data pool, wherein: The first-level cache uses a memory-type cache; The secondary cache is stored using a document-based database.
6. A hotspot data degradation device considering the relationship between servers, characterized in that: The hotspot data degradation device considering the relationship between the servers includes: A service request acquisition module, which is used to acquire service requests issued by the client within a preset time period; A hot data determination module, the hot data determination module is used to determine whether the service request is hot data according to the customer service request; A server relationship acquisition module, the server relationship acquisition module is used to obtain the relationship between other servers and the server initiating the request according to the service request when the hot data judgment module determines that it is yes; A processing method generation module, the processing method generation module is used to generate a processing method for each server according to the relationship between the other servers and the server initiating the request, and the processing method of at least one server is different from that of the other servers; A distribution module, the distribution module is used to send the processing methods to the corresponding service ends respectively, so that the service ends perform different processing according to the received processing methods; The step of determining whether the service request is hot data according to the customer service request includes: Determine whether the number of service requests sent by any client exceeds a first preset threshold within a preset time period, and if so, the service request is the first hotspot data; The step of determining whether the service request is hot data according to the customer service request further includes: Determine whether the sum of the number of identical service requests sent by any plurality of clients exceeds a second preset threshold value within a preset time period, and if so, determine that the service request is second hotspot data; The obtaining of the relationship between the other server and the server initiating the request according to the service request includes: Obtain a service request knowledge graph, wherein a server has multiple service request knowledge graphs, and a service request knowledge graph under a server indicates a connection score between the server and other servers in a service request, wherein each of the service request indication graphs includes a primary server and multiple secondary servers, each secondary server is connected to the primary server, and a connection distance between a primary server and a secondary server indicates a connection score between the primary server and the secondary server for the service request, and a higher connection score indicates a longer connection distance; According to the service request knowledge graph, the connection scores between the server initiating the request and each server in the service request knowledge graph corresponding to the hot data under the server initiating the request are obtained; Acquire a server whose contact score is higher than a first preset threshold as a first relationship server; Acquire a server whose contact score is equal to the first preset threshold as a second relationship server; Acquire a server whose contact score is lower than a first preset threshold as a third relationship server; The contact score is obtained by the following method: Respectively obtain a historical database of each server, wherein the historical database includes each historical service request obtained within a historical time period and basic information of each historical service request obtained; Perform the following operations on the server that initiates the request: Obtain basic information of a historical service request that is the same as the service request in the historical database, where the basic information of the historical service request of the server that initiates the request is referred to as first basic information; Perform the following operations for each server: Obtain basic information of the historical service request that is the same as the service request in the historical database. The basic information of the historical service request on the server side is called second basic information. The relationship between the server and the server initiating the request is obtained according to the first basic information and the second basic information.
