WO2019196287A1 - 缓存清理方法、装置、计算机装置及存储介质 - Google Patents
缓存清理方法、装置、计算机装置及存储介质 Download PDFInfo
- Publication number
- WO2019196287A1 WO2019196287A1 PCT/CN2018/099908 CN2018099908W WO2019196287A1 WO 2019196287 A1 WO2019196287 A1 WO 2019196287A1 CN 2018099908 W CN2018099908 W CN 2018099908W WO 2019196287 A1 WO2019196287 A1 WO 2019196287A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- cache
- server
- cache file
- preset value
- information
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0891—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
Definitions
- the present application relates to the field of data processing technologies, and in particular, to a cache cleaning method, apparatus, computer device, and storage medium.
- BI analysis tools are also known as BI tools.
- the BI tool is a tool that effectively integrates the system data applied in the enterprise and provides reports quickly and accurately. It can help users understand the required enterprise information and help users make business decisions.
- Common BI tools are Cognos, OBIEE, BO, etc.
- Cognos When the BI tool runs, it generates a lot of cache and needs to be cleaned up in time. Take Cognos as an example. During the startup process, Cognos will start a series of Cognos services. The Cognos application startup process can also be regarded as the startup process of the Cognos service. The functions of the Cognos application are provided by individual services (for example, LogService logs). The service provides services for writing logs during the running of Cognos. The cache is generated during the running of the Cognos application and during the refresh process of the Cognos. If the cache is not cleaned up in time, it will affect the operation of the Cognos application.
- LogService logs LogService logs
- the application provides a cache cleaning method, the method comprising:
- the cache file in the server is cleaned according to whether there is a refresh service in the server in the running state.
- the application also provides a cache cleaning device, the device comprising:
- An obtaining module configured to obtain cache file information in the server
- a determining module configured to determine, according to the cache file information, whether a type of the cache file in the server includes a specified type
- the determining module is further configured to: if the type of the cache file in the server includes the specified type, determine whether the sum of the sizes of the cache files of the specified type reaches a first preset value;
- a cleaning module configured to: if the type of the cache file in the server includes the specified type, and the sum of the sizes of the cache files of the specified type reaches the first preset value, according to whether the server is running in the server The state refresh service cleans up the cache files in the server.
- the application also provides a computer device comprising a memory and a processor, the memory for storing at least one instruction, the processor for executing the at least one instruction to implement the caching described in any embodiment Cleaning method.
- the present application also provides a non-volatile readable storage medium, wherein the non-volatile readable storage medium stores at least one instruction, which is implemented in any embodiment when executed by a processor The cache cleaning method described.
- the present application determines the cache file information in the server, and determines, according to the cache file information, whether the type of the cache file in the server includes a specified type; if yes, determining the cache file of the specified type. Whether the sum of the sizes reaches the first preset value; if the sum of the sizes of the specified types of cache files reaches the first preset value, according to whether there is a refresh service in the server in the running state to the server
- the cache file is cleaned up. When the cache reaches a certain amount, the cache is cleaned, thereby improving the disk space utilization and system operation efficiency, and avoiding the risk of service abnormality caused by the cache not being cleaned up.
- the present application cleans the cache file in the server according to whether there is a refresh service in the server in the running state, and in the BI tool, when there is a running refresh service, there may be an application service running, and no refresh service running. There will be no running application services. Therefore, the cache cleaning by this application does not affect the operation of the refresh service and other application services, and avoids the risk of system crash caused by improper cleaning of the cache.
- FIG. 1 is a flowchart of a cache cleaning method provided by an embodiment of the present application.
- FIG. 2 is a functional block diagram of a cache cleaning apparatus according to an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of a computer apparatus according to a preferred embodiment of the present invention.
- FIG. 1 is a flowchart of a cache cleaning method according to an embodiment of the present application.
- the order of the steps in the flowchart may be changed according to different requirements, and some steps may be omitted.
- the cache cleanup method described in this application can be used to clean up caches in Business Intelligence (BI) analysis tools.
- BI Business Intelligence
- the above server refers to a server of a business intelligence (BI) analysis tool.
- BI business intelligence
- the server of the BI tool can be a Linux server, and the online Analytical Processing (OLAP) can be performed on the server of the BI tool.
- OLAP online Analytical Processing
- the number of BI tool servers can be any number, and the specific quantity depends on actual needs.
- the above cache file information may be information of a cache file that has been generated or will be generated during the running of the BI tool. For example, when the BI tool is Cognos, when the Cognos service is started, a batch of associated service processes will be started. At the same time, the cache file will also be generated during the running of the BI tool (for example, viewing the report on the BI tool will generate the The relevant cache file for the report data).
- the above cache file information may also be information that the task to be executed will generate a cache file.
- the task to be executed will generate a cache file.
- an A task will be executed on the server, which will occupy 60G of cache capacity when it runs.
- S20 Determine, according to the cache file information, whether a type of the cache file in the server includes a specified type.
- the specified type may be the type of file generated by the application to be run.
- the data cube will be refreshed within half an hour
- the cache file generated in the refresh data cube process may be a file of a specified type.
- the first preset value may be preset according to requirements, and may be determined according to a state of running in the server or a disk size.
- the first preset value may be determined according to the size of the remaining space of the disk in the server of the BI tool, for example, the first preset value is 70% or 80% of the current cache capacity size in the server of the BI tool.
- the first preset value is the value of the remaining space of the disk (50G), and the data cube to be refreshed is 20G after the completion of the generation, but the refresh process will occupy 60G, and at this time, the size of the cache file of the specified type is If the sum is 60G and the disk capacity is 50G, the disk will be exhausted and the refresh will fail. This may cause the server to be abnormal and cache cleaning is necessary.
- the subsequent operations may be stopped, such as stopping to determine whether the sum of the sizes of the cache files of the specified type reaches the first preset value; or waiting for a period of time to determine the server again. Whether the type of the cache file contains the specified type.
- the above refresh service is a service used by BI tools to support the data cube refresh process.
- refresh is a process of forming a data cube by refreshing the corresponding data model and acquiring data from the data source.
- a refreshed cube is used for reporting purposes.
- the data source is also called data source, and the data cube is also called cube.
- the data source can be data that BI tools obtain from other systems in the enterprise (eg, customer relationship management systems, supply chain systems, etc.).
- a data cube is a type of multidimensional matrix.
- the data in a data cube is a form in which the source data has been processed and aggregated.
- determining whether there is a refresh service in the running state in the server may include determining whether there is a running refresh process in the server. Specifically, determining whether there is a running refresh process in the server may be determined by obtaining a name of a currently running process in the server.
- the cache file in the server is cleaned according to whether there is a running refresh service in the server. When there is a refresh service, the cache is cleaned after waiting for the refresh service to be finished. When there is no refresh service, all the There are cache files that do not affect the running of BI tools for cleanup.
- the execution of the cache file in the server may be stopped according to whether the refresh service in the server exists in the server. The operation is performed; or, according to the sum of the sizes of the cache files of the specified type, it is determined whether the size of the cache file of the specified type reaches the first preset value after a certain time interval.
- the step S40 may include any one of the following (1) and (2) to (4):
- the refresh service has some relevance to the cache file directory used by the refresh service when the refresh service is running. Therefore, the specific implementation manner of clearing the cache file that is not used by the refresh service in the running state of the server may be:
- the above full cleanup strategy refers to cleaning all cache files that already exist in the server. When there is no refresh service in the server, you can quickly clean up unnecessary cache files, free up disk space, and improve disk utilization.
- the first use frequency can be set as needed. Obtain a target report that is used more frequently than the first used preset frequency to filter out reports that are frequently accessed.
- the data of the report needs to be obtained from the server in time. If the data exists in the cache, the data can be sent to the client for viewing. Therefore, the cache files other than the cache file corresponding to the target report in the server are cleaned, so that the cache file corresponding to the report with a relatively high frequency is retained. When you look at these reports that are used more frequently, you can quickly present report data and improve the efficiency of BI tools.
- the second use frequency can be set as needed. Meanwhile, the second use frequency may be the same as or different from the first frequency, the second use frequency may be higher than the first use frequency, and the second use frequency may also be lower than the first use frequency.
- the method further includes:
- the cleaning may be performed again after the refresh is completed.
- the re-cleaning time in this embodiment refers to that in the process of cleaning the cache once, if there is a refresh service in the running state, after a part of the cache is cleaned up, when the refresh service stops running, the cleaning cache is further performed. For example, there is a refresh service that is running. After 10 minutes, the refresh service stops running and cache cleaning is performed again. You can do a more thorough cache cleanup.
- the second preset value is smaller than the first preset value, and the second preset value may be set as needed.
- the cache Since when the cache reaches a certain value, it may not release enough disk space after cleaning the cache. Therefore, when the cleanup time is reached, the cache file in the server is cleaned again according to whether there is a running refresh service in the server. Therefore, the cache can be cleaned up in time to avoid affecting the operating efficiency of the system and avoid service anomalies.
- the attribute information of the refresh service may be the name of the refresh process corresponding to the refresh service and/or the running time of the refresh process, etc., so that the possible duration of the refresh process may be reflected.
- the cleaning process is performed again when the cleaning time is reached again, so that the refresh process in the server can be prevented from being acquired too frequently, the cache is cleaned more completely, system resources are saved, and the storage space is greatly saved.
- the method described in the application further includes:
- the reminder information for clearing the cache is displayed in the user interface window, where the reminder information includes The attribute information of the cache file of the specified type and the name of the refresh service in the running state, where the fourth preset value is greater than the second preset value.
- the automatic execution is not performed automatically. Clean up, while the user interface window displays a reminder to clear the cache.
- the reminder information can be displayed through the user interface window, and the user can be reminded in time, so that the user can determine whether to perform targeted cleaning, or stop refreshing and cleaning. Wait for the operation to ensure that the cache can be cleaned up in time.
- the reminder information of the above clearing cache includes attribute information of the specified type of cache file and a name of a refresh service in a running state.
- the attribute information of the cache file of the specified type may include information such as the name, type, and size of the cache file of the specified type.
- the attribute information of the largest cache file among the specified types of cache files and/or the attribute information of the cache file whose size is larger than a certain size among the cache files of the specified type may be displayed.
- the reminder information of the clearing cache is displayed in the user interface window, so that the user can intuitively understand the information of the cache file and the information of the refresh service without searching, so that the user can quickly locate the cache file to be cleaned, and then Improve the efficiency of cleaning up cache files.
- the cache cleaning method further includes:
- the time for performing cache cleaning again determined here is based on the complete cleanup information of this time to determine the time to clear the cache by the cache cleaning method described in the present application next time.
- the information of the cached file that is cleaned may include, but is not limited to, the size of the cached file that has been cleaned, the type of the cached file that has been cleaned, and the number of cached files that have been cleaned up.
- the information of the cleaned cache file can reflect the cache file size and which cache files are generated by which running tasks.
- the information of the cleaned cache file can also directly reflect the disk pressure of the server, which is beneficial to judge the size and complexity of the data cube when the BI tool is running.
- the current cache cleanup time is 2 hours from the last cache cleanup, and the total size of the cleaned cache file is larger.
- the time to clean the cache file again can be adjusted to 1 hour later, which shortens the time for cache cleanup again.
- the time to clear the cache file based on the information of the cleaned cache file and the current process information of the server. For example, when the server has a small number of processes, it indicates that the server is running fewer applications, and if there are more cache files generated at this time, the same process information is running or the number of processes is increased, and the cache is shortened again. The time of cleaning allows the cache file to be processed in a timely manner.
- the cache cleaning time is performed again, and the cache cleaning time can be dynamically adjusted, and the cache cleaning is performed according to the running of the system, and the cleaning time is determined more accurately, thereby being more timely.
- the cache is cleaned up.
- the cache described in this application may also be triggered by the following steps. Clean up methods for cache cleanup to improve system efficiency.
- the cache cleaning method may include:
- the third preset value is smaller than the first preset value, and the specific value may be set as needed.
- Step S10 is performed again after the preset time, and the cache file in the BI tool is cleaned in time by the cache cleaning method described in the foregoing application.
- the above preset time can be set as needed. Specifically, the preset time may be determined according to the third preset value.
- the method may further include:
- the time condition for determining whether the system time satisfies the cache cleanup may be: determining whether the current system time is a specified time. If the current system time is a specified time, determining that the system time meets the cache cleanup time condition.
- the current system time is 7:00 pm, and if so, it is determined that the system time satisfies the time condition of the cache cleanup.
- the current system time interval clears the cache time for one hour, and if so, determines that the system time satisfies the cache cleanup time condition.
- the operation of generating the cache file in the obtaining server may be initiated by using a crontab command of the Linux system.
- the cache cleaning is triggered by the judgment of the system time, and the cache cleaning can be performed in time to release the disk space.
- the cache cleaning method provided by the present application obtains cache file information in the server, and determines, according to the cache file information, whether the type of the cache file in the server includes a specified type; if yes, determines a sum of sizes of the cache files of the specified type. Whether the first preset value is reached; if the sum of the sizes of the cache files of the specified type reaches the first preset value, according to whether there is a refresh service in the server to the cache file in the server Clean up. When the cache reaches a certain amount, the cache is cleaned, thereby improving the disk space utilization and system operation efficiency, and avoiding the risk of service abnormality caused by the cache not being cleaned up.
- the present application cleans the cache file in the server according to whether there is a refresh service in the server in the running state, and in the BI tool, when there is a running refresh service, there may be an application service running, and no refresh service running. There will be no running application services. Therefore, the cache cleaning by this application does not affect the operation of the refresh service and other application services, and avoids the risk of system crash caused by improper cleaning of the cache.
- FIG. 2 is a functional block diagram of a cache cleaning apparatus according to an embodiment of the present application.
- the cache cleaning device includes an obtaining module 210, a determining module 220, and a cleaning module 230.
- a module as referred to herein refers to a series of computer readable instruction segments that can be executed by a processor of a computer device and that are capable of performing a fixed function, which are stored in a memory of the computer device.
- the functions of the respective modules will be described in detail in the subsequent embodiments.
- the obtaining module 210 is configured to obtain cache file information in the server.
- the cache cleaning device described in the present application can be used to clean up a cache in a business intelligence (BI) analysis tool.
- BI business intelligence
- the above server refers to a server of a business intelligence (BI) analysis tool.
- BI business intelligence
- the server of the BI tool can be a Linux server, and the online Analytical Processing (OLAP) can be performed on the server of the BI tool.
- OLAP online Analytical Processing
- the number of BI tool servers can be any number, and the specific quantity depends on actual needs.
- the above cache file information may be information of a cache file that has been generated or will be generated during the running of the BI tool. For example, when the BI tool is Cognos, when the Cognos service is started, a batch of associated service processes will be started. At the same time, the cache file will also be generated during the running of the BI tool (for example, viewing the report on the BI tool will generate the The relevant cache file for the report data).
- the above cache file information may also be information that the task to be executed will generate a cache file.
- the task to be executed will generate a cache file.
- an A task will be executed on the server, which will occupy 60G of cache capacity when it runs.
- the determining module 220 is configured to determine, according to the cache file information, whether the type of the cache file in the server includes a specified type.
- the specified type may be the type of file generated by the application to be run.
- the data cube will be refreshed within half an hour
- the cache file generated in the refresh data cube process may be a file of a specified type.
- the determining module 220 is further configured to determine, if the type of the cache file in the server includes the specified type, whether the sum of the sizes of the cache files of the specified type reaches a first preset value.
- the first preset value may be preset according to requirements, and may be determined according to a state of running in the server or a disk size.
- the first preset value may be determined according to the size of the remaining space of the disk in the server of the BI tool, for example, the first preset value is 70% or 80% of the current cache capacity size in the server of the BI tool.
- the first preset value is the value of the remaining space of the disk (50G), and the data cube to be refreshed is 20G after the completion of the generation, but the refresh process will occupy 60G, and at this time, the size of the cache file of the specified type is If the sum is 60G and the disk capacity is 50G, the disk will be exhausted and the refresh will fail. This may cause the server to be abnormal and cache cleaning is necessary.
- the cache file in the server may stop determining whether the sum of the sizes of the cache files of the specified type reaches the first preset value, or wait for a period of time to determine the cache file in the server again. Whether the type contains the specified type.
- the cleaning module 230 is configured to: if the sum of the sizes of the cache files of the specified type reaches the first preset value, clean the cache file in the server according to whether the refresh service in the server exists in the running state .
- the above refresh service is a service used by BI tools to support the data cube refresh process.
- refresh is a process of forming a data cube by refreshing the corresponding data model and acquiring data from the data source.
- a refreshed cube is used for reporting purposes.
- the data source is also called data source, and the data cube is also called cube.
- the data source can be data that BI tools obtain from other systems in the enterprise (eg, customer relationship management systems, supply chain systems, etc.).
- a data cube is a type of multidimensional matrix.
- the data in a data cube is a form in which the source data has been processed and aggregated.
- determining whether there is a refresh service in the running state in the server may include determining whether there is a running refresh process in the server. Specifically, determining whether there is a running refresh process in the server may be determined by obtaining a name of a currently running process in the server.
- the cache file in the server is cleaned according to whether there is a running refresh service in the server. When there is a refresh service, the cache is cleaned after waiting for the refresh service to be finished. When there is no refresh service, all the There are cache files that do not affect the running of BI tools for cleanup.
- the cleaning module may also be controlled to stop executing the cache file in the server according to whether there is a refresh service in the server in the running state. The operation of performing the cleaning; or determining whether the size of the cache file of the specified type reaches the first preset value after a certain time interval according to the sum of the sizes of the cache files of the specified type.
- the cleaning module 230 is specifically configured to:
- the refresh service has some relevance to the cache file directory used by the refresh service when the refresh service is running. Therefore, the specific implementation manner of clearing the cache file that is not used by the refresh service in the running state of the server may be:
- the above full cleanup strategy refers to cleaning all cache files that already exist in the server. When there is no refresh service in the server, you can quickly clean up unnecessary cache files, free up disk space, and improve disk utilization.
- the first use frequency can be set as needed. Obtain a target report that is used more frequently than the first used preset frequency to filter out reports that are frequently accessed.
- the data of the report needs to be obtained from the server in time. If the data exists in the cache, the data can be sent to the client for viewing. Therefore, the cache files other than the cache file corresponding to the target report in the server are cleaned, so that the cache file corresponding to the report with a relatively high frequency is retained. When you look at these reports that are used more frequently, you can quickly present report data and improve the efficiency of BI tools.
- the second use frequency can be set as needed. Meanwhile, the second use frequency may be the same as or different from the first frequency, the second use frequency may be higher than the first use frequency, and the second use frequency may also be lower than the first use frequency.
- the apparatus described in this application further includes a first determining module and a cleanup triggering module.
- a first determining module configured to: if there is a refresh service in the running state in the server, and the size of the specified type of the cache file reaches a second preset value, determine, according to the attribute information of the refresh service in the running state, to clean up again time.
- the cleaning module is used to clean up the cache file that is not used by the refresh service in the server, when the refresh time is reached, the cleaning module is triggered to perform a refresh service according to whether the server is in the running state. Clean up the cache file in the server.
- the trigger cleanup module 230 cleans the cache file in the server according to whether there is a refresh service in the server.
- the cleaning may be performed again after the refresh is completed.
- the re-cleaning time in this embodiment refers to that in the process of cleaning the cache once, if there is a refresh service in the running state, after a part of the cache is cleaned up, when the refresh service stops running, the cleaning cache is further performed. For example, there is a refresh service that is running. After 10 minutes, the refresh service stops running and cache cleaning is performed again. You can do a more thorough cache cleanup.
- the second preset value is smaller than the first preset value, and the second preset value may be set as needed.
- the cache Since when the cache reaches a certain value, it may not release enough disk space after cleaning the cache. Therefore, when the cleanup time is reached, the cache file in the server is cleaned again according to whether there is a running refresh service in the server. Therefore, the cache can be cleaned up in time to avoid affecting the operating efficiency of the system and avoiding service anomalies.
- the attribute information of the refresh service may be the name of the refresh process corresponding to the refresh service and/or the running time of the refresh process, etc., so that the possible duration of the refresh process may be reflected.
- the cleaning process is performed again when the cleaning time is reached again, so that the refresh process in the server can be prevented from being obtained too frequently, the cache is cleaned more completely, the system resources are saved, and the storage space is greatly saved.
- the apparatus described in the present application further includes a reminding module.
- the reminding module is configured to: if the refresh service in the running state exists in the server, and the sum of the sizes of the specified types of cache files reaches a fourth preset value, the reminder information for clearing the cache is displayed in the user interface window,
- the reminder information includes attribute information of the specified type of cache file and a name of a refresh service in an operating state, and the fourth preset value is greater than the second preset value.
- the automatic execution is not performed automatically. Clean up, while the user interface window displays a reminder to clear the cache.
- the reminder information can be displayed through the user interface window, and the user can be reminded in time, so that the user can determine whether to perform targeted cleaning, or stop refreshing and cleaning. Wait for the operation to ensure that the cache can be cleaned up in time.
- the reminder information of the above clearing cache includes attribute information of the specified type of cache file and a name of a refresh service in a running state.
- the attribute information of the cache file of the specified type may include information such as the name, type, and size of the cache file of the specified type.
- the attribute information of the largest cache file among the specified types of cache files and/or the attribute information of the cache file whose size is larger than a certain size among the cache files of the specified type may be displayed.
- the reminder information of the clearing cache is displayed in the user interface window, so that the user can intuitively understand the information of the cache file and the information of the refresh service without searching, so that the user can quickly locate the cache file to be cleaned, and then Improve the efficiency of cleaning up cache files.
- the cache cleaning apparatus further includes a statistics module and a second determining module.
- the statistics module is configured to collect information about the cleared cache file after the cache file in the server is cleaned.
- a second determining module configured to determine, according to the information of the cleared cache file and the cache cleaning time, a time for performing cache cleaning again; or, according to the information of the cleaned cache file and the process information of the server, Determine when to cache cleanup again.
- the time for performing cache flushing determined here is based on the complete cleanup information of this time to determine the time to clear the cache by the cache cleaning device described in the present application next time.
- the information of the cached file that is cleaned may include, but is not limited to, the size of the cached file that has been cleaned, the type of the cached file that has been cleaned, and the number of cached files that have been cleaned up.
- the information of the cleaned cache file can reflect the cache file size and which cache files are generated by which running tasks.
- the information of the cleaned cache file can also directly reflect the disk pressure of the server, which is beneficial to judge the size and complexity of the data cube when the BI tool is running.
- the current cache cleanup time is 2 hours from the last cache cleanup, and the total size of the cleaned cache file is larger.
- the time to clean the cache file again can be adjusted to 1 hour later, which shortens the time for cache cleanup again.
- the time to clear the cache file based on the information of the cleaned cache file and the current process information of the server. For example, when the server has a small number of processes, it indicates that the server is running fewer applications, and if there are more cache files generated at this time, the same process information is running or the number of processes is increased, and the cache is shortened again. The time of cleaning allows the cache file to be processed in a timely manner.
- the cache cleaning time is performed again, and the cache cleaning time can be dynamically adjusted, and the cache cleaning is performed according to the running of the system, and the cleaning time is determined more accurately, thereby being more timely.
- the cache is cleaned up.
- the apparatus described in the present application may further include a trigger module, specifically:
- the determining module is further configured to: if the type of the cache file in the server includes the specified type, and the sum of the sizes of the cache files of the specified type does not reach the first preset value, determine the specified type Whether the size of the cache file reaches a third preset value, wherein the first preset value is greater than the third preset value.
- the triggering module is configured to trigger the obtaining module to obtain the cache file information in the server, if the size of the specified type of the cache file reaches a third preset value, after the preset time.
- the third preset value is smaller than the first preset value, and the specific value may be set as needed.
- the acquisition module 210 is triggered to perform operations, and then the cache file in the BI tool is cleaned in time.
- the above preset time can be set as needed. Specifically, the preset time may be determined according to the third preset value.
- the determining module is further configured to obtain a system time of the server, and determine whether the system time meets a time condition of the cache cleaning.
- the triggering module is further configured to trigger the obtaining module to obtain the cache file information in the server if the system time satisfies the time condition of the cache cleaning.
- the time condition for determining whether the system time satisfies the cache cleanup may be: determining whether the current system time is a specified time. If the current system time is a specified time, determining that the system time meets the cache cleanup time condition.
- the current system time is 7:00 pm, and if so, it is determined that the system time satisfies the time condition of the cache cleanup.
- the current system time interval clears the cache time for one hour, and if so, determines that the system time satisfies the time condition of the cache cleanup.
- the operation of generating the cache file in the obtaining server may be initiated by using a crontab command of the Linux system.
- the trigger acquisition module 210 is triggered to perform the operation by the judgment of the system time, and then the cache file in the BI tool is cleaned in time, and the cache cleaning can be performed in time to release the disk space.
- the cache cleaning device obtains the cache file information in the server by the obtaining module; the determining module determines, according to the cache file information, whether the type of the cache file in the server includes a specified type; and if the type of the cache file in the server Including the specified type, the determining module determines whether the sum of the sizes of the cache files of the specified type reaches a first preset value; if the sum of the sizes of the cache files of the specified type reaches the first preset value
- the cleaning module cleans the cache file in the server according to whether there is a running refresh service in the server. When the cache reaches a certain amount, the cache is cleaned, thereby improving the disk space utilization and system operation efficiency, and avoiding the risk of service abnormality caused by the cache not being cleaned up.
- the present application cleans the cache file in the server according to whether there is a refresh service in the server in the running state, and in the BI tool, when there is a running refresh service, there may be an application service running, and no refresh service running. There will be no running application services. Therefore, the cache cleaning by this application does not affect the operation of the refresh service and other application services, and avoids the risk of system crash caused by improper cleaning of the cache.
- the above-described integrated unit implemented in the form of a software function module can be stored in a non-volatile readable storage medium.
- the software function module described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods described in various embodiments of the present application. Part of the steps.
- FIG. 3 is a schematic structural diagram of a computer apparatus according to a preferred embodiment of the present invention.
- the computer device comprises at least one transmitting device 31, at least one memory 32, at least one processor 33, at least one receiving device 34 and at least one communication bus.
- the communication bus is used to implement connection communication between these components.
- the computer device is a device capable of automatically performing numerical calculation and/or information processing according to an instruction set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor and an application specific integrated circuit (ASIC). , Field-Programmable Gate Array (FPGA), Digital Signal Processor (DSP), embedded devices, etc.
- the computer device may also include a network device and/or a user device.
- the network device includes, but is not limited to, a single network server, a server group composed of multiple network servers, or a cloud computing-based cloud composed of a large number of hosts or network servers, where the cloud computing is distributed computing.
- a super virtual computer consisting of a group of loosely coupled computers.
- the network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), and the like.
- the Internet includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), and the like.
- VPN virtual private network
- the receiving device 34 and the transmitting device 31 may be wired transmission ports, or may be wireless devices, for example, including antenna devices, for performing data communication with other devices.
- the memory 32 is used to store program code.
- the memory 32 may be a circuit having a storage function, such as a RAM (Random-Access Memory), a FIFO (First In First Out), or the like, which has no physical form in the integrated circuit.
- the memory 32 may also be a memory having a physical form, such as a memory stick, a TF card (Trans-flash Card), a smart media card, a secure digital card, a flash memory card.
- Storage devices such as (flash card) and the like.
- the processor 33 can include one or more microprocessors, digital processors.
- the processor 33 can call program code stored in the memory 32 to perform related functions. For example, the various units described in FIG. 3 are program code stored in the memory 32 and executed by the processor 33 to implement a cache cleanup method.
- the processor 33 also known as a central processing unit (CPU), is a very large-scale integrated circuit, which is a computing core (Core) and a control unit (Control Unit).
- modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software function modules.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请提供一种缓存清理方法,包括:获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。本申请还公开了一种缓存清理装置、计算机装置和非易失性可读存储介质。本申请可以能够对缓存进行清理,从而提升磁盘的空间利用率以及系统运行效率,避免缓存不清理带来的服务异常的风险。
Description
本申请要求于2018年04月10日提交中国专利局,申请号为201810315716.9发明名称为“缓存清理方法、装置、计算机装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据处理技术领域,尤其涉及一种缓存清理方法、装置、计算机装置及存储介质。
商业智能(Business Intelligence,BI)分析工具也称为BI工具。BI工具是一种将企业中应用的各系统数据进行有效的整合,快速准确地提供报表的工具,可以帮助使用者了解所需的企业信息以及帮助使用者做出经营决策。常见的BI工具有Cognos,OBIEE,BO等。
BI工具运行时会产生大量缓存,需要及时进行清理。以Cognos为例,Cognos在启动过程中,会启动一系列的Cognos服务,即Cognos应用启动过程也可视为Cognos服务启动的过程,Cognos应用的功能由一个个的服务分别提供(如,LogService日志服务提供Cognos运行过程中写日志的服务)。在Cognos应用运行过程中以及Cognos刷新过程中都会产生缓存,若缓存得不到及时清理,会影响Cognos应用运行。
发明内容
鉴于以上内容,有必要提供一种缓存清理方法、装置、计算机装置及存储介质,能够对缓存进行清理,从而提升磁盘的空间利用率以及系统运行效率,避免缓存不清理带来的服务异常的风险。
本申请提供一种缓存清理方法,所述方法包括:
获取服务器中的缓存文件信息;
根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;
若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;
若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
本申请还提供一种缓存清理装置,所述装置包括:
获取模块,用于获取服务器中的缓存文件信息;
判断模块,用于根据所述缓存文件信息判断所述服务器中缓存文件的类 型是否包含指定类型;
所述判断模块,还用于若所述服务器中缓存文件的类型包含所述指定类型,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;
清理模块,用于若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
本申请还提供一种计算机装置,所述计算机装置包括存储器及处理器,所述存储器用于存储至少一个指令,所述处理器用于执行所述至少一个指令以实现任意实施例中所述的缓存清理方法。
本申请还提供一种非易失性可读存储介质,其特征在于,所述非易失性可读存储介质存储有至少一个指令,所述至少一个指令被处理器执行时实现任意实施例中所述的缓存清理方法。
由以上技术方案看出,本申请通过获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。使得在缓存达到一定量时,就对缓存进行清理,从而提升磁盘的空间利用率以及系统运行效率,避免缓存不清理带来的服务异常的风险。
并且,本申请根据服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理,而在BI工具中,存在运行的刷新服务时,可能有应用服务运行,没有运行的刷新服务时,也不会有运行的应用服务。因此,通过本申请进行缓存清理时不会影响刷新服务以及其他应用服务的运行,避免了由于清理缓存不当,带来的系统崩溃风险。
图1是本申请实施例提供的一种缓存清理方法的流程图;
图2是本申请实施例提供的缓存清理装置的功能模块图;
图3是本申请实现缓存清理方法的较佳实施例的计算机装置的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
如图1所示,图1为本申请实施例提供的一种缓存清理方法的流程图。 根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。
S10,获取服务器中的缓存文件信息。
本申请所述的缓存清理方法可用于对商业智能(Business Intelligence,BI)分析工具中的缓存进行清理。
其中,上述服务器是指商业智能(Business Intelligence,BI)分析工具的服务器。
具体的,BI工具的服务器可以为Linux服务器,在BI工具的服务器上可进行联机分析处理(Online Analytical Processing,OLAP)等操作。在部署BI工具时,BI工具服务器的数量可以为任意个,具体的数量根据实际需要而定。
上述缓存文件信息可以是BI工具启动后在运行过程中已产生或者将要产生的缓存文件的信息。例如,当BI工具为Cognos时,当Cognos服务启动后,会启动一批关联的服务进程,同时,在BI工具运行过程中也会产生缓存文件(如,在BI工具上查看报表,会产生该报表数据的相关缓存文件)。
同时,上述缓存文件信息也可以是将要执行的任务将会产生缓存文件的信息。例如,在服务器上将要执行A任务,该任务运行时将占用60G的缓存容量。
S20,根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型。
优选的,指定类型可以是将要运行的应用所产生的文件类型。例如,根据任务执行计划,在半个小时内将要刷新数据立方体,则该刷新数据立方体(Cube)过程中产生的缓存文件可以为指定类型的文件。
S30,若所述服务器中缓存文件的类型包含所述指定类型,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值。
上述第一预设值可以根据需要预先设定,可以依服务器中运行的状态或者磁盘大小而定。
优选的,第一预设值可以根据BI工具的服务器中磁盘剩余空间的大小来确定,例如第一预设值为BI工具的服务器中当前缓存容量大小的70%或80%。
又比如,第一预设值为磁盘剩余空间的值(50G),将要刷新的数据立方体,完成生成后是20G,但是刷新过程过中将占用60G,则此时,指定类型的缓存文件大小之和为60G,达到且超过磁盘剩余容量50G,则在刷新过程中,磁盘会耗尽,刷新会失败,可能会导致服务器异常,有必要进行缓存清理。
当服务器中缓存文件的类型不包含指定类型时,可停止执行后续的操作,如停止判断指定类型的缓存文件的大小之和是否达到第一预设值;或者是等待一段时间之后再次判断服务器中缓存文件的类型是否包含指定类型。
S40,若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文 件进行清理。
上述刷新服务是BI工具用来支撑数据立方体(Cube)刷新过程的服务。
其中,刷新是通过刷新对应的数据模型,从数据源获取数据,形成数据立方体(Cube)的过程。刷新好的Cube用于提供给报表使用。
具体的,数据源又称为data source,数据立方体又称为cube。数据源可以是BI工具从企业的其他系统(例如,客户关系管理系统、供应链系统等)中获取到的数据。数据立方体是一类多维矩阵,数据立方体中的数据是已经将源数据经过处理并聚合成立方形式。
同时,判断服务器中是否存在处于运行状态的刷新服务可包括判断服务器中是否存在运行中的刷新进程。具体的,判断服务器中是否存在运行中的刷新进程,可以通过获取服务器中当前运行中的进程的名称来判断。
根据服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理,可以是当存在刷新服务时,等待刷新服务结束后再进行缓存清理,当不存在刷新服务时可以将所有已存在的不影响BI工具运行的缓存文件进行清理。
在本申请其他实施例中,若指定类型的缓存文件的大小之和没有达到第一预设值,也可以停止执行根据服务器中是否存在处于运行状态的刷新服务对服务器中的缓存文件进行清理的操作;或者,根据指定类型的缓存文件的大小之和来确定是否间隔一定时间之后再判断指定类型的缓存文件的大小是否达到第一预设值。
进一步地,在本申请其他实施例中,所述步骤S40可包括以下(1)以及(2)至(4)中任一项:
(1)若所述服务器中存在处于运行状态的刷新服务,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件。
通常,在刷新服务运行时,刷新服务与刷新服务使用的缓存文件目录具有一定的关联性。因此,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件的具体实现方式可以为:
轮询服务器中每一个缓存目录,获取服务器中每一个缓存目录的名称,根据缓存目录的名称及服务器中运行的刷新进程的名称来判断该缓存目录是否是刷新进程所使用的缓存。如果该缓存目录不是刷新进程所使用的缓存,则对该缓存目录下的缓存文件进行清理,如果该缓存目录是刷新进程所使用的缓存,则不对该缓存目录下的缓存文件进行清理。
通过清理所述服务器中处于运行状态的刷新服务未使用的缓存文件,不仅对缓存文件进行了清理,也避免了影响刷新进程。
(2)若所述服务器中不存在处于运行状态的刷新服务,通过全清理策略对所述服务器中缓存文件进行清理。
其中,上述全清理策略是指对服务器中已存在的所有缓存文件进行清理。则当服务器中不存在刷新服务时,可以快速清理掉不需要的缓存文件,释放磁盘空间,提高磁盘利用率。
(3)若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第一使用频率的目标报表,将所述服务器中所述目标报表对应的缓存文件以外的其他缓存文件进行清理。
其中,上述第一使用频率可以根据需要设定。获取使用频率大于第一使用预设频率的目标报表用于筛选出经常被访问的报表。
当用户在客户端查看某一报表时,需要及时的从服务器中获取该报表的数据,此时若缓存中存在该数据,可以及时的将数据发送至客户端供用户进行查看。因此,将服务器中目标报表对应的缓存文件以外的其他缓存文件进行清理,使得使用频率较大的报表对应的缓存文件被保留。当再次查看使用频率较大的这些报表时,能够快速的将报表数据呈现,提高BI工具运行的效率。
(4)若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第二使用频率的目标缓存文件,将所述服务器中所述目标缓存文件以外的其他缓存文件进行清理。
其中,上述第二使用频率可以根据需要设定。同时,第二使用频率与第一频率可以相同或者不相同,第二使用频率可以高于第一使用频率,第二使用频率也可以低于第一使用频率。
获取使用频率大于第二使用频率的目标缓存文件用于筛选出使用频率较高的文件。
将服务器中目标缓存文件以外的其他缓存文件进行清理,可以清除使用频率较低的缓存文件,并且保留使用频率较高的缓存文件。从而在释放磁盘空间的同时,保证BI系统运行的效率。
进一步地,在本申请其他实施例中,所述方法还包括:
若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间;清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,执行所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理的操作。
在本实施例中,当服务器中存在刷新服务,且指定类型的缓存极大时,可在刷新结束后再次进行清理。
具体的,本实施例中的再次清理时间是指在一次清理缓存的过程中,若存在处于运行状态的刷新服务,当清理完一部分缓存之后,等到刷新服务停止运行时,接着再进行清理缓存。例如,存在处于运行状态的刷新服务。当10分钟之后,该刷新服务停止运行,再次进行缓存清理。可以更加彻底的进行缓存清理。
其中,上述第二预设值小于第一预设值,第二预设值可以根据需要设定。
由于当缓存达到一定值时,可能在清理缓存之后仍然没有释放足够的磁盘空间。因此,在达到再次清理时间时,再次根据服务器中是否存在处于运行状态的刷新服务对服务器中的缓存文件进行清理。从而可以及时的清理缓 存,避免影响系统的运行效率,避免服务异常。
同时,由于上述刷新服务的属性信息可以是刷新服务对应的刷新进程的名称和/或刷新进程的已运行时间等,从而可以反映刷新进程的可能持续时间。
在本实施例中,通过再次清理时间达到时再次进行清理,可以避免过于频繁的获取服务器中的刷新进程,更加彻底的对缓存进行清理,节省系统资源,并且有利于极大的释放存储空间。
可选的,在本申请其他实施例中,本申请所述的方法还包括:
若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小之和达到第四预设值,在用户界面窗口显示清理缓存的提醒信息,其中,所述提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称,所述第四预设值大于所述第二预设值。
在本实施例中,当服务器中存在刷新进程时,若指定类型的缓存文件的大小之和达到第四预设值,即指定类型的缓存文件的大小大于第二预设值,不对其自动进行清理,而在用户界面窗口显示清理缓存的提醒信息。
当缓存文件较大时,可能需要立即进行处理,此时可以通过用户界面窗口显示提醒信息,及时的向用户进行提醒,使得用户可以确定是否需要执行针对性的进行清理,或者是停止刷新进行清理等操作,从而保证缓存能够被及时清理。
同时,上述清理缓存的提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称。
上述指定类型的缓存文件的属性信息可以包括指定类型的缓存文件的名称、类型和大小等信息。
具体的,可以显示指定类型的缓存文件之中最大的缓存文件的属性信息和/或指定类型的缓存文件之中大小为大于某一大小的缓存文件的属性信息。
在本实施例中,在用户界面窗口显示清理缓存的提醒信息,使得用户可以无需查找就可以直观的了解到缓存文件的信息以及刷新服务的信息,方便用户快速定位要清理的缓存文件,进而可以提高缓存文件的清理效率。
可选的,在本申请其他实施例中,所述缓存清理方法还包括:
对所述服务器中的缓存文件进行清理之后,统计已清理的缓存文件的信息;以及
根据所述已清理的缓存文件的信息以及缓存清理时间,确定再次进行缓存清理的时间;或者,根据所述已清理的缓存文件的信息以及所述服务器的进程信息,确定再次进行缓存清理的时间。
这里确定的再次进行缓存清理的时间是根据本次的完整清理信息来确定下一次再通过本申请所述的缓存清理方法来清理缓存的时间。
具体的,统计已清理的缓存文件的信息可以包括但不限于:已清理的缓存文件的大小,已清理的缓存文件的类型,已清理的缓存文件的数量。
已清理的缓存文件的信息可以反映缓存文件大小以及由哪些运行任务产 生了何种缓存文件。已清理的缓存文件的信息也可以直接反映出服务器的磁盘压力,有利于对BI工具运行时,数据立方体大小、复杂度进行判断。
当已清理的缓存文件的数量较多,或者已清理的缓存文件的总大小较大时,说明在当前BI工具的运行产生较多的缓存需要及时清理,因此可以缩短再次进行缓存清理的时间。
例如,当前缓存清理距离上一次缓存清理的时间为2小时,已清理的缓存文件的总大小较大,则再次清理缓存文件的时间可以调整为1小时以后,即缩短了再次进行缓存清理的时间。
同时,还可以根据已清理的缓存文件的信息以及服务器当前的进程信息来再次确定清理缓存文件的时间。例如,当服务器当前的进程数较少,表明服务器运行了较少的应用,而若此时产生的缓存文件也较多,则同样的进程信息运行时或者是进程数变多时,缩短再次进行缓存清理的时间,使得缓存文件可以及时的得到处理。
在本实施例中,根据缓存的清理结果来确定再次进行缓存清理的时间,可以动态的调整缓存清理的时间,根据系统的运行来进行缓存清理,清理时间的确定更为精确,从而可以更加及时的进行缓存清理。
可选的,在本申请其他实施例中,当服务器中指定类型的缓存文件的大小之和虽然小于第一预设值,但是仍然较大时,也可以通过以下步骤触发本申请所述的缓存清理方法进行缓存清理,以提高系统的运行效率。所述缓存清理方法可包括:
(1)若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的缓存文件的大小之和未达到第一预设值时,判断所述指定类型的缓存文件的大小是否达到第三预设值,其中,所述第一预设值大于所述第三预设值;
(2)若是,预设时间之后,执行所述获取服务器中的缓存文件信息的操作。
其中,第三预设值小于第一预设值,其具体值可以根据需要设定。
当指定类型的缓存文件的大小之和达到第三预设值但并未达到第一预设值时,说明指定类型的缓存文件的大小没有达到进行清理的条件,但是达到某一程度,可以在预设时间之后再次执行步骤S10,进而通过前述本申请所述的缓存清理方法对BI工具中的缓存文件进行及时的清理。
上述预设时间可以根据需要设定。具体的,预设时间可以根据第三预设值而定。
可选的,在本申请其他实施例中,所述方法还可包括:
(1)获取所述服务器的系统时间,判断所述系统时间是否满足缓存清理的时间条件;
(2)若是,执行所述获取服务器中的缓存文件信息的操作。
其中,判断系统时间是否满足缓存清理的时间条件可以是,判断当前的系统时间是否为某一指定时间,若当前的系统时间为某一指定时间,则确定系统时间满足缓存清理的时间条件。
例如,判断当前的系统时间是否为晚上7点,若是,确定系统时间满足缓存清理的时间条件。
或者,判断当前的系统时间间隔上一次清理缓存的时间是否达到某一指定时间。
例如,判断当前的系统时间间隔上一次清理缓存的时间是否达到1小时,若是,确定系统时间满足缓存清理的时间条件。
具体的,可以通过Linux系统的crontab命令来发起执行所述获取服务器中产生缓存文件的操作。
在本实施例中,通过系统时间的判断来触发缓存的清理,可以及时的进行缓存清理,释放磁盘空间。
本申请提供的缓存清理方法获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。使得在缓存达到一定量时,就对缓存进行清理,从而提升磁盘的空间利用率以及系统运行效率,避免缓存不清理带来的服务异常的风险。
并且,本申请根据服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理,而在BI工具中,存在运行的刷新服务时,可能有应用服务运行,没有运行的刷新服务时,也不会有运行的应用服务。因此,通过本申请进行缓存清理时不会影响刷新服务以及其他应用服务的运行,避免了由于清理缓存不当,带来的系统崩溃风险。
如图2所示,图2为本申请实施例提供的缓存清理装置的功能模块图。所述缓存清理装置包括获取模块210、判断模块220和清理模块230。本申请所称的模块是指一种能够被计算机装置的处理器所执行并且能够完成固定功能的一系列计算机可读指令段,其存储在计算机装置的存储器中。在本实施例中,关于各模块的功能将在后续的实施例中详述。
获取模块210,用于获取服务器中的缓存文件信息。
本申请所述的缓存清理装置可用于对商业智能(Business Intelligence,BI)分析工具中的缓存进行清理。
其中,上述服务器是指商业智能(Business Intelligence,BI)分析工具的服务器。
具体的,BI工具的服务器可以为Linux服务器,在BI工具的服务器上可进行联机分析处理(Online Analytical Processing,OLAP)等操作。在部署BI工具时,BI工具服务器的数量可以为任意个,具体的数量根据实际需要而定。
上述缓存文件信息可以是BI工具启动后在运行过程中已产生或者将要产生的缓存文件的信息。例如,当BI工具为Cognos时,当Cognos服务启动后,会启动一批关联的服务进程,同时,在BI工具运行过程中也会产生缓 存文件(如,在BI工具上查看报表,会产生该报表数据的相关缓存文件)。
同时,上述缓存文件信息也可以是将要执行的任务将会产生缓存文件的信息。例如,在服务器上将要执行A任务,该任务运行时将占用60G的缓存容量。
判断模块220,用于根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型。
优选的,指定类型可以是将要运行的应用所产生的文件类型。例如,根据任务执行计划,在半个小时内将要刷新数据立方体,则该刷新数据立方体(Cube)过程中产生的缓存文件可以为指定类型的文件。
所述判断模块220,还用于若所述服务器中缓存文件的类型包含所述指定类型,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值。
上述第一预设值可以根据需要预先设定,可以依服务器中运行的状态或者磁盘大小而定。
优选的,第一预设值可以根据BI工具的服务器中磁盘剩余空间的大小来确定,例如第一预设值为BI工具的服务器中当前缓存容量大小的70%或80%。
又比如,第一预设值为磁盘剩余空间的值(50G),将要刷新的数据立方体,完成生成后是20G,但是刷新过程过中将占用60G,则此时,指定类型的缓存文件大小之和为60G,达到且超过磁盘剩余容量50G,则在刷新过程中,磁盘会耗尽,刷新会失败,可能会导致服务器异常,有必要进行缓存清理。
同时,当判断得到服务器中缓存文件的类型不包含指定类型时,可停止判断指定类型的缓存文件的大小之和是否达到第一预设值,或者是等待一段时间之后再次判断服务器中缓存文件的类型是否包含指定类型。
清理模块230,用于若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
上述刷新服务是BI工具用来支撑数据立方体(Cube)刷新过程的服务。
其中,刷新是通过刷新对应的数据模型,从数据源获取数据,形成数据立方体(Cube)的过程。刷新好的Cube用于提供给报表使用。
具体的,数据源又称为data source,数据立方体又称为cube。数据源可以是BI工具从企业的其他系统(例如,客户关系管理系统、供应链系统等)中获取到的数据。数据立方体是一类多维矩阵,数据立方体中的数据是已经将源数据经过处理并聚合成立方形式。
同时,判断服务器中是否存在处于运行状态的刷新服务可包括判断服务器中是否存在运行中的刷新进程。具体的,判断服务器中是否存在运行中的刷新进程,可以通过获取服务器中当前运行中的进程的名称来判断。
根据服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理,可以是当存在刷新服务时,等待刷新服务结束后再进行缓存 清理,当不存在刷新服务时可以将所有已存在的不影响BI工具运行的缓存文件进行清理。
在本申请其他实施例中,若指定类型的缓存文件的大小之和没有达到第一预设值,也可以控制清理模块停止执行根据服务器中是否存在处于运行状态的刷新服务对服务器中的缓存文件进行清理的操作;或者,根据指定类型的缓存文件的大小之和来确定是否间隔一定时间之后再判断指定类型的缓存文件的大小是否达到第一预设值。
进一步地,在本申请其他实施例中,清理模块230具体用于:
(1)若所述服务器中存在处于运行状态的刷新服务,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件。
通常,在刷新服务运行时,刷新服务与刷新服务使用的缓存文件目录具有一定的关联性。因此,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件的具体实现方式可以为:
轮询服务器中每一个缓存目录,获取服务器中每一个缓存目录的名称,根据缓存目录的名称及服务器中运行的刷新进程的名称来判断该缓存目录是否是刷新进程所使用的缓存。如果该缓存目录不是刷新进程所使用的缓存,则对该缓存目录下的缓存文件进行清理,如果该缓存目录是刷新进程所使用的缓存,则不对该缓存目录下的缓存文件进行清理。
通过清理所述服务器中处于运行状态的刷新服务未使用的缓存文件,不仅对缓存文件进行了清理,也避免了影响刷新进程。
(2)若所述服务器中不存在处于运行状态的刷新服务,通过全清理策略对所述服务器中缓存文件进行清理。
其中,上述全清理策略是指对服务器中已存在的所有缓存文件进行清理。则当服务器中不存在刷新服务时,可以快速清理掉不需要的缓存文件,释放磁盘空间,提高磁盘利用率。
(3)若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第一使用频率的目标报表,将所述服务器中所述目标报表对应的缓存文件以外的其他缓存文件进行清理。
其中,上述第一使用频率可以根据需要设定。获取使用频率大于第一使用预设频率的目标报表用于筛选出经常被访问的报表。
当用户在客户端查看某一报表时,需要及时的从服务器中获取该报表的数据,此时若缓存中存在该数据,可以及时的将数据发送至客户端供用户进行查看。因此,将服务器中目标报表对应的缓存文件以外的其他缓存文件进行清理,使得使用频率较大的报表对应的缓存文件被保留。当再次查看使用频率较大的这些报表时,能够快速的将报表数据呈现,提高BI工具运行的效率。
(4)若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第二使用频率的目标缓存文件,将所述服务器中所述目标缓存文件以外的其他缓存文件进行清理。
其中,上述第二使用频率可以根据需要设定。同时,第二使用频率与第一频率可以相同或者不相同,第二使用频率可以高于第一使用频率,第二使用频率也可以低于第一使用频率。
获取使用频率大于第二使用频率的目标缓存文件用于筛选出使用频率较高的文件。
将服务器中目标缓存文件以外的其他缓存文件进行清理,可以清除使用频率较低的缓存文件,并且保留使用频率较高的缓存文件。从而在释放磁盘空间的同时,保证BI系统运行的效率。
进一步地,在本申请其他实施例中,本申请所述的装置还包括第一确定模块和清理触发模块。
第一确定模块,用于若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间。
清理触发模块,用于清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,触发所述清理模块根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理的。
若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间;清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,触发清理模块230根据服务器中是否存在处于运行状态的刷新服务对服务器中的缓存文件进行清理的。
在本实施例中,当服务器中存在刷新服务,且指定类型的缓存极大时,可在刷新结束后再次进行清理。
具体的,本实施例中的再次清理时间是指在一次清理缓存的过程中,若存在处于运行状态的刷新服务,当清理完一部分缓存之后,等到刷新服务停止运行时,接着再进行清理缓存。例如,存在处于运行状态的刷新服务。当10分钟之后,该刷新服务停止运行,再次进行缓存清理。可以更加彻底的进行缓存清理。
其中,上述第二预设值小于第一预设值,第二预设值可以根据需要设定。
由于当缓存达到一定值时,可能在清理缓存之后仍然没有释放足够的磁盘空间。因此,在达到再次清理时间时,再次根据服务器中是否存在处于运行状态的刷新服务对服务器中的缓存文件进行清理。从而可以及时的清理缓存,避免影响系统的运行效率,避免服务异常。
同时,由于上述刷新服务的属性信息可以是刷新服务对应的刷新进程的名称和/或刷新进程的已运行时间等,从而可以反映刷新进程的可能持续时间。
在本实施例中,通过再次清理时间达到时再次进行清理,可以避免过于频繁的获取服务器中的刷新进程,更加彻底的对缓存进行清理,节省系统资 源,并且有利于极大的释放存储空间。
可选的在本申请其他实施例中,本申请所述的装置还包括提醒模块。
所述提醒模块,用于若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小之和达到第四预设值,在用户界面窗口显示清理缓存的提醒信息,其中,所述提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称,所述第四预设值大于所述第二预设值。
在本实施例中,当服务器中存在刷新进程时,若指定类型的缓存文件的大小之和达到第四预设值,即指定类型的缓存文件的大小大于第二预设值,不对其自动进行清理,而在用户界面窗口显示清理缓存的提醒信息。
当缓存文件较大时,可能需要立即进行处理,此时可以通过用户界面窗口显示提醒信息,及时的向用户进行提醒,使得用户可以确定是否需要执行针对性的进行清理,或者是停止刷新进行清理等操作,从而保证缓存能够被及时清理。
同时,上述清理缓存的提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称。
上述指定类型的缓存文件的属性信息可以包括指定类型的缓存文件的名称、类型和大小等信息。
具体的,可以显示指定类型的缓存文件之中最大的缓存文件的属性信息和/或指定类型的缓存文件之中大小为大于某一大小的缓存文件的属性信息。
在本实施例中,在用户界面窗口显示清理缓存的提醒信息,使得用户可以无需查找就可以直观的了解到缓存文件的信息以及刷新服务的信息,方便用户快速定位要清理的缓存文件,进而可以提高缓存文件的清理效率。
可选的,在本申请其他实施例中,所述缓存清理装置还包括统计模块和第二确定模块。
统计模块,用于对所述服务器中的缓存文件进行清理之后,统计已清理的缓存文件的信息。
第二确定模块,用于根据所述已清理的缓存文件的信息以及缓存清理时间,确定再次进行缓存清理的时间;或者,根据所述已清理的缓存文件的信息以及所述服务器的进程信息,确定再次进行缓存清理的时间。
这里确定的再次进行缓存清理的时间是根据本次的完整清理信息来确定下一次再通过本申请所述的缓存清理装置来清理缓存的时间。
具体的,统计已清理的缓存文件的信息可以包括但不限于:已清理的缓存文件的大小,已清理的缓存文件的类型,已清理的缓存文件的数量。
已清理的缓存文件的信息可以反映缓存文件大小以及由哪些运行任务产生了何种缓存文件。已清理的缓存文件的信息也可以直接反映出服务器的磁盘压力,有利于对BI工具运行时,数据立方体大小、复杂度进行判断。
当已清理的缓存文件的数量较多,或者已清理的缓存文件的总大小较大时,说明在当前BI工具的运行产生较多的缓存需要及时清理,因此可以缩短 再次进行缓存清理的时间。
例如,当前缓存清理距离上一次缓存清理的时间为2小时,已清理的缓存文件的总大小较大,则再次清理缓存文件的时间可以调整为1小时以后,即缩短了再次进行缓存清理的时间。
同时,还可以根据已清理的缓存文件的信息以及服务器当前的进程信息来再次确定清理缓存文件的时间。例如,当服务器当前的进程数较少,表明服务器运行了较少的应用,而若此时产生的缓存文件也较多,则同样的进程信息运行时或者是进程数变多时,缩短再次进行缓存清理的时间,使得缓存文件可以及时的得到处理。
在本实施例中,根据缓存的清理结果来确定再次进行缓存清理的时间,可以动态的调整缓存清理的时间,根据系统的运行来进行缓存清理,清理时间的确定更为精确,从而可以更加及时的进行缓存清理。
可选的,在本申请其他实施例中,本申请所述的装置还可包括触发模块,具体的:
所述判断模块,还用于若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的缓存文件的大小之和未达到第一预设值时,判断所述指定类型的缓存文件的大小是否达到第三预设值,其中,所述第一预设值大于所述第三预设值。
触发模块,用于若所述指定类型的缓存文件的大小达到第三预设值,预设时间之后,触发所述获取模块获取服务器中的缓存文件信息。
其中,第三预设值小于第一预设值,其具体值可以根据需要设定。
当指定类型的缓存文件的大小之和达到第三预设值但并未达到第一预设值时,说明指定类型的缓存文件的大小没有达到进行清理的条件,但是达到某一程度,可以在某一时间之后触发获取模块210执行操作,进而对BI工具中的缓存文件进行及时的清理。
上述预设时间可以根据需要设定。具体的,预设时间可以根据第三预设值而定。
可选的,在本申请其他实施例中,所述判断模块,还用于获取所述服务器的系统时间,判断所述系统时间是否满足缓存清理的时间条件。
所述触发模块,还用于若所述系统时间满足缓存清理的时间条件,触发所述获取模块获取服务器中的缓存文件信息。
其中,判断系统时间是否满足缓存清理的时间条件可以是,判断当前的系统时间是否为某一指定时间,若当前的系统时间为某一指定时间,则确定系统时间满足缓存清理的时间条件。
例如,判断当前的系统时间是否为晚上7点,若是,确定系统时间满足缓存清理的时间条件。
或者,判断当前的系统时间间隔上一次清理缓存的时间是否达到某一指定时间。
例如,判断当前的系统时间间隔上一次清理缓存的时间是否达到1小时, 若是,确定系统时间满足缓存清理的时间条件。
具体的,可以通过Linux系统的crontab命令来发起执行所述获取服务器中产生缓存文件的操作。
在本实施例中,通过系统时间的判断来触发触发获取模块210执行操作,进而对BI工具中的缓存文件进行及时的清理,可以及时的进行缓存清理,释放磁盘空间。
本申请提供的缓存清理装置通过获取模块获取服务器中的缓存文件信息;判断模块根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;以及若所述服务器中缓存文件的类型包含所述指定类型,所述判断模块判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,清理模块根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。使得在缓存达到一定量时,就对缓存进行清理,从而提升磁盘的空间利用率以及系统运行效率,避免缓存不清理带来的服务异常的风险。
并且,本申请根据服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理,而在BI工具中,存在运行的刷新服务时,可能有应用服务运行,没有运行的刷新服务时,也不会有运行的应用服务。因此,通过本申请进行缓存清理时不会影响刷新服务以及其他应用服务的运行,避免了由于清理缓存不当,带来的系统崩溃风险。
上述以软件功能模块的形式实现的集成的单元,可以存储在一个非易失性可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。
如图3所示,图3是本申请实现缓存清理方法的较佳实施例的计算机装置的结构示意图。所述计算机装置包括至少一个发送装置31、至少一个存储器32、至少一个处理器33、至少一个接收装置34以及至少一个通信总线。其中,所述通信总线用于实现这些组件之间的连接通信。
所述计算机装置是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。所述计算机装置还可包括网络设备和/或用户设备。其中,所述网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量主机或网络服务器构成的云,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。
所述计算机装置所处的网络包括,但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。
其中,所述接收装置34和所述发送装置31可以是有线发送端口,也可以 为无线设备,例如包括天线装置,用于与其他设备进行数据通信。
所述存储器32用于存储程序代码。所述存储器32可以是集成电路中没有实物形式的具有存储功能的电路,如RAM(Random-Access Memory,随机存取存储器)、FIFO(First In First Out,)等。或者,所述存储器32也可以是具有实物形式的存储器,如内存条、TF卡(Trans-flash Card)、智能媒体卡(smart media card)、安全数字卡(secure digital card)、快闪存储器卡(flash card)等储存设备等等。
所述处理器33可以包括一个或者多个微处理器、数字处理器。所述处理器33可调用存储器32中存储的程序代码以执行相关的功能。例如,图3中所述的各个单元是存储在所述存储器32中的程序代码,并由所述处理器33所执行,以实现一种缓存清理方法。所述处理器33又称中央处理器(CPU,Central Processing Unit),是一块超大规模的集成电路,是运算核心(Core)和控制核心(Control Unit)。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。
Claims (20)
- 一种缓存清理方法,其特征在于,所述方法包括:获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
- 如权利要求1所述的方法,其特征在于,所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理包括:若所述服务器中存在处于运行状态的刷新服务,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件;以及若所述服务器中不存在处于运行状态的刷新服务,通过全清理策略对所述服务器中缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第一使用频率的目标报表,将所述服务器中所述目标报表对应的缓存文件以外的其他缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第二使用频率的目标缓存文件,将所述服务器中所述目标缓存文件以外的其他缓存文件进行清理。
- 如权利要求2所述的方法,其特征在于,所述方法还包括:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间;清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,执行所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理的操作。
- 如权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:对所述服务器中的缓存文件进行清理之后,统计已清理的缓存文件的信息;根据所述已清理的缓存文件的信息以及缓存清理时间,确定再次进行缓存清理的时间;或者根据所述已清理的缓存文件的信息以及所述服务器的进程信息,确定再次进行缓存清理的时间。
- 如权利要求1至3中任一项所述的方法,其特征在于,所述方法还包 括:若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的缓存文件的大小之和未达到第一预设值时,判断所述指定类型的缓存文件的大小是否达到第三预设值,其中,所述第一预设值大于所述第三预设值;若是,预设时间之后,执行所述获取服务器中的缓存文件信息的操作。
- 如权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小之和达到第四预设值,在用户界面窗口显示清理缓存的提醒信息,其中,所述提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称,所述第四预设值大于所述第二预设值。
- 如权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:获取所述服务器的系统时间,判断所述系统时间是否满足缓存清理的时间条件;若是,执行所述获取服务器中的缓存文件信息的操作。
- 一种缓存清理装置,其特征在于,所述装置包括:获取模块,用于获取服务器中的缓存文件信息;判断模块,用于根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;所述判断模块,还用于若所述服务器中缓存文件的类型包含所述指定类型,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;清理模块,用于若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
- 一种计算机装置,其特征在于,所述计算机装置包括存储器及处理器,所述存储器用于存储至少一个指令,所述处理器用于执行所述至少一个指令以实现以下步骤:获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
- 如权利要求9所述的计算机装置,其特征在于,所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理包括:若所述服务器中存在处于运行状态的刷新服务,清理所述服务器中处于 运行状态的刷新服务未使用的缓存文件;以及若所述服务器中不存在处于运行状态的刷新服务,通过全清理策略对所述服务器中缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第一使用频率的目标报表,将所述服务器中所述目标报表对应的缓存文件以外的其他缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第二使用频率的目标缓存文件,将所述服务器中所述目标缓存文件以外的其他缓存文件进行清理。
- 如权利要求10所述的计算机装置,其特征在于,所述处理器用于执行所述至少一个指令以实现以下步骤:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间;清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,执行所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理的操作。
- 如权利要求9至11中任一项所述的计算机装置,其特征在于,所述处理器用于执行所述至少一个指令以实现以下步骤:对所述服务器中的缓存文件进行清理之后,统计已清理的缓存文件的信息;根据所述已清理的缓存文件的信息以及缓存清理时间,确定再次进行缓存清理的时间;或者根据所述已清理的缓存文件的信息以及所述服务器的进程信息,确定再次进行缓存清理的时间。
- 如权利要求9至11中任一项所述的计算机装置,其特征在于,所述处理器用于执行所述至少一个指令以实现以下步骤:若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的缓存文件的大小之和未达到第一预设值时,判断所述指定类型的缓存文件的大小是否达到第三预设值,其中,所述第一预设值大于所述第三预设值;若是,预设时间之后,执行所述获取服务器中的缓存文件信息的操作。
- 如权利要求9至11中任一项所述的计算机装置,其特征在于,所述处理器用于执行所述至少一个指令以实现以下步骤:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小之和达到第四预设值,在用户界面窗口显示清理缓存的提醒信息,其中,所述提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称,所述第四预设值大于所述第二预设值。
- 一种非易失性可读存储介质,其上存储有计算机指令,其特征在于,所述计算机指令被处理器执行时实现以下步骤:获取服务器中的缓存文件信息;根据所述缓存文件信息判断所述服务器中缓存文件的类型是否包含指定类型;若是,则判断所述指定类型的缓存文件的大小之和是否达到第一预设值;若所述指定类型的缓存文件的大小之和达到所述第一预设值,根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理。
- 如权利要求15所述的存储介质,其特征在于,所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理包括:若所述服务器中存在处于运行状态的刷新服务,清理所述服务器中处于运行状态的刷新服务未使用的缓存文件;以及若所述服务器中不存在处于运行状态的刷新服务,通过全清理策略对所述服务器中缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第一使用频率的目标报表,将所述服务器中所述目标报表对应的缓存文件以外的其他缓存文件进行清理;或者若所述服务器中不存在处于运行状态的刷新服务,获取所述服务器中使用频率大于第二使用频率的目标缓存文件,将所述服务器中所述目标缓存文件以外的其他缓存文件进行清理。
- 如权利要求16所述的存储介质,其特征在于,所述计算机指令被处理器执行时实现以下步骤:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小达到第二预设值,根据处于运行状态的刷新服务的属性信息确定再次清理时间;清理所述服务器中处于运行状态的刷新服务未使用的缓存文件之后,达到所述再次清理时间时,执行所述根据所述服务器中是否存在处于运行状态的刷新服务对所述服务器中的缓存文件进行清理的操作。
- 如权利要求15至17中任一项所述的存储介质,其特征在于,所述计算机指令被处理器执行时实现以下步骤:对所述服务器中的缓存文件进行清理之后,统计已清理的缓存文件的信息;根据所述已清理的缓存文件的信息以及缓存清理时间,确定再次进行缓存清理的时间;或者根据所述已清理的缓存文件的信息以及所述服务器的进程信息,确定再次进行缓存清理的时间。
- 如权利要求15至17中任一项所述的存储介质,其特征在于,所述计算机指令被处理器执行时实现以下步骤:若所述服务器中缓存文件的类型包含所述指定类型,且所述指定类型的 缓存文件的大小之和未达到第一预设值时,判断所述指定类型的缓存文件的大小是否达到第三预设值,其中,所述第一预设值大于所述第三预设值;若是,预设时间之后,执行所述获取服务器中的缓存文件信息的操作。
- 如权利要求15至17中任一项所述的存储介质,其特征在于,所述计算机指令被处理器执行时实现以下步骤:若所述服务器中存在处于运行状态的刷新服务,且所述指定类型的缓存文件的大小之和达到第四预设值,在用户界面窗口显示清理缓存的提醒信息,其中,所述提醒信息包括所述指定类型的缓存文件的属性信息以及处于运行状态的刷新服务的名称,所述第四预设值大于所述第二预设值。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810315716.9A CN108647156A (zh) | 2018-04-10 | 2018-04-10 | 缓存清理方法、装置、计算机装置及存储介质 |
| CN201810315716.9 | 2018-04-10 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019196287A1 true WO2019196287A1 (zh) | 2019-10-17 |
Family
ID=63745647
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/099908 Ceased WO2019196287A1 (zh) | 2018-04-10 | 2018-08-10 | 缓存清理方法、装置、计算机装置及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108647156A (zh) |
| WO (1) | WO2019196287A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112540811B (zh) * | 2020-12-15 | 2022-03-18 | 平安科技(深圳)有限公司 | 缓存数据的检测方法、装置、计算机设备和存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103019621A (zh) * | 2012-12-03 | 2013-04-03 | 广东欧珀移动通信有限公司 | 一种清理存储单元的方法、装置及移动终端 |
| CN104978152A (zh) * | 2015-07-03 | 2015-10-14 | 北京奇虎科技有限公司 | 缓存中文件清理的方法及装置 |
| US20170250992A1 (en) * | 2016-02-26 | 2017-08-31 | Wal-Mart Stores, Inc. | Systems and methods for access to electronic data |
| CN107678698A (zh) * | 2017-10-31 | 2018-02-09 | 努比亚技术有限公司 | 缓存数据清理方法、服务器、终端及计算机可读存储介质 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5338905B2 (ja) * | 2009-05-29 | 2013-11-13 | 富士通株式会社 | キャッシュ制御装置およびキャッシュ制御方法 |
| CN103761306B (zh) * | 2014-01-22 | 2017-08-04 | 广东欧珀移动通信有限公司 | 一种智能终端文件清理方法及装置 |
| CN104219283B (zh) * | 2014-08-06 | 2017-12-29 | 上海爱数信息技术股份有限公司 | 基于云存储的文件按需下载和自动同步方法及其装置 |
| CN106383748A (zh) * | 2016-09-05 | 2017-02-08 | Tcl集团股份有限公司 | 一种基于云服务的存储空间清理方法及系统 |
| CN106776378A (zh) * | 2016-12-05 | 2017-05-31 | 宇龙计算机通信科技(深圳)有限公司 | 一种清理缓存数据的方法及装置 |
| CN106598880A (zh) * | 2016-12-16 | 2017-04-26 | 深圳市金立通信设备有限公司 | 一种缓存管理的方法及终端 |
-
2018
- 2018-04-10 CN CN201810315716.9A patent/CN108647156A/zh active Pending
- 2018-08-10 WO PCT/CN2018/099908 patent/WO2019196287A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103019621A (zh) * | 2012-12-03 | 2013-04-03 | 广东欧珀移动通信有限公司 | 一种清理存储单元的方法、装置及移动终端 |
| CN104978152A (zh) * | 2015-07-03 | 2015-10-14 | 北京奇虎科技有限公司 | 缓存中文件清理的方法及装置 |
| US20170250992A1 (en) * | 2016-02-26 | 2017-08-31 | Wal-Mart Stores, Inc. | Systems and methods for access to electronic data |
| CN107678698A (zh) * | 2017-10-31 | 2018-02-09 | 努比亚技术有限公司 | 缓存数据清理方法、服务器、终端及计算机可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108647156A (zh) | 2018-10-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11574018B2 (en) | Computer data distribution architecture connecting an update propagation graph through multiple remote query processing | |
| WO2020233212A1 (zh) | 一种日志记录的处理方法、服务器及存储介质 | |
| US11016956B2 (en) | Database management system with database hibernation and bursting | |
| CN109597837B (zh) | 时序数据的存储方法、查询方法及相关设备 | |
| US20160314020A1 (en) | Job scheduling management | |
| WO2020248708A1 (zh) | 一种Spark作业的提交方法及装置 | |
| CN112988435B (zh) | 数据库过载保护处理方法和装置、存储介质 | |
| US20240411632A1 (en) | Access Consistency in High-Availability Databases | |
| CN107919987B (zh) | 一种微服务云部署的实现方法 | |
| CN109710679B (zh) | 数据抽取方法及装置 | |
| CN112131196A (zh) | 一种分布式日志处理方法、装置、终端设备及存储介质 | |
| WO2025054083A1 (en) | Unified statistics collection framework using a process-based top-down approach for postgres-based database systems | |
| WO2023069573A1 (en) | Prevention of malicious end point behavior through stateful rules | |
| CN119396346A (zh) | 用于磁盘空间管理的方法、装置、设备和存储介质 | |
| WO2017039627A1 (en) | Method and apparatus to manage it infrastructure based on application characteristics | |
| US9805038B2 (en) | Efficient conflict resolution among stateless processes | |
| WO2022016845A1 (zh) | 一种多节点监控方法、装置、电子设备及存储介质 | |
| WO2019196287A1 (zh) | 缓存清理方法、装置、计算机装置及存储介质 | |
| JP6847112B2 (ja) | ノードの再起動後にデータを処理する方法及びデバイス | |
| CN109586989A (zh) | 一种状态检查方法、装置及集群系统 | |
| CN116302331A (zh) | 一种Kubernetes集群健康巡检的方法 | |
| Litchfield et al. | Distributed Relational Database Performance In Cloud Computing: An Investigative Study. | |
| CN117743307A (zh) | 数据清理方法、装置和计算机设备 | |
| CN117149381A (zh) | 一种分布式任务管理方法、系统、计算设备及存储介质 | |
| CN108595625B (zh) | Bi工具的运维方法、装置、计算机装置及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18914307 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.01.2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18914307 Country of ref document: EP Kind code of ref document: A1 |