Data request response method, device and electronic device

By predicting the number of requests for hot data based on the current number of times the target page is opened, and refreshing it to the local shared storage space when the threshold is reached, the server crash problem caused by hot data cache pressure is solved, and stable response and efficient query of data requests are achieved.

CN114297551BActive Publication Date: 2025-09-19MIGU CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111592746.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-09-19
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

In the prior art, after hot data is cached, it is easy to reach the physical limit of the cache when the number of visits is high within a short period of time, causing server downtime and unstable data request response.

Method used

By determining the current number of times the target page is opened, the expected number of requests for the target hotspot data is predicted. When the number of requests reaches the threshold, the hotspot data is refreshed to the local shared storage space, and new data requests are scheduled to the local shared storage space for query and returned to the terminal.

Benefits of technology

It relieves the access pressure on the server, improves the response stability of data requests, avoids server downtime, and ensures the consistency and efficient response of data requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297551B_ABST
    Figure CN114297551B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to the field of computer technology, and discloses a method, device and electronic device for responding to data requests. The method includes: determining the current number of times a target page is opened, and determining the expected number of requests for target hotspot data based on the current number of times it is opened, where the target hotspot data is the hotspot data corresponding to the target page; if the expected number of requests is greater than a first request number threshold for the target hotspot data, then when the number of requests for the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to a local shared storage space; new data requests for the target hotspot data are scheduled to the local shared storage space, so as to query the target hotspot data in the local shared storage space based on the new data request; and the queried target hotspot data is returned to the first target terminal, where the first target terminal is the terminal corresponding to the new data request for the target hotspot data. In the above manner, the embodiment of the present invention improves the response stability of data requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, and electronic device for responding to a data request. Background Art

[0002] With the continuous development of Internet technology, the number of visits to website pages is increasing, resulting in increasing pressure on the server side. In order to ensure normal access to website pages, special processing of hot data is required to alleviate the pressure on hot data access.

[0003] In the related art, caching hot data in website pages is generally used to reduce server access pressure. However, in the process of implementing the embodiments of the present invention, the inventors discovered that in the related art, after hot data is cached, if there is a large number of visits to the hot data in a short period of time, the physical upper limit of the cache can be easily reached due to the concentrated traffic, causing the server to crash, and thus resulting in unstable responses to hot data requests. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention provide a method, device, and electronic device for responding to data requests, which are used to solve the problem of unstable responses to data requests in the prior art.

[0005] According to one aspect of an embodiment of the present invention, a method for responding to a data request is provided, the method comprising:

[0006] Determine the current opening count of the target page, and determine the expected request count of target hotspot data according to the current opening count, wherein the target hotspot data is the hotspot data corresponding to the target page;

[0007] If the expected number of requests is greater than a first request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the first request number threshold, refreshing the target hotspot data to the local shared storage space;

[0008] Dispatching a new data request for the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request;

[0009] The queried target hotspot data is returned to a first target terminal, wherein the first target terminal is a terminal corresponding to the new data request for the target hotspot data.

[0010] In an optional manner, the method further includes:

[0011] If the expected number of requests is greater than the second request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the second request number threshold, determining the second target terminal corresponding to the new data request for the target hotspot data, wherein the second request number threshold is greater than the first request number threshold;

[0012] Sending a request identification information generation instruction to the second target terminal, for the second target terminal to generate request identification information according to the user's request for the target hotspot data;

[0013] Before receiving the request identification information sent by the second target terminal, pre-acquiring the target hotspot data;

[0014] When the request identification information sent by the second target terminal is received, the target hotspot data is spliced ​​according to the request identification information, and the spliced ​​target hotspot data is returned to the second target terminal.

[0015] In an optional manner, determining the expected number of requests for the target hotspot data according to the current number of openings includes:

[0016] Determine a conversion rate corresponding to the target hotspot data, wherein the conversion rate is a ratio of the number of historical requests for the target hotspot data to the number of historical openings of the target page;

[0017] The expected number of requests for the target hotspot data is determined based on the current number of opens and the conversion rate.

