CN109213604A - A kind of management method and device of data source - Google Patents
A kind of management method and device of data source Download PDFInfo
- Publication number
- CN109213604A CN109213604A CN201811197830.2A CN201811197830A CN109213604A CN 109213604 A CN109213604 A CN 109213604A CN 201811197830 A CN201811197830 A CN 201811197830A CN 109213604 A CN109213604 A CN 109213604A
- Authority
- CN
- China
- Prior art keywords
- data source
- access
- information table
- data
- deleted
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
Abstract
The embodiment of the invention provides a kind of management method of data source and devices, this method comprises: according to the last access time of each data source in the data source information table of storage, judge the data source it is current do not access whether duration is greater than preset duration, if the current duration that do not access of the data source is greater than preset duration, the data source is determined as data source to be deleted, data source to be deleted is deleted from memory, and the corresponding list item of data source to be deleted is deleted from data source information table.Based on above-mentioned processing, data source not visited for a long time in memory can be deleted, and then can reduce the occupation rate of memory according to data source information table, improve system performance.
Description
Technical field
The present invention relates to database technical fields, more particularly to the management method and device of a kind of data source.
Background technique
With the fast development of cloud computing and Internet technology, many platforms all suffer from mass data, these data are usual
It can store in different databases.Data source would generally be stored in server, record establishes database company in data source
The information connect.After server receives the data access request of terminal, corresponding data source can be returned to terminal, terminal is then
It can be connected according to data source with corresponding Database, to access the database.
In the prior art, server can be according to the data access request dynamic generation data source received, and will generate
Data source be written memory.When server receives data access request next time, correspondence can be read directly from memory
Data source, and terminal is back to, so that terminal is connected according to data source with corresponding Database.
However, inventor has found in the implementation of the present invention, at least there are the following problems for the prior art:
In carrying out business procession, server can be generated in a large amount of data source write-in memory, will lead to memory
Occupation rate is higher, reduces system performance.
Summary of the invention
The management method and device for being designed to provide a kind of data source of the embodiment of the present invention, to improve system performance.
Specific technical solution is as follows:
In a first aspect, in order to achieve the above object, it is described the embodiment of the invention discloses a kind of management method of data source
Method includes:
According to the last access time of each data source in the data source information table of storage, judge that the data source is current not
Whether access duration is greater than preset duration, wherein the data access request received according to the data source information table generates
's;
If the current duration that do not access of the data source is greater than the preset duration, which is determined as number to be deleted
According to source;
The data source to be deleted is deleted from memory, and the data to be deleted are deleted from the data source information table
The corresponding list item in source.
Optionally, the data source information table also records the initialization time for having data source and access times;
It is described the data source is determined as data source to be deleted before, the method also includes:
According to current time, the initialization time of the data source and access times, the access frequency of the data source is calculated;
If the access frequency of the data source is greater than default access frequency, the last access time of the data source is updated to
Current time;
If the access frequency of the data source is not more than the default access frequency, execution is described to be determined as the data source
Data source step to be deleted.
Optionally, the data source information table also records the deletion License Status for having data source, the deletion License Status
It is deleted to allow or does not allow to delete;
Described according to current time, the initialization time of the data source and access times, the access of the data source is calculated
Before frequency, the method also includes:
Obtain the deletion License Status of the data source in the data source information table;
If the deletion License Status of the data source is to allow to delete, execute described according to current time, the data source
Initialization time and access times calculate the access frequency step of the data source.
Optionally, the data source information table also record have the corresponding data source uniform resource position mark URL of data source and
User name;
The method also includes:
When receive terminal transmission data access request when, according to the data source information table, judge whether there is with
The corresponding target data source of data source URL and user name carried in the data access request;
If there is no the target data source, according to the data access request generation target data source, and
The corresponding list item of the target data source is added in the data source information table;
If there is the target data source, the target data source is sent to the terminal, and update the target
The corresponding list item of data source.
Optionally, the method also includes:
When receiving data source query instruction, the data source information table is sent to the user terminal, so that the use
Family terminal shows the information recorded in the data source information table.
Second aspect, it is in order to achieve the above object, described the embodiment of the invention discloses a kind of managing device of data source
Device includes:
Judgment module, for the last access time of each data source in the data source information table according to storage, judgement should
Data source it is current do not access whether duration is greater than preset duration, wherein the number received according to the data source information table
It is generated according to access request;
Determining module, if the do not access duration current for the data source is greater than the preset duration, by the data source
It is determined as data source to be deleted;
Removing module is deleted for deleting the data source to be deleted from memory, and from the data source information table
The corresponding list item of the data source to be deleted.
Optionally, the data source information table also records the initialization time for having data source and access times;
Described device further include:
First processing module, for according to current time, the data source initialization time and access times, calculate the number
According to the access frequency in source;
If the access frequency of the data source is greater than default access frequency, the last access time of the data source is updated to
Current time;
If the access frequency of the data source is not more than the default access frequency, execution is described to be determined as the data source
Data source step to be deleted.
Optionally, the data source information table also records the deletion License Status for having data source, the deletion License Status
It is deleted to allow or does not allow to delete;
Described device further include:
Second processing module, for obtaining the deletion License Status of the data source in the data source information table;
If the deletion License Status of the data source is to allow to delete, execute described according to current time, the data source
Initialization time and access times calculate the access frequency step of the data source.
Optionally, the data source information table also record have the corresponding data source uniform resource position mark URL of data source and
User name;
Described device further include:
Third processing module, for when receive terminal transmission data access request when, according to the data source information
Table judges whether there is target data source corresponding with the data source URL and user name that carry in the data access request;
If there is no the target data source, according to the data access request generation target data source, and
The corresponding list item of the target data source is added in the data source information table;
If there is the target data source, the target data source is sent to the terminal, and update the target
The corresponding list item of data source.
Optionally, described device further include:
Sending module, for when receiving data source query instruction, the data source information table to be sent to user's end
End, so that the user terminal shows the information recorded in the data source information table.
At the another aspect that the present invention is implemented, a kind of electronic equipment is additionally provided, the electronic equipment includes processor, leads to
Believe interface, memory and communication bus, wherein processor, communication interface, memory complete mutual lead to by communication bus
Letter;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes the management of any of the above-described data source
Method.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable
Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described data source
Management method.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced
Product, when run on a computer, so that computer executes the management method of any of the above-described data source.
The management method and device of data source provided in an embodiment of the present invention, according to each in the data source information table of storage
The last access time of data source, it can be determined that the data source it is current do not access whether duration is greater than preset duration, if should
The current duration that do not access of data source is greater than preset duration, which is determined as data source to be deleted, is deleted from memory
Data source to be deleted, and the corresponding list item of data source to be deleted is deleted from data source information table.Based on above-mentioned processing, Ke Yigen
According to data source information table, data source not visited for a long time in memory is deleted, and then the occupation rate of memory can be reduced, is improved
System performance.
Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach all the above excellent simultaneously
Point.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow chart of the management method of data source provided in an embodiment of the present invention;
Fig. 2 is a kind of exemplary flow chart of the management method of data source provided in an embodiment of the present invention;
Fig. 3 is a kind of structure chart of the managing device of data source provided in an embodiment of the present invention;
Fig. 4 is the structure chart of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
In the prior art, server can generate corresponding data source according to data access request.Specifically, data access
Data source URL (Uniform Resource Locator, uniform resource locator), user can be usually carried in request
Name, the mark of data source driving, data source URL may include protocol name, sub-protocol name and dataSource link.
Illustratively, for the data access request of oracle database, data source URL can be with are as follows: jdbc:oracle:
The mark of thin:@machine_name:port:dbname, data source driving can be with are as follows:
Oracle.jdbc.driver.OracleDriver, wherein JDBC (Java DataBase Connectivity, JAVA data
Library connection) presentation protocol name;Oracle indicates sub-protocol name, is determined by the author that data source drives, machine_name table
Show the title of the machine where database;Port indicates port numbers, is defaulted as 1521;Dbname indicates dataSource link.Server
Can according in data source URL information and data source drive, generate corresponding data source, and will be in the write-in of the data source of generation
It deposits.However, server can generate in a large amount of data source write-in memory in business procession, occupying for memory will lead to
Rate is higher, reduces the performance of system.
To solve the above-mentioned problems, the embodiment of the invention provides a kind of management method of data source and device, Ke Yiying
For server, which can receive the data access request of terminal transmission, and return to corresponding data source to terminal, eventually
End can then be connect according to the data source with Database, and then the accessible database.
Based on method of the invention, server can be according to the last visit of each data source in the data source information table of storage
Ask the time, judge the data source it is current do not access whether duration is greater than preset duration, do not accessed if the data source is current
Duration is greater than preset duration, i.e. the data source is not visited for a long time, then the data source can be determined as to be deleted by server
Data source, then, server can delete data source to be deleted from memory, and number to be deleted is deleted from data source information table
According to the corresponding list item in source.Based on above-mentioned processing, server can be deleted in memory and be not interviewed for a long time according to data source information table
The data source asked, and then the occupation rate of memory can be reduced, improve the system performance of server.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of the management method of data source provided in an embodiment of the present invention, and this method can
With the following steps are included:
S101: according to the last access time of each data source in the data source information table of storage, judge that the data source is worked as
Preceding does not access whether duration is greater than preset duration.
Wherein, preset duration can be rule of thumb configured by technical staff.Data source information table can be server
It is generated, and is stored in local according to the data access request received.It can recorde server generation in data source information table
Data source last access time.The current duration that do not access of data source can be for from the last access time of data source to working as
The duration at preceding moment.
In an implementation, server can read the data source information table being locally stored in default renewable time, obtain data
The last access time of each data source recorded in source information table, and then can be according to current time and each data source most
Access time afterwards, judge each data source it is current do not access whether duration is greater than preset duration.
In this step, default renewable time can be rule of thumb configured by technical staff, for example, default renewable time
It can be the fixed moment in period, or at the time of the data access request that server receives terminal transmission corresponds to.
When reaching default renewable time, server can successively obtain local data source according to default search order
The last access time of each data source recorded in information table.For each data source, server can calculate the data source
Last access time and current time between duration, as the data source it is current do not access duration, then, server can
With judge the data source it is current do not access whether duration is greater than preset duration.Wherein, default search order can be by technology people
Member is rule of thumb configured, for example, the time that default search order can generate each data source for server (is properly termed as
Initialization time) sequencing.
S102: if the duration that do not access of the data source currently is greater than preset duration, which is determined as to be deleted
Data source.
In an implementation, for each data source, when server determine the data source it is current do not access duration be greater than it is default
When duration, which can be determined as data source to be deleted by server.
Optionally, for a certain data source, when server determines that the current duration that do not access of the data source is less than or waits
When preset duration, server can be without any processing, then to the data source, and server can be suitable according to default inquiry
Sequence continues to judge that the current of next data source does not access whether duration is greater than preset duration, until server believes data source
All data sources judgement recorded in breath table terminates.
S103: deleting data source to be deleted from memory, and deletes data source to be deleted from data source information table and correspond to
List item.
In an implementation, for each data source recorded in data source information table, data source to be deleted that server is determined
It can be one, or multiple.Then, server can delete the data source to be deleted determined from memory, and
The corresponding list item of data source to be deleted is deleted from data source information table.
In this step, for each data source, server can be when determining the data source be data source to be deleted, by this
Data source is deleted from memory, and the corresponding list item of the data source is deleted from data source information table, and then, server can be by
According to default search order, continue to judge whether next data source is data source to be deleted.Alternatively, server can also determine first
After all data sources to be deleted recorded in data source information table out, then, then by each data source to be deleted determined from interior
Middle deletion is deposited, and deletes the corresponding list item of each data source to be deleted from data source information table.For server from memory
Data source to be deleted is deleted, and deletes the time of the corresponding list item of data source to be deleted, the present embodiment from data source information table
It is not defined.
As it can be seen that the method based on the present embodiment, server can delete data source not visited for a long time in memory, most
The initial frequencies for possibly reducing data source greatly, to reduce the calculating pressure of system.
Optionally, server can also further screen in not accessing data source of the duration greater than preset duration, with true
Make data source to be deleted.Specifically, data source information table can also record initialization time and the access times of data source.
If a certain data source it is current do not access duration greater than preset duration, by the data source be determined as data source to be deleted it
Before, this method may also comprise the following steps::
Step 1 calculates the access of the data source according to current time, the initialization time of the data source and access times
Frequency.
Wherein, for each data source, initialization time and the visit of the data source can also be recorded in data source information table
Ask number, the initialization time of data source namely server generate the time of the data source, the access times of data source namely from
Until generating the data source to current time, the accessed number of the data source.
In an implementation, for a certain data source, when server determines that the current access duration of the data source is greater than default
When long, the initialization time of the data source recorded in the available data source information table of server and access times.Then, it takes
Business device can calculate the data source and work as according to the access times at current time, the initialization time of the data source and the data source
Preceding access frequency.For example, server, which can calculate the duration between current time and the initialization time of the data source, (can claim
For there are durations), then, server can calculate the data source access times and the data source there are the quotient of duration,
The access frequency current as the data source.
Step 2, if the access frequency of the data source is greater than default access frequency, when by the last access of the data source
Between be updated to current time.
Wherein, default access frequency can be rule of thumb configured by technical staff.
In an implementation, when server determines that the current duration that do not access of a certain data source is greater than preset duration, and the data
When the current access frequency in source is greater than default access frequency, server can be by the data source recorded in data source information table
Last access time is updated to current time so that server next time can last access updated according to the data source when
Between, judge the data source does not access whether duration is greater than preset duration.
The data source is determined as wait delete by step 3 if the access frequency of the data source is not more than default access frequency
Except data source.
In an implementation, when server determines that the current duration that do not access of a certain data source is greater than preset duration, and the data
When the current access frequency in source is less than or equal to default access frequency, which can be determined as number to be deleted by server
According to source, and then the data source can be deleted from memory, improve the performance of system.
Optionally, server can also determine whether to delete the data source according to the deletion License Status of a certain data source.
Specifically, data source information table can also record the deletion License Status of data source, deleting License Status can be to allow to delete
Or do not allow to delete.
For a certain data source, server according to current time, the data source initialization time and access times, meter
Before the access frequency for calculating the data source, this method may also comprise the following steps:: obtaining the data source in data source information table
Deletion License Status;If the deletion License Status of the data source is to allow to delete, judges that the data source is current and do not access
Whether duration is greater than preset duration.
Wherein, the deletion License Status of data source can be rule of thumb configured by technical staff.Delete License Status
It can be to allow to delete or do not allow to delete.If the deletion License Status of a certain data source is to allow to delete, then it represents that service
Device can delete the data source, if the deletion License Status of the data source is not allow to delete, then it represents that server cannot
Delete the data source.
In an implementation, for a certain data source, server can obtain the data recorded in data source information table first
The deletion License Status in source, if the deletion License Status of the data source is to allow to delete, server can further judge
The data source it is current do not access whether duration is greater than preset duration, if the data source it is current do not access duration be greater than it is default
Duration, then server can calculate the visit of the data source according to current time, the initialization time of the data source and access times
It asks frequency, and carries out respective handling.
Alternatively, server can also first determine whether the data source it is current do not access whether duration is greater than preset duration, such as
The current duration that do not access of the fruit data source is greater than preset duration, and server can further judge the deletion license of the data source
Whether state is to allow to delete, if the deletion License Status of the data source is to allow to delete, server can be according to current
Moment, the initialization time of the data source and access times calculate the access frequency of the data source, and carry out respective handling.It is right
In above-mentioned judgement sequence, the present embodiment is not defined.
In addition, server can not to the data source if the deletion License Status of the data source is not allow to delete
Carry out any processing.Then, server can obtain the deletion License Status of next data source according to default search order, and
Carry out respective handling.
Optionally, server can also update data source information table according to the data access request of terminal.Specifically, data
Source information table can also record the corresponding data source URL of data source and user name, and this method may also comprise the following steps::
Step 1, according to data source information table, is judged whether there is when receiving the data access request of terminal transmission
Target data source corresponding with the data source URL and user name that are carried in data access request.
Wherein, it is corresponding can also to record the data source when generating a certain data source in data source information table for server
Data source URL and user name, server can determine whether terminal has corresponding data access authority according to user name.
In an implementation, terminal can send data access request to server, to access corresponding database, data access
User name and data origin url can be carried in request.Correspondingly, server then can receive the data access of terminal transmission
Request, parsing data access request obtain user name and data origin url.
Then, server can be inquired in data source information table, judge in data source information table with the presence or absence of with
The mark of the user name and the corresponding data source of data origin url that are carried in data access request, namely judge whether deposit in memory
With the user name and data origin url corresponding data source (i.e. target data source) that are carried in data access request.
Step 2 generates target data source according to data access request, and in data source if there is no target data source
The corresponding list item of target data source is added in information table.
In an implementation, when server determines that target data source is not present in memory, server can be according to data access
Request generates target data source, and the method that server generates target data source is same as the prior art, and details are not described herein again.Together
When, server can also add the corresponding list item of target data source in data source information table.Illustratively, server can be
Initialization time (i.e. current time), the access times (i.e. 1), user name, number of target data source are recorded in data source information table
According to origin url and last access time (i.e. current time).
In addition, target data source after generating target data source, can be sent to terminal by server, so that terminal can be with
Access corresponding database.
Target data source is sent to terminal if there is target data source by step 3, and it is corresponding to update target data source
List item.
In an implementation, when server determines in memory that server can send out target data source there are when target data source
It send to terminal.Meanwhile server can also update the corresponding list item of target data source.
In this step, the last access time of target data source can be updated to current time by server, and update mesh
Mark the access times of data source.Illustratively, the current access times of the available target data source of server, and will be current
Access times add 1, to update the access times of target data source.Optionally, the information that server can also provide data source is looked into
It askes.Specifically, this method may also comprise the following steps:: when receiving data query instruction, data source information table being sent
To user terminal, so that the information recorded in user terminal display data sources information table.
In an implementation, user can send data query instruction to server by user terminal, to inquire current number
According to the information in source, correspondingly, data source information table can be sent to user's end when server receives data query instruction
End, user terminal then can information to record in display data sources information table.
In addition, the corresponding data source driving of data source can also have been recorded in data source information table, for user's browsing.
As it can be seen that the monitoring of data source may be implemented in the method based on the present embodiment, user is allowed to pass through user terminal
The directly effective state for understanding data source cleaning.
Referring to fig. 2, Fig. 2 is a kind of exemplary flow chart of the management method of data source provided in an embodiment of the present invention, the party
Method may comprise steps of:
S201: the data access request that terminal is sent is received.
Wherein, data source URL and user name are carried in data access request.
S202: according to the data source information table of storage, judge in memory with the presence or absence of with carried in data access request
Data source URL and the corresponding target data source of user name execute S203, if memory if there are target data sources in memory
In be not present target data source, execute S204.
Wherein, record has the mark of data source, initialization time, data source URL, user name, most in data source information table
Access time, deletion License Status and access times afterwards.
S203: being sent to terminal for target data source, and updates the corresponding list item of target data source.
S204: target data source is generated according to data access request, and adds target data source in data source information table
Corresponding list item.
S205: for each data source recorded in data source information table, judge that the deletion License Status of the data source is
No is to allow to delete, if the deletion License Status of the data source is to allow to delete, executes S206.
S206: judge the data source it is current do not access whether duration is greater than preset duration, if the data source is current
Duration is not accessed greater than preset duration, executes S207.
S207: judging whether the current access frequency of the data source is greater than default access frequency, if so, S208 is executed,
If not, executing S209.
S208: the last access time of the data source is updated to current time.
S209: the data source is determined as data source to be deleted.
S2010: deleting data source to be deleted from memory, and deletes data source to be deleted from data source information table and correspond to
List item.
As seen from the above, the management method of the data source based on the embodiment of the present invention, according to the data source information table of storage
In each data source last access time, judge the data source it is current do not access whether duration is greater than preset duration, if
The current duration that do not access of the data source is greater than preset duration, which is determined as data source to be deleted, is deleted from memory
Except data source to be deleted, and the corresponding list item of data source to be deleted is deleted from data source information table.It, can be with based on above-mentioned processing
According to data source information table, data source not visited for a long time in memory is deleted, and then the occupation rate of memory can be reduced, is mentioned
High system performance.
Corresponding with the management method of the data source of Fig. 1, the embodiment of the invention also provides a kind of management of data source dresses
It sets.
Referring to Fig. 3, Fig. 3 is a kind of structure chart of the managing device of data source provided in an embodiment of the present invention, which can
To include:
Judgment module 301, for the last access time of each data source in the data source information table according to storage, judgement
The data source it is current do not access whether duration is greater than preset duration, wherein received according to the data source information table
What data access request generated;
Determining module 302, if the do not access duration current for the data source is greater than the preset duration, by the data
Source is determined as data source to be deleted;
Removing module 303 is deleted for deleting the data source to be deleted from memory, and from the data source information table
Except the corresponding list item of the data source to be deleted.
Optionally, the data source information table also records the initialization time for having data source and access times;
Described device further include:
First processing module, for according to current time, the data source initialization time and access times, calculate the number
According to the access frequency in source;
If the access frequency of the data source is greater than default access frequency, the last access time of the data source is updated to
Current time;
If the access frequency of the data source is not more than the default access frequency, execution is described to be determined as the data source
Data source step to be deleted.
Optionally, the data source information table also records the deletion License Status for having data source, the deletion License Status
It is deleted to allow or does not allow to delete;
Described device further include:
Second processing module, for obtaining the deletion License Status of the data source in the data source information table;
If the deletion License Status of the data source is to allow to delete, execute described according to current time, the data source
Initialization time and access times calculate the access frequency step of the data source.
Optionally, the data source information table also record have the corresponding data source uniform resource position mark URL of data source and
User name;
Described device further include:
Third processing module, for when receive terminal transmission data access request when, according to the data source information
Table judges whether there is target data source corresponding with the data source URL and user name that carry in the data access request;
If there is no the target data source, according to the data access request generation target data source, and
The corresponding list item of the target data source is added in the data source information table;
If there is the target data source, the target data source is sent to the terminal, and update the target
The corresponding list item of data source.
Optionally, described device further include:
Sending module, for when receiving data source query instruction, the data source information table to be sent to user's end
End, so that the user terminal shows the information recorded in the data source information table.
As seen from the above, the managing device of the data source based on the embodiment of the present invention, according to the data source information table of storage
In each data source last access time, judge the data source it is current do not access whether duration is greater than preset duration, if
The current duration that do not access of the data source is greater than preset duration, which is determined as data source to be deleted, is deleted from memory
Except data source to be deleted, and the corresponding list item of data source to be deleted is deleted from data source information table.It, can be with based on above-mentioned processing
According to data source information table, data source not visited for a long time in memory is deleted, and then the occupation rate of memory can be reduced, is mentioned
High system performance.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 4, include processor 401, communication interface 402,
Memory 403 and communication bus 404, wherein processor 401, communication interface 402, memory 403 are complete by communication bus 404
At mutual communication,
Memory 403, for storing computer program;
Processor 401 when for executing the program stored on memory 403, realizes number provided in an embodiment of the present invention
According to the management method in source.
Specifically, the management method of above-mentioned data source, comprising:
According to the last access time of each data source in the data source information table of storage, judge that the data source is current not
Whether access duration is greater than preset duration, wherein the data access request received according to the data source information table generates
's;
If the current duration that do not access of the data source is greater than the preset duration, which is determined as number to be deleted
According to source;
The data source to be deleted is deleted from memory, and the data to be deleted are deleted from the data source information table
The corresponding list item in source.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..
Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), also may include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
Electronic equipment provided in an embodiment of the present invention, can according to data source information table, delete memory in for a long time not by
The data source of access, and then the occupation rate of memory can be reduced, improve system performance.
The embodiment of the invention also provides a kind of computer readable storage medium, stored in the computer readable storage medium
There is instruction, when run on a computer, so that computer executes the management method of data source provided in an embodiment of the present invention.
Specifically, the management method of above-mentioned data source, comprising:
According to the last access time of each data source in the data source information table of storage, judge that the data source is current not
Whether access duration is greater than preset duration, wherein the data access request received according to the data source information table generates
's;
If the current duration that do not access of the data source is greater than the preset duration, which is determined as number to be deleted
According to source;
The data source to be deleted is deleted from memory, and the data to be deleted are deleted from the data source information table
The corresponding list item in source.
It should be noted that other implementations of the management method of above-mentioned data source and preceding method embodiment part phase
Together, which is not described herein again.
It, can be according to data by running the instruction stored in computer readable storage medium provided in an embodiment of the present invention
Source information table deletes data source not visited for a long time in memory, and then can reduce the occupation rate of memory, improves systematicness
Energy.
The embodiment of the invention also provides a kind of computer program products comprising instruction, when it runs on computers
When, so that computer executes the management method of data source provided in an embodiment of the present invention.
Specifically, the management method of above-mentioned data source, comprising:
According to the last access time of each data source in the data source information table of storage, judge that the data source is current not
Whether access duration is greater than preset duration, wherein the data access request received according to the data source information table generates
's;
If the current duration that do not access of the data source is greater than the preset duration, which is determined as number to be deleted
According to source;
The data source to be deleted is deleted from memory, and the data to be deleted are deleted from the data source information table
The corresponding list item in source.
It should be noted that other implementations of the management method of above-mentioned data source and preceding method embodiment part phase
Together, which is not described herein again.
It, can be according to data source information table, in deletion by running computer program product provided in an embodiment of the present invention
The not visited data source of middle long-time is deposited, and then the occupation rate of memory can be reduced, improves system performance.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk
Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For electronic equipment, computer readable storage medium, computer program product embodiments, implement since it is substantially similar to method
Example, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (11)
1. a kind of management method of data source, which is characterized in that the described method includes:
According to the last access time of each data source in the data source information table of storage, judges that the data source is current and do not access
Whether duration is greater than preset duration, wherein what the data access request received according to the data source information table generated;
If the current duration that do not access of the data source is greater than the preset duration, which is determined as data to be deleted
Source;
The data source to be deleted is deleted from memory, and the data source pair to be deleted is deleted from the data source information table
The list item answered.
2. the method according to claim 1, wherein the data source information table, which also records, the initial of data source
Change time and access times;
It is described the data source is determined as data source to be deleted before, the method also includes:
According to current time, the initialization time of the data source and access times, the access frequency of the data source is calculated;
If the access frequency of the data source is greater than default access frequency, the last access time of the data source is updated to currently
Moment;
If the access frequency of the data source is not more than the default access frequency, execution is described to be determined as the data source wait delete
Except data source step.
3. according to the method described in claim 2, it is characterized in that, the data source information table also records the deletion for having data source
License Status, the deletion License Status are to allow to delete or do not allow to delete;
Described according to current time, the initialization time of the data source and access times, the access frequency of the data source is calculated
Before, the method also includes:
Obtain the deletion License Status of the data source in the data source information table;
If the deletion License Status of the data source be allow to delete, execute it is described according to current time, the data source it is initial
Change time and access times, calculates the access frequency step of the data source.
4. having data source corresponding the method according to claim 1, wherein the data source information table also records
Data source uniform resource position mark URL and user name;
The method also includes:
When receive terminal transmission data access request when, according to the data source information table, judge whether there is with it is described
The corresponding target data source of data source URL and user name carried in data access request;
If there is no the target data source, the target data source is generated according to the data access request, and described
The corresponding list item of the target data source is added in data source information table;
If there is the target data source, the target data source is sent to the terminal, and update the target data
The corresponding list item in source.
5. method according to claim 1-4, which is characterized in that the method also includes:
When receiving data source query instruction, the data source information table is sent to the user terminal, so that the user is whole
End shows the information recorded in the data source information table.
6. a kind of managing device of data source, which is characterized in that described device includes:
Judgment module judges the data for the last access time of each data source in the data source information table according to storage
Source it is current do not access whether duration is greater than preset duration, wherein the data received according to the data source information table are visited
Ask what request generated;
Determining module determines the data source if the do not access duration current for the data source is greater than the preset duration
For data source to be deleted;
Removing module, for deleting the data source to be deleted from memory, and from the data source information table described in deletion
The corresponding list item of data source to be deleted.
7. device according to claim 6, which is characterized in that the data source information table, which also records, the initial of data source
Change time and access times;
Described device further include:
First processing module, for according to current time, the data source initialization time and access times, calculate the data source
Access frequency;
If the access frequency of the data source is greater than default access frequency, the last access time of the data source is updated to currently
Moment;
If the access frequency of the data source is not more than the default access frequency, execution is described to be determined as the data source wait delete
Except data source step.
8. device according to claim 7, which is characterized in that the data source information table also records the deletion for having data source
License Status, the deletion License Status are to allow to delete or do not allow to delete;
Described device further include:
Second processing module, for obtaining the deletion License Status of the data source in the data source information table;
If the deletion License Status of the data source be allow to delete, execute it is described according to current time, the data source it is initial
Change time and access times, calculates the access frequency step of the data source.
9. device according to claim 6, which is characterized in that the data source information table, which also records, has data source corresponding
Data source uniform resource position mark URL and user name;
Described device further include:
Third processing module, for according to the data source information table, sentencing when receiving the data access request of terminal transmission
It is disconnected to whether there is target data source corresponding with the data source URL and user name that carry in the data access request;
If there is no the target data source, the target data source is generated according to the data access request, and described
The corresponding list item of the target data source is added in data source information table;
If there is the target data source, the target data source is sent to the terminal, and update the target data
The corresponding list item in source.
10. according to the described in any item devices of claim 6-9, which is characterized in that described device further include:
Sending module, for when receiving data source query instruction, the data source information table to be sent to the user terminal, with
The user terminal is set to show the information recorded in the data source information table.
11. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein described
Processor, the communication interface, the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes any side claim 1-5
Method step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811197830.2A CN109213604B (en) | 2018-10-15 | 2018-10-15 | Data source management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811197830.2A CN109213604B (en) | 2018-10-15 | 2018-10-15 | Data source management method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109213604A true CN109213604A (en) | 2019-01-15 |
CN109213604B CN109213604B (en) | 2021-08-20 |
Family
ID=64980157
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811197830.2A Active CN109213604B (en) | 2018-10-15 | 2018-10-15 | Data source management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109213604B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110032667A (en) * | 2019-04-17 | 2019-07-19 | 成都市审计局 | A kind of data assets management method for platform of auditing |
CN110187836A (en) * | 2019-05-29 | 2019-08-30 | 北京奇艺世纪科技有限公司 | A kind of data-erasure method, device, computer and storage medium |
CN110417901A (en) * | 2019-07-31 | 2019-11-05 | 北京金山云网络技术有限公司 | Data processing method, device and gateway server |
CN113849131A (en) * | 2021-09-28 | 2021-12-28 | 咪咕文化科技有限公司 | Data storage method and device, computing equipment and storage medium |
CN114840272A (en) * | 2022-07-04 | 2022-08-02 | 好享家舒适智能家居股份有限公司 | Multi-data-source dynamic planning and monitoring system and method |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104298613A (en) * | 2014-09-29 | 2015-01-21 | 广州金山网络科技有限公司 | Method for cleaning up system memory and terminal device |
CN104331492A (en) * | 2014-11-14 | 2015-02-04 | 北京国双科技有限公司 | Method and device for caching multi-instance data |
US9037598B1 (en) * | 2013-01-25 | 2015-05-19 | Google Inc. | Variable query generation |
US20150278233A1 (en) * | 2014-03-25 | 2015-10-01 | Yokogawa Electric Corporation | Data storage management apparatus and data storage management method |
CN105183902A (en) * | 2015-09-30 | 2015-12-23 | 北京金山安全软件有限公司 | File cleaning method and device and terminal |
CN106301968A (en) * | 2016-10-25 | 2017-01-04 | 广东欧珀移动通信有限公司 | The processing method of a kind of terminal data, Apparatus and system |
CN106325990A (en) * | 2016-08-19 | 2017-01-11 | 宇龙计算机通信科技(深圳)有限公司 | Control method of application program, control device and terminal |
CN107133234A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | The method of data cached renewal, apparatus and system |
CN107562515A (en) * | 2017-08-04 | 2018-01-09 | 致象尔微电子科技(上海)有限公司 | A kind of method of the managing internal memory in virtualization technology |
CN107797871A (en) * | 2017-11-30 | 2018-03-13 | 努比亚技术有限公司 | EMS memory occupation method for releasing resource, mobile terminal and computer-readable recording medium |
CN107861688A (en) * | 2017-10-30 | 2018-03-30 | 努比亚技术有限公司 | A kind of data-erasure method, terminal and readable storage medium storing program for executing |
CN107943581A (en) * | 2017-11-14 | 2018-04-20 | 广东欧珀移动通信有限公司 | Using method for cleaning, device, storage medium and electronic equipment |
-
2018
- 2018-10-15 CN CN201811197830.2A patent/CN109213604B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9037598B1 (en) * | 2013-01-25 | 2015-05-19 | Google Inc. | Variable query generation |
US20150278233A1 (en) * | 2014-03-25 | 2015-10-01 | Yokogawa Electric Corporation | Data storage management apparatus and data storage management method |
CN104298613A (en) * | 2014-09-29 | 2015-01-21 | 广州金山网络科技有限公司 | Method for cleaning up system memory and terminal device |
CN104331492A (en) * | 2014-11-14 | 2015-02-04 | 北京国双科技有限公司 | Method and device for caching multi-instance data |
CN105183902A (en) * | 2015-09-30 | 2015-12-23 | 北京金山安全软件有限公司 | File cleaning method and device and terminal |
CN107133234A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | The method of data cached renewal, apparatus and system |
CN106325990A (en) * | 2016-08-19 | 2017-01-11 | 宇龙计算机通信科技(深圳)有限公司 | Control method of application program, control device and terminal |
CN106301968A (en) * | 2016-10-25 | 2017-01-04 | 广东欧珀移动通信有限公司 | The processing method of a kind of terminal data, Apparatus and system |
CN107562515A (en) * | 2017-08-04 | 2018-01-09 | 致象尔微电子科技(上海)有限公司 | A kind of method of the managing internal memory in virtualization technology |
CN107861688A (en) * | 2017-10-30 | 2018-03-30 | 努比亚技术有限公司 | A kind of data-erasure method, terminal and readable storage medium storing program for executing |
CN107943581A (en) * | 2017-11-14 | 2018-04-20 | 广东欧珀移动通信有限公司 | Using method for cleaning, device, storage medium and electronic equipment |
CN107797871A (en) * | 2017-11-30 | 2018-03-13 | 努比亚技术有限公司 | EMS memory occupation method for releasing resource, mobile terminal and computer-readable recording medium |
Non-Patent Citations (4)
Title |
---|
MIRYLENKA KATSIARYNA: ""Conditional heavy hitters:detecting interesting correlations in data streams"", 《VLDB JOURNAL》 * |
安易学车: ""缓存淘汰算法--LRU算法"", 《HTTPS://WWW.JIANSHU.COM/P/092A0CACE221》 * |
袁盛东: ""基于冗余的云存储数据分布策略研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
谢杰涛: ""Web系统高性能本地数据缓存实现机制"", 《计算机应用研究》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110032667A (en) * | 2019-04-17 | 2019-07-19 | 成都市审计局 | A kind of data assets management method for platform of auditing |
CN110187836A (en) * | 2019-05-29 | 2019-08-30 | 北京奇艺世纪科技有限公司 | A kind of data-erasure method, device, computer and storage medium |
CN110187836B (en) * | 2019-05-29 | 2022-09-02 | 北京奇艺世纪科技有限公司 | Data deleting method and device, computer and storage medium |
CN110417901A (en) * | 2019-07-31 | 2019-11-05 | 北京金山云网络技术有限公司 | Data processing method, device and gateway server |
WO2021017884A1 (en) * | 2019-07-31 | 2021-02-04 | 北京金山云网络技术有限公司 | Data processing method and apparatus, and gateway server |
CN110417901B (en) * | 2019-07-31 | 2022-04-29 | 北京金山云网络技术有限公司 | Data processing method and device and gateway server |
CN113849131A (en) * | 2021-09-28 | 2021-12-28 | 咪咕文化科技有限公司 | Data storage method and device, computing equipment and storage medium |
CN114840272A (en) * | 2022-07-04 | 2022-08-02 | 好享家舒适智能家居股份有限公司 | Multi-data-source dynamic planning and monitoring system and method |
Also Published As
Publication number | Publication date |
---|---|
CN109213604B (en) | 2021-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109213604A (en) | A kind of management method and device of data source | |
US9996565B2 (en) | Managing an index of a table of a database | |
US9052938B1 (en) | Correlation and associated display of virtual machine data and storage performance data | |
US7447799B2 (en) | System and method for automatically updating a wireless device | |
US9996596B2 (en) | Managing a table of a database | |
CN108268216B (en) | Data processing method, device and server | |
CN101557427A (en) | Method for providing diffluent information and realizing the diffluence of clients, system and server thereof | |
CN107181821A (en) | A kind of information push method and device based on SSE specifications | |
CN110737682A (en) | cache operation method, device, storage medium and electronic equipment | |
CN109885786A (en) | Data buffer storage processing method, device, electronic equipment and readable storage medium storing program for executing | |
CN103491152A (en) | Metadata obtaining method, device and system in distributed file system | |
CN108932286A (en) | A kind of date storage method, data query method and device | |
CN108347459A (en) | A kind of high in the clouds data quick storage method and device | |
CN109828980A (en) | Data cache method, device, terminal and storage medium | |
CN109684270A (en) | Database filing method, apparatus, system, equipment and readable storage medium storing program for executing | |
CN108154024A (en) | A kind of data retrieval method, device and electronic equipment | |
CN107409086B (en) | Mass data management in communication applications through multiple mailboxes | |
CN109240893A (en) | Using operating status querying method and terminal device | |
CN107894942B (en) | Method and device for monitoring data table access amount | |
US9449036B2 (en) | Handling an increase in transactional data without requiring relocation of preexisting data between shards | |
CN109408496A (en) | A kind of method and device reducing data redundancy | |
CN103870603A (en) | Directory management method and electronic device | |
CN109710673B (en) | Work processing method, device, equipment and medium | |
US8645316B2 (en) | Storing records in databases in a randomized manner to effectively utilize database servers | |
CN113672473A (en) | Monitoring data processing method, device, equipment, medium and program product of cloud database |
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 |