WO2022134806A1 - 热点key的确定方法、装置、设备及存储介质 - Google Patents

热点key的确定方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022134806A1
WO2022134806A1 PCT/CN2021/125269 CN2021125269W WO2022134806A1 WO 2022134806 A1 WO2022134806 A1 WO 2022134806A1 CN 2021125269 W CN2021125269 W CN 2021125269W WO 2022134806 A1 WO2022134806 A1 WO 2022134806A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
keys
slope
request
time
Prior art date
Application number
PCT/CN2021/125269
Other languages
English (en)
French (fr)
Inventor
吴名先
郑丕伟
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2022134806A1 publication Critical patent/WO2022134806A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Definitions

  • the present application relates to the technical field of data analysis, and in particular, to a method, apparatus, computer device, and computer-readable storage medium for determining a hotspot key.
  • Redis is a key-value storage system. It supports relatively more value types for storage, including string (string), list (linked list), key (event), set (set) and zset (ordered set).
  • string string
  • list linked list
  • key event
  • set set
  • zset ordered set
  • the main purpose of this application is to provide a method, device, computer equipment and computer-readable storage medium for determining a hotspot key, which aims to solve the problem of inaccurate positioning of hotspot keys caused by only focusing on acquiring data samples for a period of time in the prior art. technical problem.
  • the present application provides a method for determining a hotspot key, and the method for determining a hotspot key includes the following steps:
  • the acquisition time of the corresponding key, the opening time period and each access request time of each of the keys are obtained, and a schematic diagram of the request density of each of the keys is generated;
  • the hotspot keys in the keys are determined.
  • the present application further provides a method and device for determining a hotspot key, and the method and device for determining a hotspot key include:
  • a first obtaining module configured to enable a preset monitor according to the query rate of the target interface, and obtain the opening time period of the preset monitor
  • a second obtaining module configured to obtain the time of each access request of each key based on the preset monitor, and to obtain the time of obtaining the corresponding key in response to each of the access requests;
  • a generating module configured to obtain the acquisition time of the corresponding key, the opening time period and the access request time of each of the keys according to each of the access requests, and generate a schematic diagram of the request density of each of the keys;
  • a determination module configured to determine a hotspot key in the key based on the schematic diagram of the request density of each key.
  • the present application also provides a computer device, the computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program is executed by the When the processor executes, the following steps are implemented:
  • the acquisition time of the corresponding key, the opening time period and each access request time of each of the keys are obtained, and a schematic diagram of the request density of each of the keys is generated;
  • the hotspot keys in the keys are determined.
  • the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, wherein when the computer program is executed by a processor, the following steps are implemented:
  • the acquisition time of the corresponding key, the opening time period and each access request time of each of the keys are obtained, and a schematic diagram of the request density of each of the keys is generated;
  • the hotspot keys in the keys are determined.
  • the present application provides a method, device, computer equipment and computer-readable storage medium for determining a hotspot key, by enabling a preset monitor according to the query rate of a target interface, and obtaining the opening time period of the preset monitor;
  • the preset monitor obtains the time of each access request of each key, and obtains the time of obtaining the corresponding key in response to each of the access requests; obtains the time of obtaining the corresponding key, the opening time period and the corresponding key according to each of the access requests.
  • a schematic diagram of the request density of each of the keys is generated; based on the schematic diagram of the request density of each of the keys, the hot keys in the key are determined, so as to avoid the request exceeding the current cache capacity, which will cause the lower layer service. Crash, the implementation of hot keys is determined by requesting density diagrams, thereby increasing the accuracy of determining hot keys.
  • FIG. 1 is a schematic flowchart of a method for determining a hotspot key according to an embodiment of the present application
  • Fig. 3 is the sub-step flowchart schematic diagram of the determination method of the hot spot key in Fig. 1;
  • Fig. 4 is the sub-step flow schematic diagram of the determination method of the hot spot key in Fig. 1;
  • FIG. 5 is a schematic block diagram of a method and apparatus for determining a hotspot key provided by an embodiment of the present application
  • FIG. 6 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
  • Embodiments of the present application provide a method, an apparatus, a computer device, and a computer-readable storage medium for determining a hotspot key.
  • the method for determining the hotspot key can be applied to a computer device, and the computer device can be an electronic device such as a server, a notebook computer, a desktop computer, etc., wherein the server includes a Redis server.
  • FIG. 1 is a schematic flowchart of a method for determining a hotspot key provided by an embodiment of the present application.
  • the method for determining the hotspot key includes steps S101 to S104.
  • Step S101 enable a preset monitor according to the query rate of the target interface, and acquire the opening time period of the preset monitor.
  • a visitor accesses a server through an interface, and queries a key in the server, where the key is an important news, a popular gossip news, etc., and the server is a Redis server.
  • Multiple interfaces are preset in advance to obtain corresponding target interfaces. For example, an interface with a large amount of access is marked in advance, and the marked interface is used as a target interface, wherein the number of target interfaces is not limited. Get the query rate of the target interface, and enable the preset monitor based on the query rate.
  • the Redis server obtains the qps of the target interface, and starts the preset monitor through the qps, where qps is the query rate per second of the target interface, and the monitor is used by the Redis server to record query information in real time. Acquire the opening time period of the preset monitor.
  • the preset monitor is opened, the first moment of opening the preset monitor is obtained. time.
  • An on-time period is set for the monitor in advance, and the on-time period of the preset monitor is obtained through the first moment of the preset monitor and the on-time period.
  • the enabling the preset monitor according to the query rate of the target interface includes: monitoring the target interface, and obtaining the query rate of the target interface; when the query rate is greater than or equal to a first preset threshold, to open the preset monitor.
  • the target interface is monitored, and the query rate of the target interface is obtained in real time.
  • the query rate obtained in real time is compared with the first preset threshold, and if the query rate is greater than the first preset threshold, the preset monitor is enabled.
  • the qps of the target interface is acquired in real time, and when the qps of the target interface is greater than the first preset threshold, the preset monitor is enabled, and the first preset threshold is not limited.
  • Step S102 acquiring each access request time of each key based on the preset monitor, and acquiring the corresponding key acquisition time in response to each of the access requests.
  • each access request time of each key is obtained by starting the preset monitor.
  • the preset monitor detects that the first request accesses the first key, and obtains the moment when the first request accesses the first key, or the preset monitor detects that the first request and the second request access the first key, respectively.
  • each access request time includes: a first access request time, a second access request time, and a third access request time.
  • the preset monitor detect the first request, the second request and the third request to access the first key; obtain the first time when the first request accesses the first key, and the second request accesses the first key The second time of the key and the third time of the third request to access the first key. Based on this method, the first access request time of each key's first access request, the second access request time of each key's second request access, and the third access request time of each key's third request access are obtained.
  • Step S103 obtaining the acquisition time of the corresponding key, the opening time period, and each access request time of each of the keys according to each of the access requests, and generate a schematic diagram of the request density of each of the keys.
  • the request density information of each key is obtained according to each access request time of each key and the acquisition time of each access request corresponding to the key, and the request density information of each key is to obtain the request density information corresponding to each key acquisition time, According to the request density information of each key and the opening time period of the preset monitor, a schematic diagram of the request density of each key in the opening time period is obtained.
  • step S103 includes: sub-step S1031 to sub-step S1032.
  • Sub-step S1031 Calculate the acquisition time of each of the access requests to obtain the corresponding key and the first access request time, the second access request time, and the third access request time of each of the keys through a preset request density formula, and obtain the Obtain the request density information of each key at the moment.
  • Density information for example, the time when the first key is obtained by the access request, the time of the first access request of the first request of the first key, the time of the second access request of the second request of the first key, the time of the second access request of the first key.
  • the third access request time of the third request access based on the preset request density formula Obtain the request density information of the first key, where T is the acquisition time of the first key obtained by the access request, t 1 is the second access request time of the second request of the first key, and t 0 is the first key of the first key.
  • the first access request time of requesting access, t 2 The third access request time of the third request for access of the first key, t m is the request density information of the first key, when the request is more frequent, the value of t m is larger; Conversely, the smaller the value of t m is, but t m is always greater than or equal to 1.
  • Sub-step S1032 Generate a schematic diagram of the request density of each key by acquiring the request density information of each key at the acquisition time within the preset open time period, wherein the preset open time period includes multiple Get the moment.
  • the request density information of each key is the request density information of each key at the time of acquisition, based on the start time period of the preset monitor and the request density of each key at the time of acquisition. information, to obtain schematic diagrams of the request density of each key as shown in Figure 2a, Figure 2b, Figure 2c, and Figure 2d.
  • Step S104 Determine a hotspot key in the key based on the schematic diagram of the request density of each key.
  • the hot key in each key is determined. For example, after obtaining the schematic diagram of the request density of each key, the curve information of each key in the schematic diagram of the request density of each key is obtained. If the curve information shows an increasing trend, the key corresponding to the curve is determined as a hot key.
  • step S104 includes: sub-step S1041 to sub-step S1043 .
  • Sub-step S1041 Perform curve derivation on the curve information in the schematic diagram of the requested density of each key to obtain a slope curve of each of the keys.
  • the curve information in the schematic diagram of the request density of each key is obtained by curve derivation, and the slope curve of each key is obtained, wherein the slope curve of each key includes the curve shown in FIG. 2a .
  • Sub-step S1042 Obtain the slope area of each key according to the slope curve of each key.
  • an upwardly increasing slope curve as shown in FIG. 2a, and/or a downwardly decreasing slope curve as shown in FIG. 2b, and/or a first decreasing and then increasing slope curve as shown in FIG. 2c is obtained. and/or when the slope curve is increasing first and then decreasing as shown in Fig. 2d, calculate the slope area of the upwardly increasing slope curve as shown in Fig. 2a, and/or the slope area of the downwardly decreasing slope curve as shown in Fig. 2b. The slope area, and/or the slope area of the first decreasing and then increasing slope curve as shown in FIG. 2c and/or the slope area of the first increasing and then decreasing slope curve as shown in FIG. 2d.
  • the slope curve of each key includes abscissa time and ordinate request density
  • obtaining the slope area of each key according to the slope curve of each key includes: calculating each The abscissa moment of the slope curve and the ordinate request density, obtain the first slope area and/or the second slope area corresponding to the slope curve of each key; if the first slope area is obtained, then the The first slope area of is used as the slope area of each of the keys; or, if the second slope area is obtained, the slope area of each of the keys is zero; and/or, if the obtained For the first slope area and the second slope area, the second slope area is subtracted from the first slope area to obtain the slope area of each key.
  • the slope curve of each key includes the time on the abscissa and the requested density on the ordinate, and the corresponding slope area is obtained by calculating the time on the abscissa and the requested density on the ordinate. For example, as shown in Fig. 2a, the start and end increment times of the slope curve are obtained, and the increment duration is obtained. Obtain the request density corresponding to the start increment time and the request density corresponding to the end increment time in the ordinate, calculate the increment duration, the request density corresponding to the start increment time, and the request density corresponding to the end increment time, and obtain the slope area of the corresponding area of the slope curve.
  • first slope area and/or the second slope area in the slope curve of each key through the slope curve of each key, wherein the first slope area is the area corresponding to the increasing area, and the second slope area is the area corresponding to the decreasing area,
  • first slope area is the area corresponding to the increasing area
  • second slope area is the area corresponding to the decreasing area
  • the slope area is the area corresponding to the increasing region, and the slope area corresponding to the increasing region is a positive number; and/or, when obtaining the curve shown in Figure 2b
  • the slope area is the area corresponding to the decreasing region, and the slope area corresponding to the decreasing region is a negative number;
  • the first slope area corresponding to the increasing area and the second slope area corresponding to the decreasing area are calculated respectively, and the corresponding slope is obtained by adding the first slope area and the second slope area area.
  • Sub-step S1043 Compare the slope area of each key with the second preset threshold, and determine that the key with the slope area greater than the third preset threshold is a hot key.
  • the slope area of each key is compared with the second preset threshold to determine whether it is greater than the second preset threshold.
  • the slope area greater than the second preset threshold is determined as the target slope area, and the key corresponding to the target target slope area is determined as the hotspot key.
  • FIG. 5 is a schematic block diagram of a method and apparatus for determining a hotspot key provided by an embodiment of the present application.
  • the method and apparatus 400 for determining a hotspot key includes: a first acquiring module 401 , a second acquiring module 402 , a generating module 403 , and a determining module 404 .
  • the first obtaining module 401 is configured to open a preset monitor according to the query rate of the target interface, and obtain the opening time period of the preset monitor;
  • the second obtaining module 402 is configured to obtain, based on the preset monitor, the time of each access request of each key, and to obtain the time of obtaining the corresponding key in response to each of the access requests;
  • the generating module 403 is configured to obtain the acquisition time of the corresponding key, the opening time period and the access request time of each of the keys according to each of the access requests, and generate a schematic diagram of the request density of each of the keys;
  • a determination module 404 configured to determine a hotspot key in the key based on the schematic diagram of the request density of each of the keys;
  • the second obtaining module 402 is also specifically used for:
  • the respective access request moments include: a first access request moment, a second access request moment and a third access request moment.
  • the generating module 403 is also specifically used for:
  • a schematic diagram of the request density of each key is generated by acquiring the request density information of each key at the acquisition time within the preset open time period, wherein the preset open time period includes multiple acquisition times.
  • the determining module 404 is also specifically used for:
  • the slope area of each key is compared with the second preset threshold, and it is determined that the key whose slope area is greater than the third preset threshold is a hot key.
  • the determining module 404 is specifically also used for:
  • the obtained first slope area is used as the slope area of each key; or,
  • the obtained first slope area is used as the slope area of each of the keys, wherein the second slope area is a negative number; and/or,
  • the second slope area is subtracted from the first slope area to obtain the slope area of each key.
  • the first obtaining module 401 is also specifically used for:
  • the preset monitor When the query rate is greater than or equal to the first preset threshold, the preset monitor is turned on.
  • the apparatuses provided in the above embodiments may be implemented in the form of a computer program, and the computer program may be executed on the computer device as shown in FIG. 6 .
  • FIG. 6 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
  • the computer device may be a terminal.
  • the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
  • Non-volatile storage media can store operating systems and computer programs.
  • the computer program includes program instructions, which, when executed, can cause the processor to execute any method for determining a hotspot key.
  • the processor is used to provide computing and control capabilities to support the operation of the entire computer equipment.
  • the internal memory provides an environment for running the computer program in the non-volatile storage medium.
  • the processor can execute any method for determining a hot key.
  • the network interface is used for network communication, such as sending assigned tasks.
  • the network interface is used for network communication, such as sending assigned tasks.
  • FIG. 6 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated circuits) Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like.
  • the processor is configured to run a computer program stored in the memory to implement the following steps:
  • the acquisition time of the corresponding key, the opening time period and each access request time of each of the keys are obtained, and a schematic diagram of the request density of each of the keys is generated;
  • the hotspot keys in the keys are determined.
  • the processor obtains, according to each of the access requests, the acquisition time of the corresponding key, the opening time period, and the time of each access request of each of the keys, and generates a schematic diagram of the request density of each of the keys When implemented, used to implement:
  • a schematic diagram of the request density of each key is generated by acquiring the request density information of each key at the acquisition time within the preset open time period, wherein the preset open time period includes multiple acquisition times.
  • the processor based on the schematic diagram of the request density of each key, when determining that the hot key in the key is implemented, is used to implement:
  • the slope area of each key is compared with the second preset threshold, and it is determined that the key whose slope area is greater than the third preset threshold is a hot key.
  • the slope curve of each key of the processor includes abscissa time and ordinate request density, and according to the slope curve of each key, obtaining the slope area of each key is realized when , which is used to implement:
  • the obtained first slope area is used as the slope area of each key; or,
  • the obtained first slope area is used as the slope area of each of the keys, wherein the second slope area is a negative number; and/or,
  • the second slope area is subtracted from the first slope area to obtain the slope area of each key.
  • the processor when the processor starts the preset monitor implementation according to the query rate of the target interface, it is used to implement:
  • the preset monitor When the query rate is greater than or equal to the first preset threshold, the preset monitor is turned on.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, the computer program includes program instructions, and the method implemented when the program instructions are executed may refer to this document Various embodiments of the method for determining the application hotspot key.
  • the computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or a memory of the computer device.
  • the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) ) card, Flash Card, etc.
  • the computer-readable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; The data created by the use of the node, etc.
  • the blockchain referred to in this application is a new application mode of computer technologies such as storage of preset monitors, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种热点key的确定方法、装置、计算机设备及计算机可读存储介质,该方法包括:通过根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段(S101);基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻(S102);根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图(S103);基于各个所述key的请求密度示意图,确定所述key中的热点key(S104),从而避免请求超过当前缓存容量就会造成下层服务的崩溃,实现通过请求密度示意图确定热key,从而增加确定热key的准确性。