[0018] In an optional manner, the target page includes a plurality of request operation buttons; and determining the current opening count of the target page includes:

[0019] Determining respectively the operation delay time between the opening operation of the target page and the clicking operation of each requested operation button;

[0020] Determining the shortest opening time of the target page according to the operation delay time corresponding to each requested operation button, wherein the shortest opening time is used to identify the shortest duration in which the target page is in a valid opening state;

[0021] The current opening times of the target page are determined according to the shortest opening time.

[0022] In an optional manner, determining the second target terminal corresponding to the new data request of the target hotspot data includes:

[0023] Determine a key page area where a request operation button corresponding to the target hotspot data on the target page is located;

[0024] Determine the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page;

[0025] The currently connected terminal whose color similarity is less than a preset similarity threshold is determined as the second target terminal corresponding to the new data request of the target hotspot data.

[0026] In an optional manner, determining the color similarity of the current frame of the target page of the currently connected terminal and the key page area corresponding to the previous frame of the target page includes:

[0027] Determine the color grade value of each pixel in the key page area corresponding to the current frame of the target page of the currently connected terminal;

[0028] Determine the color grade value of each pixel in the key page area corresponding to the previous frame of the target page of the currently connected terminal;

[0029] Generate a current frame color vector according to the color level value of each pixel corresponding to the current frame of the target page, and generate a previous frame color vector according to the color level value of each pixel corresponding to the previous frame of the target page;

[0030] The cosine similarity between the current frame color vector and the previous frame color vector is determined as the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame of the target page.

[0031] In an optional manner, the method further includes:

[0032] Determine the local storage node corresponding to the target hotspot data;

[0033] A stress test is performed on the local storage node to determine a first request count threshold for the target hotspot data.

[0034] According to another aspect of an embodiment of the present invention, a device for responding to a data request is provided, the device comprising:

[0035] A determination module, configured to determine the current opening count of a target page, and determine the expected request count of target hotspot data according to the current opening count, wherein the target hotspot data is the hotspot data corresponding to the target page;

[0036] A refresh module, configured to refresh the target hotspot data to a local shared storage space when the expected number of requests is greater than a first request number threshold of the target hotspot data and when the number of requests for the target hotspot data reaches the first request number threshold;

[0037] A query module, configured to dispatch a new data request for the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request;

[0038] The return module is used to return the queried target hotspot data to the first target terminal, wherein the first target terminal is the terminal corresponding to the new data request for the target hotspot data.

[0039] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication hotspot, and a communication bus, wherein the processor, the memory, and the communication hotspot communicate with each other via the communication bus;

[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the above-mentioned data request response method.

[0041] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction. When the executable instruction is executed on an electronic device, the electronic device executes the operation of the above-mentioned data request response method.

[0042] In an embodiment of the present invention, after determining the current number of times the target page is opened, the expected number of requests for the target hotspot data can be determined based on the current number of times it is opened; if the expected number of requests for the target hotspot data is greater than the first request number threshold of the target hotspot data, then when the request number of the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to the local shared storage space; when a new data request for the target hotspot data is received, the new data request is dispatched to the local shared storage space to query the target hotspot data in the local shared storage space based on the new data request, and the queried target hotspot data is returned to the first target terminal. It can be seen that the embodiment of the present invention can predict the amount of data requests for the target hotspot data based on the expected number of requests for the target hotspot data, and dispatch the new data requests that exceed the server cache performance to the local shared storage space based on the prediction result, thereby alleviating the access pressure on the server and improving the stability of responding to data requests.

[0043] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to more clearly understand the technical means of the embodiments of the present invention, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:

[0045] Figure 1 A schematic diagram showing a flow chart of a method for responding to a data request provided by an embodiment of the present invention;

[0046] Figure 2 A schematic diagram showing the structure of a device for responding to a data request provided by an embodiment of the present invention is shown;

[0047] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0048] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0049] Figure 1 The flowchart of the data request response method according to an embodiment of the present invention is shown, and the method is executed by an electronic device. The memory of the electronic device is used to store at least one executable instruction, and the executable instruction enables the processor of the electronic device to perform the operation of the data request response method.

