Movatterモバイル変換


[0]ホーム

URL:


CN107133108A - Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock - Google Patents

Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock
Download PDF

Info

Publication number
CN107133108A
CN107133108ACN201710287547.8ACN201710287547ACN107133108ACN 107133108 ACN107133108 ACN 107133108ACN 201710287547 ACN201710287547 ACN 201710287547ACN 107133108 ACN107133108 ACN 107133108A
Authority
CN
China
Prior art keywords
lock
competitive resource
containing single
terminal
locks
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.)
Pending
Application number
CN201710287547.8A
Other languages
Chinese (zh)
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co LtdfiledCriticalNubia Technology Co Ltd
Priority to CN201710287547.8ApriorityCriticalpatent/CN107133108A/en
Publication of CN107133108ApublicationCriticalpatent/CN107133108A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention discloses implementation method, terminal, server and the computer-readable recording medium of a kind of distributed complex lock, the method comprising the steps of:Terminal to server sends the complicated lock containing multiple competitive resources and obtains request;Complicated lock containing multiple competitive resources is obtained request by server, is split into multiple locks containing single competitive resource and is obtained request, and sending all locks containing single competitive resource to terminal obtains successful response;All locks containing single competitive resource that terminal the reception server is sent obtain successful response, obtain all locks containing single competitive resource.The present invention is multiple monolocks by splitting complicated lock, meets the simultaneously operating to multiple competitive resources;The unique lock of each competitive resource correspondence one, reaching can support to operate while different types of competitive resource;By the way of lock is monitored, improve the efficiency for again attempting to obtain lock and save system resource.

Description