Description

热点key的确定方法、装置、设备及存储介质
本申请要求于2020年12月22日提交中国专利局、申请号为2020115306161、发明名称为“热点key的确定方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据分析技术领域,尤其涉及一种热点key的确定方法、装置、计算机设备及计算机可读存储介质。
背景技术
Redis是一个key-value存储系统。它支持存储的value类型相对更多,包括string(字符串)、list(链表)、key(事件)、set(集合)和zset(有序集合),作为一个数据缓存层,会在项目中经常用到。在使用过程中,如果有大量请求到同一个key时,会对redis造成奔溃,例如,key为访问某商品的活动信息。所以在实际的项目中需要及时定位到热点key。业界最常用的一种方法就是在一段时间内统计访问者访问各个key的请求量,然后对各个key的请求量进行排序,根据key的排序来确认热点key,但发明人意识到该种方法只关注获取一段时间的数据样本,导致定位的热点key不准确。
发明内容
本申请的主要目的在于提供一种热点key的确定方法、装置、计算机设备及计算机可读存储介质,旨在解决现有技术中只关注获取一段时间的数据样本,导致定位的热点key不准确的技术问题。
第一方面,本申请提供一种热点key的确定方法,所述热点key的确定方法包括以下步骤:
根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
基于各个所述key的请求密度示意图,确定所述key中的热点key。
第二方面,本申请还提供一种热点key的确定方法装置,所述热点key的确定方法装置包括:
第一获取模块,用于根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
第二获取模块,用于基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
生成模块,用于根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
确定模块,用于基于各个所述key的请求密度示意图,确定所述key中的热点key。
第三方面,本申请还提供一种计算机设备,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如下步骤:
根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
基于各个所述key的请求密度示意图,确定所述key中的热点key。
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如下步骤:
根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
基于各个所述key的请求密度示意图,确定所述key中的热点key。
本申请提供一种热点key的确定方法、装置、计算机设备及计算机可读存储介质,通过根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;基于各个所述key的请求密度示意图,确定所述key中的热点key,从而避免请求超过当前缓存容量就会造成下层服务的崩溃,实现通过请求密度示意图确定热key,从而增加确定热key的准确性。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种热点key的确定方法的流程示意图;
图2a至图2d是本申请中各个key的请求密度示意图;
图3为图1中的热点key的确定方法的子步骤流程示意图;
图4为图1中的热点key的确定方法的子步骤流程示意图;
图5为本申请实施例提供的一种热点key的确定方法装置的示意性框图;
图6为本申请一实施例涉及的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
本申请实施例提供一种热点key的确定方法、装置、计算机设备及计算机可读存储介质。其中,该热点key的确定方法可应用于计算机设备中,该计算机设备可以是服务器、笔记本电脑、台式电脑等电子设备,其中该服务器包括Redis服务器。
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参照图1,图1为本申请的实施例提供的一种热点key的确定方法的流程示意图。
如图1所示,该热点key的确定方法包括步骤S101至步骤S104。
步骤S101、根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段。
示范性的,访问者通过接口访问服务器,查询该服务器中的key,该key为一个重要的新闻,一个热门的八卦新闻等等,该服务器为Redis服务器。预先对多个接口进行预设,得到对应的目标接口。例如,预先对访问量大的接口进行标记,将该标记的接口作为目标接口,其中,目标接口的数量不做限定。获取目标接口的查询率,通过该查询率开启预置监视器。例如,Redis服务器获取目标接口的qps,通过该qps来开启预置monitor,其中,qps为目标接口的每秒查询率,monitor为Redis服务器中用于实时记录查询信息的。获取所述预置监视器的开启时间段,示范例的,在开启预置监视器时,获取开启预置监视器的第一时刻,例如,通过进程或访问时间系统获取开启预置监视器的时刻。预先对该监视器设置一个开启时长,通过该预置监视器的第一时刻和开启时长,得到该预置监视器的开启时间段。
在一实施例中,所述根据目标接口的查询率开启预置监视器,包括:监控目标接口,并获取所述目标接口的查询率;当所述查询率大于或等于第一预置阈值,则开启预置监视器。
示范性的,监控目标接口,实时获取该目标接口的查询率。将实时获取到的查询率与第一预置阈值进行比对,若该查询率大于第一预置阈值时,则开启预置监视器。例如,实时获取到目标接口的qps,当目标接口的qps大于第一预置阈值时,开启预置监视器,对第一预置阈值不做限定。
步骤S102、基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻。
示范性的,通过开启预置监视器,获取各个key的各个访问请求时刻。例如,通过预置监视器检测到第一请求访问第一key,获取第一请求访问第一key的时刻,或者,通过预置监视器检测到第一请求和第二请求访问第一key,分别获取第一请求访问访问第一key的时刻和第二请求访问访问第一key的时刻。并获取服务器响应各个访问请求获取对应key的获取时刻,例如,在接收到访问请求时,基于该访问请求中携带的实例信息访问对应的数据库,记录获取该数据库中对应的key的时刻。
在一实时例中,所述各个访问请求时刻包括:第一访问请求时刻、第二访问请求时刻和第三访问请求时刻。
示范性的,基于所述预置监视器,检测第一请求、第二请求以及第三请求访问第一key;获取第一请求访问该第一key的第一时刻、第二请求访问该第一key的第二时刻、第三请求访问该第一key的第三时刻。基于该方式,获取各个key的第一请求访问的第一访问请求时刻、各个key的第二请求访问的第二访问请求时刻、各个key的第三请求访问的第三访问请求时刻。
步骤S103、根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图。
示范性的,根据各个key的各个访问请求时刻和各个访问请求获取对应key的获取时刻,得到各个key的请求密度信息,该各个key的请求密度信息为获取各个key获取时刻对应的请求密度信息,根据该各个key的请求密度信息和预置监视器的开启时间段,获取各个key在开启时间段内的请求密度示意图。
在一实施例中,具体地,参照图3,步骤S103包括:子步骤S1031至子步骤S1032。
子步骤S1031、通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息。
示范性的,通过预置请求密度公式,计算各个访问请求获取对应key的获取时刻和各个key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到获取时刻各个key的请求密度信息,例如,通过第一key被访问请求获取的时刻、第一key的第一请求访问的第一访问请求时刻、第一key的第二请求访问的第二访问请求时刻、第一key的第三请求访问的第三访问请求时刻,基于预置请求密度公式
Figure PCTCN2021125269-appb-000001
得到第一key的请求密度信息,其中,T为第一key被访问请求获取的获取时刻,t 1为第一key的第二请求访问的第二访问请求时刻,t 0第一key的第一请求访问的第一访问请求时刻,t 2第一key的第三请求访问的第三访问请求时刻,t m为第一key的请求密度信息,当请求越频繁时,t m的值越大;反之,t m的值越小,但t m始终大于等于1。
子步骤S1032、通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
示范性的,在获取到各个key的请求密度信息,该各个key的请求密度信息为各个key的获取时刻的请求密度信息,基于预置监视器的开始时间段和获取时刻的各个key的请求密度信息,得到如图2a、如图2b、如图2c、如图2d所示的各个key的请求密度示意图。
步骤S104、基于各个所述key的请求密度示意图,确定所述key中的热点key。
示范例的,在得到如图2a、如图2b、如图2c、如图2d所示的各个key的请求密度示意图,通过分析各个key的请求密度示意图,确定各个key中的热点key。例如,在得到各个key的请求密度示意图,获取各个key的请求密度示意图中各个key的曲线信息,若该曲线信息为递增趋势,则确定该曲线对应的key为热点key。
在一实施例中,具体地,参照图4,步骤S104包括:子步骤S1041至子步骤S1043。
子步骤S1041、对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线。
示范例的,在得到各个key的请求密度示意图,对各个key的请求密度示意图中的曲线信息进行曲线求导,得到各个key的斜率曲线,其中,各个key的斜率曲线包括如图2a所示的向上递增的斜率曲线、和/或如图2b所示的向下递减的斜率曲线、和/或如图2c所示的先减后增的斜率曲线和/或如图2d所示的先增后减的斜率曲线。
子步骤S1042、根据各个所述key的斜率曲线,获取各个所述key的斜率面积。
示范例的,在得到如图2a所示的向上递增的斜率曲线、和/或如图2b所示的向下递减的斜率曲线、和/或如图2c所示的先减后增的斜率曲线和/或如图2d所示的先增后减的斜率曲线时,计算如图2a所示的向上递增的斜率曲线的斜率面积、和/或如图2b所示的向下递减的斜率曲线的斜率面积、和/或如图2c所示的先减后增的斜率曲线的斜率面积和/或如图2d所示的先增后减的斜率曲线的斜率面积。
在一实时例中,所述各个所述key的斜率曲线包括横坐标时刻和纵坐标请求密度,所述根据各个所述key的斜率曲线,获取各个所述key的斜率面积,包括:通过计算各个所述斜率曲线的横坐标时刻和纵坐标请求密度,获取各个所述key的斜率曲线对应的第一斜率面积和/或第二斜率面积;若获取到所述第一斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积;或,若获取到所述第二斜率面积,则获取到各个所述key的斜率面积为零;和/或,若获取到所述第一斜率面积和所述第二斜率面积,则将所述第一斜率面积减去所述第二斜率面积,获取各个所述key的斜率面积。
实施例的,各个所述key的斜率曲线包括横坐标时刻和纵坐标请求密度,通过计算该横坐标时刻和纵坐标请求密度,得到对应的斜率面积。例如,如图2a所示,获取横最表该斜率曲线开始递增时刻和结束递增时刻,得到递增时长。获取纵坐标中开始递增时刻对应的请求密度和结束递增时刻对应的请求密度,计算递增时长、开始递增时刻对应的请求密度和结束递增时刻对应的请求密度,得到斜率曲线对应区域的斜率面积。
通过各个key的斜率曲线,获取各个key的斜率曲线中的第一斜率面积和/或第二斜率面积,其中,第一斜率面积为递增区域对应的面积,第二斜率面积为递减区域对应面积,在得到第一斜率面积和/或第二斜率面积时,将第一斜率面积减去第二斜率面积得到斜率面积。例如,在得到如图2a所示的向上递增的斜率曲线时,该斜率面积为递增区域对应的面积,该递增区域对应的斜率面积为正数;和/或,在得到如图2b所示的向下递减的斜率曲线时,该斜率面积为递减区域对应的面积,该递减区域对应的斜率面积为负数;和/或在得到如图2c所示的先减后增的斜率曲线和/或如图2d所示的先增后减的斜率曲线时,分别计算递增区域对应的第一斜率面积和递减区域对应的第二斜率面积,通过将第一斜率面积与第二斜率面积相加得到对应斜率面积。
子步骤S1043、将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
实施例的,在得到各个key的斜率面积时,分别将各个key的斜率面积与第二预置阈值进行比对,确定是否大于第二预置阈值。将大于第二预置阈值的斜率面积确定为目标斜率面积,将目标目标斜率面积对应的key确定为热点key。
在本申请实施例中,通过根据目标接口的查询率开启预置监视器,并获取预置监视器的开启时间段、各个key的各个访问请求时刻和监测到各个访问请求获取对应key的时刻,根据各个访问请求获取对应key的时刻、开启时间段和各个各个key的各个访问请求时刻,生成各个key的请求密度示意图,确定key中的热点key,从而避免请求超过当前缓存容量就会造成下层服务的崩溃,实现通过请求密度示意图确定热key,从而增加确定热key的准确性。
请参照图5,图5为本申请实施例提供的一种热点key的确定方法装置的示意性框图。
如图5所示,该热点key的确定方法装置400,包括:第一获取模块401、第二获取模块402、生成模块403、确定模块404。
第一获取模块401,用于根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
第二获取模块402,用于基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
生成模块403,用于根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
确定模块404,用于基于各个所述key的请求密度示意图,确定所述key中的热点key;
其中,第二获取模块402具体还用于:
所述各个访问请求时刻包括:第一访问请求时刻、第二访问请求时刻和第三访问请求时刻。
其中,生成模块403具体还用于:
通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息;
通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
其中,确定模块404具体还用于:
对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线;
根据各个所述key的斜率曲线,获取各个所述key的斜率面积;
将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
其中,确定模块404具体还用于:
通过计算各个所述斜率曲线的横坐标时刻和纵坐标请求密度,获取各个所述key的斜率曲线对应的第一斜率面积和/或第二斜率面积;
若获取到所述第一斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积;或,
若获取到所述第二斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积,其中,所述第二斜率面积为负数;和/或,
若获取到所述第一斜率面积和所述第二斜率面积,则将所述第一斜率面积减去所述第二斜率面积,获取各个所述key的斜率面积。
其中,第一获取模块401具体还用于:
监控目标接口,并获取所述目标接口的查询率;
当所述查询率大于或等于第一预置阈值,则开启预置监视器。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块及单元的具体工作过程,可以参考前述热点key的确定方法实施例中的对应过程,在此不再赘述。
上述实施例提供的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图6所示的计算机设备上运行。
请参阅图6,图6为本申请实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以为终端。
如图6所示,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括非易失性存储介质和内存储器。
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种热点key的确定方法。
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种热点key的确定方法。
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:
根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
基于各个所述key的请求密度示意图,确定所述key中的热点key。
在一个实施例中,所述处理器所述根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图实现时,用于实现:
通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息;
通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
在一个实施例中,所述处理器所述基于各个所述key的请求密度示意图,确定所述key中的热点key实现时,用于实现:
对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线;
根据各个所述key的斜率曲线,获取各个所述key的斜率面积;
将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
在一个实施例中,所述处理器所述各个所述key的斜率曲线包括横坐标时刻和纵坐标请求密度,所述根据各个所述key的斜率曲线,获取各个所述key的斜率面积实现时,用于实现:
通过计算各个所述斜率曲线的横坐标时刻和纵坐标请求密度,获取各个所述key的斜率曲线对应的第一斜率面积和/或第二斜率面积;
若获取到所述第一斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积;或,
若获取到所述第二斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积,其中,所述第二斜率面积为负数;和/或,
若获取到所述第一斜率面积和所述第二斜率面积,则将所述第一斜率面积减去所述第二斜率面积,获取各个所述key的斜率面积。
在一个实施例中,所述处理器所述根据目标接口的查询率开启预置监视器实现时,用于实现:
监控目标接口,并获取所述目标接口的查询率;
当所述查询率大于或等于第一预置阈值,则开启预置监视器。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序中包括程序指令,所述程序指令被执行时所实现的方法可参照本申请热点key的确定方法的各个实施例。
其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请所指区块链是预置监视器的存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种热点key的确定方法,其中,包括:
    根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
    基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
    根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
    基于各个所述key的请求密度示意图,确定所述key中的热点key。
  2. 根据权利要求1所述的热点key的确定方法,其中,所述各个访问请求时刻包括:第一访问请求时刻、第二访问请求时刻和第三访问请求时刻。
  3. 根据权利要求2所述的热点key的确定方法,其中,所述根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图,包括:
    通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息;
    通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
  4. 根据权利要求1所述的热点key的确定方法,其中,所述基于各个所述key的请求密度示意图,确定所述key中的热点key,包括:
    对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线;
    根据各个所述key的斜率曲线,获取各个所述key的斜率面积;
    将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
  5. 根据权利要求4所述的热点key的确定方法,其中,所述key的斜率曲线,包括向上递增的斜率曲线、向下递减的斜率曲线、先减后增的斜率曲线和先增后减的斜率曲线。
  6. 根据权利要求4所述的热点key的确定方法,其中,所述各个所述key的斜率曲线包括横坐标时刻和纵坐标请求密度,所述根据各个所述key的斜率曲线,获取各个所述key的斜率面积,包括:
    通过计算各个所述斜率曲线的横坐标时刻和纵坐标请求密度,获取各个所述key的斜率曲线对应的第一斜率面积和/或第二斜率面积;
    若获取到所述第一斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积;或,
    若获取到所述第二斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积,其中,所述第二斜率面积为负数;和/或,
    若获取到所述第一斜率面积和所述第二斜率面积,则将所述第一斜率面积与所述第二斜率面积相加,获取各个所述key的斜率面积。
  7. 根据权利要求1所述的热点key的确定方法,其中,所述根据目标接口的查询率开启预置监视器,包括:
    监控目标接口,并获取所述目标接口的查询率;
    当所述查询率大于或等于第一预置阈值,则开启预置监视器。
  8. 一种热点key的确定方法装置,其中,包括:
    第一获取模块,用于根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
    第二获取模块,用于基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
    生成模块,用于根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
    确定模块,用于基于各个所述key的请求密度示意图,确定所述key中的热点key。
  9. 一种计算机设备,其中,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如下步骤:
    根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
    基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
    根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
    基于各个所述key的请求密度示意图,确定所述key中的热点key。
  10. 根据权利要求9所述的计算机设备,其中,所述各个访问请求时刻包括:第一访问请求时刻、第二访问请求时刻和第三访问请求时刻。
  11. 根据权利要求10所述的计算机设备,其中,所述根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图,包括:
    通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息;
    通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
  12. 根据权利要求9所述的计算机设备,其中,所述基于各个所述key的请求密度示意图,确定所述key中的热点key,包括:
    对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线;
    根据各个所述key的斜率曲线,获取各个所述key的斜率面积;
    将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
  13. 根据权利要求12所述的计算机设备,其中,所述key的斜率曲线,包括向上递增的斜率曲线、向下递减的斜率曲线、先减后增的斜率曲线和先增后减的斜率曲线。
  14. 根据权利要求12所述的计算机设备,其中,所述各个所述key的斜率曲线包括横坐标时刻和纵坐标请求密度,所述根据各个所述key的斜率曲线,获取各个所述key的斜率面积,包括:
    通过计算各个所述斜率曲线的横坐标时刻和纵坐标请求密度,获取各个所述key的斜率曲线对应的第一斜率面积和/或第二斜率面积;
    若获取到所述第一斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积;或,
    若获取到所述第二斜率面积,则将获取到的所述第一斜率面积作为各个所述key的斜率面积,其中,所述第二斜率面积为负数;和/或,
    若获取到所述第一斜率面积和所述第二斜率面积,则将所述第一斜率面积与所述第二斜率面积相加,获取各个所述key的斜率面积。
  15. 根据权利要求9所述的计算机设备,其中,所述根据目标接口的查询率开启预置监视器,包括:
    监控目标接口,并获取所述目标接口的查询率;
    当所述查询率大于或等于第一预置阈值,则开启预置监视器。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如下步骤:
    根据目标接口的查询率开启预置监视器,并获取所述预置监视器的开启时间段;
    基于所述预置监视器,获取各个key的各个访问请求时刻,以及响应各个所述访问请求获取对应key的获取时刻;
    根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图;
    基于各个所述key的请求密度示意图,确定所述key中的热点key。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述各个访问请求时刻包括:第一访问请求时刻、第二访问请求时刻和第三访问请求时刻。
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述根据各个所述访问请求获取对应key的获取时刻、所述开启时间段和各个所述key的各个访问请求时刻,生成各个所述key的请求密度示意图,包括:
    通过预置请求密度公式,计算各个所述访问请求获取对应key的获取时刻和各个所述key的第一访问请求时刻、第二访问请求时刻、第三访问请求时刻,得到所述获取时刻各个所述key的请求密度信息;
    通过获取所述预置开启时间段内所述获取时刻各个所述key的请求密度信息,生成各个所述key的请求密度示意图,其中,所述预置开启时间段内包括多个获取时刻。
  19. 根据权利要求16所述的计算机可读存储介质,其中,所述基于各个所述key的请求密度示意图,确定所述key中的热点key,包括:
    对各个所述key的请求密度示意图中的曲线信息进行曲线求导,得到各个所述key的斜率曲线;
    根据各个所述key的斜率曲线,获取各个所述key的斜率面积;
    将各个所述key的斜率面积与第二预置阈值进行比对,确定斜率面积大于第三预置阈值的key为热点key。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述key的斜率曲线,包括向上递增的斜率曲线、向下递减的斜率曲线、先减后增的斜率曲线和先增后减的斜率曲线。