[0050] like Figure 1 As shown, the method includes the following steps:

[0051] Step 110: Determine the current opening times of the target page, and determine the expected request times of target hotspot data according to the current opening times, where the target hotspot data is the hotspot data corresponding to the target page.

[0052] The target page is typically the page corresponding to the hotspot data. When a user accesses the target page, clicking a request action button on the target page triggers the client to request the corresponding hotspot data from the server. Generally, multiple client users may open and access the target page at the same time. The server can count the number of times the target page has been opened in real time at preset time intervals. For example, at time t1, the target page has been opened n1 times, meaning that n1 are the number of clients that opened the target page at time t1. The target page typically includes multiple request action buttons. When accessing the target page, users may or may not click a request action button. Furthermore, the probability of a user clicking on different request action buttons varies. To determine the expected number of requests for the target hotspot data based on the current number of opens, the historical number of opens of the target page and the historical number of requests for the target hotspot data can be calculated. The ratio of the historical number of requests for the target hotspot data to the historical number of opens of the target page can be used to determine the conversion rate for the target hotspot data. After determining the conversion rate for the target hotspot data, the expected number of requests for the target hotspot data is determined based on the current number of opens of the target page and the conversion rate. For example, if the current number of opens is 100 and the conversion rate is 30%, the expected number of requests for the target hotspot data is 30.

[0053] Furthermore, when a user accesses a target page, there is generally a certain time interval between opening the target page and clicking the request operation button to trigger a data request for the target hotspot data. When the server receives an abnormal access, the target page has a shorter opening time, and the number of times the target page with a shorter opening time is opened may not be counted in the current number of times it is opened. For example, when determining the current number of times the target page is opened, the operation delay time between the opening operation of the target page and the clicking operation of each request operation button may be determined respectively, and the shortest opening time of the target page may be determined based on the operation delay time corresponding to each request operation button. The shortest opening time is used to identify the shortest duration that the target page is in a valid open state, and the current number of times the target page is opened is determined based on the shortest opening time. When determining the current number of times the target page is opened based on the shortest opening time, the initial statistical value of the current number of times can be obtained, and then the invalid opening times with an opening time lower than the shortest opening time can be eliminated from the initial statistical value, and the statistical value excluding the invalid opening times is determined as the current number of times it is opened.

[0054] Step 120: If the expected number of requests is greater than the first request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to the local shared storage space.

[0055] Among them, the target hotspot data is generally stored in the distributed cache of the server, for example, it can be stored in the Redis cache. The distributed cache's access requests to the target hotspot data generally have traffic restrictions, that is, a large number of accesses to the target hotspot data will be limited by the performance bottleneck of the distributed cache. In order to determine the maximum number of requests for the target hotspot data that the distributed cache can support, you can first determine the local storage node corresponding to the target hotspot data, and then perform a stress test on the local storage node to determine the first request number threshold for the target hotspot data. The first request number threshold is the maximum number of requests for the target hotspot data that the distributed cache can support.

[0056] Furthermore, if the expected number of requests for the target hotspot data is greater than a first request number threshold for the target hotspot data, it indicates that the distributed cache will soon be unable to satisfy the data request for the target hotspot data. The number of requests for the target hotspot data can be monitored. When the number of requests for the target hotspot data reaches the first request number threshold, the target hotspot data is pre-refreshed to the local shared storage space. The local shared storage space is a storage space shared by multiple hosts on the server side.

[0057] Step 130: dispatching the new data request of the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request.

[0058] Among them, after refreshing the target hotspot data to the local shared storage space, when receiving a new data request for the target hotspot data, the new data request for the target hotspot data can be dispatched to the local shared storage space, so that the target hotspot data can be queried in the local shared storage space according to the new data request. By querying the target hotspot data in the local shared storage space, the access pressure of the server-side distributed cache can be reduced, and the access consistency of the target hotspot data can be guaranteed, thereby preventing the data inconsistency problem that may be caused by querying the target hotspot data in the independent storage space of each host.

[0059] Step 140: Return the queried target hotspot data to the first target terminal, where the first target terminal is the terminal corresponding to the new data request for the target hotspot data.

