[go: up one dir, main page]

CN109213815A - Control executes method, apparatus, server terminal and the readable medium of number - Google Patents

Control executes method, apparatus, server terminal and the readable medium of number Download PDF

Info

Publication number
CN109213815A
CN109213815A CN201710514730.7A CN201710514730A CN109213815A CN 109213815 A CN109213815 A CN 109213815A CN 201710514730 A CN201710514730 A CN 201710514730A CN 109213815 A CN109213815 A CN 109213815A
Authority
CN
China
Prior art keywords
key value
execute
response
value
execution operation
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.)
Granted
Application number
CN201710514730.7A
Other languages
Chinese (zh)
Other versions
CN109213815B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710514730.7A priority Critical patent/CN109213815B/en
Publication of CN109213815A publication Critical patent/CN109213815A/en
Application granted granted Critical
Publication of CN109213815B publication Critical patent/CN109213815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses method, apparatus, server terminal and readable mediums that control executes number, are related to field of computer technology.One specific embodiment of this method includes: to receive the execution operation requests of client;Corresponding execution operation data is read from memory database according to the execution operation requests;Judged to execute whether number is more than preset threshold according to the execution operation data, whether then returned according to judging result allows to execute the response operated.The embodiment can be while guaranteeing performance, and the data that can be needed with persistence compensate for the deficiency of disk database, and can control a variety of execution events, range is wider, and flexibility is higher.

Description