PCT/CN2021/125269 2020-12-22 2021-10-21 热点key的确定方法、装置、设备及存储介质 WO2022134806A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011530616.1 2020-12-22
CN202011530616.1A CN112650752A (zh) 2020-12-22 2020-12-22 热点key的确定方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022134806A1 true WO2022134806A1 (zh) 2022-06-30

Family

ID=75359112

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/125269 WO2022134806A1 (zh) 2020-12-22 2021-10-21 热点key的确定方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112650752A (zh)
WO (1) WO2022134806A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650752A (zh) * 2020-12-22 2021-04-13 深圳壹账通智能科技有限公司 热点key的确定方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200180A (zh) * 2018-01-08 2018-06-22 武汉斗鱼网络科技有限公司 一种用于限制请求频率的方法、装置及计算机设备
WO2019148727A1 (zh) * 2018-02-01 2019-08-08 平安科技(深圳)有限公司 电子装置、基于redis的异常预警方法及存储介质
CN111324809A (zh) * 2020-02-04 2020-06-23 京东数字科技控股有限公司 一种热点信息监测方法、装置及系统
CN112052394A (zh) * 2020-09-10 2020-12-08 上海梅斯医药科技有限公司 专业内容信息的推荐方法、系统、终端设备和存储介质
CN112650752A (zh) * 2020-12-22 2021-04-13 深圳壹账通智能科技有限公司 热点key的确定方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200180A (zh) * 2018-01-08 2018-06-22 武汉斗鱼网络科技有限公司 一种用于限制请求频率的方法、装置及计算机设备
WO2019148727A1 (zh) * 2018-02-01 2019-08-08 平安科技(深圳)有限公司 电子装置、基于redis的异常预警方法及存储介质
CN111324809A (zh) * 2020-02-04 2020-06-23 京东数字科技控股有限公司 一种热点信息监测方法、装置及系统
CN112052394A (zh) * 2020-09-10 2020-12-08 上海梅斯医药科技有限公司 专业内容信息的推荐方法、系统、终端设备和存储介质
CN112650752A (zh) * 2020-12-22 2021-04-13 深圳壹账通智能科技有限公司 热点key的确定方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN112650752A (zh) 2021-04-13