[0060] Among them, a response message can be generated based on the queried target hotspot data, and the target hotspot data can be added to the response message and returned to the first target terminal. It should be noted that when the number of requests for the target hotspot data does not reach the first request number threshold, the target hotspot data is still queried from the distributed cache on the server side, such as the Redis cache, and the queried target hotspot data is returned to the terminal corresponding to the data request for the target hotspot data. Since the local shared storage space is generally small and cannot carry excessive data request traffic, when the data request traffic scheduled to the local shared storage space is large, it is easy to reach the performance bottleneck of the local shared storage space.

[0061] Among them, when monitoring the number of requests for the target hotspot data, if the expected number of requests for the target hotspot data is greater than the second request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the second request number threshold, the target hotspot data can be obtained in advance, and the obtained target hotspot data can be actively sent to the second target terminal corresponding to the new data request for the target hotspot data, and the second request number threshold is greater than the first request number threshold. Further, when the number of requests for the target hotspot data reaches the second request number threshold, the second target terminal corresponding to the new data request for the target hotspot data can be first determined, so that when the second target terminal obtains the trigger operation of the user's data request for the target hotspot data, it no longer sends the called request interface URL to the server side, but generates request identification information based on the user's trigger operation for the data request for the target hotspot data, and sends the request identification information to the server side instead of sending the called request interface URL to the server side. By generating the request identification information, there is no need to call the relevant business interface request, the interface call of the business process is not followed, the distributed storage resources are not occupied, and the message length of the request identification information is also relatively short, which can improve the transmission efficiency of the message. Under the same network bandwidth, compared with the request interface URL, the request message containing the request identification information can be received by the server first, thereby improving the response speed of the data request.

[0062] Furthermore, after determining the second target terminal corresponding to the new data request for the target hotspot data, a request identification information generation instruction can be sent to the second target terminal, so that the second target terminal can generate request identification information according to the user's request for the target hotspot data, and pre-acquire the target hotspot data before receiving the request identification information sent by the second target terminal. For example, the target hotspot data is taken out from the distributed cache in advance. At this time, the high-traffic data request for the target hotspot data has not been sent to the server side, and taking out the target interface data does not occupy distributed storage resources. Furthermore, when the request identification information sent by the second target terminal is received, the target hotspot data can be spliced ​​according to the request identification information, and the spliced ​​target hotspot data can be returned to the second target terminal.

[0063] It should be noted that, the server side of the embodiment of the present invention can determine in advance the first target terminal that is about to send the data request before receiving the data request for the target hotspot data from the first target terminal; and can determine in advance the second target terminal that is about to send the data request before receiving the data request for the target hotspot data from the second target terminal. The following takes the example of the server side determining the second target terminal in advance to illustrate the specific process of the server side determining the first target terminal and the second target terminal in advance. When determining the second target terminal corresponding to the new data request for the target hotspot data, first determine the key page area where the request operation button corresponding to the target hotspot data on the target page is located, and then determine the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page, and determine the currently connected terminal whose color similarity is less than the preset similarity threshold as the second target terminal corresponding to the new data request for the target hotspot data.

[0064] For example, the target page is a product management page, and the target page includes three request operation buttons: "Query", "Export" and "Reset". The target hotspot data is the hotspot data corresponding to the "Query" button. When the "Query" button is clicked, the "Query" button will change from white to gray or generate a dynamic effect. At this time, the key page area where the "Query" button is located will change color, and the color similarity between the key page area in the current frame of the target page of the current connection terminal on the server side and the key page area in the previous frame on the target page will change from large to small; the current connection terminal whose color similarity is less than the preset similarity threshold is identified as a terminal that is about to send a data request for the target hotspot data to the server side, and the current connection terminal whose color similarity is not less than the preset similarity threshold is not identified as a terminal that is about to send a data request for the target hotspot data to the server side.

