CN107145582A - The control method and Database Systems of database cursor - Google Patents

The control method and Database Systems of database cursor Download PDF

Info

Publication number
CN107145582A
CN107145582A CN201710323310.0A CN201710323310A CN107145582A CN 107145582 A CN107145582 A CN 107145582A CN 201710323310 A CN201710323310 A CN 201710323310A CN 107145582 A CN107145582 A CN 107145582A
Authority
CN
China
Prior art keywords
vernier
database
activated
release
memory
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
CN201710323310.0A
Other languages
Chinese (zh)
Other versions
CN107145582B (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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201710323310.0A priority Critical patent/CN107145582B/en
Publication of CN107145582A publication Critical patent/CN107145582A/en
Application granted granted Critical
Publication of CN107145582B publication Critical patent/CN107145582B/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/21Design, administration or maintenance of databases
    • G06F16/217Database tuning

Abstract

The invention discloses a kind of control method of database cursor and Database Systems, the control method of the database cursor includes:When detecting database activation vernier, the vernier and its vernier rank of activation are recorded, to obtain all sorted lists for having activated vernier;When detecting the low level vernier for existing in sorted lists and having activated and having left unused, the memory source that release low level vernier takes.The present invention closes vernier in internal memory inadequate resource, according to vernier rank and carries out resource release, effectively solves RAM leakage caused by database cursor.

Description

The control method and Database Systems of database cursor
Technical field
The present invention relates to the control method and data base set of database technical field, more particularly to a kind of database cursor System.
Background technology
In Database Systems, it is frequently present of irretrievable memory source or the memory source used is excessive, make It is fewer and fewer into the free memory in system, cause system operation not smooth.
Vernier would generally be applied in Database Systems, is not closed in time after vernier is cited, easily in increase Spilling probability is deposited, can so cause system operation more and more slower, until the machine of delaying.Current RAM leakage instrument is typically examined using internal memory The static memory mistake that tool analysis goes out system is looked into, but can not in real time monitor and close vernier, this will cause Database Systems to exist When there is the situation of memory source deficiency, interim card, machine of delaying even system crash can occur because lacking internal memory operation resource in system The problems such as.
The content of the invention
It is a primary object of the present invention to provide the control method and Database Systems of a kind of database cursor, it is intended to solve Database Systems system memory resource caused by vernier is not turned off is not enough, the technical problem for causing system not run normally.
To achieve the above object, the embodiment of the present invention provides a kind of control method of database cursor, and the vernier is set There is vernier rank, including low level vernier, the control method of the database cursor includes:
When detecting database activation vernier, the vernier and its vernier rank of activation are recorded, to obtain all activated The sorted lists of vernier;
When detecting the low level vernier for existing in sorted lists and having activated and having left unused, release low level vernier takes Memory source.
Alternatively, it is described when detecting the low level vernier for existing in sorted lists and having activated and having left unused, discharge rudimentary Also include after the step of memory source that other vernier takes:
The freememory resource of current database system is counted, to obtain corresponding statistical parameter;
When detecting statistical parameter less than predetermined threshold value, all internal memories for having activated vernier occupancy in release sorted lists Resource.
Alternatively, it is described when detecting statistical parameter less than predetermined threshold value, it is all in release sorted lists to have activated trip Also include after the step of marking the memory source taken:
All event informations of this releasing memory resource are stored, using the foundation optimized as memory source.
Alternatively, it is described when detecting statistical parameter less than predetermined threshold value, it is all in the release sorted lists to have swashed The step of memory source that vernier living takes, includes:
When detecting statistical parameter less than predetermined threshold value, activation verniers all in current sorted lists are shown, with For user's selection;
The pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
Alternatively, it is described when detecting statistical parameter less than predetermined threshold value, it is all in the release sorted lists to have swashed The step of memory source that vernier living takes, includes:
When detecting statistical parameter less than predetermined threshold value, all memory sources for having activated vernier in sorted lists are obtained Release authority;
When detect release authority fail release it is all activated vernier occupancy memory source when, force obtain number According to the highest authority of storehouse system;
All memory sources for having activated vernier occupancy are discharged based on highest authority.
In addition, to achieve the above object, the present invention is also provided to be provided with a kind of Database Systems, the Database Systems Vernier, and the vernier is provided with vernier rank, including low level vernier, the Database Systems include:
Logging modle, for when detecting database activation vernier, the vernier and its vernier rank of activation being recorded, to obtain The sorted lists of vernier all must be activated;
First release module, for when detecting in sorted lists in the presence of the low level vernier for having activated and having left unused, releasing Lower the memory source of rank vernier occupancy.
Alternatively, the Database Systems also include:
Statistical module, the freememory resource for counting current database system, to obtain corresponding statistical parameter;
Second release module, for when detect statistical parameter less than predetermined threshold value when, release sorted lists in it is all Activate the memory source that vernier takes.
Alternatively, the Database Systems also include:
Memory module, all event informations for storing this releasing memory resource, using what is optimized as memory source Foundation.
Alternatively, second release module includes:
Display unit, for when detecting statistical parameter less than predetermined threshold value, showing all in current sorted lists Vernier is activated, so that user selects;
First releasing unit, for the pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
Alternatively, second release module includes:
Acquiring unit, for when detecting statistical parameter less than predetermined threshold value, obtaining all in sorted lists activated The release authority of the memory source of vernier;
Permission unit, all memory sources for having activated vernier occupancy are discharged for working as to detect release authority and fail When, force to obtain the highest authority of Database Systems;
Second releasing unit, for discharging all memory sources for having activated vernier occupancy based on highest authority.
In technical scheme, when detecting database activation vernier, the vernier and its vernier level of activation are recorded Not, to obtain all sorted lists for having activated vernier;There is the low level that has activated and left unused in sorted lists when detecting During vernier, the memory source that release low level vernier takes.The present invention uses the side of Real-time Monitoring Data storehouse vernier use state Formula, in internal memory inadequate resource, closes vernier according to vernier rank and carries out resource release, it is to avoid vernier takes excessive interior in itself Deposit resource and cause the problems such as system is due to not enough internal memory paralysis, interim card, deadlock, effectively solving database cursor causes RAM leakage.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the control method first embodiment of database cursor of the present invention;
Fig. 2 is the schematic flow sheet of the control method second embodiment of database cursor of the present invention;
Fig. 3 is the schematic flow sheet of the control method 3rd embodiment of database cursor of the present invention;
Fig. 4 for database cursor of the present invention control method fourth embodiment described in when detect statistical parameter be less than in advance If during threshold value, the refinement flow for the step of discharging the step of all memory sources for having activated vernier occupancy in the sorted lists Schematic diagram;
Fig. 5 for database cursor of the present invention the embodiment of control method the 5th described in when detect statistical parameter be less than in advance If during threshold value, the refinement flow for the step of discharging the step of all memory sources for having activated vernier occupancy in the sorted lists Schematic diagram;
Fig. 6 is the module diagram of Database Systems first embodiment of the present invention;
Fig. 7 is the module diagram of Database Systems second embodiment of the present invention;
Fig. 8 is the module diagram of Database Systems 3rd embodiment of the present invention;
Fig. 9 is the refinement module schematic diagram of the second release module in Database Systems fourth embodiment of the present invention;
Figure 10 is the refinement module schematic diagram of the second release module in the embodiment of Database Systems the 5th of the present invention.
The realization, functional characteristics and advantage of the object of the invention will in conjunction with the embodiments, and refer to the attached drawing is described further.
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.
Describe to realize the Database Systems of each embodiment of the invention referring now to accompanying drawing.In follow-up description, make With the suffix of such as " module ", " part " or " unit " for representing element only for being conducive to the explanation of the present invention, its Body does not have specific meaning.Therefore, " module " can be used mixedly with " part ".
The vernier is that Database Systems are the data buffer zone that user opens up, and storage database performs holding for sentence Row result.In Database Systems, vernier can realize object reference by opening or closing.Pass through the use of vernier, data Storehouse system conveniently can must get the specific data record that vernier is be mapped to.And Database Systems are in actual use, After terminating to the use of vernier, even if the vernier is no longer called, during system asynchronous processing, often mistakes and omissions Some verniers, make it not be called, and but keep state of activation, take certain system memory resource, have influence on Database Systems Normal operation.
With reference to Fig. 1, the present invention provides a kind of control method of database cursor, and the control method of the database cursor is main Applied in Database Systems, in the control method first embodiment of database cursor, the vernier is provided with vernier rank, Including low level vernier, the control method of the database cursor includes:
Step S10, when detecting database activation vernier, records the vernier and its vernier rank of activation, to obtain There are the sorted lists for having activated vernier;
Database Systems are among normal operation, the vernier needed for meeting dynamic call, whenever Database Systems activate vernier When, the database cursor being activated is recorded, its vernier rank is recorded, all sorted lists for having activated vernier are obtained.
The vernier rank, refers to the presence rank of vernier in itself, and the height of rank means vernier to data base set The influence degree of the application of function of system.For example, A verniers belong to system-level vernier, the execution of its efficacy is to Database Systems Normal operation play critical effect, then A verniers are high-level vernier;And B verniers belong to common vernier, its function Normal operation of the execution of effectiveness to Database Systems is almost had no effect, only as buffered data or the medium of ephemeral data, It can easily reproduce and executory cost is humble, then B verniers are low level vernier.
In general, the list is used to preserve all activated database cursor object set.Assuming that the state hair of vernier Give birth to and change, such as being released or occur exception during phenomenon, Database Systems understand real-time tracing to the vernier, and according to vernier The state real-time update or editor's sorted lists of itself, for example, inquired about corresponding vernier in sorted lists, inserted, deleted Deng operation, sorted lists are safeguarded with this.
Step S20, when detecting the low level vernier for existing in sorted lists and having activated and having left unused, release low level trip Mark the memory source taken.
To prevent vernier from taking memory source excessive in Database Systems, it is necessary to monitor sorted lists in real time, for example, exist When one section of prefixed time interval, the active state of all verniers in detection sorted lists.Wherein, prefixed time interval can be with It is the default value of acquiescence or the specific data of artificial self-defined generation, such as 5 seconds, 10 seconds etc..The different shapes of vernier There are different use meanings in state, be then not present, be such as activated when vernier is closed, then be likely to be at called state, also may be used Can be in unloaded idle state.
In Database Systems, vernier can be by the available process or thread activation in Database Systems, and in activation Application is transferred by calling main body (can be process or thread) afterwards.And after vernier is activated, the vernier being active It can be transferred by it and enter application state, now, the vernier can occupy considerable degree of system memory resource, to be held as vernier The running space of its function of row.And when the process or thread dispatching are finished, the vernier will not be re-used as the need of funcall Object is sought, vernier now is in idle state, if not being turned off, the vernier being active remains unchanged and can occupy part Memory source.
In above-described vernier state, the vernier being active can occupy system resource, but wherein, in activation And the vernier of called state is currently being used, if stopping by force, may influence whether the normal execution of current database system. And its efficacy is not played under activation and vernier the present situation of idle state, but consume the internal memory of system in itself Resource, easily has influence on the normal operation of Database Systems.Therefore need to arrange the vernier in activation and idle state Look into.In the present embodiment, the vernier of idle state is active and is in simultaneously in detection sorted lists, and according to it Vernier rank, only filters out low level vernier.Because low level vernier does not interfere with the normal operation of Database Systems in itself. Only simultaneously meet activated, left unused, the vernier of three kinds of conditions of low level, be only the present embodiment perform timing detection screening pair As.
If detected in sorted lists at the same meet activated, left unused, the vernier of the big condition of low level three, be this reality Apply the detection object that example to be carried out resource release.Because now the vernier is in idle state, therefore process or line need not be released The operation of the Cheng Zhanyong verniers, can directly discharge its shared memory source under activation and idle state.
Although it should be noted that low level vernier under activation and idle state and being not called upon performing its work( Efficiency is used, but itself is still in state to be called, and the main body that can be called at any time (can be process or thread) is re-called, Therefore the vernier object remains unchanged to remain and connect with the data of the data-interface of calling main body and other objects for realizing its function Mouthful, and the realization of data-interface is accomplished by consumption and occupies system memory resource in itself.This partial memory resource is left unused in vernier In the case of it is still occupied and be not released, system memory resource can substantially utilize by being discharged, and improve interior The application efficiency of resource is deposited, the problems such as preventing memory source deficiency and then not smooth system operation, interim card occur.
Preferably, the vernier being largely active is saved in sorted lists, after low level vernier is released, Need the low level vernier being removed from the list.Assuming that not deleted, the trip of state of activation had both been saved in list Mark also saves the vernier being released, and the vernier being released has no use in sorted lists.The present embodiment institute It is accomplished that the cleaning to the vernier of state of activation discharges, treatment mechanism is had no for the vernier discharged.Therefore released The vernier bled off needs to carry out cleaning deletion, to improve the operating efficiency of vernier detection and inquiry.Simultaneously, it is assumed that do not delete and released The vernier bled off, then with the growth of Database Systems run time, the record for being released vernier can be more and more, that is, arrange The memory source that sequence table takes in itself can also increase, and the normal operation of Database Systems is had influence on after other side.
In technical scheme, when detecting database activation vernier, the vernier and its vernier level of activation are recorded Not, to obtain all sorted lists for having activated vernier;There is the low level that has activated and left unused in sorted lists when detecting During vernier, the memory source that release low level vernier takes.The present invention uses the side of Real-time Monitoring Data storehouse vernier use state Formula, in internal memory inadequate resource, closes vernier according to vernier rank and carries out resource release, it is to avoid vernier takes excessive interior in itself Deposit resource and cause the problems such as system is due to not enough internal memory paralysis, interim card, deadlock, effectively solving database cursor causes RAM leakage.The present invention is by the way of the vernier use state of Real-time Monitoring Data storehouse, in internal memory inadequate resource, according to trip Mark rank and close vernier progress resource release, it is to avoid vernier takes excessive memory source and causes system due to no foot in itself Enough internal memory paralysis, interim card, the problems such as crash, effectively solve RAM leakage caused by database cursor.
Further, on the basis of the control method first embodiment of database cursor of the present invention, database trip is proposed Target control method second embodiment, with reference to Fig. 2, the difference between the second embodiment and first embodiment is, described When detecting the low level vernier for existing in sorted lists and having activated and having left unused, the memory source that release low level vernier takes The step of after also include:
Step S30, counts the freememory resource of current database system, to obtain corresponding statistical parameter;
The freememory resource, is referred in Database Systems, is currently at idle state, and be not called upon it is interior Deposit resource.In general, system resource is except the memory source being called is, it is necessary to which the idle memory source in part is used as follow-up work( The default resource being called when can perform.Inquiry is obtained after the memory source in idle state, due to the storage of memory source Mode is not necessarily connection, the memory source that there may be segmentation and regionalization form, it is therefore desirable to be in idle state to all Memory source counted, to obtain corresponding statistical parameter.The statistical parameter refers to that this is in the interior of idle state Deposit the residual capacity of resource.
Step S40, when detecting statistical parameter less than predetermined threshold value, all verniers that activated are accounted in release sorted lists Memory source.
In the present embodiment, Database Systems are provided with a predetermined threshold value, and the predetermined threshold value is used as the one of statistical parameter Individual boundary reference numerical value, what the numerical value was referred to be the residual capacity of the memory source in idle state in Database Systems most Threshold ones.When the obtained statistical parameter of statistics is less than the predetermined threshold value, then prove to be used as buffering in Database Systems The memory source of idle state has reached minimum threshold, if the memory source without new idle state is used as supplement, data In the moment not smooth or even system crash the edge of operation will occur for storehouse system.Therefore, now need in sorted lists to own The memory source shared by vernier being active all is discharged, and is provided with the freememory for expanding current database system Source.Certainly, high-level vernier is there may be in all verniers of activation, operation interim card occurs to prevent Database Systems The extreme case even collapsed, high-level vernier is also required to discharge simultaneously.
Further, on the basis of the control method second embodiment of database cursor of the present invention, database trip is proposed Target control method 3rd embodiment, with reference to Fig. 3, the difference between the 3rd embodiment and second embodiment is, described When detecting statistical parameter less than predetermined threshold value, the step of all memory sources for having activated vernier occupancy in release sorted lists Also include after rapid:
Step S50, stores all event informations of this releasing memory resource, using the foundation optimized as memory source.
In the present embodiment, after system resource release is completed, the residual capacity of freememory resource can increase, because it is Activate what is obtained after vernier release.Therefore all event informations for participating in releasing memory resource in this subjob can be stored (the vernier object being released is contained, and each vernier object is released in which step, and the vernier is released Bleed off the information such as discharged memory source).In these message reflections Database Systems vernier be activated but not and When the technical problem closed, expose unreasonable in the system design problem of Database Systems, such as logical design from side, or It is unreasonable etc. that operation principle is realized.According to these technical problems, system operators or designer can be targeted Ground is analyzed and processed, and to eliminate the irrational use of system vernier, realizes effective optimization of memory source.
Further, on the basis of the control method 3rd embodiment of database cursor of the present invention, database trip is proposed Target control method fourth embodiment, with reference to Fig. 4, the difference between the fourth embodiment and 3rd embodiment is, described When detecting statistical parameter less than predetermined threshold value, all memory sources for having activated vernier occupancy in the sorted lists are discharged The step of include:
Step S41, when detecting statistical parameter less than predetermined threshold value, shows activation all in current sorted lists Vernier, so that user selects;
Step S42, the pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
When statistical parameter is less than predetermined threshold value, then needs to discharge and all activated vernier.But, if user wants to be directed to Property discharge part and activated vernier, and part vernier is retained and performed.For example, all verniers that activated include A, B, C tri- Vernier, now statistical parameter be less than predetermined threshold value, need under normal flow to discharge A, B, tri- verniers of C, but user and merely desire to release Fall B, C verniers and retain A verniers.Now, Database Systems can provide a display interface, show institute in current sorted lists The activation vernier having, and the edit mode that selection has activated vernier is provided, so that user selects.User passes through editor, selection Go out to preselect vernier, be used as the real vernier object for performing release function.According to pre-selection vernier, Database Systems swim the pre-selection The memory source that mark takes is discharged.
Further, on the basis of the control method second embodiment of database cursor of the present invention, database trip is proposed The embodiment of target control method the 5th, with reference to Fig. 5, the difference between the 5th embodiment and second embodiment is, described When detecting statistical parameter less than predetermined threshold value, all memory sources for having activated vernier occupancy in the sorted lists are discharged The step of include:
Step S43, when detecting statistical parameter less than predetermined threshold value, obtains all verniers that activated in sorted lists The release authority of memory source;
Step S44, when detect release authority fail release it is all activated vernier occupancy memory source when, by force System obtains the highest authority of Database Systems;
Step S45, all memory sources for having activated vernier occupancy are discharged based on highest authority.
In Database Systems, to discharge vernier needs certain operating right, and the acquisition of release authority is potentially based on Current database system account.In reality scene, it is possible that the phenomenon of some verniers can not be discharged.Wherein, Ke Nengcun It is abnormal in vernier processing, or vernier is in the medium reason of guard mode.Now need to get specific vernier release authority, and Release operation is carried out based on release authority.But, when authority acquiring request can not get the release authority for having activated vernier, Then prove with current operating right, it is impossible to complete to have activated the release operation of vernier.It can now force to get data base set The highest authority of system.And highest authority then means that the every operation step of current database system can all not hinder execution.Together The reason of sample, possesses highest authority and is meant to not hinder all memory sources for having activated Europe superscript of release.Based on the highest Authority, Database Systems can normally perform all memory sources activated shared by vernier.
Certainly, the present embodiment can complement each other with fourth embodiment, obtain system highest authority to discharge vernier occupancy The embodiment of memory source selects the mutual not contradiction of the embodiment for the vernier to be discharged with User Defined, and the two can mutually be tied Close, to form the optimal technical scheme that different embodiments of the invention solve the problem of system memory resource is not enough.
With reference to Fig. 6, the present invention also provides a kind of Database Systems, in Database Systems first embodiment, the data Vernier is provided with the system of storehouse, and the vernier is provided with vernier rank, including low level vernier, the Database Systems Including:
Logging modle 10, for when detecting database activation vernier, recording the vernier and its vernier rank of activation, with Obtain all sorted lists for having activated vernier;
Database Systems are among normal operation, the vernier needed for meeting dynamic call, whenever Database Systems activate vernier When, logging modle 10 records the database cursor being activated, and records its vernier rank, obtains all Sorted lists for having activated vernier Table.
The vernier rank, refers to the presence rank of vernier in itself, and the height of rank means vernier to data base set The influence degree of the application of function of system.For example, A verniers belong to system-level vernier, the execution of its efficacy is to Database Systems Normal operation play critical effect, then A verniers are high-level vernier;And B verniers belong to common vernier, its function Normal operation of the execution of effectiveness to Database Systems is almost had no effect, only as buffered data or the medium of ephemeral data, It can easily reproduce and executory cost is humble, then B verniers are low level vernier.
In general, the list is used to preserve all activated database cursor object set.Assuming that the state hair of vernier Give birth to and change, such as being released or occur exception during phenomenon, Database Systems understand real-time tracing to the vernier, and according to vernier The state real-time update or editor's sorted lists of itself, for example, inquired about corresponding vernier in sorted lists, inserted, deleted Deng operation, sorted lists are safeguarded with this.
First release module 20, for when detect in sorted lists exist activated and leave unused low level vernier when, Discharge the memory source that low level vernier takes.
To prevent vernier from taking memory source excessive in Database Systems, the first release module 20 monitors Sorted list in real time Table, such as when every one section of prefixed time interval, the active state of all verniers in detection sorted lists.Wherein, when presetting Between interval can be the default value of acquiescence or the specific data of artificial self-defined generation, such as 5 seconds, 10 seconds etc..Trip There are different use meanings in target different conditions, be then not present, be such as activated when vernier is closed, then be likely to be at called State, it is also possible in unloaded idle state.
In Database Systems, vernier can be by the available process or thread activation in Database Systems, and in activation Application is transferred by calling main body (can be process or thread) afterwards.And after vernier is activated, the vernier being active It can be transferred by it and enter application state, now, the vernier can occupy considerable degree of system memory resource, to be held as vernier The running space of its function of row.And when the process or thread dispatching are finished, the vernier will not be re-used as the need of funcall Object is sought, vernier now is in idle state, if not being turned off, the vernier being active remains unchanged and can occupy part Memory source.
In above-described vernier state, the vernier being active can occupy system resource, but wherein, in activation And the vernier of called state is currently being used, if stopping by force, may influence whether the normal execution of current database system. And its efficacy is not played under activation and vernier the present situation of idle state, but consume the internal memory of system in itself Resource, easily has influence on the normal operation of Database Systems.Therefore need to arrange the vernier in activation and idle state Look into.In the present embodiment, it is active in the first release module 20 detection sorted lists and is in idle state simultaneously Vernier, and according to its vernier rank, only filter out low level vernier.Because low level vernier does not interfere with Database Systems The normal operation of itself.Only simultaneously meet activated, left unused, the vernier of three kinds of conditions of low level, be only the present embodiment execution The screening object of timing detection.
If detected in sorted lists at the same meet activated, left unused, the vernier of the big condition of low level three, be this reality Apply the detection object that example to be carried out resource release.Because now the vernier is in idle state, therefore process or line need not be released The operation of the Cheng Zhanyong verniers, can directly discharge its shared memory source under activation and idle state.
Although it should be noted that low level vernier under activation and idle state and being not called upon performing its work( Efficiency is used, but itself is still in state to be called, and the main body that can be called at any time (can be process or thread) is re-called, Therefore the vernier object remains unchanged to remain and connect with the data of the data-interface of calling main body and other objects for realizing its function Mouthful, and the realization of data-interface is accomplished by consumption and occupies system memory resource in itself.This partial memory resource is left unused in vernier In the case of it is still occupied and be not released, system memory resource can substantially utilize by being discharged, and improve interior The application efficiency of resource is deposited, the problems such as preventing memory source deficiency and then not smooth system operation, interim card occur.
Preferably, the vernier being largely active is saved in sorted lists, after low level vernier is released, Need the low level vernier being removed from the list.Assuming that not deleted, the trip of state of activation had both been saved in list Mark also saves the vernier being released, and the vernier being released has no use in sorted lists.The present embodiment institute It is accomplished that the cleaning to the vernier of state of activation discharges, treatment mechanism is had no for the vernier discharged.Therefore released The vernier bled off needs to carry out cleaning deletion, to improve the operating efficiency of vernier detection and inquiry.Simultaneously, it is assumed that do not delete and released The vernier bled off, then with the growth of Database Systems run time, the record for being released vernier can be more and more, that is, arrange The memory source that sequence table takes in itself can also increase, and the normal operation of Database Systems is had influence on after other side.
In technical scheme, when logging modle 10 detects database activation vernier, the vernier of activation is recorded And its vernier rank, to obtain all sorted lists for having activated vernier;When the first release module 20 is detected in sorted lists During in the presence of the low level vernier for having activated and having left unused, the memory source that release low level vernier takes.The present invention is using prison in real time The mode of database cursor use state is surveyed, in internal memory inadequate resource, vernier is closed according to vernier rank and carries out resource release, Vernier is avoided to take excessive memory source in itself and cause system to be asked due to not enough internal memory paralysis, interim card, deadlock etc. Topic, effectively solves RAM leakage caused by database cursor.The present invention uses the side of Real-time Monitoring Data storehouse vernier use state Formula, in internal memory inadequate resource, closes vernier according to vernier rank and carries out resource release, it is to avoid vernier takes excessive interior in itself Deposit resource and cause the problems such as system is due to not enough internal memory paralysis, interim card, deadlock, effectively solving database cursor causes RAM leakage.
Further, on the basis of Database Systems first embodiment of the present invention, propose that Database Systems second are implemented Example, with reference to Fig. 7, the difference between the second embodiment and first embodiment is that the Database Systems also include:
Statistical module 30, the freememory resource for counting current database system, to obtain corresponding statistical parameter;
The freememory resource, is referred in Database Systems, is currently at idle state, and be not called upon it is interior Deposit resource.In general, system resource is except the memory source being called is, it is necessary to which the idle memory source in part is used as follow-up work( The default resource being called when can perform.Statistical module 50, which can be inquired about, gets the memory source in idle state, due to interior The storage mode for depositing resource is not necessarily connection, the memory source that there may be segmentation and regionalization form, it is therefore desirable to all Memory source in idle state is counted, to obtain corresponding statistical parameter.The statistical parameter refers to that this is in The residual capacity of the memory source of idle state.
Second release module 40, for when detecting statistical parameter less than predetermined threshold value, owning in release sorted lists The memory source of vernier occupancy is activated.
In the present embodiment, Database Systems are provided with a predetermined threshold value, and the predetermined threshold value is used as the one of statistical parameter Individual boundary reference numerical value, what the numerical value was referred to be the residual capacity of the memory source in idle state in Database Systems most Threshold ones.When the obtained statistical parameter of statistics is less than the predetermined threshold value, then prove to be used as buffering in Database Systems The memory source of idle state has reached minimum threshold, if the memory source without new idle state is used as supplement, data In the moment not smooth or even system crash the edge of operation will occur for storehouse system.Therefore, now need in sorted lists to own The memory source shared by vernier being active all is discharged, and is provided with the freememory for expanding current database system Source.Certainly, high-level vernier is there may be in all verniers of activation, operation interim card occurs to prevent Database Systems The extreme case even collapsed, high-level vernier is also required to discharge simultaneously.
Further, on the basis of Database Systems second embodiment of the present invention, propose that Database Systems the 3rd are implemented Example, with reference to Fig. 8, the difference between the 3rd embodiment and second embodiment is that the Database Systems also include:
Memory module 50, all event informations for storing this releasing memory resource, to optimize as memory source Foundation.
In the present embodiment, after system resource release is completed, the residual capacity of freememory resource can increase, because it is Activate what is obtained after vernier release.Therefore all event informations for participating in releasing memory resource in this subjob can be stored (the vernier object being released is contained, and each vernier object is released in which step, and the vernier is released Bleed off the information such as discharged memory source).In these message reflections Database Systems vernier be activated but not and When the technical problem closed, expose unreasonable in the system design problem of Database Systems, such as logical design from side, or It is unreasonable etc. that operation principle is realized.According to these technical problems, system operators or designer can be targeted Ground is analyzed and processed, and to eliminate the irrational use of system vernier, realizes effective optimization of memory source.
Further, on the basis of Database Systems 3rd embodiment of the present invention, propose that Database Systems the 4th are implemented Example, with reference to Fig. 9, the difference between the fourth embodiment and 3rd embodiment is, second release module 40 includes:
Display unit 41, for when detecting statistical parameter less than predetermined threshold value, showing in current sorted lists and owning Activation vernier, for user select;
First releasing unit 42, for the pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
When statistical parameter is less than predetermined threshold value, then needs to discharge and all activated vernier.But, if user wants to be directed to Property discharge part and activated vernier, and part vernier is retained and performed.For example, all verniers that activated include A, B, C tri- Vernier, now statistical parameter be less than predetermined threshold value, need under normal flow to discharge A, B, tri- verniers of C, but user and merely desire to release Fall B, C verniers and retain A verniers.Now, Database Systems can provide a display interface, show institute in current sorted lists The activation vernier having, and the edit mode that selection has activated vernier is provided, so that user selects.User passes through editor, selection Go out to preselect vernier, be used as the real vernier object for performing release function.According to pre-selection vernier, Database Systems swim the pre-selection The memory source that mark takes is discharged.
Further, on the basis of Database Systems first embodiment of the present invention, propose that Database Systems the 5th are implemented Example, with reference to Figure 10, the difference between the 5th embodiment and first embodiment is that second release module 40 includes:
Acquiring unit 43, it is all in acquisition sorted lists to have swashed for when detecting statistical parameter less than predetermined threshold value The release authority of the memory source of vernier living;
Permission unit 44, all internal memories moneys for having activated vernier occupancy are discharged for working as to detect release authority and fail During source, force to obtain the highest authority of Database Systems;
Second releasing unit 45, for discharging all memory sources for having activated vernier occupancy based on highest authority.
In Database Systems, to discharge vernier needs certain operating right, and the acquisition of release authority is potentially based on Current database system account.In reality scene, it is possible that the phenomenon of some verniers can not be discharged.Wherein, Ke Nengcun It is abnormal in vernier processing, or vernier is in the medium reason of guard mode.Now need to get specific vernier release authority, and Release operation is carried out based on release authority.But, when authority acquiring request can not get the release authority for having activated vernier, Then prove with current operating right, it is impossible to complete to have activated the release operation of vernier.It can now force to get data base set The highest authority of system.And highest authority then means that the every operation step of current database system can all not hinder execution.Together The reason of sample, possesses highest authority and is meant to not hinder all memory sources for having activated Europe superscript of release.Based on the highest Authority, Database Systems can normally perform all memory sources activated shared by vernier.
Certainly, the present embodiment can complement each other with fourth embodiment, obtain system highest authority to discharge vernier occupancy The embodiment of memory source selects the mutual not contradiction of the embodiment for the vernier to be discharged with User Defined, and the two can mutually be tied Close, to form the optimal technical scheme that different embodiments of the invention solve the problem of system memory resource is not enough.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and And also including other key elements being not expressly set out, or also include for this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also 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 side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Understood based on such, technical scheme is substantially done to prior art in other words Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be mobile phone, computer, clothes It is engaged in device, air conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of control method of database cursor, it is characterised in that the vernier is provided with vernier rank, including rudimentary Other vernier, the control method of the database cursor includes:
When detecting database activation vernier, the vernier and its vernier rank of activation are recorded, all vernier has been activated to obtain Sorted lists;
When detecting the low level vernier for existing in sorted lists and having activated and having left unused, the internal memory that release low level vernier takes Resource.
2. the control method of database cursor as claimed in claim 1, it is characterised in that
It is described when detecting the low level vernier for existing in sorted lists and having activated and having left unused, release low level vernier takes Also include after the step of memory source:
The freememory resource of current database system is counted, to obtain corresponding statistical parameter;
When detecting statistical parameter less than predetermined threshold value, all internal memory moneys for having activated vernier occupancy in release sorted lists Source.
3. the control method of database cursor as claimed in claim 2, it is characterised in that
It is described when detect statistical parameter less than predetermined threshold value when, release sorted lists in it is all activated vernier occupancy internal memories Also include after the step of resource:
All event informations of this releasing memory resource are stored, using the foundation optimized as memory source.
4. the control method of database cursor as claimed in claim 3, it is characterised in that
It is described when detecting statistical parameter less than predetermined threshold value, discharge all vernier occupancy of having activated in the sorted lists The step of memory source, includes:
When detecting statistical parameter less than predetermined threshold value, show activation verniers all in current sorted lists, for Family is selected;
The pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
5. the control method of the database cursor as described in Claims 1-4 any one, it is characterised in that
It is described when detecting statistical parameter less than predetermined threshold value, discharge all vernier occupancy of having activated in the sorted lists The step of memory source, includes:
When detecting statistical parameter less than predetermined threshold value, all memory sources for having activated vernier releases in acquisition sorted lists Delegate power limit;
When detect release authority fail release it is all activated vernier occupancy memory source when, force obtain database The highest authority of system;
All memory sources for having activated vernier occupancy are discharged based on highest authority.
6. a kind of Database Systems, it is characterised in that vernier is provided with the Database Systems, and the vernier is provided with trip Rank is marked, including low level vernier, the Database Systems include:
Logging modle, for when detecting database activation vernier, the vernier and its vernier rank of activation being recorded, to obtain There are the sorted lists for having activated vernier;
First release module, for when detecting in sorted lists in the presence of the low level vernier for having activated and having left unused, discharging low The memory source that rank vernier takes.
7. Database Systems as claimed in claim 6, it is characterised in that the Database Systems also include:
Statistical module, the freememory resource for counting current database system, to obtain corresponding statistical parameter;
Second release module, it is all in release sorted lists to have activated for when detecting statistical parameter less than predetermined threshold value The memory source that vernier takes.
8. Database Systems as claimed in claim 7, it is characterised in that the Database Systems also include:
Memory module, all event informations for storing this releasing memory resource, using the foundation optimized as memory source.
9. Database Systems as claimed in claim 8, it is characterised in that second release module includes:
Display unit, it is all in the current sorted lists of display to have swashed for when detecting statistical parameter less than predetermined threshold value Vernier living, so that user selects;
First releasing unit, for the pre-selection vernier selected based on user, the memory source that release pre-selection vernier takes.
10. the Database Systems as described in claim 6 to 9 any one, it is characterised in that the second release module bag Include:
Acquiring unit, it is all in acquisition sorted lists to have activated vernier for when detecting statistical parameter less than predetermined threshold value Memory source release authority;
Permission unit, for when detect release authority fail release it is all activated vernier occupancy memory source when, Force the highest authority of acquisition Database Systems;
Second releasing unit, for discharging all memory sources for having activated vernier occupancy based on highest authority.
CN201710323310.0A 2017-05-09 2017-05-09 Control method of database cursor and database system Active CN107145582B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710323310.0A CN107145582B (en) 2017-05-09 2017-05-09 Control method of database cursor and database system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710323310.0A CN107145582B (en) 2017-05-09 2017-05-09 Control method of database cursor and database system

Publications (2)

Publication Number Publication Date
CN107145582A true CN107145582A (en) 2017-09-08
CN107145582B CN107145582B (en) 2022-01-04

Family

ID=59778286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710323310.0A Active CN107145582B (en) 2017-05-09 2017-05-09 Control method of database cursor and database system

Country Status (1)

Country Link
CN (1) CN107145582B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737295A (en) * 2020-06-11 2020-10-02 上海达梦数据库有限公司 Database cursor query method, device, equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010502A1 (en) * 2002-07-12 2004-01-15 Bomfim Joanes Depaula In-memory database for high performance, parallel transaction processing
CN101315628A (en) * 2007-06-01 2008-12-03 华为技术有限公司 Internal memory database system and method and device for implementing internal memory data base
CN101847127A (en) * 2010-06-18 2010-09-29 福建星网锐捷网络有限公司 Memory management method and device
CN101859261A (en) * 2010-06-09 2010-10-13 中兴通讯股份有限公司 Control method and control equipment for releasing memory
EP2290562A1 (en) * 2009-08-24 2011-03-02 Amadeus S.A.S. Segmented main-memory stored relational database table system with improved collaborative scan algorithm
US20130120402A1 (en) * 2011-11-14 2013-05-16 Microsoft Corporation Discarding Idle Graphical Display Components from Memory and Processing
CN103914337A (en) * 2014-03-24 2014-07-09 小米科技有限责任公司 Service calling method, device and terminal
CN104375828A (en) * 2014-10-27 2015-02-25 小米科技有限责任公司 Method and device for optimizing memory
CN105243003A (en) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 Memory allocation monitoring method and apparatus
US20160110223A1 (en) * 2011-09-20 2016-04-21 Intel Corporation Multi-threaded queuing system for pattern matching
CN105700968A (en) * 2016-01-11 2016-06-22 厦门雅迅网络股份有限公司 Method and device for memory leakage diagnosis processing in embedded system
CN105786939A (en) * 2014-12-26 2016-07-20 中兴通讯股份有限公司 Memory database optimization method and apparatus
CN106326137A (en) * 2015-07-02 2017-01-11 腾讯科技(深圳)有限公司 Memory optimization method and apparatus, and user equipment
CN106326094A (en) * 2015-06-29 2017-01-11 联芯科技有限公司 Method and system for inspecting abnormity of pointer

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010502A1 (en) * 2002-07-12 2004-01-15 Bomfim Joanes Depaula In-memory database for high performance, parallel transaction processing
CN101315628A (en) * 2007-06-01 2008-12-03 华为技术有限公司 Internal memory database system and method and device for implementing internal memory data base
EP2290562A1 (en) * 2009-08-24 2011-03-02 Amadeus S.A.S. Segmented main-memory stored relational database table system with improved collaborative scan algorithm
CN101859261A (en) * 2010-06-09 2010-10-13 中兴通讯股份有限公司 Control method and control equipment for releasing memory
CN101847127A (en) * 2010-06-18 2010-09-29 福建星网锐捷网络有限公司 Memory management method and device
US20160110223A1 (en) * 2011-09-20 2016-04-21 Intel Corporation Multi-threaded queuing system for pattern matching
US20130120402A1 (en) * 2011-11-14 2013-05-16 Microsoft Corporation Discarding Idle Graphical Display Components from Memory and Processing
CN103914337A (en) * 2014-03-24 2014-07-09 小米科技有限责任公司 Service calling method, device and terminal
CN104375828A (en) * 2014-10-27 2015-02-25 小米科技有限责任公司 Method and device for optimizing memory
CN105786939A (en) * 2014-12-26 2016-07-20 中兴通讯股份有限公司 Memory database optimization method and apparatus
CN106326094A (en) * 2015-06-29 2017-01-11 联芯科技有限公司 Method and system for inspecting abnormity of pointer
CN106326137A (en) * 2015-07-02 2017-01-11 腾讯科技(深圳)有限公司 Memory optimization method and apparatus, and user equipment
CN105243003A (en) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 Memory allocation monitoring method and apparatus
CN105700968A (en) * 2016-01-11 2016-06-22 厦门雅迅网络股份有限公司 Method and device for memory leakage diagnosis processing in embedded system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737295A (en) * 2020-06-11 2020-10-02 上海达梦数据库有限公司 Database cursor query method, device, equipment and storage medium
CN111737295B (en) * 2020-06-11 2023-02-03 上海达梦数据库有限公司 Database cursor query method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN107145582B (en) 2022-01-04

Similar Documents

Publication Publication Date Title
CN102566928A (en) System and method for automatically managing desktop application icons of mobile terminal
EP1845439A3 (en) Storage area dynamic assignment method
CN104731302B (en) A kind of method and system of electricity saving of mobile terminal operation
EP2985694A1 (en) Application program management method and apparatus, server, and terminal device
CN108234348A (en) A kind of processing method and processing device in queue operation
CN106933733A (en) A kind of method and apparatus for determining RAM leakage position
CN105516787B (en) The storage controlling method and device of application cache data
CN109788138A (en) Screen control method, device, terminal and storage medium
CN109656779A (en) Internal memory monitoring method, device, terminal and storage medium
CN106649759A (en) Picture processing method and mobile terminal
CN110134650B (en) File loading method, device, equipment and storage medium
CN108228449A (en) Terminal equipment control method and device, terminal device and computer readable storage medium
CN110457235A (en) Memory compression methods, device, terminal and storage medium
CN107273200A (en) A kind of method for scheduling task stored for isomery
CN107145582A (en) The control method and Database Systems of database cursor
CN106997316A (en) Detecting system and method that memory abnormal increases
CN105335367B (en) Method, device and server for determining application program associated with file directory
CN106534464A (en) Call processing method and terminal
CN105843686A (en) Resource release method and apparatus for singleton component
CN108388672A (en) Lookup method, device and the computer readable storage medium of video
CN106649130A (en) Memory space recovery method and apparatus, and electronic device
CN108228342A (en) Terminal equipment control method and device, terminal device and computer readable storage medium
CN108287761A (en) Method for recovering internal storage and device, terminal device and computer readable storage medium
EP3444721A1 (en) Method and apparatus for clearing up process, and storage medium
CN107786586B (en) The load dispatching method and device of business

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