Similar Documents

Publication Publication Date Title
US11750607B2 (en) Identifying accounts having shared credentials
WO2019140828A1 (zh) 电子装置、分布式系统日志查询方法及存储介质
WO2020037930A1 (zh) 信息推荐方法、装置、计算机设备及存储介质
CN113285883A (zh) 一种访问请求的限流方法及装置、电子设备、存储介质
US20200169614A1 (en) Function Based Dynamic Traffic Management for Network Services
AU2016351383A1 (en) Performance monitoring in a distributed storage system
US11568596B2 (en) Non-blocking token authentication cache
CN110213255B (zh) 一种对主机进行木马检测的方法、装置及电子设备
WO2019237591A1 (zh) 文件格式转换方法、装置、计算机设备及存储介质
WO2021197392A1 (zh) 任务队列生成
WO2022134806A1 (zh) 热点key的确定方法、装置、设备及存储介质
WO2021217916A1 (zh) 时间序列数据分段构建方法、装置、计算机设备及存储介质
KR20180121775A (ko) 데이터에 대한 요청들을 조정하고 인증하기 위한 방법 및 장치
CN111382206A (zh) 一种数据存储方法及装置
US10579676B2 (en) Highly scalable fine grained rate limiting
US11743284B2 (en) Multi-factor illicit enumeration detection
KR102567900B1 (ko) 클라우드 저하 모드에서 지속적인 디바이스 동작 안정성을 보장하기 위한 방법 및 장치
WO2020063946A1 (zh) 键值对数据的收集方法和装置
Bassamboo et al. Dynamics of new product introduction in closed rental systems
US20210035115A1 (en) Method and system for provisioning software licenses
US10248508B1 (en) Distributed data validation service
CN113609168B (zh) 数据导出方法、装置、终端以及可读存储介质
CN110572299B (zh) 设备测试方法、系统、装置、网络节点、终端及存储介质
US11580082B2 (en) Object storage system with control entity quota usage mapping
US7660888B2 (en) Indicating network resource availability methods, system and program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21908807

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31.10.2023)