[0065] Furthermore, when determining the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame on the target page, the color level value of each pixel point in the key page area corresponding to the current frame of the target page of the currently connected terminal is first determined, and the color level value of each pixel point in the key page area corresponding to the previous frame of the target page of the currently connected terminal is determined; then, a current frame color vector is generated according to the color level value of each pixel point corresponding to the current frame of the target page, and a previous frame color vector is generated according to the color level value of each pixel point corresponding to the previous frame on the target page; finally, the cosine similarity of the current frame color vector and the previous frame color vector is determined as the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame on the target page. For example, color levels can be defined, such as Z1 for black, Z2 for white, and Z3 for gray, and the number of color levels can be customized. If the color level value of each pixel in the key page area corresponding to the current frame of the target page falls into the customized color level number A1, A2, A3...An respectively, and the color level value of each pixel in the key page area corresponding to the previous frame of the target page falls into the customized color level number B1, B2, B3...Bn respectively, the current frame color vector can be (A1, A2, A3...An), and the previous frame color vector can be (B1, B2, B3...Bn), the cosine similarity cos(θ) between the current frame color vector and the previous frame color vector can be calculated by the following formula:

[0066]

[0067] In an embodiment of the present invention, after determining the current number of times the target page is opened, the expected number of requests for the target hotspot data can be determined based on the current number of times it is opened; if the expected number of requests for the target hotspot data is greater than the first request number threshold of the target hotspot data, then when the request number of the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to the local shared storage space; when a new data request for the target hotspot data is received, the new data request is dispatched to the local shared storage space to query the target hotspot data in the local shared storage space based on the new data request, and the queried target hotspot data is returned to the first target terminal. It can be seen that the embodiment of the present invention can predict the amount of data requests for the target hotspot data based on the expected number of requests for the target hotspot data, and dispatch the new data requests that exceed the server cache performance to the local shared storage space based on the prediction result, thereby alleviating the access pressure on the server and improving the stability of responding to data requests.

[0068] Figure 2 FIG. 1 shows a schematic diagram of the structure of a device for responding to a data request according to an embodiment of the present invention. Figure 2As shown, the apparatus 300 includes: a determination module 310 , a refresh module 320 , a query module 330 and a return module 340 .

[0069] Among them, the determination module 310 is used to determine the current number of times the target page is opened, and determine the expected number of requests for the target hotspot data based on the current number of times it is opened, and the target hotspot data is the hotspot data corresponding to the target page; the refresh module 320 is used to refresh the target hotspot data to the local shared storage space when the number of requests for the target hotspot data reaches the first request number threshold if the expected number of requests is greater than the first request number threshold of the target hotspot data; the query module 330 is used to schedule the new data request of the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request; the return module 340 is used to return the queried target hotspot data to the first target terminal, and the first target terminal is the terminal corresponding to the new data request of the target hotspot data.

[0070] In an optional manner, the returning module 340 is further configured to:

[0071] If the expected number of requests is greater than the second request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the second request number threshold, determining the second target terminal corresponding to the new data request for the target hotspot data, wherein the second request number threshold is greater than the first request number threshold;

[0072] Sending a request identification information generation instruction to the second target terminal, for the second target terminal to generate request identification information according to the user's request for the target hotspot data;

[0073] Before receiving the request identification information sent by the second target terminal, pre-acquiring the target hotspot data;

[0074] When the request identification information sent by the second target terminal is received, the target hotspot data is spliced ​​according to the request identification information, and the spliced ​​target hotspot data is returned to the second target terminal.

[0075] In an optional manner, the determination module 310 is configured to:

[0076] Determine a conversion rate corresponding to the target hotspot data, wherein the conversion rate is a ratio of the number of historical requests for the target hotspot data to the number of historical openings of the target page;

[0077] The expected number of requests for the target hotspot data is determined based on the current number of opens and the conversion rate.

[0078] In an optional manner, the target page includes multiple request operation buttons; the determination module 310 is configured to:

[0079] Determining respectively the operation delay time between the opening operation of the target page and the clicking operation of each requested operation button;

[0080] Determining the shortest opening time of the target page according to the operation delay time corresponding to each requested operation button, wherein the shortest opening time is used to identify the shortest duration in which the target page is in a valid opening state;

[0081] The current opening times of the target page are determined according to the shortest opening time.