Implementation method, terminal, server and the computer-readable storage of distributed complex lockMedium
Technical field
The present invention relates to communication technical field, more particularly to the implementation method of distributed complex lock a kind of, terminal, serverAnd computer-readable recording medium.
Background technology
With the fast development of mobile communication and mobile Internet, substantial amounts of user is interconnected using mobile InternetThe access process of network service, so, the load pressure of the concurrent processing of magnanimity is just generated to the service end of mobile Internet businessPower.In order to meet the performance requirement of high concurrent, the framework of the service end of Internet service uses distributed type assemblies, meanwhile,Service end has ability extending transversely.And in distributed server architecture, how to ensure between multiple serversThe locking of resource contention is processed into for primary problems faced.
During the present invention is realized, inventor has found that prior art has problems with:Prior art both forThe scheme that single competitive resource is locked, when an operation needs to operate multiple competitive resources simultaneously, existing scheme can not be metBusiness demand.
The content of the invention
It is a primary object of the present invention to propose a kind of implementation method, terminal, server and the calculating of distributed complex lockMachine readable storage medium storing program for executing, it is intended to solve the problem of prior art is present.
To achieve the above object, first aspect of the embodiment of the present invention provides a kind of implementation method of distributed complex lock, instituteStating method includes step:
Terminal to server sends the complicated lock containing multiple competitive resources and obtains request;
The server receives the complicated lock acquisition request that the terminal is sent, and the complexity containing multiple competitive resources is lockedRequest is obtained, multiple locks containing single competitive resource is split into and obtains request;
The server sends all locks containing single competitive resource to the terminal and obtains successful response;
The terminal receives all successful responses of locks acquisition containing single competitive resource that the server is sent, and obtainsTake all locks containing single competitive resource.
Further, server described in the step sends all locks containing single competitive resource to the terminal and obtainedSuccessfully response includes:
Attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get the multiple containThere is a lock in the lock of single competitive resource;
If getting a lock in the multiple lock containing single competitive resource, judge all containing single competitionWhether the lock of resource obtains success;If all locks containing single competitive resource are obtained successfully, send all to the terminalLock containing single competitive resource obtains successful response;If all locks containing single competitive resource do not obtain success,Continue executing with step and attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get described manyA lock in the individual lock containing single competitive resource;
If not getting a lock in the multiple lock containing single competitive resource, all got is dischargedLock;A lock in the multiple lock containing single competitive resource is monitored, if listening to the multiple containing listA lock in the lock of individual competitive resource has been released, then continues executing with step and attempt to obtain multiple containing single competitive resourceA lock in lock, and judge whether to get one in the multiple lock containing single competitive resource lock.
Further, methods described also includes step:
The terminal-pair competitive resource is operated, and operated it is rear to the server send release it is all containingThe lock request of single competitive resource.
Further, the complicated lock, which obtains request, includes complicated lock effective time;Methods described also includes step:
The server judges whether the complicated lock effective time has reached, if the complicated lock effective time has been arrivedReach, then delete the complicated lock.
In addition, to achieve the above object, second aspect of the embodiment of the present invention provides a kind of terminal, the terminal includes storageDistributed complex lock that device, processor and being stored in can be run on the memory and on the processor realizes program,What the distributed complex was locked realizes following steps when realizing program by the computing device:
The complicated lock containing multiple competitive resources, which is sent, to server obtains request;
All successful responses of locks acquisition containing single competitive resource that the server is sent are received, all contains is obtainedThere is the lock of single competitive resource;
Wherein, the server receives the complicated lock acquisition request that the terminal is sent, and will contain multiple competitive resourcesComplexity lock obtains request and splits into multiple locks acquisition requests containing single competitive resource;Transmission is all to contain single competitive resourceLock obtain successful response.
Further, what the distributed complex was locked is additionally operable to realize following step when realizing program by the computing deviceSuddenly:
Competitive resource is operated, and discharges all containing single competition in rear sent to the server operatedThe lock request of resource.
Further, the complicated lock, which obtains request, includes complicated lock effective time.
Further, what the distributed complex was locked is additionally operable to realize following step when realizing program by the computing deviceSuddenly:
When successfully getting all locks containing single competitive resource, all by acquisition contain single competitive resourceLock share competitive resource.
In addition, to achieve the above object, the third aspect of the embodiment of the present invention provides a kind of server, the server includesDistributed complex lock that memory, processor and being stored in can be run on the memory and on the processor realizes journeySequence, what the distributed complex was locked realizes following steps when realizing program by the computing device:
The complicated lock containing multiple competitive resources that receiving terminal is sent obtains request;
Complicated lock of the reception containing multiple competitive resources obtained into request, is split into multiple containing single competitive resourceLock obtains request;
All locks containing single competitive resource, which are sent, to the terminal obtains successful response.
Furthermore, to achieve the above object, fourth aspect of the embodiment of the present invention provides a kind of computer-readable recording medium, instituteThe program of realizing for the distributed complex lock that is stored with computer-readable recording medium is stated, what the distributed complex was locked realizes programThe step of implementation method of upper described distributed complex lock is realized when being executed by processor.
Implementation method, terminal, server and the computer-readable storage of distributed complex lock provided in an embodiment of the present inventionMedium, is multiple monolocks by splitting complicated lock, meets the simultaneously operating to multiple competitive resources;Each competitive resource correspondenceOne unique lock, reaching can support to operate while different types of competitive resource;By the way of lock is monitored, improve againThe secondary efficiency for attempting to obtain lock and saving system resource.
Brief description of the drawings
Fig. 1 is the hardware architecture diagram for the mobile terminal for realizing each embodiment of the invention;
Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention;
The implementation method schematic flow sheet that Fig. 3 locks for the distributed complex of first embodiment of the invention;
Responding process schematic diagram in the implementation method that Fig. 4 locks for the distributed complex of first embodiment of the invention;
Another schematic flow sheet of implementation method that Fig. 5 locks for the distributed complex of first embodiment of the invention;
Fig. 6 is the terminal structure schematic diagram of second embodiment of the invention;
Fig. 7 is the server architecture schematic diagram of third embodiment of the invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is onlyBe conducive to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can be mixedGround is used.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat boardComputer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portableMedia player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. are movedMove the fixed terminals such as terminal, and numeral TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except specialOutside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware architecture diagram for a kind of mobile terminal of realization each embodiment of the invention, the shiftingDynamic terminal 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit103rd, A/V (audio/video) input block 104, sensor 105, display unit 106, user input unit 107, interface unit108th, the part such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal can be included than illustrating more or less parts,Either combine some parts or different parts arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base stationDownlink information receive after, handled to processor 110;In addition, up data are sent into base station.Generally, radio frequency unit 101Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetratingFrequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communicationStandard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunicationsSystem), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (CodeDivision Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code DivisionMultiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous CodeDivision Multiple Access, TD SDMA), FDD-LTE (Frequency DivisionDuplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time DivisionDuplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user's transmitting-receiving electricity by WiFi module 102Sub- mail, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1 showsGo out WiFi module 102, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can be according to needTo be omitted in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 1 00When under the isotypes such as formula, speech recognition mode, broadcast reception mode, it is that radio frequency unit 101 or WiFi module 102 are received orThe voice data stored in memory 109 is converted into audio signal and is output as sound.Moreover, audio output unit 103The audio output related to the specific function that mobile terminal 1 00 is performed can also be provided (for example, call signal receives sound, disappearedBreath receives sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor(Graphics Processing Unit, GPU) 1041 and microphone 1042,1041 pairs of graphics processor is in video acquisition modeOr the view data progress of the static images or video obtained in image capture mode by image capture apparatus (such as camera)Reason.Picture frame after processing may be displayed on display unit 106.Picture frame after being handled through graphics processor 1041 can be depositedStorage is transmitted in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.MikeWind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio (voice) data after processing canTo be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model.Microphone 1042 can implement various types of noises and eliminate (or suppression) algorithm to eliminate (or suppression) in reception and send soundThe noise produced during frequency signal or interference.
Mobile terminal 1 00 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographiesSensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environmentThe light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 1 00 is moved in one's earDisplay panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (generalFor three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can be wrappedDisplay panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be usedForms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminalThe key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 withAnd other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it(such as user is using any suitable objects such as finger, stylus or annex on contact panel 1071 or in contact panel 1071Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detectionTwo parts of device and touch controller.Wherein, touch detecting apparatus detects the touch orientation of user, and detects touch operation bandThe signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by itIt is converted into contact coordinate, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, canTo realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can be wrappedInclude but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc.One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 orAfter neighbouring touch operation, processor 110 is sent to determine the type of touch event, with preprocessor 110 according to touch thingThe type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel1061 be input and the output function that mobile terminal is realized as two independent parts, but in certain embodiments, canBy contact panel 1071 and the input that is integrated and realizing mobile terminal of display panel 1061 and output function, not do specifically hereinLimit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 1 00.For example,External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothingLine FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) endMouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, numberIt is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 1 00 or can be withFor transmitting data between mobile terminal 1 00 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program areaAnd storage data field, wherein, application program (the such as sound that storing program area can be needed for storage program area, at least one functionSound playing function, image player function etc.) etc.;Storage data field can be stored uses created data (such as according to mobile phoneVoice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, it can also include non-easyThe property lost memory, for example, at least one disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connectionIndividual part, by operation or performs and is stored in software program and/or module in memory 109, and calls and be stored in storageData in device 109, perform the various functions and processing data of mobile terminal, so as to carry out integral monitoring to mobile terminal.PlaceReason device 110 may include one or more processing units;It is preferred that, processor 110 can integrated application processor and modulatedemodulate mediateDevice is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is mainHandle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 1 00 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, putThe function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 1 00 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system that the mobile terminal of the present invention is based on is entered belowRow description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network systemUnite as the LTE system of universal mobile communications technology, UE (User Equipment, use of the LTE system including communicating connection successivelyFamily equipment) 201, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, evolved UMTS landsGround wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation204。
Specifically, UE201 can be above-mentioned terminal 100, and here is omitted.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returningJourney (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203,ENodeB2021 can provide UE201 to EPC203 access.
EPC203 can include MME (Mobility Management Entity, mobility management entity) 2031, HSS(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy andCharging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 andThere is provided carrying and connection management for the control node of signaling between EPC203.HSS2032 is all to manage for providing some registersSuch as function of attaching position register (not shown) etc, and some are preserved about the use such as service features, data rateThe special information in family.All customer data can be transmitted by SGW2034, and PGW2035 can provide UE 201 IPAddress is distributed and other functions, and PCRF2036 is strategy and the charging control strategic decision-making of business data flow and IP bearing resourcesPoint, it selects and provided available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimediaSystem) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not onlySuitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA withAnd following new network system etc., do not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the inventive method is proposed.
First embodiment
As shown in figure 3, a kind of implementation method for distributed complex lock that first embodiment of the invention is provided, this method includesStep:
30th, terminal to server sends the complicated lock containing multiple competitive resources and obtains request.
31st, the complicated lock that server receiving terminal is sent obtains request, and the complicated lock containing multiple competitive resources is obtainedRequest, splits into multiple locks containing single competitive resource and obtains request.
In the present embodiment, it is multiple monolocks by splitting complicated lock, the simultaneously operating to multiple competitive resources can be met.
32nd, server sends all locks containing single competitive resource to terminal and obtains successful response.
It refer to shown in Fig. 4, in the present embodiment, step 32 specifically includes:
320th, attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get multiple containThere is a lock in the lock of single competitive resource;
If the 321, getting a lock in multiple locks containing single competitive resource, judge all containing single competitionWhether the lock of resource obtains success;
If the 322, all locks containing single competitive resource are obtained successfully, send all containing single competition money to terminalThe lock in source obtains successful response;
If all locks containing single competitive resource do not obtain success, continue executing with step attempt obtain it is multiple containingA lock in the lock of single competitive resource, and judge whether to get one in the multiple lock containing single competitive resourceIndividual lock;
If the 323, not getting a lock in the multiple lock containing single competitive resource, all obtained is dischargedThe lock got;
324th, a lock in multiple locks containing single competitive resource is monitored;
If the 325, listening to one in the multiple lock containing single competitive resource lock to be released, continue executing withStep attempts to obtain a lock in multiple locks containing single competitive resource, and judges whether to get multiple containing single competingThe lock striven in the lock of resource.
Further, if the lock not listened in multiple locks containing single competitive resource has been released, afterIt is continuous that a lock in multiple locks containing single competitive resource is monitored.
In the present embodiment, by the way of lock is monitored, the efficiency for again attempting to obtain lock and saving system money can be improvedSource.
33rd, all locks containing single competitive resource that terminal the reception server is sent obtain successful response, obtain instituteThere is the lock containing single competitive resource.
In the present embodiment, the unique lock of each competitive resource correspondence one, reaching can support different types of competingOperated while striving resource.
It please check shown in Fig. 5, in another embodiment, this method also includes step:
34th, terminal-pair competitive resource is operated, and discharges all containing single in rear sent to server operatedThe lock request of competitive resource.
Please check again shown in Fig. 5, in another embodiment, complexity lock, which obtains request, includes complicated lock effective time;This method also includes step:
35th, server judges whether complicated lock effective time has reached, if complicated lock effective time has been reached, deletes multipleMiscellaneous lock.
When the complicated lock that usual server receives terminal obtains request, unblock can be normally carried out.And when the program of terminalWhen operation goes wrong and sends request without normal direction server, server can also be according to the effective time, in lock effective timeDuring arrival, then complexity lock is deleted to discharge the resource of terminal occupancy, other-end is distributed to and uses.
The implementation method of distributed complex lock provided in an embodiment of the present invention, is multiple monolocks by splitting complicated lock, fullSimultaneously operating of the foot to multiple competitive resources;The unique lock of each competitive resource correspondence one, inhomogeneity can be supported by reachingOperated while the competitive resource of type;By the way of lock is monitored, the efficiency and saving system that raising again attempts to obtain lock are providedSource.
Second embodiment
A kind of reference picture 6, terminal that Fig. 6 provides for second embodiment of the invention, terminal 40 includes memory 41, processor42 and be stored in the distributed complex lock that can run on the memory 41 and on the processor 42 realize program, it is describedWhat distributed complex was locked realizes following steps when realizing program by the computing device:
The complicated lock containing multiple competitive resources, which is sent, to server obtains request;
All successful responses of locks acquisition containing single competitive resource that the server is sent are received, all contains is obtainedThere is the lock of single competitive resource;
Wherein, the server receives the complicated lock acquisition request that the terminal is sent, and will contain multiple competitive resourcesComplexity lock obtains request and splits into multiple locks acquisition requests containing single competitive resource;Transmission is all to contain single competitive resourceLock obtain successful response.
In the present embodiment, server is multiple monolocks by splitting complicated lock, can be met to the same of multiple competitive resourcesStep operation.
As illustratively, server sends all locks containing single competitive resource to terminal and obtains successful response, canComprise the following steps:
Attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get multiple containing listA lock in the lock of individual competitive resource;
If getting a lock in multiple locks containing single competitive resource, judge all containing single competitive resourceLock whether obtain success;
If all locks containing single competitive resource are obtained successfully, send all containing single competitive resource to terminalLock obtains successfully response;
If all locks containing single competitive resource do not obtain success, continue executing with step attempt obtain it is multiple containingA lock in the lock of single competitive resource, and judge whether to get one in the multiple lock containing single competitive resourceIndividual lock;
If not getting a lock in the multiple lock containing single competitive resource, all got is dischargedLock;
A lock in multiple locks containing single competitive resource is monitored;
If listening to one in the multiple lock containing single competitive resource lock to be released, step is continued executing withAttempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get multiple containing single competition moneyA lock in the lock in source.
Further, if the lock not listened in multiple locks containing single competitive resource has been released, afterIt is continuous that a lock in multiple locks containing single competitive resource is monitored.By the way of lock is monitored, it can improve and taste againExamination obtains the efficiency of lock and saves system resource.
In one embodiment, the realizing for distributed complex lock is additionally operable to when program is performed by the processor 42Realize following steps:
Competitive resource is operated, and discharges all containing single competition in rear sent to the server operatedThe lock request of resource.
In another embodiment, the complicated lock, which obtains request, includes complicated lock effective time.
When the complicated lock that usual server receives terminal obtains request, unblock can be normally carried out.And when the program of terminalWhen operation goes wrong and sends request without normal direction server, server can also be according to the effective time, in lock effective timeDuring arrival, then complexity lock is deleted to discharge the resource of terminal occupancy, other-end is distributed to and uses.
In another embodiment, the realizing for distributed complex lock is also used when program is performed by the processor 42In realizing following steps:
When successfully getting all locks containing single competitive resource, all by acquisition contain single competitive resourceLock share competitive resource.
Terminal provided in an embodiment of the present invention, is multiple monolocks by splitting complicated lock, meets to multiple competitive resourcesSimultaneously operating;The unique lock of each competitive resource correspondence one, reaches while can support different types of competitive resourceOperation;By the way of lock is monitored, improve the efficiency for again attempting to obtain lock and save system resource.
3rd embodiment
As shown in fig. 7, a kind of server that Fig. 7 provides for third embodiment of the invention, the server 50 includes storageDevice 51, processor 52 and the reality for being stored in the distributed complex lock that can be run on the memory 51 and on the processor 52Existing program, the realizing for distributed complex lock realizes following steps when program is performed by the processor 52:
The complicated lock containing multiple competitive resources that receiving terminal is sent obtains request;
Complicated lock of the reception containing multiple competitive resources obtained into request, is split into multiple containing single competitive resourceLock obtains request;
In the present embodiment, it is multiple monolocks by splitting complicated lock, the simultaneously operating to multiple competitive resources can be met.
All locks containing single competitive resource, which are sent, to the terminal obtains successful response.
In one embodiment, the realizing for distributed complex lock is additionally operable to when program is performed by the processor 52Realize following steps:
Attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get the multiple containThere is a lock in the lock of single competitive resource;
If getting a lock in the multiple lock containing single competitive resource, judge all containing single competitionWhether the lock of resource obtains success;If all locks containing single competitive resource are obtained successfully, send all to the terminalLock containing single competitive resource obtains successful response;If all locks containing single competitive resource do not obtain success,Continue executing with step and attempt to obtain a lock in multiple locks containing single competitive resource, and judge whether to get described manyA lock in the individual lock containing single competitive resource;
If not getting a lock in the multiple lock containing single competitive resource, all got is dischargedLock;A lock in the multiple lock containing single competitive resource is monitored, if listening to the multiple containing listA lock in the lock of individual competitive resource has been released, then continues executing with step and attempt to obtain multiple containing single competitive resourceA lock in lock, and judge whether to get one in the multiple lock containing single competitive resource lock.
Further, if the lock not listened in multiple locks containing single competitive resource has been released, afterIt is continuous that a lock in multiple locks containing single competitive resource is monitored.
In the present embodiment, by the way of lock is monitored, the efficiency for again attempting to obtain lock and saving system money can be improvedSource.
In another embodiment, the realizing for distributed complex lock is also used when program is performed by the processor 52In realizing following steps:
Complexity lock, which obtains request, includes complicated lock effective time;Judge whether complicated lock effective time has reached, if complicatedLock effective time has been reached, then deletes complicated lock.
When the complicated lock that usual server receives terminal obtains request, unblock can be normally carried out.And when the program of terminalWhen operation goes wrong and sends request without normal direction server, server can also be according to the effective time, in lock effective timeDuring arrival, then complexity lock is deleted to discharge the resource of terminal occupancy, other-end is distributed to and uses.
Server provided in an embodiment of the present invention, is multiple monolocks by splitting complicated lock, meets to multiple competitive resourcesSimultaneously operating;The unique lock of each competitive resource correspondence one, the same of different types of competitive resource can be supported by reachingWhen operate;By the way of lock is monitored, improve the efficiency for again attempting to obtain lock and save system resource.
Fourth embodiment
Fourth embodiment of the embodiment of the present invention provides a kind of computer-readable recording medium, the computer-readable storage mediumWhat the distributed complex that is stored with matter was locked realizes program, and the realizing for distributed complex lock is realized when program is executed by processorThe step of implementation method of distributed complex lock described in first embodiment.
Computer-readable recording medium provided in an embodiment of the present invention, is multiple monolocks, satisfaction pair by splitting complicated lockThe simultaneously operating of multiple competitive resources;The unique lock of each competitive resource correspondence one, reaching can support different types ofOperated while competitive resource;By the way of lock is monitored, improve the efficiency for again attempting to obtain lock and save system resource.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-rowHis property is included, so that process, method, article or device including a series of key elements not only include those key elements, andAnd also including other key elements being not expressly set out, or also include for this process, method, article or device institute inherentlyKey element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including thisAlso there is other identical element in process, method, article or the device of key element.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment sideMethod can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many casesThe former is more preferably embodiment.Understood based on such, technical scheme is substantially done to prior art in other wordsGoing out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage mediumIn (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal (can be mobile phone, computer, serviceDevice, air conditioner, or network equipment etc.) perform method described in each of the invention embodiment.
Embodiments of the invention are described above in conjunction with accompanying drawing, but the invention is not limited in above-mentioned specificEmbodiment, above-mentioned embodiment is only schematical, rather than restricted, one of ordinary skill in the artUnder the enlightenment of the present invention, in the case of present inventive concept and scope of the claimed protection is not departed from, it can also make a lotForm, these are belonged within the protection of the present invention.

Claims (10)

CN201710287547.8A2017-04-272017-04-27Implementation method, terminal, server and the computer-readable recording medium of distributed complex lockPendingCN107133108A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710287547.8ACN107133108A (en)2017-04-272017-04-27Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710287547.8ACN107133108A (en)2017-04-272017-04-27Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock

Publications (1)

Publication NumberPublication Date
CN107133108Atrue CN107133108A (en)2017-09-05

Family

ID=59716392

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710287547.8APendingCN107133108A (en)2017-04-272017-04-27Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock

Country Status (1)

CountryLink
CN (1)CN107133108A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108089926A (en)*2018-01-082018-05-29马上消费金融股份有限公司Method, device and equipment for acquiring distributed lock and readable storage medium
CN111124697A (en)*2020-01-022020-05-08中国航空工业集团公司西安航空计算技术研究所Task synchronization and execution method facing distributed platform
CN111163140A (en)*2019-12-202020-05-15深圳市中农易讯信息技术有限公司Method, apparatus and computer readable storage medium for resource acquisition and allocation
CN114218237A (en)*2021-12-072022-03-22中信银行股份有限公司Data center access application method and system based on extensible distributed lock

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2009002686A1 (en)*2007-06-272008-12-31Microsoft CorporationHybrid resource manager
CN105573823A (en)*2014-10-092016-05-11阿里巴巴集团控股有限公司Resource locking method and device
CN106354565A (en)*2016-09-212017-01-25努比亚技术有限公司Distributed lock client and control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2009002686A1 (en)*2007-06-272008-12-31Microsoft CorporationHybrid resource manager
CN105573823A (en)*2014-10-092016-05-11阿里巴巴集团控股有限公司Resource locking method and device
CN106354565A (en)*2016-09-212017-01-25努比亚技术有限公司Distributed lock client and control method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108089926A (en)*2018-01-082018-05-29马上消费金融股份有限公司Method, device and equipment for acquiring distributed lock and readable storage medium
CN111163140A (en)*2019-12-202020-05-15深圳市中农易讯信息技术有限公司Method, apparatus and computer readable storage medium for resource acquisition and allocation
CN111124697A (en)*2020-01-022020-05-08中国航空工业集团公司西安航空计算技术研究所Task synchronization and execution method facing distributed platform
CN111124697B (en)*2020-01-022023-09-08中国航空工业集团公司西安航空计算技术研究所Task synchronization and execution method for distributed platform
CN114218237A (en)*2021-12-072022-03-22中信银行股份有限公司Data center access application method and system based on extensible distributed lock

Similar Documents

PublicationPublication DateTitle
CN107133092A (en)Multi-thread synchronization processing method, terminal and computer-readable recording medium
CN106961706A (en)Method, mobile terminal and the computer-readable recording medium of communication pattern switching
CN107436779A (en)A kind of application management method, equipment and computer-readable recording medium
CN108052302A (en)Association display methods, terminal and the computer readable storage medium of double-sided screen
CN107343083A (en)One kind lifting game experiencing method, apparatus and computer-readable recording medium
CN107329682A (en)Edge exchange method and mobile terminal
CN107181700A (en)Control method, mobile terminal and the storage medium of application program for mobile terminal
CN107133302A (en)Realize method, system, terminal and the computer-readable recording medium of data consistency
CN106953684A (en)A kind of method for searching star, mobile terminal and computer-readable recording medium
CN106953989A (en)Incoming call reminding method and device, terminal, computer-readable recording medium
CN107181865A (en)Processing method, terminal and the computer-readable recording medium of unread short messages
CN107580350A (en)A kind of signal intensity switching method, equipment and computer-readable recording medium
CN107360558A (en)Emergency call control method, communication terminal and computer-readable recording medium
CN107124466A (en)One kind prevents caching penetrating method and device, computer-readable recording medium
CN107133151A (en)A kind of daily record data processing method, equipment and computer-readable recording medium
CN107172605A (en)A kind of Emmergency call method, mobile terminal and computer-readable recording medium
CN107133108A (en)Implementation method, terminal, server and the computer-readable recording medium of distributed complex lock
CN107896287A (en)Phone number risk monitoring method and mobile terminal
CN107124428A (en)A kind of method, equipment and the storage medium of raising VoLTE call successful rates
CN107390856A (en)A kind of method, mobile terminal and storage medium for reducing mobile terminal power consumption
CN109445945A (en)Memory allocation method, mobile terminal, server and the storage medium of application program
CN107241489A (en)A kind of method of calling, mobile terminal and computer-readable recording medium
CN107368241A (en)A kind of information processing method, equipment and computer-readable recording medium
CN107480003A (en)A kind of method, equipment and the computer-readable recording medium of backup radio frequency parameter
CN107659726A (en)A kind of method, equipment and computer-readable recording medium for recovering end message

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20170905


[8]ページ先頭

©2009-2025 Movatter.jp