Control executes method, apparatus, server terminal and the readable medium of number
Technical field
The present invention relates to field of computer technology more particularly to a kind of control to execute the method, apparatus of number, server end End and readable medium.
Background technique
With the development of computer technology, in actual many operation scenarios, it is usually present and some operations is executed The demand of number control, such as there is malice and repeat to submit operation, or provide to grasp within the regular hour in certain business The execution number of work may not exceed numerical value etc..
The scheme of the execution number of control operation is essentially the following two kinds in the prior art: the first is that handle is related to operation Data persistence into traditional database, then further according to needing data to read, can be executed with judging whether to return As a result, number of operations can be for example persisted in MySQL database and be read, achieve the purpose that control number of operations; Second is opened a timer and meter by controlling corresponding operation in the page, such as using JavaScript script Number device realizes the control of number of operations, but this control can only be adapted to the operation of a small number of execution, lack flexibility.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1, performance is low
Since traditional database is disk database, generally the data accessed are needed to be fitted into main memory user, based on number According to management be Disk Caching Disk, so there is the bottleneck for accessing I/O disk, read or write speed is slower, to drop significantly Low performance.
2, flexibility is low
Although using JavaScript Script controlling number of operations there is no access data the problem of, safety compared with It is low, due to not can be carried out database persistence, so execution type few in number can only be controlled, there is biggish limitation, spirit Activity is lower, therefore generally can only be used to control better simply to execute operation.
3, complexity is high
It is higher using database persistence Operating Complexity, it is unfavorable for later maintenance and secondary development.
Summary of the invention
In view of this, the embodiment of the present invention, which provides a kind of control, executes the method, apparatus of number, server terminal and can Medium is read, can be while guaranteeing performance, the data that can be needed with persistence compensate for the deficiency of disk database, and And can control a variety of execution events, range is wider, and flexibility is higher.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of side of control execution number is provided Method.
The method that a kind of control of the embodiment of the present invention executes number includes: to receive the execution operation requests of client;Root Corresponding execution operation data is read from memory database according to the execution operation requests;Sentenced according to the execution operation data Whether disconnected to execute whether number is more than preset threshold, then being returned according to judging result allows to execute the response operated.
Optionally, the memory database comprises at least one of the following: Redis, memcached.
Optionally, the execution operation data includes following one or more: the KEY value of unique identification respective operations, generation The numerical value of the counter of the KEY value of table handling number and the life span of the KEY value.
Optionally, judged to execute whether number is more than preset threshold according to the execution operation data, then according to judgement If it includes: that the KEY value is small for the numerical value of the counter of the empty or described KEY value that whether as a result return, which allows to execute the response operated, In the preset threshold, then returning allows to execute the response operated;If the KEY value is not the counter of the empty and described KEY value Numerical value be more than or equal to the preset threshold, then judge whether the life span of the KEY value is greater than 0, if more than, then return refuse Otherwise the response for executing operation absolutely continues to judge whether there are still if it does not exist, then return allows to execute operation the KEY value Response, and if it exists, then delete KEY value, and return and allow to execute the response operated.
Optionally, if the KEY value be sky, KEY value is initialized first, and assignment life span, then to Add 1 in the counter of corresponding KEY value, and returns to the response for allowing to execute operation.
To achieve the above object, according to another aspect of an embodiment of the present invention, a kind of dress of control execution number is provided It sets.
The device that a kind of control of the embodiment of the present invention executes number includes: receiving module, for receiving holding for client Row operation requests;Read module executes operation for reading from memory database according to the execution operation requests accordingly Data;Judgment module executes whether number is more than preset threshold for judging according to the execution operation data, and then basis is sentenced Whether disconnected result returns allows to execute the response operated.
Optionally, the memory database comprises at least one of the following: Redis, memcached.
Optionally, the execution operation data includes following one or more: the KEY value of unique identification respective operations, generation The numerical value of the counter of the KEY value of table handling number and the life span of the KEY value.
Optionally, the judgment module is also used to: if the KEY value is small for the numerical value of the counter of the empty or described KEY value In the preset threshold, then returning allows to execute the response operated;If the KEY value is not the counter of the empty and described KEY value Numerical value be more than or equal to the preset threshold, then judge whether the life span of the KEY value is greater than 0, if more than, then return refuse Otherwise the response for executing operation absolutely continues to judge whether there are still if it does not exist, then return allows to execute operation the KEY value Response, and if it exists, then delete KEY value, and return and allow to execute the response operated.
Optionally, the judgment module is also used to: if the KEY value is sky, KEY value is initialized first, and Then assignment life span adds 1 into the counter of corresponding KEY value, and returns to the response for allowing to execute operation.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of server terminal.
A kind of server terminal of the embodiment of the present invention includes: one or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more A processor realizes the method that the control of the embodiment of the present invention executes number.
To achieve the above object, another aspect according to an embodiment of the present invention, provides a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed The method that the control of the embodiment of the present invention executes number is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because is deposited using that will execute operation data The technological means in memory database is stored up, so the technical issues of overcoming the bottleneck of magnetic disc i/o when database access, in turn Reach raising system performance, accelerate data processing speed, realizes the efficient and high performance technical effect for executing number control; By using the execution operation data in memory database, judge to operate corresponding KEY value whether be empty and number of operations whether More than threshold value, while thereby may be ensured that performance, the data that can be needed with persistence compensate for disk database not Foot, and may be implemented to control a variety of execution events, range is wider, and flexibility is higher;And improve the program that control executes number Flexibility is also convenient for later maintenance and secondary development, greatly reduces realization so that program development and transplanting are more flexible convenient Complexity.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 2 is the schematic diagram of the main flow for the method that control according to an embodiment of the present invention executes number;
Fig. 3 is that the embodiment of the present invention can be applied to system framework figure therein;
Fig. 4 is the skeleton schematic diagram of the method for the control execution number for realizing the embodiment of the present invention;
Fig. 5 is the service logic flow diagram of the server-side for realizing the embodiment of the present invention;
Fig. 6 is the logical schematic of the service logic estimate of situation 1 of the server-side for realizing the embodiment of the present invention;
Fig. 7 is the logical schematic of the service logic estimate of situation 2 of the server-side for realizing the embodiment of the present invention;
Fig. 8 is the schematic diagram of the main modular for the device that control according to an embodiment of the present invention executes number;
Fig. 9 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1, which is shown, can execute time counting method using the control of the embodiment of the present invention or control executes showing for time counting apparatus Example property system architecture 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 101,102,103 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, such as utilize terminal device 101,102,103 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It is generally executed by server 105 it should be noted that control provided by the embodiment of the present invention executes time counting method, Correspondingly, control executes time counting apparatus and is generally positioned in server 105.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 2 is the schematic diagram of the main flow for the method that control according to an embodiment of the present invention executes number.
As shown in Fig. 2, the method that a kind of control of the embodiment of the present invention executes number mainly includes the following steps:
Step S201: the execution operation requests of client are received.
Step S202: corresponding execution operation data is read from memory database according to the execution operation requests.Its In, memory database comprises at least one of the following: Redis, memcached.Executing operation data includes following one or more: The KEY value of unique identification respective operations, represent number of operations the KEY value counter numerical value and the KEY value Life span.
Step S203: judged to execute whether number is more than preset threshold according to the execution operation data, then basis is sentenced Whether disconnected result returns allows to execute the response operated.Specifically judge as follows: if the KEY value is sky or the meter of the KEY value The numerical value of number device is less than the preset threshold, then returning allows to execute the response operated;If the KEY value is not empty and described The numerical value of the counter of KEY value is more than or equal to the preset threshold, then judges whether the life span of the KEY value is greater than 0, if It is greater than, then returns to the response that refusal executes operation, otherwise continue to judge whether there are still if it does not exist, then return the KEY value Allow to execute the response operated, and if it exists, then delete KEY value, and return to the response for allowing to execute operation.
In addition, being initialized first to KEY value, and assignment life span, if the KEY value is sky then to right Add 1 in the counter for the KEY value answered, and returns to the response for allowing to execute operation.
Fig. 3 is that the embodiment of the present invention can be applied to system framework figure therein.As shown in figure 3, including in system framework Client and server-side.
Wherein, client is used for: being configured the information in relation to calling service, is provided corresponding parameter information.
Server-side is used for:
(1) client request and parameter are received, whether return to client allows to execute the result operated.
(2) it reads life span for executing number of operations and respective operations KEY value etc. and executes operation data, according to obtaining Execution operation data judge whether that operation can be executed, to the counting of KEY value in respective operations if it can execute operation Device adds 1.In the embodiment of the present invention, operation can be executed with certain one kind of KEY value unique identification client in memory database Request, using VALUE field as counter identification number of operations.Memory database in the embodiment of the present invention includes but unlimited In can be following at least one: Redis, Memcached.
(3) high performance read-write operation is provided, quick customer in response end is requested, and can be with perdurable data.
Fig. 4 is the skeleton schematic diagram of the method for the control execution number for realizing the embodiment of the present invention.Such as Fig. 4 Shown, server-side can be divided into Business Logic and data access layer.Wherein, Business Logic encapsulates secondary to operation is executed The realization of number control, data access layer provide the read-write service to data in the memory databases such as redis, and Business Logic calls Data access layer obtains data relevant to operation, and industry of going forward side by side business judgement finally returns that the result for whether allowing to execute to visitor Family end.
Fig. 5 is the service logic flow diagram of the server-side for realizing the embodiment of the present invention.As shown in figure 5, business The logic flow of logical layer is specific as follows:
1, the request for receiving client, obtains the parameter that client transmits.
2, call data access layer to the numerical value in the counter for corresponding to KEY Value Operations in the memory databases such as redis into Row is read.
3, judge whether KEY value is empty, and whether the numerical value of obtained operation execution counter is less than maximum operation time Number, and judgement is provided according to different situations, return to final result.
Fig. 6 is the logical schematic of the service logic estimate of situation 1 of the server-side for realizing the embodiment of the present invention;Fig. 7 It is the logical schematic of the service logic estimate of situation 2 of the server-side for realizing the embodiment of the present invention.Below in conjunction with Fig. 6 and figure 7, two class estimate of situation of service logic process are described in detail.
Wherein, Fig. 6 corresponds to the service logic of estimate of situation 1:
1, explanation is to execute operation for the first time when KEY value is empty, so first to be initialized to KEY value, and Give KEY value corresponding life span assignment;
2, add 1 to corresponding counter;
3, the result for allowing to execute is returned to client.
The service logic of estimate of situation 2 is corresponded in Fig. 7:
1, logic business layer calls data access layer to read the life span for corresponding to KEY value;
If 2, life span is greater than 0, the result that refusal executes operation is returned;
If 3, life span is less than 0, continue to judge that KEY value whether there is;
If 4, KEY value is not present, illustrates that the life span of KEY has exceeded, be automatically deleted, return allows to execute The result of operation;
If 5, KEY value exists, illustrate then to delete KEY, return allows to execute to the life span assignment of KEY not yet The result of operation.
The technical solution for the method that control according to an embodiment of the present invention executes number can be seen that because using that will execute Operation data is stored in the technological means in memory database, so overcoming the skill of the bottleneck of magnetic disc i/o when database access Art problem, and then reach raising system performance, accelerate data processing speed, realizes efficient and high performance execution number control Technical effect;By using the execution operation data in memory database, judging to operate whether corresponding KEY value is empty and behaviour Make whether number is more than threshold value, while thereby may be ensured that performance, the data that can be needed with persistence compensate for disk number It according to the deficiency in library, and may be implemented to control a variety of execution events, range is wider, and flexibility is higher;And improve control execution time Several program flexibilities is also convenient for later maintenance and secondary development, drops significantly so that program development and transplanting are more flexible convenient The low complexity realized.
Fig. 8 is the schematic diagram of the main modular for the device that control according to an embodiment of the present invention executes number.
As shown in figure 8, the device 800 that the control of the embodiment of the present invention executes number specifically includes that receiving module 801, reads Modulus block 802 and judgment module 803.
Wherein, receiving module 801, for receiving the execution operation requests of client;Read module 802, for according to institute It states execution operation requests and reads corresponding execution operation data from memory database;Judgment module 803, for being held according to Row operation data judges to execute whether number is more than preset threshold and return whether allow to execute operation according to judging result Response.
Wherein, memory database may include following at least one: Redis, memcached.The execution operation data May include following one or more: the KEY value of unique identification respective operations, represent number of operations the KEY value counting The life span of the numerical value of device and the KEY value.
Moreover, it is judged that module 803 can also be used in: if the numerical value that the KEY value is the counter of the empty or described KEY value is less than The preset threshold, then returning allows to execute the response operated;If the KEY value is not the counter of the empty and described KEY value Numerical value is more than or equal to the preset threshold, then judges whether the life span of the KEY value is greater than 0, if more than refusal is then returned Otherwise the response for executing operation continues to judge whether there are still if it does not exist, then return allows to execute operation to the KEY value Response, and if it exists, then delete KEY value, and return to the response for allowing to execute operation.
In addition, judgment module 803 can also be used in: if the KEY value is sky, being initialized first to KEY value, and assign It is worth life span, 1 is then added into the counter of corresponding KEY value, and return to the response for allowing to execute operation.
From the above, it can be seen that because using the technology hand that operation data is stored in memory database will be executed Section, thus the technical issues of overcoming the bottleneck of magnetic disc i/o when database access, and then reach raising system performance, accelerate number According to processing speed, the efficient and high performance technical effect for executing number control is realized;By using in memory database Operation data is executed, judges to operate whether corresponding KEY value is whether empty and number of operations is more than threshold value, the property of thereby may be ensured that While energy, the data that can be needed with persistence compensate for the deficiency of disk database, and may be implemented to control a variety of execution Event, range is wider, and flexibility is higher;And the program flexibility that control executes number is improved, so that program development and transplanting It is more flexible convenient, it is also convenient for later maintenance and secondary development, greatly reduces the complexity of realization.
Below with reference to Fig. 9, it illustrates the computer systems 900 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 9 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 9, computer system 900 includes central processing unit (CPU) 901, it can be read-only according to being stored in Program in memory (ROM) 902 or be loaded into the program in random access storage device (RAM) 903 from storage section 908 and Execute various movements appropriate and processing.In RAM 903, also it is stored with system 900 and operates required various programs and data. CPU 901, ROM 902 and RAM 903 are connected with each other by bus 904.Input/output (I/O) interface 905 is also connected to always Line 904.
I/O interface 905 is connected to lower component: the importation 906 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 907 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 908 including hard disk etc.; And the communications portion 909 of the network interface card including LAN card, modem etc..Communications portion 909 via such as because The network of spy's net executes communication process.Driver 910 is also connected to I/O interface 905 as needed.Detachable media 911, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 910, in order to read from thereon Computer program be mounted into storage section 908 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 909, and/or from can Medium 911 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 901, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include receiving module, read module and judgment module.Wherein, the title of these modules is not constituted under certain conditions to the mould The restriction of block itself, for example, receiving module is also described as " receiving the module of the execution operation requests of client ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: to receive the execution operation requests of client;It is read from memory database according to the execution operation requests It is corresponding to execute operation data;Judged to execute whether number is more than preset threshold according to the execution operation data, then basis Whether judging result returns allows to execute the response operated.
Technical solution according to an embodiment of the present invention, because being stored in memory database using operation data will be executed Technological means, so the technical issues of overcoming the bottleneck of magnetic disc i/o when database access, and then reach raising system performance, Accelerate data processing speed, realizes the efficient and high performance technical effect for executing number control;By utilizing internal storage data Execution operation data in library judges operate whether corresponding KEY value is sky and whether number of operations is more than threshold value, so as to While guaranteeing performance, the data that can be needed with persistence compensate for the deficiency of disk database, and it is more that control may be implemented Kind execution event, range is wider, and flexibility is higher;And the program flexibility that control executes number is improved, so that program development It is more flexible convenient with transplanting, it is also convenient for later maintenance and secondary development, greatly reduces the complexity of realization.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of method that control executes number characterized by comprising
Receive the execution operation requests of client;
Corresponding execution operation data is read from memory database according to the execution operation requests;
According to the execution operation data judge execute number whether be more than preset threshold, then according to judging result return whether Allow to execute the response operated.
2. the method according to claim 1, wherein the memory database comprises at least one of the following: Redis、memcached。
3. the method according to claim 1, wherein the execution operation data includes following one or more:
The KEY value of unique identification respective operations, represent number of operations the KEY value counter numerical value and the KEY The life span of value.
4. according to the method described in claim 3, it is characterized in that, judging whether execute number according to the execution operation data More than preset threshold, whether then returned according to judging result, which allows to execute the response operated, includes:
If the numerical value that the KEY value is the counter of the empty or described KEY value is less than the preset threshold, return allows to execute behaviour The response of work;
If the numerical value that the KEY value is not the counter of the empty and described KEY value is more than or equal to the preset threshold, described in judgement Whether the life span of KEY value is greater than 0, if more than then returning to the response that refusal executes operation, otherwise continuing to judge the KEY Whether there are still if it does not exist, then return allows to execute the response operated value, and if it exists, then deletes KEY value, and returns to permission Execute the response of operation.
5. according to the method described in claim 3, it is characterized in that, being carried out just to KEY value first if the KEY value is sky Then beginningization, and assignment life span add 1 into the counter of corresponding KEY value, and return to the response for allowing to execute operation.
6. the device that a kind of control executes number characterized by comprising
Receiving module, for receiving the execution operation requests of client;
Read module, for reading corresponding execution operation data from memory database according to the execution operation requests;
Judgment module executes whether number is more than preset threshold for judging according to the execution operation data, and then basis is sentenced Whether disconnected result returns allows to execute the response operated.
7. device according to claim 6, which is characterized in that the memory database comprises at least one of the following: Redis、memcached。
8. device according to claim 6, which is characterized in that the execution operation data includes following one or more:
The KEY value of unique identification respective operations, represent number of operations the KEY value counter numerical value and the KEY The life span of value.
9. device according to claim 8, which is characterized in that the judgment module is also used to:
If the numerical value that the KEY value is the counter of the empty or described KEY value is less than the preset threshold, return allows to execute behaviour The response of work;
If the numerical value that the KEY value is not the counter of the empty and described KEY value is more than or equal to the preset threshold, described in judgement Whether the life span of KEY value is greater than 0, if more than then returning to the response that refusal executes operation, otherwise continuing to judge the KEY Whether there are still if it does not exist, then return allows to execute the response operated value, and if it exists, then deletes KEY value, and returns to permission Execute the response of operation.
10. device according to claim 8, which is characterized in that the judgment module is also used to: if the KEY value is sky, Then KEY value is initialized first, and assignment life span, 1 is then added into the counter of corresponding KEY value, and return Allow to execute the response operated.
11. a kind of server terminal characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 5 is realized when row.
CN201710514730.7A 2017-06-29 2017-06-29 Method, apparatus, server terminal, and readable medium for controlling execution times Active CN109213815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710514730.7A CN109213815B (en) 2017-06-29 2017-06-29 Method, apparatus, server terminal, and readable medium for controlling execution times

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710514730.7A CN109213815B (en) 2017-06-29 2017-06-29 Method, apparatus, server terminal, and readable medium for controlling execution times