[0082] In an optional manner, the returning module 340 is further configured to:

[0083] Determine a key page area where a request operation button corresponding to the target hotspot data on the target page is located;

[0084] Determine the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page;

[0085] The currently connected terminal whose color similarity is less than a preset similarity threshold is determined as the second target terminal corresponding to the new data request of the target hotspot data.

[0086] In an optional manner, the returning module 340 is further configured to:

[0087] Determine the color grade value of each pixel in the key page area corresponding to the current frame of the target page of the currently connected terminal;

[0088] Determine the color grade value of each pixel in the key page area corresponding to the previous frame of the target page of the currently connected terminal;

[0089] Generate a current frame color vector according to the color level value of each pixel corresponding to the current frame of the target page, and generate a previous frame color vector according to the color level value of each pixel corresponding to the previous frame of the target page;

[0090] The cosine similarity between the current frame color vector and the previous frame color vector is determined as the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame of the target page.

[0091] In an optional manner, the determination module 310 is configured to:

[0092] Determine the local storage node corresponding to the target hotspot data;

[0093] A stress test is performed on the local storage node to determine a first request count threshold for the target hotspot data.

[0094] In an embodiment of the present invention, after determining the current number of times the target page is opened, the expected number of requests for the target hotspot data can be determined based on the current number of times it is opened; if the expected number of requests for the target hotspot data is greater than the first request number threshold of the target hotspot data, then when the request number of the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to the local shared storage space; when a new data request for the target hotspot data is received, the new data request is dispatched to the local shared storage space to query the target hotspot data in the local shared storage space based on the new data request, and the queried target hotspot data is returned to the first target terminal. It can be seen that the embodiment of the present invention can predict the amount of data requests for the target hotspot data based on the expected number of requests for the target hotspot data, and dispatch the new data requests that exceed the server cache performance to the local shared storage space based on the prediction result, thereby alleviating the access pressure on the server and improving the stability of responding to data requests.

[0095] Figure 3 The schematic diagram of the structure of the electronic device according to the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0096] like Figure 3 As shown, the electronic device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0097] Processor 402, communication hotspot 404, and memory 406 communicate with each other via communication bus 408. Communication hotspot 404 is used to communicate with other devices, such as clients or other server network elements. Processor 402 is used to execute program 410, which may specifically perform the steps described in the aforementioned embodiment of the method for responding to data requests.

[0098] Specifically, the program 410 may include program code including computer-executable instructions.

[0099] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0100] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0101] Program 410 may be specifically called by processor 402 to enable the electronic device to perform the following operations:

[0102] Determine the current opening count of the target page, and determine the expected request count of target hotspot data according to the current opening count, wherein the target hotspot data is the hotspot data corresponding to the target page;

[0103] If the expected number of requests is greater than a first request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the first request number threshold, refreshing the target hotspot data to the local shared storage space;

[0104] Dispatching a new data request for the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request;

[0105] The queried target hotspot data is returned to a first target terminal, wherein the first target terminal is a terminal corresponding to the new data request for the target hotspot data.

[0106] In an optional manner, the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0107] If the expected number of requests is greater than the second request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the second request number threshold, determining the second target terminal corresponding to the new data request for the target hotspot data, wherein the second request number threshold is greater than the first request number threshold;

[0108] Sending a request identification information generation instruction to the second target terminal, for the second target terminal to generate request identification information according to the user's request for the target hotspot data;

[0109] Before receiving the request identification information sent by the second target terminal, pre-acquiring the target hotspot data;

[0110] When the request identification information sent by the second target terminal is received, the target hotspot data is spliced ​​according to the request identification information, and the spliced ​​target hotspot data is returned to the second target terminal.

[0111] In an optional manner, the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0112] Determine a conversion rate corresponding to the target hotspot data, wherein the conversion rate is a ratio of the number of historical requests for the target hotspot data to the number of historical openings of the target page;

[0113] The expected number of requests for the target hotspot data is determined based on the current number of opens and the conversion rate.

[0114] In an optional manner, the target page includes a plurality of request operation buttons; the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0115] Determining respectively the operation delay time between the opening operation of the target page and the clicking operation of each requested operation button;

