CN107463612A - High concurrent REDIS database operation methods and system - Google Patents

High concurrent REDIS database operation methods and system Download PDF

Info

Publication number
CN107463612A
CN107463612A CN201710516178.5A CN201710516178A CN107463612A CN 107463612 A CN107463612 A CN 107463612A CN 201710516178 A CN201710516178 A CN 201710516178A CN 107463612 A CN107463612 A CN 107463612A
Authority
CN
China
Prior art keywords
linkedblockingqueue
synchronousqueue
pipeline
objects
current
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
CN201710516178.5A
Other languages
Chinese (zh)
Other versions
CN107463612B (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 VRV Software Corp Ltd
Original Assignee
Beijing VRV Software Corp 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 VRV Software Corp Ltd filed Critical Beijing VRV Software Corp Ltd
Priority to CN201710516178.5A priority Critical patent/CN107463612B/en
Publication of CN107463612A publication Critical patent/CN107463612A/en
Application granted granted Critical
Publication of CN107463612B publication Critical patent/CN107463612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Abstract

The present invention discloses a kind of high concurrent REDIS database operation methods and system, the number of operations that operational approach calls Redis databases can be reduced, it is that a Pipeline is operated to merge multi-pass operation, it is significant to reduce the average time-consuming of Redis database manipulations, improve the treatment effeciency of whole business module;LinkedBlockingQueue is performed by using PipeLine<Object[]>Time-consuming statistics, dynamically control LinkedBlockingQueue<Object[]>Size, ensure that each Pipeline is performed it is average it is time-consuming reach optimum state, avoid instantaneous high concurrent operation cause operating result return to waiting for it is long caused by time-out failure, so as to improve the reliability of Redis databases.

Description

High concurrent REDIS database operation methods and system
Technical field
The present invention relates to Redis database fields, and in particular to a kind of high concurrent REDIS database operation methods and is System.
Background technology
Redis databases are used in software development, it is necessary to using newly-increased, modification, the command operation Redis data deleted Storehouse;Available action mode has two ways:Non- duct type, duct type operation;The operation of wherein non-duct type needs to hold in order The result to be returned such as after having gone, such as:Set, hset, get, hget, del etc. order, when handling high concurrent, it is necessary to by One operation, efficiency are very low;Therefore pipeline is needed to use to operate Redis databases, such benefit is handled when being exactly high concurrent Efficiency improves, and its shortcoming is to need to wait all operations in whole pipeline to complete, and just finally returns that whole results;Finally need To match pipe operations one by one from whole results is incoming each operation, it is necessary to expend certain time.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of high concurrent REDIS database operation methods and system, one side energy Make the directly accurate returning result of Redis pipe operations, remove the time-consuming of result matching from, improve the speed of response of Redis operations;Separately Redis number of tubes dynamic can on the one hand increased and decreased, improves treatment effeciency.
On the one hand, the embodiment of the present invention proposes a kind of high concurrent REDIS database operation methods, including:
S1, structure Pipeline connection pools, singleton tool-class, a mission thread and the startup of a Redis operation are somebody's turn to do Thread;
S2, it is that each Pipeline builds one respectively
HashMap<String,SynchronousQueue<Object>>With
LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
S3, start in Redis operation calls, know that current Pipeline objects are unlocked if checking, and currently LinkedBlockingQueue corresponding to Pipeline objects<Object[]>Less than, then an Object [] is built, will Method, method parameter list type, the input parameter of Redis operation calls are encapsulated into the Object [], and generate one at random Uuid, the uuid is put into the Object [], while creates a SynchronousQueue<Object>, using uuid as Key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue<Object >>;
S4, the Object [] is put into LinkedBlockingQueue<Object[]>, according in the Object [] Uuid is from HashMap<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
Wherein, methods described also includes:
S5, calculate LinkedBlockingQueue corresponding to the current Pileline objects of the mission thread execution< Object[]>It is time-consuming and perform command number, according to described time-consuming and perform command number and calculate the average consumption that obtains and each order When, performed described in command number and the corresponding average time-consuming historical record being stored in internal memory fragment, from the historical record The middle average time-consuming most short execution command number of selection, sets LinkedBlockingQueue corresponding to current Pipeline objects< Object[]>Length be the execution command number;
S6, in LinkedBlockingQueue corresponding to current Pileline objects<Object[]>After the completion of execution, by One passes through HashMap corresponding to the uuid in Object [] from current Pileline objects<String, SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, calling should SynchronousQueue<Object>Put () method Redis command execution results are put into.
On the other hand, a kind of high concurrent REDIS database operating systems of the embodiment of the present invention, including:
First construction unit, for build Pipeline connection pools, the singleton tool-class of Redis operation, one appoint Business thread simultaneously starts the thread;
Second construction unit, for building one respectively for each Pipeline
HashMap<String,SynchronousQueue<Object>>With
LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
Writing unit, for starting in Redis operation calls, know that current Pipeline objects are unlocked if checking, and LinkedBlockingQueue corresponding to current Pipeline objects<Object[]>Less than, then an Object [] is built, The method of Redis operation calls, method parameter list type, input parameter are encapsulated into the Object [], and generate one at random Individual uuid, the uuid is put into the Object [], while creates a SynchronousQueue<Object>, uuid is made For key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue< Object>>;
First call unit, for the Object [] to be put into LinkedBlockingQueue<Object[]>, according to Uuid is from HashMap in the Object []<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
Wherein, the system also includes:
Setting unit, performed for calculating the mission thread corresponding to current Pileline objects LinkedBlockingQueue<Object[]>It is time-consuming and perform command number, according to described time-consuming and perform command number and calculate Obtain and each order average time-consuming, the history in the execution command number and corresponding average time-consuming deposit internal memory fragment is remembered In record, average time-consuming most short execution command number is selected from the historical record, is set corresponding to current Pipeline objects LinkedBlockingQueue<Object[]>Length be the execution command number;
Second call unit, in LinkedBlockingQueue corresponding to current Pileline objects<Object[] >After the completion of execution, pass through HashMap corresponding to the uuid in Object [] from current Pileline objects one by one<String, SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, calling should SynchronousQueue<Object>Put () method Redis command execution results are put into.
The high concurrent REDIS database operation methods and system that the embodiment of the present invention proposes, on the one hand, multiple by merging The operation of Redis databases is called to be operated for a Pipeline, it is possible to reduce operational approach calls the operation of Redis databases Number, so as to significantly reduce the average time-consuming of Redis database manipulations, improve the treatment effeciency of whole business module; On the other hand, LinkedBlockingQueue is performed by using PipeLine<Object[]>Time-consuming statistics, dynamically Control LinkedBlockingQueue<Object[]>Size, ensure that each Pipeline is performed average time-consuming reaches most Good state, instantaneous high concurrent operation is avoided to cause operating result to return to waiting for long caused time-out failure, so as to improve The reliability of Redis databases.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the embodiment part of high concurrent REDIS database operation methods one of the present invention;
Fig. 2 is a kind of part schematic flow sheet of another embodiment of high concurrent REDIS database operation methods of the present invention;
Fig. 3 is a kind of schematic flow sheet of the another embodiment of high concurrent REDIS database operation methods of the present invention;
Fig. 4 is a kind of part schematic flow sheet of the another embodiment of high concurrent REDIS database operation methods of the present invention;
Fig. 5 is a kind of structural representation of the embodiment of high concurrent REDIS database operating systems one of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is explicitly described, it is clear that described embodiment be the present invention Part of the embodiment, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not having The every other embodiment obtained under the premise of creative work is made, belongs to the scope of protection of the invention.
Referring to Fig. 1 and Fig. 2, the present embodiment discloses a kind of high concurrent REDIS database operation methods, including:
S1, structure Pipeline connection pools, singleton tool-class, a mission thread and the startup of a Redis operation are somebody's turn to do Thread;
S2, it is that each Pipeline builds one respectively
HashMap<String,SynchronousQueue<Object>>With
LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
S3, start in Redis operation calls, know that current Pipeline objects are unlocked if checking, and currently LinkedBlockingQueue corresponding to Pipeline objects<Object[]>Less than, then an Object [] is built, will Method, method parameter list type, the input parameter of Redis operation calls are encapsulated into the Object [], and generate one at random Uuid, the uuid is put into the Object [], while creates a SynchronousQueue<Object>, using uuid as Key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue<Object >>;
S4, the Object [] is put into LinkedBlockingQueue<Object[]>, according in the Object [] Uuid is from HashMap<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
Wherein, methods described also includes:
S5, calculate LinkedBlockingQueue corresponding to the current Pileline objects of the mission thread execution< Object[]>It is time-consuming and perform command number, according to described time-consuming and perform command number and calculate the average consumption that obtains and each order When, performed described in command number and the corresponding average time-consuming historical record being stored in internal memory fragment, from the historical record The middle average time-consuming most short execution command number of selection, sets LinkedBlockingQueue corresponding to current Pipeline objects< Object[]>Length be the execution command number;
S6, in LinkedBlockingQueue corresponding to current Pileline objects<Object[]>After the completion of execution, by One passes through HashMap corresponding to the uuid in Object [] from current Pileline objects<String, SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, calling should SynchronousQueue<Object>Put () method Redis command execution results are put into.
The high concurrent REDIS database operation methods that the present embodiment proposes, on the one hand, repeatedly call Redis by merging The operation of database is that a Pipeline is operated, it is possible to reduce operational approach calls the number of operations of Redis databases, so as to It is significant to reduce the average time-consuming of Redis database manipulations, improve the treatment effeciency of whole business module;On the other hand, LinkedBlockingQueue is performed by using PipeLine<Object[]>Time-consuming statistics, dynamic control LinkedBlockingQueue<Object[]>Size, ensure that each Pipeline is performed average time-consuming reaches optimal shape State, instantaneous high concurrent operation is avoided to cause operating result to return to waiting for long caused time-out failure, so as to improve Redis numbers According to the reliability in storehouse.
Fig. 3 is a kind of overall flow schematic diagram of the embodiment of high concurrent REDIS database operation methods one of the present invention, Fig. 4 For a kind of part schematic flow sheet of the embodiment of high concurrent REDIS database operation methods one of the present invention, with reference to Fig. 3 and figure 4 pairs of high concurrent REDIS database operation methods of the present invention are described in detail, and referring to Fig. 3, this method comprises the following steps:
(1) build Pipeline connection pools, the singleton tool-class of Redis operation, one perform Pipeline and its LinkedBlockingQueue<Object[]>Mission thread and start the thread;
(2) one is built respectively for each Pipeline
HashMap<String,SynchronousQueue<Object>>
And LinkedBlockingQueue<Object[]>;
(3) start in Redis operation calls, check whether current Pipeline objects lock:Pipeline is locked A Pipeline is then obtained from Pipeline connection pools, the unlocked rules of Pipeline return;
(4) LinkedBlockingQueue in Pipeline corresponding to current Pipeline objects is checked<Object[] >Whether length is full, and a Pipeline is obtained from Pipeline connection pools again if full, if being returned less than if Pipeline;
(5) step (3) and (4) are repeated, until getting an available Pipeline;
(6) method of Redis operation calls, method parameter list type, input parameter are encapsulated into Object [], and with Machine generates a uuid, and the uuid is also placed in into Object [];A SynchronousQueue is created simultaneously<Object>, Using uuid as key assignments, SynchronousQueue<Object>HashMap is write as value<String, SynchronousQueue<Object>>;
(7) Object [] is put into LinkedBlockingQueue<Object[]>, according to uuid in the Object [] From HashMap<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid that SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
It is understood that SynchronousQueue<Object>Take () can wait until the object in be pushed into One available result.
After mission thread startup, current Pipeline objects meeting monitor task thread, performed when monitoring mission thread During Pipeline, it may be determined that go out the Pipeline objects.Afterwards by LinkedBlockingQueue<Object[]>Use The sync () of the Pipeline objects starts to perform, and records Starting Executing Time, and by this Pipeline object lock, now If calling service Redis database manipulations, then directly obtain a new PipeLine from Pipeline connection pools and lay equal stress on Newly performed since step (3).Referring to Fig. 4, in LinkedBlockingQueue<Object[]>At the end of execution, record is held The row end time, count the mission thread and perform LinkedBlockingQueue corresponding to current Pileline objects< Object[]>Execution command number, according to the Starting Executing Time and perform the end time and calculate the mission thread and perform LinkedBlockingQueue corresponding to current Pileline objects<Object[]>It is time-consuming, according to described time-consuming and perform What command number calculating acquisition was each ordered is averagely taken, and the execution command number and corresponding averagely take are stored in into internal memory fragment In historical record in, average time-consuming most short execution command number is selected from the historical record, to this Pipeline object It is unlocked, LinkedBlockingQueue corresponding to current Pipeline objects is set<Object[]>Length held for this Line command number, to optimize the efficiency of Pipeline processing.
In addition, LinkedBlockingQueue<Object[]>After the completion of queue performs, one by one by Object [] Uuid from HashMap<String,SynchronousQueue<Object>>Obtain value corresponding to the uuid: SynchronousQueue<Object>, call the put () method of the object to be put into Redis command execution results.Now, Foregoing take () method is because SynchronousQueue<Object>There is available value, get the value and return, entirely Redis operation execution terminates;
Referring to Fig. 5, the present embodiment discloses a kind of high concurrent REDIS database operating systems, including:
First construction unit 1, for build Pipeline connection pools, the singleton tool-class of Redis operation, one appoint Business thread simultaneously starts the thread;
Second construction unit 2, for building one respectively for each Pipeline
HashMap<String,SynchronousQueue<Object>>With
LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
Writing unit 3, for starting in Redis operation calls, know that current Pipeline objects are unlocked if checking, and LinkedBlockingQueue corresponding to current Pipeline objects<Object[]>Less than, then an Object [] is built, The method of Redis operation calls, method parameter list type, input parameter are encapsulated into the Object [], and generate one at random Individual uuid, the uuid is put into the Object [], while creates a SynchronousQueue<Object>, uuid is made For key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue< Object>>;
In the present embodiment, said write unit, it can be also used for:
If inspection know that current Pipeline objects are locked or current Pipeline objects corresponding to LinkedBlockingQueue<Object[]>Full, then acquisition one is available from the Pipeline connection pools again Pipeline is continued with.
First call unit 4, for the Object [] to be put into LinkedBlockingQueue<Object[]>, according to Uuid is from HashMap in the Object []<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
Wherein, the system also includes:
Setting unit 5, performed for calculating the mission thread corresponding to current Pileline objects LinkedBlockingQueue<Object[]>It is time-consuming and perform command number, according to described time-consuming and perform command number and calculate Obtain and each order average time-consuming, the history in the execution command number and corresponding average time-consuming deposit internal memory fragment is remembered In record, average time-consuming most short execution command number is selected from the historical record, is set corresponding to current Pipeline objects LinkedBlockingQueue<Object[]>Length be the execution command number;
In the present embodiment, the setting unit, specifically it can be used for:
The mission thread is monitored by Pileline, it is determined that current Pileline objects;
LinkedBlockingQueue is performed using the sync () of current Pileline objects<Object[]>, record opens Begin to perform the time, and the state of executory current Pileline objects is set to locking;
In LinkedBlockingQueue<Object[]>At the end of execution, record performs the end time, is opened according to described Begin to perform the time and the calculating of execution end time is described time-consuming.
Second call unit 6, in LinkedBlockingQueue corresponding to current Pileline objects<Object []>After the completion of execution, pass through HashMap corresponding to the uuid in Object [] from current Pileline objects one by one< String,SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, adjust With the SynchronousQueue<Object>Put () method Redis command execution results are put into.
The high concurrent REDIS database operating systems that the present embodiment proposes, on the one hand, repeatedly call Redis by merging The operation of database is that a Pipeline is operated, it is possible to reduce operational approach calls the number of operations of Redis databases, so as to It is significant to reduce the average time-consuming of Redis database manipulations, improve the treatment effeciency of whole business module;On the other hand, LinkedBlockingQueue is performed by using PipeLine<Object[]>Time-consuming statistics, dynamic control LinkedBlockingQueue<Object[]>Size, ensure that each Pipeline is performed average time-consuming reaches optimal shape State, instantaneous high concurrent operation is avoided to cause operating result to return to waiting for long caused time-out failure, so as to improve Redis numbers According to the reliability in storehouse.
Although being described in conjunction with the accompanying embodiments of the present invention, those skilled in the art can not depart from this hair Various modifications and variations are made in the case of bright spirit and scope, such modifications and variations are each fallen within by appended claims Within limited range.

Claims (6)

  1. A kind of 1. high concurrent REDIS database operation methods, it is characterised in that including:
    S1, build Pipeline connection pools, the singleton tool-class that a Redis is operated, a mission thread and start the thread;
    S2, it is that each Pipeline builds one respectively
    HashMap<String,SynchronousQueue<Object>>With
    LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
    S3, start in Redis operation calls, know that current Pipeline objects are unlocked if checking, and it is current Pipeline pairs As corresponding LinkedBlockingQueue<Object[]>Less than, then build an Object [], by Redis operation calls Method, method parameter list type, input parameter be encapsulated into the Object [], and generate a uuid at random, by the uuid The Object [] is put into, while creates a SynchronousQueue<Object>, using uuid as key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue<Object>>;
    S4, the Object [] is put into LinkedBlockingQueue<Object[]>, according to uuid in the Object [] from HashMap<String,SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to uuid< Object>, and call the SynchronousQueue<Object>Take () return to Redis operation calls as a result Person;
    Wherein, methods described also includes:
    S5, calculate LinkedBlockingQueue corresponding to the current Pileline objects of the mission thread execution<Object[] >It is time-consuming and perform command number, according to it is described time-consuming and perform command number calculate obtain each order it is average time-consuming, will described in Perform in the historical record in command number and corresponding average time-consuming deposit internal memory fragment, selected from the historical record average Time-consuming most short execution command number, sets LinkedBlockingQueue corresponding to current Pipeline objects<Object[]> Length be the execution command number;
    S6, in LinkedBlockingQueue corresponding to current Pileline objects<Object[]>After the completion of execution, lead to one by one HashMap corresponding to the uuid crossed in Object [] from current Pileline objects<String,SynchronousQueue< Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, call the SynchronousQueue< Object>Put () method Redis command execution results are put into.
  2. 2. according to the method for claim 1, it is characterised in that the S3, in addition to:
    If inspection know that current Pipeline objects are locked or current Pipeline objects corresponding to LinkedBlockingQueue<Object[]>Full, then acquisition one is available from the Pipeline connection pools again Pipeline is continued with.
  3. 3. method according to claim 1 or 2, it is characterised in that the S5, specifically include:
    The mission thread is monitored by Pileline, it is determined that current Pileline objects;
    LinkedBlockingQueue is performed using the sync () of current Pileline objects<Object[]>, record and start to hold The row time, and the state of executory current Pileline objects is set to locking;
    In LinkedBlockingQueue<Object[]>At the end of execution, record performs the end time, starts to hold according to described Row time and execution end time calculate described time-consuming.
  4. A kind of 4. high concurrent REDIS database operating systems, it is characterised in that including:
    First construction unit, for singleton tool-class, the task line for building Pipeline connection pools, a Redis is operated Journey simultaneously starts the thread;
    Second construction unit, for building one respectively for each Pipeline
    HashMap<String,SynchronousQueue<Object>>With
    LinkedBlockingQueue<Object[]>, wherein, the mission thread be used for perform Pipeline and its LinkedBlockingQueue<Object[]>;
    Writing unit, for starting in Redis operation calls, know that current Pipeline objects are unlocked if checking, and currently LinkedBlockingQueue corresponding to Pipeline objects<Object[]>Less than, then an Object [] is built, will Method, method parameter list type, the input parameter of Redis operation calls are encapsulated into the Object [], and generate one at random Uuid, the uuid is put into the Object [], while creates a SynchronousQueue<Object>, using uuid as Key assignments, SynchronousQueue<Object>HashMap is write as value<String,SynchronousQueue<Object >>;
    First call unit, for the Object [] to be put into LinkedBlockingQueue<Object[]>, according to this Uuid is from HashMap in Object []<String,SynchronousQueue<Object>>Corresponding to middle acquisition uuid SynchronousQueue<Object>, and call the SynchronousQueue<Object>Take () return as a result Back to Redis operation calls persons;
    Wherein, the system also includes:
    Setting unit, performed for calculating the mission thread corresponding to current Pileline objects LinkedBlockingQueue<Object[]>It is time-consuming and perform command number, according to described time-consuming and perform command number and calculate Obtain and each order average time-consuming, the history in the execution command number and corresponding average time-consuming deposit internal memory fragment is remembered In record, average time-consuming most short execution command number is selected from the historical record, is set corresponding to current Pipeline objects LinkedBlockingQueue<Object[]>Length be the execution command number;
    Second call unit, in LinkedBlockingQueue corresponding to current Pileline objects<Object[]>Hold After the completion of row, pass through HashMap corresponding to the uuid in Object [] from current Pileline objects one by one<String, SynchronousQueue<Object>>Middle acquisition SynchronousQueue corresponding to the uuid<Object>, calling should SynchronousQueue<Object>Put () method Redis command execution results are put into.
  5. 5. system according to claim 4, it is characterised in that said write unit, be additionally operable to:
    If inspection know that current Pipeline objects are locked or current Pipeline objects corresponding to LinkedBlockingQueue<Object[]>Full, then acquisition one is available from the Pipeline connection pools again Pipeline is continued with.
  6. 6. the system according to claim 4 or 5, it is characterised in that the setting unit, be specifically used for:
    The mission thread is monitored by Pileline, it is determined that current Pileline objects;
    LinkedBlockingQueue is performed using the sync () of current Pileline objects<Object[]>, record and start to hold The row time, and the state of executory current Pileline objects is set to locking;
    In LinkedBlockingQueue<Object[]>At the end of execution, record performs the end time, starts to hold according to described Row time and execution end time calculate described time-consuming.
CN201710516178.5A 2017-06-29 2017-06-29 High concurrent REDIS database operation method and system Active CN107463612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710516178.5A CN107463612B (en) 2017-06-29 2017-06-29 High concurrent REDIS database operation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710516178.5A CN107463612B (en) 2017-06-29 2017-06-29 High concurrent REDIS database operation method and system

Publications (2)

Publication Number Publication Date
CN107463612A true CN107463612A (en) 2017-12-12
CN107463612B CN107463612B (en) 2019-10-01

Family

ID=60546460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710516178.5A Active CN107463612B (en) 2017-06-29 2017-06-29 High concurrent REDIS database operation method and system

Country Status (1)

Country Link
CN (1) CN107463612B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108549592A (en) * 2018-03-19 2018-09-18 联动优势电子商务有限公司 A kind of monitoring method and monitoring device, application server of database connection pool
CN109165101A (en) * 2018-09-11 2019-01-08 南京朝焱智能科技有限公司 Inner server design method based on Redis
CN109299125A (en) * 2018-10-31 2019-02-01 中国银行股份有限公司 Database update method and device
CN110083501A (en) * 2018-01-25 2019-08-02 北京京东尚科信息技术有限公司 Interface calls method of counting and device
CN110928937A (en) * 2019-10-28 2020-03-27 东南大学 Highway portal system capable of rapidly processing and transmitting data
CN113377434A (en) * 2021-06-08 2021-09-10 北京金山云网络技术有限公司 Method and device for determining command response time length and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872947A (en) * 1995-10-24 1999-02-16 Advanced Micro Devices, Inc. Instruction classification circuit configured to classify instructions into a plurality of instruction types prior to decoding said instructions
CN102880475A (en) * 2012-10-23 2013-01-16 上海普元信息技术股份有限公司 Real-time event handling system and method based on cloud computing in computer software system
CN103577431A (en) * 2012-07-27 2014-02-12 深圳市易通无限科技有限公司 Method, device and system for performing system design through multiple databases
CN105260376A (en) * 2015-08-17 2016-01-20 北京京东尚科信息技术有限公司 Method, equipment and system used for cluster node contraction and expansion

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872947A (en) * 1995-10-24 1999-02-16 Advanced Micro Devices, Inc. Instruction classification circuit configured to classify instructions into a plurality of instruction types prior to decoding said instructions
CN103577431A (en) * 2012-07-27 2014-02-12 深圳市易通无限科技有限公司 Method, device and system for performing system design through multiple databases
CN102880475A (en) * 2012-10-23 2013-01-16 上海普元信息技术股份有限公司 Real-time event handling system and method based on cloud computing in computer software system
CN105260376A (en) * 2015-08-17 2016-01-20 北京京东尚科信息技术有限公司 Method, equipment and system used for cluster node contraction and expansion

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083501A (en) * 2018-01-25 2019-08-02 北京京东尚科信息技术有限公司 Interface calls method of counting and device
CN108549592A (en) * 2018-03-19 2018-09-18 联动优势电子商务有限公司 A kind of monitoring method and monitoring device, application server of database connection pool
CN109165101A (en) * 2018-09-11 2019-01-08 南京朝焱智能科技有限公司 Inner server design method based on Redis
CN109165101B (en) * 2018-09-11 2021-03-19 南京朝焱智能科技有限公司 Memory server design method based on Redis
CN109299125A (en) * 2018-10-31 2019-02-01 中国银行股份有限公司 Database update method and device
CN109299125B (en) * 2018-10-31 2021-05-28 中国银行股份有限公司 Database updating method and device
CN110928937A (en) * 2019-10-28 2020-03-27 东南大学 Highway portal system capable of rapidly processing and transmitting data
CN113377434A (en) * 2021-06-08 2021-09-10 北京金山云网络技术有限公司 Method and device for determining command response time length and storage medium

Also Published As

Publication number Publication date
CN107463612B (en) 2019-10-01

Similar Documents

Publication Publication Date Title
CN107463612A (en) High concurrent REDIS database operation methods and system
CN109033123B (en) Big data-based query method and device, computer equipment and storage medium
KR20100046198A (en) Transactional graph-based computation with error handling
CN106547612A (en) A kind of multi-task processing method and device
CN107256180A (en) Data processing method, device and terminal
US11656902B2 (en) Distributed container image construction scheduling system and method
CN105956481A (en) Data processing method and device
CN109471711A (en) A kind of method and device of task processing
CN102629220A (en) Dynamic task allocation and management method
CN105512188A (en) Data connection method and data connection system
CN112699150A (en) Database operation framework, method and system
CN111522668A (en) Method and apparatus for resource configuration and computer-readable storage medium
CN111984402A (en) Unified scheduling monitoring method and system for thread pool
CN108829740A (en) Date storage method and device
CN107544844A (en) A kind of method and device of lifting Spark Operating ettectiveness
CN103853713B (en) The efficient storage method of mass data
CN104251913B (en) Rotating machinery monitors system start and stop intelligent determination method
CN116069480B (en) Processor and computing device
CN106170013B (en) A kind of Kafka message uniqueness method based on Redis
CN110134512A (en) Method, apparatus, equipment and the storage medium of cluster server execution task
Hou et al. Efficient allocation of testing resources for software module testing based on the hyper-geometric distribution software reliability growth model
WO2022267395A1 (en) Payment request processing method and system
KR101411266B1 (en) Event processing method using hierarchical structure and event processing engine and system thereof
CN113722349A (en) SQL (structured query language) auditing method and device based on distributed database and computer equipment
CN106484879A (en) A kind of polymerization of the Map end data based on MapReduce

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