Publications (2)

Publication Number Publication Date
CN109213815A true CN109213815A (en) 2019-01-15
CN109213815B CN109213815B (en) 2020-11-03

Family

ID=64960568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710514730.7A Active CN109213815B (en) 2017-06-29 2017-06-29 Method, apparatus, server terminal, and readable medium for controlling execution times

Country Status (1)

Country Link
CN (1) CN109213815B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187987A (en) * 2019-06-05 2019-08-30 北京百度网讯科技有限公司 Method and apparatus for handling request
CN113778565A (en) * 2021-01-19 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for processing interface data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080120327A1 (en) * 2006-11-22 2008-05-22 Oracle International Corporation Method and system for transforming metadata modeled in the common information model into grid control target metadata
CN102073690A (en) * 2010-12-16 2011-05-25 四川川大智胜软件股份有限公司 Memory database supporting historical Key information
CN104618343A (en) * 2015-01-06 2015-05-13 中国科学院信息工程研究所 Method and system for detecting website threat based on real-time log
CN105426415A (en) * 2015-10-30 2016-03-23 Tcl集团股份有限公司 Management method, device and system of website access request
CN106161451A (en) * 2016-07-19 2016-11-23 青松智慧(北京)科技有限公司 The method of defence CC attack, Apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080120327A1 (en) * 2006-11-22 2008-05-22 Oracle International Corporation Method and system for transforming metadata modeled in the common information model into grid control target metadata
CN102073690A (en) * 2010-12-16 2011-05-25 四川川大智胜软件股份有限公司 Memory database supporting historical Key information
CN104618343A (en) * 2015-01-06 2015-05-13 中国科学院信息工程研究所 Method and system for detecting website threat based on real-time log
CN105426415A (en) * 2015-10-30 2016-03-23 Tcl集团股份有限公司 Management method, device and system of website access request
CN106161451A (en) * 2016-07-19 2016-11-23 青松智慧(北京)科技有限公司 The method of defence CC attack, Apparatus and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187987A (en) * 2019-06-05 2019-08-30 北京百度网讯科技有限公司 Method and apparatus for handling request
CN110187987B (en) * 2019-06-05 2022-02-25 北京百度网讯科技有限公司 Method and apparatus for processing requests
CN113778565A (en) * 2021-01-19 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for processing interface data