[0116] Determining the shortest opening time of the target page according to the operation delay time corresponding to each requested operation button, wherein the shortest opening time is used to identify the shortest duration in which the target page is in a valid opening state;

[0117] The current opening times of the target page are determined according to the shortest opening time.

[0118] In an optional manner, the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0119] Determine a key page area where a request operation button corresponding to the target hotspot data on the target page is located;

[0120] Determine the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page;

[0121] The currently connected terminal whose color similarity is less than a preset similarity threshold is determined as the second target terminal corresponding to the new data request of the target hotspot data.

[0122] In an optional manner, the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0123] Determine the color grade value of each pixel in the key page area corresponding to the current frame of the target page of the currently connected terminal;

[0124] Determine the color grade value of each pixel in the key page area corresponding to the previous frame of the target page of the currently connected terminal;

[0125] Generate a current frame color vector according to the color level value of each pixel corresponding to the current frame of the target page, and generate a previous frame color vector according to the color level value of each pixel corresponding to the previous frame of the target page;

[0126] The cosine similarity between the current frame color vector and the previous frame color vector is determined as the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame of the target page.

[0127] In an optional manner, the program 410 is called by the processor 402 to enable the electronic device to perform the following operations:

[0128] Determine the local storage node corresponding to the target hotspot data;

[0129] A stress test is performed on the local storage node to determine a first request count threshold for the target hotspot data.

[0130] In an embodiment of the present invention, after determining the current number of times the target page is opened, the expected number of requests for the target hotspot data can be determined based on the current number of times it is opened; if the expected number of requests for the target hotspot data is greater than the first request number threshold of the target hotspot data, then when the request number of the target hotspot data reaches the first request number threshold, the target hotspot data is refreshed to the local shared storage space; when a new data request for the target hotspot data is received, the new data request is dispatched to the local shared storage space to query the target hotspot data in the local shared storage space based on the new data request, and the queried target hotspot data is returned to the first target terminal. It can be seen that the embodiment of the present invention can predict the amount of data requests for the target hotspot data based on the expected number of requests for the target hotspot data, and dispatch the new data requests that exceed the server cache performance to the local shared storage space based on the prediction result, thereby alleviating the access pressure on the server and improving the stability of responding to data requests.

[0131] An embodiment of the present invention provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction is executed on an electronic device, the electronic device executes the method for responding to a data request in any of the above method embodiments.

[0132] An embodiment of the present invention provides a device for responding to a data request, which is used to execute the above-mentioned method for responding to a data request.

[0133] An embodiment of the present invention provides a computer program, which can be called by a processor to enable an electronic device to execute the method for responding to a data request in any of the above method embodiments.

[0134] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the data request response method in any of the above method embodiments.

[0135] The algorithm or demonstration provided herein are not inherently relevant to any particular computer, virtual system or other equipment. Various general-purpose systems may also be used together with the teachings based on this. According to the above description, it is apparent that the structure required for constructing this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of the present invention.

[0136] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0137] Similarly, it should be understood that in order to streamline the present invention and facilitate understanding of one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0138] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed so far can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0139] It should be noted that the above embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by a person skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

Claims

1. A method for responding to a data request, characterized in that: The method comprises: Determine the current opening count of the target page, and determine the expected request count of target hotspot data according to the current opening count, wherein the target hotspot data is the hotspot data corresponding to the target page; If the expected number of requests is greater than a first request number threshold of the target hotspot data, then when the number of requests for the target hotspot data reaches the first request number threshold, refreshing the target hotspot data to the local shared storage space; Dispatching a new data request for the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request; Returning the queried target hotspot data to a first target terminal, wherein the first target terminal is a terminal corresponding to the new data request for the target hotspot data; When the number of requests for the target hotspot data reaches a second request number threshold, the target hotspot data is obtained in advance, and the obtained target hotspot data is actively sent to the second target terminal corresponding to the new data request for the target hotspot data; wherein, the key page area where the request operation button corresponding to the target hotspot data on the target page is located is determined, and the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page is determined, and the currently connected terminal whose color similarity is less than a preset similarity threshold is determined as the second target terminal; The second request number threshold is greater than the first request number threshold.

