CN111078718B - Frequency control method, device, equipment and computer storage medium - Google Patents

Frequency control method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN111078718B
CN111078718B CN201911401928.XA CN201911401928A CN111078718B CN 111078718 B CN111078718 B CN 111078718B CN 201911401928 A CN201911401928 A CN 201911401928A CN 111078718 B CN111078718 B CN 111078718B
Authority
CN
China
Prior art keywords
value
key
mapping table
stored
hash mapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911401928.XA
Other languages
Chinese (zh)
Other versions
CN111078718A (en
Inventor
曾斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911401928.XA priority Critical patent/CN111078718B/en
Publication of CN111078718A publication Critical patent/CN111078718A/en
Application granted granted Critical
Publication of CN111078718B publication Critical patent/CN111078718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • 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
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a frequency control method, a frequency control device, frequency control equipment and a computer storage medium, and belongs to the technical field of computers. The method comprises the following steps: when key value pairs to be stored corresponding to user behaviors are obtained, whether a target key of the key value pairs to be stored is stored in a concurrent hash mapping table or not is determined; if the concurrent hash mapping table stores the target key, determining a first difference value between the current timestamp and a timestamp of the target key in corresponding values in the concurrent hash mapping table; and when the first difference value is larger than the threshold value, updating the value of the key value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table. According to the method and the device, the timestamp is set in the value of the key value pair in the concurrent Hash mapping table, so that whether the frequency of the user behavior exceeds the threshold value or not can be judged through the concurrent Hash mapping table, and the diversity of the frequency control method is increased. The problem that a frequency control method in the related art is single is solved. The effect of enriching the frequency control method is achieved.

Description

Frequency control method, device, equipment and computer storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a frequency control method, apparatus, device, and computer storage medium.
Background
The device providing the network service generally needs to control the frequency of the user behavior of the client, so as to avoid the influence of the high-frequency user behavior of the client on the normal operation of the device.
In a frequency control method, a counter counts each time a client implements a user behavior, and if the number of user behaviors of the client exceeds a threshold within a certain period of time, no feedback is given to the user behavior of the client.
However, the frequency control method of the above method is simple.
Disclosure of Invention
The embodiment of the application provides a frequency control method, a frequency control device, frequency control equipment and a computer storage medium.
The technical scheme is as follows:
according to a first aspect of the present application, there is provided a frequency control method, the method comprising:
when key value pairs to be stored corresponding to user behaviors are obtained, judging whether a target key of the key value pairs to be stored is stored in a concurrent hash mapping table or not, wherein the concurrent hash mapping table comprises a plurality of key value pairs, and the value of each key value pair in the concurrent hash mapping table comprises a timestamp when the key value pair is stored;
if the target key is stored in the concurrent hash mapping table, determining a first difference value between a current timestamp and a timestamp of the target key in corresponding values in the concurrent hash mapping table;
when the first difference value is larger than a threshold value, updating the value of the key value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table;
and if the target key is not stored in the concurrent hash mapping table, storing the key value pair to be stored into the concurrent hash mapping table.
Optionally, the updating the value of the key-value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table includes:
and updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table.
Optionally, after the updating the value of the key-value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table and the updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table, the method further includes:
determining a second difference value between a timestamp of the target key corresponding to the target key in the concurrent hash mapping table and a timestamp of the target key corresponding to the target key in a remote dictionary service, wherein the remote dictionary service comprises a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service comprises a timestamp of the key-value pair during storage;
and when the second difference is larger than the threshold value, updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service.
Optionally, if the target key is not stored in the concurrent hash mapping table, storing the key-value pair to be stored in the concurrent hash mapping table includes:
and if the target key is not stored in the concurrent hash mapping table, updating the current timestamp to the value of the key value pair to be stored, and storing the key value pair to be stored in the concurrent hash mapping table.
Optionally, after the updating the current timestamp to the value of the key-value pair to be stored and storing the key-value pair to be stored in the concurrent hash mapping table, the method further includes:
determining a second difference value between a timestamp of the target key corresponding to the target key in the concurrent hash mapping table and a timestamp of the target key corresponding to the target key in a remote dictionary service, wherein the remote dictionary service comprises a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service comprises a timestamp of the key-value pair during storage;
and when the second difference is larger than the threshold value, updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service.
Optionally, the method further comprises:
and when the second difference is not larger than the threshold value, updating the corresponding value of the target key in the remote dictionary service to the corresponding value of the target key in the concurrent hash mapping table.
According to a second aspect of the present application, there is provided a frequency control device comprising:
the target key judgment module is used for judging whether a target key of the key value pair to be stored is stored in a concurrent hash mapping table when the key value pair to be stored corresponding to the user behavior is obtained, wherein the concurrent hash mapping table comprises a plurality of key value pairs, and the value of each key value pair in the concurrent hash mapping table comprises a timestamp when the key value pair is stored;
a first difference determining module, configured to determine, if the concurrent hash mapping table stores the target key, a first difference between a current timestamp and a timestamp of the target key in corresponding values in the concurrent hash mapping table;
a first updating module, configured to update a value of the key-value pair to be stored to a corresponding value of the target key in the concurrent hash mapping table when the first difference is greater than a threshold;
and the storage module is used for storing the key value pair to be stored into the concurrent hash mapping table if the target key is not stored in the concurrent hash mapping table.
Optionally, the first updating module is configured to:
updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table;
the frequency control device further includes:
a second difference determining module, configured to determine a second difference between a timestamp of the target key corresponding to the target key in the concurrent hash mapping table and a timestamp of the target key corresponding to the target key in a remote dictionary service, where the remote dictionary service includes a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service includes a timestamp of the target key when the key-value pair is saved;
and the second updating module is used for updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service when the second difference value is larger than the threshold value.
According to a third aspect of the present application, there is provided a frequency control device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the frequency control method according to the first aspect.
According to a fourth aspect of the present application, there is provided a computer storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded and executed by a processor to implement the frequency control method according to the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the timestamp is set in the value of the key value pair in the concurrent hash mapping table, so that whether the frequency of the user behavior exceeds the threshold value or not can be judged through the concurrent hash mapping table, and the diversity of the frequency control method is increased. The problem that a frequency control method in the related art is single is solved. The effect of enriching the frequency control method is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an implementation environment of a garbage classification indication method provided in an embodiment of the present application;
fig. 2 is a flow chart of a frequency control method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another frequency control method according to an embodiment of the present application;
fig. 4 is a block diagram of a frequency control apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of another frequency control apparatus provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a frequency control apparatus according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the following detailed description of the embodiments of the present application will be made with reference to the accompanying drawings.
The user behavior may include various operations performed by the user on the website, such as data acquisition and uploading, and the like. The frequency of user behavior, if too high (possibly including malicious access), can have a severe impact on the proper functioning of the website.
The embodiment of the application provides a frequency control method, a frequency control device, frequency control equipment and a computer storage medium, and can solve the technical problems.
The following explains some matters related to the present application.
A concurrent hash map (ConcurrentHashMap) is a thread-safe and efficient hash map (HashMap) implementation that can act as a cache. The concurrent hash mapping table may store a plurality of key-value pairs, each key-value pair including a corresponding key and value. When user action occurs, a key-value pair is ready to be stored in the concurrent hash map. Wherein the key of each key-value pair may correspond to a user identification.
A Remote Dictionary service (Redis) is a key-value storage system that can act as a distributed cache. The remote dictionary service may also have stored therein a plurality of key-value pairs, each key-value pair including a corresponding key and value.
A timestamp (timestamp) is a complete, verifiable piece of data that can indicate that a piece of data existed before a particular time, and is typically a sequence of characters that uniquely identifies the time of a particular moment. In the related art, the values of the concurrent hash mapping table and the values of the remote dictionary service do not generally include a timestamp, but in the present application, a timestamp may be added to the values of the concurrent hash mapping table and the values of the remote dictionary service to control the frequency.
Fig. 1 is a schematic diagram of an implementation environment of a garbage classification indication method according to an embodiment of the present application, where the implementation environment may include a server 11 and a terminal 12.
The server 11 may be a server or a cluster of servers.
The terminal 12 may be a mobile phone, a tablet computer, a notebook computer, an intelligent wearable device, or other various terminals capable of displaying a user interface. The terminal 12 may be connected to the server in a wired or wireless manner (in the case of wireless connection shown in fig. 1).
Fig. 2 is a flowchart of a frequency control method according to an embodiment of the present application, and the present embodiment illustrates that the frequency control method is applied to the server shown in fig. 1. The frequency control method may include the steps of:
step 201, when the key value pair to be stored corresponding to the user behavior is obtained, whether a target key of the key value pair to be stored is stored in the concurrent hash mapping table is judged.
The concurrent hash mapping table comprises a plurality of key value pairs, and the value in each key value pair in the concurrent hash mapping table comprises a timestamp when the key value pair is stored. If the concurrent hash mapping table stores the target key, step 202 is executed, and if the concurrent hash mapping table does not store the target key, step 204 is executed.
Step 202, a first difference between the current timestamp and the timestamp of the target key in the corresponding value in the concurrent hash map is determined.
And 203, when the first difference value is greater than the threshold value, updating the value of the key value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table.
And step 204, storing the key value pair to be stored into the concurrent hash mapping table.
To sum up, according to the frequency control method provided in the embodiment of the present application, the timestamp is set in the value of the key value pair in the concurrent hash mapping table, so that whether the frequency of the user behavior exceeds the threshold can be determined through the concurrent hash mapping table, and the diversity of the frequency control method is increased. The problem that a frequency control method in the related art is single is solved. The effect of enriching the frequency control method is achieved.
Fig. 3 is a flowchart of another frequency control method shown in the embodiment of the present application, and the embodiment illustrates that the frequency control method is applied to the server shown in fig. 1. The frequency control method may include the steps of:
step 301, when a key value pair to be stored corresponding to a user behavior is obtained, whether a target key of the key value pair to be stored is stored in a concurrent hash mapping table is judged. If the concurrent hash mapping table stores the target key, go to step 302, and if the concurrent hash mapping table does not store the target key, go to step 304.
The user behavior may be triggered when the access terminal accesses the local server, and the access terminal may be a terminal in the implementation environment shown in fig. 1 or another server besides the local server.
And the value in each key value pair in the concurrent hash mapping table comprises a time stamp when the key value pair is stored. When the server obtains the key value pair to be stored corresponding to the user behavior, it may be determined whether the target key of the key value pair to be stored is stored in the concurrent hash mapping table, that is, whether the key value pair to be stored is stored in the current concurrent hash mapping table is determined.
Step 302, determining whether a first difference between the current timestamp and a timestamp of the target key in the corresponding values in the concurrent hash mapping table is greater than a threshold. When the first difference is greater than the threshold, step 303 is performed, and when the first difference is not greater than the threshold, step 301 is performed.
If the concurrent hash mapping table stores the target key, it indicates that the access terminal corresponding to the key value to be stored has previously triggered the user behavior at the home terminal, and at this time, the server may perform local frequency control on the access terminal, that is, determine whether a first difference between the current timestamp and a timestamp in a value corresponding to the target key in the concurrent hash mapping table is greater than a threshold. The threshold may be preset by an operator, and may be determined according to the computing power of the server, for example, and may be set smaller when the computing power of the server is high and larger when the computing power of the server is low.
And 303, updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table. Step 305 is performed.
When the first difference is greater than the threshold, it is indicated that the frequency of triggering the user behavior by the access terminal corresponding to the target key is low, and the server may update the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table through local frequency control, and update the current timestamp to the value of the target key corresponding to the concurrent hash mapping table.
And 304, updating the current timestamp to the value of the key value pair to be stored, and storing the key value pair to be stored in the concurrent hash mapping table. Step 305 is performed.
If the concurrent hash mapping table does not store the target key, it indicates that the access terminal corresponding to the target key has not triggered the user behavior at the home terminal before, at this time, the access terminal may also be considered to pass the local frequency control, and the server may directly update the current timestamp to the value of the key value pair to be stored, and store the key value pair to be stored in the concurrent hash mapping table.
Step 305, determining whether a second difference between a timestamp of the target key corresponding to the concurrent hash mapping table and a timestamp of the target key corresponding to the remote dictionary service is greater than a threshold. When the second difference is greater than the threshold, step 306 is executed, and when the second difference is not greater than the threshold, step 307 is executed.
After the access terminal corresponding to the target key passes the local frequency control, the distributed frequency control may be performed on the access terminal through the remote dictionary service, that is, the server may determine whether a second difference between a timestamp of the target key corresponding to the concurrent hash mapping table and a timestamp of the target key corresponding to the remote dictionary service is greater than a threshold, where the threshold may be the same as the threshold in step 302.
And step 306, updating the value of the key value pair to be stored to the corresponding value of the target key in the remote dictionary service.
When the second difference is greater than the threshold, it indicates that the access end corresponding to the target key passes the distributed frequency control, and at this time, the server may update the value of the key-value pair to be stored to the value corresponding to the target key in the remote dictionary service.
And 307, updating the value of the target key corresponding to the remote dictionary service to the value of the target key corresponding to the concurrent hash mapping table.
And when the second difference is not greater than the threshold, it is indicated that the access terminal corresponding to the target key does not pass the distributed frequency control, and under such a condition, a certain problem may exist in a value corresponding to the target key in the concurrent hash mapping table, so that the server may update the value corresponding to the target key in the remote dictionary service to the value corresponding to the target key in the concurrent hash mapping table.
In the related art, the concurrent hash mapping table and the remote dictionary service are generally used as a first-level cache and a distributed cache in the service, and the purpose is to prevent cache avalanche from occurring, which causes impact on a bottom database. Even if the concurrent hash mapping table and the remote dictionary service are used in combination, the role thereof is a function of caching.
However, in the embodiment of the present application, a timestamp is set in a value of a key value pair of a concurrent hash mapping table and a remote dictionary service, so that a function of performing frequency control on a user behavior through the timestamp is realized. And the high frequency control effect and the high accuracy degree of the user behavior are realized through the dual frequency control of the local frequency control of the concurrent hash mapping table and the distributed frequency control of the remote dictionary service.
In summary, according to the frequency control method provided in the embodiment of the present application, the timestamp is set in the value of the key value pair in the concurrent hash mapping table, so that whether the frequency of the user behavior exceeds the threshold value can be determined through the concurrent hash mapping table, and the diversity of the frequency control method is increased. The problem that a frequency control method in the related art is single is solved. The effect of enriching the frequency control method is achieved.
Fig. 4 is a block diagram of a frequency control apparatus according to an embodiment of the present application, which is illustrated by applying the frequency control method to the server shown in fig. 1. The frequency control apparatus 400 may include:
a target key judgment module 410, configured to determine whether a target key of a key value pair to be stored is stored in a concurrent hash mapping table when a key value pair to be stored corresponding to a user behavior is obtained, where the concurrent hash mapping table includes a plurality of key value pairs, and a value in each key value pair in the concurrent hash mapping table includes a timestamp for storing the key value pair;
a first difference determining module 420, configured to determine, if the concurrent hash mapping table stores the target key, a first difference between the current timestamp and a timestamp of the target key in a corresponding value in the concurrent hash mapping table;
a first updating module 430, configured to update a value of the key-value pair to be stored to a corresponding value of the target key in the concurrent hash mapping table when the first difference is greater than the threshold;
the storing module 440 is configured to store the key value pair to be stored into the concurrent hash mapping table if the target key is not stored in the concurrent hash mapping table.
Optionally, the first updating module 430 is configured to:
updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table;
as shown in fig. 5, which is a block diagram of another frequency control apparatus provided in the embodiment of the present application, the frequency control apparatus further includes:
a second difference determining module 450, configured to determine a second difference between a timestamp of the target key corresponding to the concurrent hash mapping table and a timestamp of the target key corresponding to the remote dictionary service, where the remote dictionary service includes multiple key value pairs, and a value of each key value pair of the remote dictionary service includes a timestamp of when the key value pair is saved;
and a second updating module 460, configured to update the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service when the second difference is greater than the threshold.
To sum up, the frequency control device provided in the embodiment of the present application sets a timestamp in a value of a key value pair in a concurrent hash mapping table, thereby determining whether a frequency of a user behavior exceeds a threshold through the concurrent hash mapping table, and increasing diversity of frequency control methods. The problem that a frequency control method in the related art is single is solved. The effect of enriching the frequency control method is achieved.
Referring to fig. 6, a schematic structural diagram of a frequency control apparatus 600 provided in an embodiment of the present application is shown, where the frequency control apparatus 600 may be a server. Illustratively, as shown in FIG. 6, the apparatus 600 includes a Central Processing Unit (CPU) 601, a system memory 604 including a Random Access Memory (RAM) 602 and a Read Only Memory (ROM) 603, and a system bus 605 connecting the system memory 604 and the central processing unit 601. The apparatus 600 also includes a basic input/output system (I/O system) 606 to facilitate transfer of information between devices within the computer, and a mass storage device 607 for storing an operating system 613, application programs 614, and other program modules 615.
The basic input/output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse, keyboard, etc. for a user to input information. Wherein a display 608 and an input device 609 are connected to the central processing unit 601 via an input output controller 610 connected to the system bus 605. The basic input/output system 606 may also include an input/output controller 610 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, an input/output controller 610 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer-readable media provide non-volatile storage for the apparatus 600. That is, mass storage device 607 may include a computer readable medium (not shown), such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable storage media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 604 and mass storage device 607 described above may be collectively referred to as memory.
According to various embodiments of the present application, the apparatus 600 may also operate as a remote computer connected to a network via a network, such as the Internet. That is, the apparatus 600 may be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 611.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU to implement the method provided by the embodiment of the present application.
Embodiments of the present application further provide a frequency control device, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement any one of the frequency control methods provided in the foregoing embodiments.
The embodiments of the present application also provide a computer storage medium, in which at least one instruction, at least one program, a code set, or an instruction set is stored, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement any one of the frequency control methods provided in the above embodiments.
In this application, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "plurality" means two or more unless expressly limited otherwise.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method of frequency control, the method comprising:
when key value pairs to be stored corresponding to user behaviors are obtained, judging whether a target key of the key value pairs to be stored is stored in a concurrent hash mapping table, wherein the concurrent hash mapping table comprises a plurality of key value pairs, and the value of each key value pair in the concurrent hash mapping table comprises a timestamp when the key value pair is stored;
if the target key is stored in the concurrent hash mapping table, determining a first difference value between a current timestamp and a timestamp of the target key in corresponding values in the concurrent hash mapping table;
when the first difference value is larger than a threshold value, updating the value of the key value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table;
and if the target key is not stored in the concurrent hash mapping table, storing the key value pair to be stored into the concurrent hash mapping table.
2. The method according to claim 1, wherein the updating the value of the key-value pair to be stored to the corresponding value of the target key in the concurrent hash mapping table includes:
and updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table.
3. The method of claim 2, wherein after updating the value of the key-value pair to be stored to the value of the target key corresponding to the concurrent hash map and updating the current timestamp to the value of the target key corresponding to the concurrent hash map, the method further comprises:
determining a second difference value between a timestamp corresponding to the target key in the concurrent hash mapping table and a timestamp corresponding to the target key in a remote dictionary service, wherein the remote dictionary service comprises a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service comprises a timestamp when the key-value pair is stored;
and when the second difference is larger than the threshold value, updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service.
4. The method according to claim 1, wherein if the target key is not stored in the concurrent hash mapping table, storing the key-value pair to be stored in the concurrent hash mapping table comprises:
and if the target key is not stored in the concurrent hash mapping table, updating the current timestamp to the value of the key value pair to be stored, and storing the key value pair to be stored in the concurrent hash mapping table.
5. The method of claim 4, wherein after updating the current timestamp into the value of the key-value pair to be stored and storing the key-value pair to be stored into the concurrent hash map, the method further comprises:
determining a second difference value between a timestamp of the target key corresponding to the target key in the concurrent hash mapping table and a timestamp of the target key corresponding to the target key in a remote dictionary service, wherein the remote dictionary service comprises a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service comprises a timestamp of the key-value pair during storage;
and when the second difference is larger than the threshold value, updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service.
6. The method according to claim 3 or 5, characterized in that the method further comprises:
and when the second difference is not larger than the threshold value, updating the corresponding value of the target key in the remote dictionary service to the corresponding value of the target key in the concurrent hash mapping table.
7. A frequency control apparatus, characterized in that the frequency control apparatus comprises:
the target key judgment module is used for judging whether a target key of the key value pair to be stored is stored in a concurrent hash mapping table when the key value pair to be stored corresponding to the user behavior is obtained, wherein the concurrent hash mapping table comprises a plurality of key value pairs, and the value of each key value pair in the concurrent hash mapping table comprises a timestamp for storing the key value pair;
a first difference determining module, configured to determine, if the concurrent hash mapping table stores the target key, a first difference between a current timestamp and a timestamp of the target key in corresponding values in the concurrent hash mapping table;
a first updating module, configured to update a value of the key-value pair to be stored to a corresponding value of the target key in the concurrent hash mapping table when the first difference is greater than a threshold;
and the storage module is used for storing the key value pair to be stored into the concurrent hash mapping table if the target key is not stored in the concurrent hash mapping table.
8. The frequency control apparatus of claim 7, wherein the first updating module is configured to:
updating the value of the key value pair to be stored to the value of the target key corresponding to the concurrent hash mapping table, and updating the current timestamp to the value of the target key corresponding to the concurrent hash mapping table;
the frequency control device further includes:
a second difference determining module, configured to determine a second difference between a timestamp of the target key corresponding to the target key in the concurrent hash mapping table and a timestamp of the target key corresponding to the target key in a remote dictionary service, where the remote dictionary service includes a plurality of key-value pairs, and a value of each key-value pair of the remote dictionary service includes a timestamp of the target key when the key-value pair is saved;
and the second updating module is used for updating the value of the key-value pair to be stored to the corresponding value of the target key in the remote dictionary service when the second difference value is larger than the threshold value.
9. A frequency control device comprising a processor and a memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded and executed by the processor to implement a frequency control method according to any one of claims 1 to 6.
10. A computer storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the frequency control method of any of claims 1 to 6.
CN201911401928.XA 2019-12-30 2019-12-30 Frequency control method, device, equipment and computer storage medium Active CN111078718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911401928.XA CN111078718B (en) 2019-12-30 2019-12-30 Frequency control method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911401928.XA CN111078718B (en) 2019-12-30 2019-12-30 Frequency control method, device, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN111078718A CN111078718A (en) 2020-04-28
CN111078718B true CN111078718B (en) 2023-04-07

Family

ID=70320052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911401928.XA Active CN111078718B (en) 2019-12-30 2019-12-30 Frequency control method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN111078718B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013061680A1 (en) * 2011-10-26 2013-05-02 インターナショナル・ビジネス・マシーンズ・コーポレーション Information processing device, data access method, and program
WO2016197621A1 (en) * 2015-06-12 2016-12-15 华为技术有限公司 Method and apparatus for adjusting frequency of server
CN107844269A (en) * 2017-10-17 2018-03-27 华中科技大学 A kind of layering mixing storage system and method based on uniformity Hash
CN109542892A (en) * 2018-10-19 2019-03-29 北京全路通信信号研究设计院集团有限公司 A kind of relativization implementation method of real-time data base, apparatus and system
CN109756528A (en) * 2017-11-01 2019-05-14 广州腾讯科技有限公司 Control method for frequency and device, equipment, storage medium, server
CN109766349A (en) * 2018-12-13 2019-05-17 平安普惠企业管理有限公司 The anti-weighing method of task, device, computer equipment and storage medium
WO2019211644A2 (en) * 2018-04-29 2019-11-07 Pratik Sharma Event publisher module for in-memory hash map

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013061680A1 (en) * 2011-10-26 2013-05-02 インターナショナル・ビジネス・マシーンズ・コーポレーション Information processing device, data access method, and program
WO2016197621A1 (en) * 2015-06-12 2016-12-15 华为技术有限公司 Method and apparatus for adjusting frequency of server
CN107844269A (en) * 2017-10-17 2018-03-27 华中科技大学 A kind of layering mixing storage system and method based on uniformity Hash
CN109756528A (en) * 2017-11-01 2019-05-14 广州腾讯科技有限公司 Control method for frequency and device, equipment, storage medium, server
WO2019211644A2 (en) * 2018-04-29 2019-11-07 Pratik Sharma Event publisher module for in-memory hash map
CN109542892A (en) * 2018-10-19 2019-03-29 北京全路通信信号研究设计院集团有限公司 A kind of relativization implementation method of real-time data base, apparatus and system
CN109766349A (en) * 2018-12-13 2019-05-17 平安普惠企业管理有限公司 The anti-weighing method of task, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
多直流馈入受端电网短期频率稳定性的实时协调控制方法;王路平等;《中国电机工程学报》;20180321(第08期);全文 *

Also Published As

Publication number Publication date
CN111078718A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN112765271A (en) Block chain transaction index storage method and device, computer equipment and medium
CN111414389B (en) Data processing method and device, electronic equipment and storage medium
CN109543891B (en) Method and apparatus for establishing capacity prediction model, and computer-readable storage medium
US20160034504A1 (en) Efficient aggregation, storage and querying of large volume metrics
CN114095567B (en) Data access request processing method and device, computer equipment and medium
CN103108033B (en) File uploading method and system
CN104881454A (en) Updating method and system of parameter
CN114996173B (en) Method and device for managing write operation of storage equipment
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN110737548B (en) Data request method and server
CN104348905A (en) Method and device for pushing message in off-line way
CN110427394B (en) Data operation method and device
CN111078718B (en) Frequency control method, device, equipment and computer storage medium
CN110020166B (en) Data analysis method and related equipment
US11662927B2 (en) Redirecting access requests between access engines of respective disk management devices
CN113111078B (en) Resource data processing method and device, computer equipment and storage medium
CN113132241B (en) ACL template dynamic configuration method and device
CN103778218A (en) Cloud computation-based standard information consistency early warning system and method
CN114238335A (en) Buried point data generation method and related equipment thereof
CN116628042A (en) Data processing method, device, equipment and medium
CN114169451A (en) Behavior data classification processing method, device, equipment and storage medium
CN112148387A (en) Method and device for preloading feedback information, computer equipment and storage medium
CN111741046A (en) Data reporting method, data acquisition method, device, equipment and medium
CN111125041A (en) Data reading method, electronic device and computer program product
CN113434359B (en) Data traceability system construction method and device, electronic device and readable storage medium

Legal Events

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