Also Published As

Publication number Publication date
CN109213815B (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN109523187A (en) Method for scheduling task, device and equipment
CN109274731A (en) Deployment, call method and the device of web services based on multi-tenant technology
CN108920222A (en) A kind of method and device for business processing of rule-based engine
CN110334036A (en) A kind of method and apparatus for realizing data cached scheduling
CN109033001A (en) Method and apparatus for distributing GPU
CN109388654A (en) A kind of method and apparatus for inquiring tables of data
CN109981322A (en) The method and apparatus of cloud resource management based on label
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN109492053A (en) Method and apparatus for accessing data
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN108897874A (en) Method and apparatus for handling data
CN108173919A (en) Big data platform builds system, method, equipment and computer-readable medium
CN109597810A (en) A kind of task cutting method, device, medium and electronic equipment
CN110400067A (en) A kind of method and system of purpose balance management
CN109885593A (en) Method and apparatus for handling information
CN108959636A (en) Data processing method, device, system, computer-readable medium
CN110220549A (en) A kind of method and apparatus of pile type assessment
CN108897551A (en) A kind of generation method and device of quoting resource relational tree
CN109213815A (en) Control executes method, apparatus, server terminal and the readable medium of number
CN108984197A (en) A kind of code update method and device
CN108985673A (en) It makes an inventory single generation method and device
CN103268264B (en) A kind of multi event synchronization RFID middleware system of low coupling and its implementation
CN110399397A (en) A kind of data query method and system
CN109976835A (en) A kind of method and system managing Obj State
CN108985805A (en) A kind of method and apparatus that selectivity executes push task

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