2. The method according to claim 1, characterized in that The step of actively sending the acquired target hotspot data to the second target terminal corresponding to the new data request for the target hotspot data includes: Sending a request identification information generation instruction to the second target terminal, for the second target terminal to generate request identification information according to the user's request for the target hotspot data; Before receiving the request identification information sent by the second target terminal, pre-acquiring the target hotspot data; When the request identification information sent by the second target terminal is received, the target hotspot data is spliced ​​according to the request identification information, and the spliced ​​target hotspot data is returned to the second target terminal.

3. The method according to claim 1, characterized in that Determining the expected number of requests for target hotspot data according to the current number of openings includes: Determine a conversion rate corresponding to the target hotspot data, wherein the conversion rate is a ratio of the number of historical requests for the target hotspot data to the number of historical openings of the target page; The expected number of requests for the target hotspot data is determined based on the current number of opens and the conversion rate.

4. The method according to any one of claims 1 to 3, characterized in that The target page includes a plurality of request operation buttons; and determining the current opening times of the target page includes: Determining respectively the operation delay time between the opening operation of the target page and the clicking operation of each requested operation button; Determining the shortest opening time of the target page according to the operation delay time corresponding to each requested operation button, wherein the shortest opening time is used to identify the shortest duration in which the target page is in a valid opening state; The current opening times of the target page are determined according to the shortest opening time.

5. The method according to any one of claims 1 to 3, characterized in that Determining the color similarity between the current frame of the target page of the currently connected terminal and the key page area corresponding to the previous frame of the target page includes: Determine the color grade value of each pixel in the key page area corresponding to the current frame of the target page of the currently connected terminal; Determine the color grade value of each pixel in the key page area corresponding to the previous frame of the target page of the currently connected terminal; Generate a current frame color vector according to the color level value of each pixel corresponding to the current frame of the target page, and generate a previous frame color vector according to the color level value of each pixel corresponding to the previous frame of the target page; The cosine similarity between the current frame color vector and the previous frame color vector is determined as the color similarity of the key page area corresponding to the current frame of the target page of the currently connected terminal and the previous frame of the target page.

6. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Determine the local storage node corresponding to the target hotspot data; A stress test is performed on the local storage node to determine a first request count threshold for the target hotspot data.

7. A device for responding to a data request, characterized in that: The device comprises: A determination module, configured to determine the current opening count of a target page, and determine the expected request count of target hotspot data according to the current opening count, wherein the target hotspot data is the hotspot data corresponding to the target page; A refresh module, configured to refresh the target hotspot data to a local shared storage space when the expected number of requests is greater than a first request number threshold of the target hotspot data and when the number of requests for the target hotspot data reaches the first request number threshold; A query module, configured to dispatch a new data request for the target hotspot data to the local shared storage space, so as to query the target hotspot data in the local shared storage space according to the new data request; A returning module, configured to return the queried target hotspot data to a first target terminal, wherein the first target terminal is a terminal corresponding to the new data request for the target hotspot data; And the device is used to: when the number of requests for target hotspot data reaches a second request number threshold, pre-acquire the target hotspot data, and actively send the acquired target hotspot data to the second target terminal corresponding to the new data request for the target hotspot data; wherein, determine the key page area where the request operation button corresponding to the target hotspot data on the target page is located, determine the color similarity between the key page area in the current frame of the target page of the currently connected terminal and the key page area in the previous frame of the target page, and determine the currently connected terminal whose color similarity is less than the preset similarity threshold as the second target terminal; wherein, the second request number threshold is greater than the first request number threshold.

8. An electronic device, characterized in that: include: A processor, a memory, a communication hotspot, and a communication bus, wherein the processor, the memory, and the communication hotspot communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the data request response method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The storage medium stores at least one executable instruction, and when the executable instruction is executed on the electronic device, the electronic device executes the operation of the method for responding to a data request according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Processing method and system of data access

    CN103177005A

  • Method, apparatus, electronic device and storage medium for identifying program hot spots

    CN109240793A