Storage space management method and device, equipment, storage medium and program product
By selecting disk expansion, log forwarding or log deletion strategies based on configuration information when the storage space utilization of the log server reaches the preset threshold, the problem of inflexible storage space management in traditional technology is solved, and a more efficient, secure and compliant cloud log storage management is achieved.
Patent Information
- Application Number
- CN202411791939.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
AI Technical Summary
In traditional technology, the storage space management method of storing cloud logs is relatively simple, lacks flexibility, and cannot effectively deal with the problem of insufficient storage space.
A storage space management method is provided, by determining a target space management policy based on the configuration information of the log server when the storage space utilization rate of the log server reaches a preset threshold, including at least one of a disk expansion policy, a log forwarding policy and a log deletion policy, thereby flexibly managing the storage space.
Through the flexible choice of multiple space management strategies, the flexibility of storage space management of storage cloud logs is improved, and more diverse management methods can be achieved without losing logs, reducing storage costs, and improving the security and compliance of the log system.
Smart Images

Figure CN119645311A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a storage space management method, device, equipment, storage medium and program product. Background Art
[0002] With the development of cloud computing technology, cloud services will generate more and more cloud logs. As the number of cloud logs increases, the storage space for storing cloud logs needs to be managed.
[0003] In the conventional technology, when the storage space for storing the cloud logs is insufficient, the storage space for storing the cloud logs is managed by releasing the storage space.
[0004] However, the conventional method of releasing storage space is relatively simple, and there is a problem of inflexible management of storage space. Summary of the invention
[0005] Based on this, it is necessary to provide a storage space management method, apparatus, device, storage medium and program product that can improve the flexibility of managing the storage space for storing cloud logs in response to the above technical problems.
[0006] In a first aspect, the present application provides a storage space management method, comprising:
[0007] When the storage space usage rate of the log server reaches a preset threshold, determining a target space management strategy configured by the log server according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy;
[0008] The storage space of the log server is managed according to the target space management strategy.
[0009] In one embodiment, if the target space management strategy is the disk expansion strategy, managing the storage space of the log server according to the target space management strategy includes:
[0010] Determine the expansion multiple based on the number of logs generated in a unit time period in historical data;
[0011] According to the expansion multiple, the storage disk of the log server is expanded.
[0012] In one embodiment, if the target space management policy is the log forwarding policy, managing the storage space of the log server according to the target space management policy includes:
[0013] Determining a target log file from the log files according to the storage time of the log files in the storage space and a preset forwarding granularity;
[0014] The target log file is sent to a backup server of the log server, and the target log file stored in the storage space is deleted.
[0015] In one embodiment, the method further comprises:
[0016] Receiving an acquisition request; the acquisition request is used to acquire the deleted log files in the storage space;
[0017] In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
[0018] In one embodiment, the method further comprises:
[0019] Obtaining a first signature of the deleted log file;
[0020] According to a preset signature algorithm, the deleted log file is signed to obtain a second signature of the deleted log file;
[0021] A consistency check is performed on the deleted log file according to the first signature and the second signature.
[0022] In one embodiment, if the target space management policy is the log deletion policy, managing the storage space of the log server according to the target space management policy includes:
[0023] Determining the log files to be deleted in the storage space according to a preset deletion granularity;
[0024] Release the storage space occupied by the log file to be deleted.
[0025] In a second aspect, the present application further provides a storage space management device, including:
[0026] A determination module, for determining a target space management strategy configured by the log server according to configuration information of the log server when the storage space usage of the log server reaches a preset threshold; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy;
[0027] The management module is used to manage the storage space of the log server according to the target space management strategy.
[0028] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0030] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0031] The above-mentioned storage space management method, device, equipment, storage medium and program product, when the storage space usage rate of the log server reaches a preset threshold, determines the target space management strategy configured by the log server according to the configuration information of the log server; the target space management strategy includes at least one of the disk expansion strategy, the log forwarding strategy and the log deletion strategy; according to the target space management strategy, the storage space of the log server is managed. Since the target space management strategy in the embodiment of the present application includes at least one of the disk expansion strategy, the log forwarding strategy and the log deletion strategy, the embodiment of the present application can flexibly select at least one from a variety of space management strategies as the target space management strategy. Compared with the related art that can only manage storage space by log forwarding, the management method in the present application is more diversified, so it can improve the flexibility of managing the storage space for storing cloud logs. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A diagram of an application environment of a storage space management method in one embodiment;
[0034] Figure 2 is a flowchart of a storage space management method in one embodiment;
[0035] Figure 3 A flow chart of a log forwarding step in an embodiment;
[0036] Figure 4 is a flowchart of a storage space management method in another embodiment;
[0037] Figure 5 is a flowchart of a storage space management method in yet another embodiment;
[0038] Figure 6 is a flowchart of a method for managing storage space in an optional embodiment;
[0039] Figure 7 is a structural block diagram of a storage space management device in one embodiment;
[0040] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0043] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0044] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0045] With the development of cloud computing technology, there are more and more business systems in the cloud environment, and cloud businesses will generate more and more cloud logs. The importance of cloud business data is increasing, and the importance of cloud environment log auditing is becoming increasingly prominent. Among them, log auditing, as an important part of cloud auditing, can assist cloud users to quickly locate problems by collecting logs of various dimensions, timely discover various security threats and abnormal behavior events, and provide a global perspective for operation and maintenance. At the same time, it meets internal and external regulatory requirements and helps enterprises improve their compliance management capabilities. As cloud business becomes more and more frequent, the number of various cloud logs is increasing, the storage space occupied by cloud logs is also increasing, and the storage cost of cloud logs is getting higher and higher. If cloud logs cannot be stored in a timely and effective manner, logs may not be stored, which in turn affects log auditing and problem tracing. It also violates the requirements of the Cybersecurity Law for log retention. Therefore, it is necessary to manage the storage space for storing cloud logs.
[0046] In the conventional technology, when the storage space for storing cloud logs is insufficient, the storage space is released by log forwarding to manage the storage space for storing cloud logs, so as to solve the problem of insufficient storage space. However, the conventional technology has a relatively simple method for releasing storage space, so the conventional technology has the problem of insufficient flexibility in managing storage space.
[0047] After introducing the background technology of the storage space management method provided by the embodiment of the present application, the implementation environment involved in the storage space management method provided by the embodiment of the present application will be briefly described below. The storage space management method provided by the embodiment of the present application can be applied to Figure 1In the cloud computing system shown. The cloud computing system includes a control platform 11, a log server 12, a log backup server 13, a signature verification server 14, multiple host nodes 15, and a Spine-leaf switching system in a cloud environment, wherein the control platform 11 is a unified management device for the entire network cloud infrastructure, and the control platform 11 may include but not be limited to cloud hosts, cloud hard disks, cloud hard disk backups, etc. The control platform 11 is mainly responsible for the configuration of log management related policies in the cloud computing system, and provides users with a visual operation page; the log server 12 is used to collect the operation logs of the virtual machines from at least one host node 15, and classify, store and back up the collected logs according to the requirements defined by the control platform 11; the log backup server 13 is used to perform log backup, and can restore the logs to the log server 12 through a preset acquisition interface; the signature verification server 14 is used to sign the logs and return the signature results to the log server for storage, so that the integrity of the logs can be verified through the linkage of the log server 12 and the signature verification server 14; the host node 15 is used to provide virtual machine (VM, VMware) instances for deployment by various business systems; the Spine-leaf switching system includes a spine layer (Spine The spine-leaf switching system is used to ensure that the entire cloud computing system network IP (Internet Protocol) is reachable.
[0048] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the distributed storage system to which the scheme of the present application is applied. The specific distributed storage system may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0049] In one embodiment, Figure 2 As shown, a storage space management method is provided, and the method is applied to Figure 1 The following steps are used to illustrate the log server in the example:
[0050] S201, when the storage space usage of the log server reaches a preset threshold, determine the target space management strategy of the log server configuration according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy.
[0051] The storage space utilization rate is used to characterize the remaining storage space of the log server, and the preset threshold is a user-defined storage space utilization rate threshold, for example, the preset threshold may be 90%, and of course, the specific value of the preset threshold is not limited in the embodiment of the present application. The configuration information of the log server may include but is not limited to any one of the usage ranking information of the space management strategy configured by the log server in the historical time period, the space management strategy or information that is easily obtained by the log server, etc., and the target space management strategy includes at least one of the disk expansion strategy, the log forwarding strategy, and the log deletion strategy.
[0052] In the embodiment of the present application, the user terminal can configure multiple space management strategies on the control platform in advance, and the multiple space management strategies may include but not limited to at least one of a preset threshold, a disk expansion strategy, a log forwarding strategy, and a log deletion strategy, so that the control platform can send the multiple space management strategies that have been configured to the log server. The log server can collect the logs of the virtual machine from the virtual machine in at least one host node, and classify the collected logs according to the historical retrieval frequency. For example, the logs with a historical retrieval frequency higher than the preset retrieval threshold can be determined as hot logs, and the logs with a historical retrieval frequency not higher than the preset retrieval threshold can be determined as cold logs. Thus, the log server can classify and store the logs according to different log types. Exemplarily, if the log type is a hot log type, it means that the retrieval frequency of the log is high. In order to ensure the retrieval efficiency, the log is not compressed, that is, the log server can directly store the log according to the original log size of the log; if the log type is a cold log type, it means that the retrieval frequency of the log is low. In order to save storage space and reduce the cost of user log storage, the log server can determine the compression ratio of the log, call different compression algorithms to compress the log, and store the compressed log. Among them, for example, the compression algorithm can be the LZ77 compression algorithm, and the compression ratio can be 3:1. In order to avoid the high compression ratio affecting the efficiency of log retrieval, the embodiment of the present application can select the compression ratio based on actual business needs to balance the log retrieval time and storage cost of the cloud computing system. That is, the embodiment of the present application does not limit the specific values of the preset retrieval threshold and the compression ratio.
[0053] Thus, the log server can monitor the storage space utilization rate of the log server in real time, and can display the storage space utilization rate on the log management page in the log server. When it is determined that the storage space utilization rate of the log server reaches a preset threshold, the log server can determine the target space management strategy configured by the log server according to the configuration information of the log server. Exemplarily, the log server can determine the space management strategy set configured by the log server according to the configuration information of the log server, wherein the space management strategy set includes at least two of the disk expansion strategy, the log forwarding strategy and the log deletion strategy, thereby, the log server can determine the target space management strategy from the space management strategy set configured by the log server according to the preset selection strategy.
[0054] In one of the embodiments, the preset selection strategy may include but is not limited to the priority of each space management strategy. Optionally, the log server may determine the priority of each space management strategy in the space management strategy set based on the ranking information of the number of times the space management strategy configured by the log server in the historical time period is used in the configuration information. That is, it can be understood that the space management strategy with more times of use has a higher priority. Therefore, according to the priority of each space management strategy, a target space management strategy with a higher priority can be determined from the space management strategy set configured by the log server. Alternatively, the log server may determine the priority of each space management strategy in the space management strategy set based on the ranking information of the space management strategy that is easy for the log server to obtain in the configuration information. That is, it can be understood that the space management strategy that is easier to obtain has a higher priority. Therefore, according to the priority of each space management strategy, a target space management strategy with a higher priority can be determined from the space management strategy set configured by the log server.
[0055] S202: managing the storage space of the log server according to the target space management policy.
[0056] In the embodiment of the present application, optionally, the log server can manage the storage space of the log server according to the disk expansion strategy; and / or, the log server can also manage the storage space of the log server according to the log forwarding strategy; and / or, the log server can also manage the storage space of the log server according to the log deletion strategy. Of course, the embodiment of the present application does not limit the specific method for managing the storage space of the log server.
[0057] In the above storage space management method, when the storage space usage rate of the log server reaches a preset threshold, the target space management strategy configured by the log server is determined according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy, and a log deletion strategy; according to the target space management strategy, the storage space of the log server is managed. Since the target space management strategy in the embodiment of the present application includes at least one of a disk expansion strategy, a log forwarding strategy, and a log deletion strategy, the embodiment of the present application can flexibly select at least one from a variety of space management strategies as the target space management strategy. Compared with the related art that can only manage storage space by log forwarding, the management method in the present application is more diversified, so it can improve the flexibility of managing the storage space for storing cloud logs.
[0058] In one embodiment, when the target space management strategy is a disk expansion strategy, a method for managing the storage space of the log server is provided, that is, the “managing the storage space of the log server according to the target space management strategy” in S202 above, including:
[0059] Determine the expansion multiple based on the number of logs generated in a unit time period in historical data.
[0060] Expand the storage disk of the log server according to the expansion multiple.
[0061] The disk expansion strategy refers to a strategy for expanding the capacity of the disk for storing logs. The unit time period may include but is not limited to any unit time period of minutes, hours, days, weeks, months, years, etc. The expansion multiple refers to the multiple of the original disk capacity to which the disk capacity is expanded.
[0062] In an embodiment of the present application, the log server can obtain the number of logs generated in a unit time period in the historical data used by the user. For example, the log server can obtain the number of logs generated per month on average in the historical data used by the user. Thus, the log server can determine the expansion multiple based on the number of logs generated per unit time period in the historical data. For example, the expansion multiple can be 3 times. Afterwards, the log server can perform expansion processing on the storage disk of the log server based on the expansion multiple. Exemplarily, the log server can automatically expand the storage disk of the log server according to 3 times the number of logs generated per month on average in the historical data. In addition, the log server can also generate a corresponding expansion bill, and notify the expansion bill to the user terminal via a message transmission method. Among them, the message transmission method may include but is not limited to at least one of a text message, an email, a cloud computing system message, and the like.
[0063] In this embodiment, the expansion multiple can be determined based on the number of logs generated in a unit time period in the historical data, and the storage disk of the log server can be automatically expanded based on the expansion multiple. The management of the log storage space can be achieved through disk expansion, so the management method of the log storage space can be enriched.
[0064] In one embodiment, when the target space management strategy is a log forwarding strategy, a method for managing the storage space of the log server is provided, that is, "managing the storage space of the log server according to the target space management strategy" in S202 above. Figure 3 As shown, including:
[0065] S301, determining a target log file from the log files according to the storage time of the log files in the storage space and a preset forwarding granularity.
[0066] S302, sending the target log file to the backup server of the log server, and deleting the target log file stored in the storage space.
[0067] The preset forwarding granularity may include any one of daily forwarding, weekly forwarding, monthly forwarding, etc. The target log file refers to the log file that needs to be forwarded, and the backup server of the log server is Figure 1 The log backup server in.
[0068] In the embodiment of the present application, the log server can determine the target log file from the log file according to the storage time of the log file in the storage space and the preset forwarding granularity. For example, if the preset forwarding granularity is forwarded by day, the log server can determine the log file of the earliest day of storage time as the target log file according to the storage time of the log file in the storage space and the preset forwarding granularity. Thus, the log server can forward the target log file to the backup server of the log server through the syslog protocol for storage, and can delete the target log file stored in the storage space to release the storage space for the latest log.
[0069] In this embodiment, a target log file can be determined from the log files according to the storage time of the log files in the storage space and the preset forwarding granularity. The target log file is a log file with a smaller forwarding granularity and a more accurate storage time. Therefore, the target log file with a smaller forwarding granularity and a more accurate storage time can be sent to a backup server of the log server, and the target log file stored in the storage space can be deleted. The management of the log storage space can be achieved by forwarding the target log file on a daily basis. Therefore, it is possible to provide a richer log storage space management method with a more flexible granularity and more in line with business retrieval needs.
[0070] In one embodiment, a method for restoring a deleted log file is provided, such as Figure 4 As shown, the storage space management method further includes:
[0071] S303, receiving an acquisition request; the acquisition request is used to acquire deleted log files in the storage space.
[0072] S304: In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
[0073] The acquisition request is used to obtain deleted log files in the storage space.
[0074] In the embodiment of the present application, after the target log file has been forwarded to the backup server of the log server and the target log file stored in the storage space of the log server has been deleted, if the user terminal sends a request for obtaining to the log server through the control platform, the log server can receive the request for obtaining and can respond to the request for obtaining by calling a preset obtaining interface to obtain the deleted log file from the backup server. That is, it can be understood that, in the case where the user terminal triggers the generation of the obtaining request (i.e., the log retrieval request), if the log server determines that the log retrieval time carried in the log retrieval request exceeds the log storage time range locally stored in the log server, the log server can automatically call a preset obtaining interface (i.e., the log backup service interface), pull the target log file that has been retrieved and deleted in the log server from the backup server of the log server back to the local temporary storage space of the log server, and at the same time, uniformly display it on the local log service retrieval page of the log server, so that the user does not perceive whether the storage location of the target log file is the log server or the backup server of the log server, thereby achieving consistency in the user retrieval experience.
[0075] In this embodiment, an acquisition request can be received, wherein the acquisition request is used to obtain deleted log files in the storage space, and in response to the acquisition request, a preset acquisition interface is called to obtain the deleted log files from the backup server, and the target log files that are hit by the search and deleted in the log server can be pulled back from the backup server of the log server to the local temporary storage space of the log server, and all logs can be visually retrieved locally on the log server, thereby achieving consistency in the user log retrieval experience.
[0076] In one embodiment, a method for implementing consistency check on deleted log files is provided, such as Figure 5 As shown, the storage space management method further includes:
[0077] S305: Obtain the first signature of the deleted log file.
[0078] In an embodiment of the present application, after the log server collects the log, the collected log can be automatically sent to the signature verification server, so that the signature verification server uses a preset signature algorithm to perform the first signature processing on the collected log, obtains the first signature of the collected log, and returns the first signature of the collected log to the log server for storage. Since the first signature of the collected log includes the first signature of the deleted log file, the log server can obtain the first signature of the deleted log file saved in advance locally. Among them, the preset signature algorithm may include but is not limited to any one of the signature algorithms such as the HMAC-SM3 national secret algorithm and the MD5 signature algorithm, and the deleted log file refers to the log that has been deleted from the log server.
[0079] S306: Perform signature processing on the deleted log file according to a preset signature algorithm to obtain a second signature of the deleted log file.
[0080] S307: Perform a consistency check on the deleted log file according to the first signature and the second signature.
[0081] In an embodiment of the present application, when a deleted log file has been restored to a log server through a log backup service interface, the log server can send the deleted log file to a signature verification server, so that the signature verification server performs a second signature process on the deleted log file according to a preset signature algorithm, obtains a second signature of the deleted log file, and returns the second signature of the deleted log file to the log server. Thus, the log server can compare the second signature of the deleted log file with the first signature of the deleted log file to perform a consistency check on the deleted log file. If the comparison results are consistent, a first prompt message is sent to the user terminal, and the first prompt message is used to prompt the user that the log consistency check is successful; if the comparison results are inconsistent, a second prompt message is sent to the user terminal, and the second prompt message is used to prompt the user that the log consistency check has failed. In addition, the cloud computing system can also support the user terminal to manually select a log for integrity verification to determine whether the log has been maliciously tampered with.
[0082] In this embodiment, the first signature of the deleted log file can be obtained, and the deleted log file can be signed according to a preset signature algorithm to obtain the second signature of the deleted log file. Thus, the deleted log file can be checked for consistency based on the first signature and the second signature. In this way, the integrity check of the log can be implemented to ensure that the log has not been maliciously tampered with while meeting compliance requirements.
[0083] In one embodiment, when the target space management policy is a log deletion policy, a method for managing the storage space of the log server is provided, that is, the “managing the storage space of the log server according to the target space management policy” in S202 above, including:
[0084] The log files to be deleted in the storage space are determined according to the preset deletion granularity.
[0085] Free up storage space occupied by log files to be deleted.
[0086] The preset deletion granularity may include any one of daily deletion, weekly deletion, monthly deletion, etc., and the log files to be deleted refer to the log files that need to be deleted.
[0087] In the embodiment of the present application, if the user does not configure the dynamic expansion or log transfer strategy, the log server defaults to the target space management strategy as the log deletion strategy. Based on this, the log server can pre-set the preset deletion granularity, so that the log files to be deleted in the storage space can be determined according to the preset deletion granularity. For example, if the preset deletion granularity is to delete on a daily basis, the log server can determine the log files with the earliest storage time in the storage space as the log files to be deleted. Afterwards, the log server can delete the log files to be deleted stored in the storage space to release the storage space occupied by the log files to be deleted and leave it for the latest logs.
[0088] In this embodiment, the log files to be deleted in the storage space can be determined according to the preset deletion granularity, and the storage space occupied by the log files to be deleted can be released. The management of the log storage space can be achieved through the log deletion method, so the management method of the log storage space can be enriched.
[0089] Based on all the above embodiments, the present application also provides a complete storage space management method, such as Figure 6 As shown, the method includes:
[0090] S401, the user terminal can pre-configure multiple space management strategies on the control platform, and the multiple space management strategies may include but not limited to at least one of a preset threshold, a disk expansion strategy, a log forwarding strategy, and a log deletion strategy, so that the control platform can send the configured multiple space management strategies to the log server;
[0091] S402, the log server may collect logs of the virtual machines from the virtual machines in at least one host node, and classify and store the collected logs according to the historical retrieval frequency;
[0092] For example, a log whose historical retrieval frequency is higher than a preset retrieval threshold can be determined as a hot log, and the hot log is not compressed, that is, the log server can directly store the hot log according to the original log size; a log whose historical retrieval frequency is not higher than the preset retrieval threshold can be determined as a cold log, and the compression ratio of the cold log can be determined, different compression algorithms are called to compress the cold log, and the compressed cold log is stored;
[0093] S403, after the log server collects the log, it can automatically send the collected log to the signature verification server, so that the signature verification server uses a preset signature algorithm to perform a first signature process on the collected log, obtains a first signature of the collected log, and returns the first signature of the collected log to the log server for storage;
[0094] S404, the log server can monitor the storage space usage of the log server in real time;
[0095] S405, determining whether the storage space usage of the log server reaches a preset threshold; if the storage space usage of the log server reaches the preset threshold, executing S406; if the storage space usage of the log server does not reach the preset threshold, returning to execute S404;
[0096] S406, determining whether the target space management policy includes a disk expansion policy; if the target space management policy includes a disk expansion policy, executing S407-S409; if the target space management policy does not include a disk expansion policy, executing S410 and the following steps;
[0097] S407, the log server may obtain the number of logs generated in a unit time period in the historical data used by the user;
[0098] S408, the log server may determine the expansion multiple according to the number of logs generated in a unit time period in the historical data, and perform expansion processing on the storage disk of the log server according to the expansion multiple;
[0099] S409, the log server may generate a corresponding capacity expansion bill, and notify the user terminal of the capacity expansion bill via message transmission;
[0100] S410, determining whether the target space management policy includes a log forwarding policy; if the target space management policy includes a log forwarding policy, executing S411; if the target space management policy does not include a log forwarding policy, executing S412;
[0101] S411, the log server can determine the target log file from the log file according to the storage time of the log file in the storage space and the preset forwarding granularity, and can forward the target log file to the backup server of the log server through the syslog protocol for storage, and can delete the target log file stored in the storage space to release the storage space for the latest log;
[0102] S412, the log server may determine the log files to be deleted in the storage space according to the preset deletion granularity, and delete the log files to be deleted stored in the storage space to release the storage space occupied by the log files to be deleted and leave it for the latest log;
[0103] S413, after the target log file has been forwarded to the backup server of the log server and the target log file stored in the storage space of the log server has been deleted, if the user terminal triggers the generation of an acquisition request (i.e., a log retrieval request), and the log server determines that the log retrieval time carried in the log retrieval request exceeds the log storage time range locally stored in the log server, the log server can automatically call a preset acquisition interface (i.e., a log backup service interface), pull the target log file that has been hit by the search and deleted in the log server back from the backup server of the log server to the local temporary storage space of the log server, and simultaneously display it uniformly on the local log service retrieval page of the log server;
[0104] S414, when the deleted log file has been restored to the log server through the log backup service interface, the log server may send the deleted log file to the signature verification server, so that the signature verification server performs a second signature process on the deleted log file according to a preset signature algorithm to obtain a second signature of the deleted log file, and returns the second signature of the deleted log file to the log server; thereby, the log server may compare the second signature of the deleted log file with the first signature of the deleted log file to obtain a comparison result;
[0105] S415, determining whether the comparison results are consistent; if the comparison results are consistent, executing S416; if the comparison results are inconsistent, executing S417;
[0106] S416, sending a first prompt message to the user terminal, where the first prompt message is used to prompt the user that the log consistency check is successful;
[0107] S417, sending a second prompt message to the user terminal, where the second prompt message is used to prompt the user that the log consistency check fails;
[0108] S418, the cloud computing system may also support the user terminal to manually select a log for integrity verification to determine whether the log has been maliciously tampered with.
[0109] In the above storage space management method, when the storage space utilization rate of the log server reaches a preset threshold, the target space management strategy of the log server configuration is determined according to the configuration information of the log server; the target space management strategy includes at least one of the disk expansion strategy, the log forwarding strategy and the log deletion strategy; according to the target space management strategy, the storage space of the log server is managed. Since the target space management strategy in the embodiment of the present application includes at least one of the disk expansion strategy, the log forwarding strategy and the log deletion strategy, the embodiment of the present application can flexibly select at least one from a variety of space management strategies as the target space management strategy when the log storage space is insufficient. Compared with the storage space management that can only be performed by log forwarding in the related art, the present application can achieve more diversified management methods while ensuring that the log is not lost, so it can improve the flexibility of managing the storage space of the storage cloud log. Therefore, the embodiment of the present application can provide a flexible, low-cost, safe and compliant, full-log retrievable log management solution, which helps users to conveniently and flexibly manage audit logs, reduce the construction cost of cloud computing systems, and improve the security of log systems.
[0110] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a storage space management device for implementing the storage space management method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more storage space management device embodiments provided below can refer to the limitations of the storage space management method above, and will not be repeated here.
[0112] In an exemplary embodiment, Figure 7 As shown, a storage space management device is provided, including: a determination module 31 and a management module 32, wherein:
[0113] The determination module 31 is used to determine the target space management strategy of the log server configuration according to the configuration information of the log server when the storage space usage of the log server reaches a preset threshold; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy.
[0114] The management module 32 is used to manage the storage space of the log server according to the target space management policy.
[0115] In one embodiment, if the target space management strategy is a disk capacity expansion strategy, the management module 32 includes:
[0116] The expansion multiple determination unit is used to determine the expansion multiple according to the number of logs generated in a unit time period in the historical data;
[0117] The expansion unit is used to expand the storage disk of the log server according to the expansion multiple.
[0118] In one embodiment, if the target space management strategy is a log forwarding strategy, the management module 32 includes:
[0119] A target log file determination unit, used to determine a target log file from the log files according to the storage time of the log files in the storage space and a preset forwarding granularity;
[0120] The sending unit is used to send the target log file to the backup server of the log server and delete the target log file stored in the storage space.
[0121] In one embodiment, the storage space management device further includes:
[0122] A receiving module, used for receiving an acquisition request; the acquisition request is used for acquiring deleted log files in the storage space;
[0123] The acquisition module is used to call a preset acquisition interface to acquire the deleted log file from the backup server in response to the acquisition request.
[0124] In one embodiment, the storage space management device further includes:
[0125] A first signature acquisition module, used to acquire a first signature of a deleted log file;
[0126] The signature processing module is used to perform signature processing on the deleted log file according to a preset signature algorithm to obtain a second signature of the deleted log file;
[0127] The verification module is used to perform consistency verification on the deleted log file according to the first signature and the second signature.
[0128] In one embodiment, if the target space management policy is a log deletion policy, the management module 32 includes:
[0129] A to-be-deleted log file determination unit, used to determine the to-be-deleted log files in the storage space according to a preset deletion granularity;
[0130] The release unit is used to release the storage space occupied by the log file to be deleted.
[0131] Each module in the above storage space management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0132] In an exemplary embodiment, a log server is provided. The log server may be a computer device, and the computer device may be a terminal. The internal structure diagram thereof may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a storage space management method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0133] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0135] When the storage space usage rate of the log server reaches a preset threshold, determining a target space management strategy configured for the log server according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy;
[0136] Manage the storage space of the log server according to the target space management strategy.
[0137] In one embodiment, if the target space management strategy is a disk expansion strategy, the storage space of the log server is managed according to the target space management strategy, and the processor further implements the following steps when executing the computer program:
[0138] Determine the expansion multiple based on the number of logs generated in a unit time period in historical data;
[0139] Expand the storage disk of the log server according to the expansion multiple.
[0140] In one embodiment, if the target space management strategy is a log forwarding strategy, the storage space of the log server is managed according to the target space management strategy, and the processor further implements the following steps when executing the computer program:
[0141] Determine the target log file from the log files according to the storage time of the log files in the storage space and the preset forwarding granularity;
[0142] The target log file is sent to the backup server of the log server, and the target log file stored in the storage space is deleted.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0144] Receive a request for obtaining a deleted log file in a storage space;
[0145] In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0147] Get the first signature of the deleted log file;
[0148] According to a preset signature algorithm, the deleted log file is signed to obtain a second signature of the deleted log file;
[0149] A consistency check is performed on the deleted log file according to the first signature and the second signature.
[0150] In one embodiment, if the target space management policy is a log deletion policy, the storage space of the log server is managed according to the target space management policy, and the processor further implements the following steps when executing the computer program:
[0151] Determine the log files to be deleted in the storage space according to the preset deletion granularity;
[0152] Free up storage space occupied by log files to be deleted.
[0153] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0154] When the storage space usage rate of the log server reaches a preset threshold, determining a target space management strategy configured for the log server according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy;
[0155] Manage the storage space of the log server according to the target space management strategy.
[0156] In one embodiment, if the target space management strategy is a disk expansion strategy, the storage space of the log server is managed according to the target space management strategy, and the computer program further implements the following steps when executed by the processor:
[0157] Determine the expansion multiple based on the number of logs generated in a unit time period in historical data;
[0158] Expand the storage disk of the log server according to the expansion multiple.
[0159] In one embodiment, if the target space management strategy is a log forwarding strategy, the storage space of the log server is managed according to the target space management strategy, and the computer program further implements the following steps when executed by the processor:
[0160] Determine the target log file from the log files according to the storage time of the log files in the storage space and the preset forwarding granularity;
[0161] The target log file is sent to the backup server of the log server, and the target log file stored in the storage space is deleted.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] Receive a request for obtaining a deleted log file in a storage space;
[0164] In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] Get the first signature of the deleted log file;
[0167] According to a preset signature algorithm, the deleted log file is signed to obtain a second signature of the deleted log file;
[0168] A consistency check is performed on the deleted log file according to the first signature and the second signature.
[0169] In one embodiment, if the target space management policy is a log deletion policy, the storage space of the log server is managed according to the target space management policy, and the computer program further implements the following steps when executed by the processor:
[0170] Determine the log files to be deleted in the storage space according to the preset deletion granularity;
[0171] Free up storage space occupied by log files to be deleted.
[0172] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0173] When the storage space usage rate of the log server reaches a preset threshold, determining a target space management strategy configured for the log server according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy;
[0174] Manage the storage space of the log server according to the target space management strategy.
[0175] In one embodiment, if the target space management strategy is a disk expansion strategy, the storage space of the log server is managed according to the target space management strategy, and the computer program further implements the following steps when executed by the processor:
[0176] Determine the expansion multiple based on the number of logs generated in a unit time period in historical data;
[0177] Expand the storage disk of the log server according to the expansion multiple.
[0178] In one embodiment, if the target space management strategy is a log forwarding strategy, the storage space of the log server is managed according to the target space management strategy, and the computer program further implements the following steps when executed by the processor:
[0179] Determine the target log file from the log files according to the storage time of the log files in the storage space and the preset forwarding granularity;
[0180] The target log file is sent to the backup server of the log server, and the target log file stored in the storage space is deleted.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] Receive a request for obtaining a deleted log file in a storage space;
[0183] In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0185] Get the first signature of the deleted log file;
[0186] According to a preset signature algorithm, the deleted log file is signed to obtain a second signature of the deleted log file;
[0187] A consistency check is performed on the deleted log file according to the first signature and the second signature.
[0188] In one embodiment, if the target space management policy is a log deletion policy, the storage space of the log server is managed according to the target space management policy, and the computer program further implements the following steps when executed by the processor:
[0189] Determine the log files to be deleted in the storage space according to the preset deletion granularity;
[0190] Free up storage space occupied by log files to be deleted.
[0191] It should be noted that the user information (including but not limited to user terminal information, user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0194] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A storage space management method, characterized in that: The method comprises: When the storage space usage rate of the log server reaches a preset threshold, determining a target space management strategy configured for the log server according to the configuration information of the log server; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy; The storage space of the log server is managed according to the target space management strategy.
2. The method according to claim 1, characterized in that If the target space management strategy is the disk expansion strategy, managing the storage space of the log server according to the target space management strategy includes: Determine the expansion multiple based on the number of logs generated in a unit time period in historical data; According to the expansion multiple, the storage disk of the log server is expanded.
3. The method according to claim 1, characterized in that If the target space management policy is the log forwarding policy, managing the storage space of the log server according to the target space management policy includes: Determining a target log file from the log files according to the storage time of the log files in the storage space and a preset forwarding granularity; The target log file is sent to a backup server of the log server, and the target log file stored in the storage space is deleted.
4. The method according to claim 3, characterized in that The method further comprises: Receiving an acquisition request; the acquisition request is used to acquire the deleted log files in the storage space; In response to the acquisition request, a preset acquisition interface is called to acquire the deleted log file from the backup server.
5. The method according to claim 4, characterized in that The method further comprises: Obtaining a first signature of the deleted log file; According to a preset signature algorithm, the deleted log file is signed to obtain a second signature of the deleted log file; A consistency check is performed on the deleted log file according to the first signature and the second signature.
6. The method according to claim 1, characterized in that If the target space management policy is the log deletion policy, managing the storage space of the log server according to the target space management policy includes: Determining the log files to be deleted in the storage space according to a preset deletion granularity; Release the storage space occupied by the log file to be deleted.
7. A storage space management device, characterized in that: The device comprises: A determination module, used to determine a target space management strategy configured by the log server according to configuration information of the log server when the storage space usage of the log server reaches a preset threshold; the target space management strategy includes at least one of a disk expansion strategy, a log forwarding strategy and a log deletion strategy; The management module is used to manage the storage space of the log server according to the target space management strategy.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.