Photovoltaic energy storage system service file management method and related products
By automatically managing service files of the photovoltaic energy storage system, including backup files and log files, the problems of large storage space occupation and low manual cleaning efficiency are solved, and the stability and security of the system are improved.
Patent Information
- Application Number
- CN202411054205.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The number of service files in photovoltaic energy storage systems has increased sharply, resulting in large storage space occupation and degradation of system performance. Traditional manual cleaning methods are inefficient and easy to delete important files by mistake.
A service file management method for photovoltaic energy storage system is proposed. By collecting engineering service collection and service files, calculating the number of backup files, determining whether it exceeds the preset threshold, automatically sorting and deleting backup files, and estimating disk space based on the log generation amount to ensure sufficient storage space.
It realizes the automated management of service documents of the photovoltaic energy storage system, reduces manual participation, avoids the mistaken deletion of important documents, improves execution efficiency, and improves system stability and security.
Smart Images

Figure CN118916333B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic energy storage, and particularly to a method for managing service files of a photovoltaic energy storage system and related products. Background Art
[0002] With the wide application of photovoltaic energy storage systems, the number of service files generated by them has increased sharply. These files are crucial for the stable operation and fault recovery of the system. In particular, backup files and log files. Excessive backup files will occupy a large amount of storage space, affect the system performance, and may even lead to data redundancy and chaos. The traditional manual cleaning method is not only inefficient but also prone to accidentally deleting important files. Therefore, an intelligent backup file cleaning method is needed. Summary of the Invention
[0003] In view of the above problems, the present invention proposes a method for managing service files of a photovoltaic energy storage system and related products that overcomes the above problems or at least partially solves the above problems.
[0004] One objective of the present invention is to improve the stability and security of the photovoltaic energy storage system.
[0005] A further objective of the present invention is to achieve automated management of service files of the photovoltaic energy storage system and reduce manual participation.
[0006] Specifically, the present invention provides a method for managing service files of a photovoltaic energy storage system, including:
[0007] Collect the engineering service set in the photovoltaic energy storage system and the corresponding service files, where the service files include backup files and log files;
[0008] Calculate the number of backup files corresponding to each target engineering service in the engineering service set one by one;
[0009] Determine whether the number of backup files exceeds the preset threshold corresponding to the target engineering service;
[0010] If so, calculate the number of backup files to be deleted in the target engineering service;
[0011] Sort the backup files according to the preset sorting rule to obtain a file list;
[0012] Delete the corresponding number of backup files in the file list according to the number to be deleted;
[0013] Detect whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient;
[0014] If not, expand the storage space of the preset disk.
[0015] Optionally, the steps of sorting the backup files according to a preset sorting rule to obtain a file list include:
[0016] Calculate the sorting scores of the backup files according to the preset sorting rule;
[0017] Sort the backup files in reverse order according to the sorting scores to obtain a file list, and the backup files ranked earlier in the file list are preferentially deleted.
[0018] Optionally, the steps of calculating the sorting scores of the backup files according to the preset sorting rule include:
[0019] Determine the evaluation types of the preset sorting rule, and the evaluation types include any one or more of the importance level, timeliness level, and redundancy level;
[0020] Collect the attribute information of the backup files;
[0021] Evaluate according to the attribute information to obtain the evaluation results of different evaluation types of the backup files;
[0022] Calculate the sorting scores of the backup files according to the evaluation results.
[0023] Optionally, the steps of evaluating according to the attribute information to obtain the evaluation results of different evaluation types of the backup files include:
[0024] Evaluate according to the preset importance evaluation rule in combination with the attribute information to obtain the importance level of the backup files, and the preset importance evaluation rule includes evaluating according to the service association degree, data type, and recent access time in the attribute information;
[0025] Evaluate according to the preset timeliness evaluation rule in combination with the attribute information to obtain the timeliness level of the backup files, and the preset timeliness evaluation rule includes evaluating according to the creation time, modification frequency, and business requirements of the target project service in the attribute information;
[0026] Evaluate according to the preset redundancy evaluation rule in combination with the attribute information to obtain the redundancy level of the backup files, and the preset redundancy evaluation rule includes evaluating according to the data integrity and time span in the attribute information in combination with the recovery test;
[0027] Take any one or more of the importance level, timeliness level, and redundancy level as the evaluation results.
[0028] Optionally, the steps of calculating the number of backup files corresponding to each target project service in the project service set one by one include:
[0029] Obtain the target name of the target project service according to the project service set;
[0030] Obtain the backup files corresponding to the target engineering service by matching through regular expressions according to the target name;
[0031] Calculate the number of backup files corresponding to the target engineering service one by one.
[0032] Optionally, the steps of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient include:
[0033] Obtain the detection instruction of the preset disk;
[0034] Determine the retention time of the log file corresponding to each target engineering service according to the detection instruction;
[0035] Determine the business volume of each target engineering service per unit time and the average log generation volume of the business corresponding to each target engineering service per unit time according to the detection instruction;
[0036] Calculate the log generation volume of each target engineering service per unit time according to the business volume and the average log generation volume;
[0037] Merge the log generation volume of each target engineering service per unit time to obtain the total log generation volume of all engineering services in the engineering service set per unit time;
[0038] Calculate the disk size required for the photovoltaic energy storage system to store log files according to the retention time and the total log generation volume per unit time;
[0039] Judge whether the storage space of the preset disk meets the disk size.
[0040] Optionally, after the steps of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient, it further includes:
[0041] When the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient, set a log storage policy for the preset disk, and the log storage policy includes: the retention time of the log file, the storage location of the log file, and the log generation volume of each target engineering service per unit time.
[0042] According to another aspect of the present invention, there is also provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above photovoltaic energy storage system service file management methods are implemented.
[0043] According to still another aspect of the present invention, there is also provided a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the above photovoltaic energy storage system service file management methods are implemented.
[0044] According to another aspect of the present invention, there is also provided a computer device, including a memory, a processor, and a machine-executable program stored on the memory and running on the processor. When the processor executes the machine-executable program, the steps of any one of the above photovoltaic energy storage system service file management methods are implemented.
[0045] For the photovoltaic energy storage system service file management method of the present invention, collect the engineering service set and corresponding service files in the photovoltaic energy storage system, where the service files include backup files and log files; detect whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient; if not, expand the preset disk storage space; calculate the number of backup files corresponding to each target engineering service in the engineering service set one by one; determine whether the number of backup files exceeds the preset threshold corresponding to the target engineering service; if so, calculate the number of backup files to be deleted in the target engineering service; sort the backup files according to the preset sorting rule to obtain a file list; delete the corresponding storage space in the file list according to the number of files to be deleted. Through this method, manual participation in service file management can be reduced, accidental deletion of important files can be avoided, and the execution efficiency can be improved without considering the issue of personnel access rights, thereby realizing the automated management of photovoltaic energy storage system service files and enhancing the stability and security of the photovoltaic energy storage system.
[0046] Furthermore, for the photovoltaic energy storage system service file management method of the present invention, the total log generation amount of the photovoltaic energy storage system per unit time is obtained by calculating the log generation amount of each target engineering service in the photovoltaic energy storage system per unit time, and then the disk size required for the photovoltaic energy storage system to store log files is calculated according to the retention time and the total log generation amount per unit time, so as to estimate the disk size required for the photovoltaic energy storage system to store log files. Through this method, the disk size can be modified in real time according to the estimation result, avoiding the situation where the log files cannot be stored due to too small disk space.
[0047] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more clear about the above and other objects, advantages, and features of the present invention. Description of the Drawings
[0048] Hereinafter, some specific embodiments of the present invention will be described in detail with reference to the accompanying drawings in an exemplary but non-limiting manner. The same reference numerals in the drawings denote the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:
[0049] Figure 1 is a flowchart of the photovoltaic energy storage system service file management method according to an embodiment of the present invention;
[0050] Figure 2It is a schematic flowchart of the process of managing backup files in the photovoltaic energy storage system service file management method according to an embodiment of the present invention;
[0051] Figure 3 It is a schematic flowchart of the process of managing log files in the photovoltaic energy storage system service file management method according to an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of a computer program product according to an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; and
[0054] Figure 6 It is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed implementation manners
[0055] Those skilled in the art should understand that the embodiments described below are only a part of the embodiments of the present invention, rather than all the embodiments of the present invention. This part of the embodiments is intended to explain the technical principle of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should still fall within the protection scope of the present invention.
[0056] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, device or equipment and execute the instructions), or in combination with these instruction execution systems, devices or equipment.
[0057] During the deployment and operation of the service of the photovoltaic energy storage system, generally additional redundant files will be generated, which are mainly divided into two categories: service executable backup files (abbreviated as backup files) and log files generated during the service operation process. However, in the actual use process of the photovoltaic energy storage system, the expired backup files and log files have lost the value of restoration or traceability, and then can be deleted and cleaned up.
[0058] For such files, the usual processing methods are manual processing or setting up scheduled tasks. Manual processing means: regularly checking the number of backup files of each service and the size of the system operation logs manually, and deleting a certain number of redundant files. However, the disadvantages of this method are: manual processing is time-consuming and laborious, with high costs, and it is easy to under-delete, mis-delete, or over-delete files when deleting files; whether it is once a week or once a month, it cannot fully guarantee whether the system disk will be full.
[0059] For scheduled tasks: The usual practice is to create a scheduled task script in the Linux operating system to regularly clean up redundant files in each service and each directory. However, this method can only achieve file cleaning, and cannot always guarantee that the system disk will not be full. Moreover, every time a new service is added to the server of the photovoltaic energy storage system, the scheduled task script needs to be updated, increasing the service operation and maintenance deployment cost.
[0060] To solve the above problems, Figure 1 is a schematic flowchart of a method for managing service files of a photovoltaic energy storage system according to an embodiment of the present invention. As Figure 1 shown, the method for managing service files of the photovoltaic energy storage system at least includes the following steps S101 to step S108.
[0061] Step S101, collect the engineering service set in the photovoltaic energy storage system and the corresponding service files. Service files generally include backup files and log files. The engineering service set in the photovoltaic energy storage system is a comprehensive service package that covers multiple stages from project planning, design, construction to operation and maintenance. For each engineering service among them, a corresponding directory will be established to store the backup files of the corresponding engineering service. Backup files are generally a comprehensive data set that covers multiple aspects such as system design, equipment, operation and maintenance, software programs, and important data. For example, photovoltaic energy storage system design and configuration files, equipment files, operation and maintenance files, program files, and other important data files. Therefore, backup files are usually of various types and large in number, and problems often occur in manual maintenance. Therefore, automated processing of backup files is selected.
[0062] Step S102, calculate the number of backup files corresponding to each target engineering service in the engineering service set one by one. In some optional embodiments, the step of calculating the number of backup files corresponding to each target engineering service in the engineering service set one by one generally may include: obtaining the target name of the target engineering service according to the engineering service set; obtaining the backup files corresponding to the target engineering service by matching through a regular expression according to the target name; calculating the number of backup files corresponding to the target engineering service one by one.
[0063] In the photovoltaic energy storage system of this embodiment, in order to clearly distinguish each engineering service, generally, the directory of the subsequent files to be stored (such as backup files) is established through the name or alias of each target engineering service. Therefore, the target name of the target engineering service exists in the path string corresponding to each backup file. Based on this storage logic, the present invention selects to obtain the backup files corresponding to the target engineering service by matching through regular expressions according to the target name; and calculates the number of backup files corresponding to the target engineering service one by one.
[0064] Step S103, determine whether the number of backup files exceeds the preset threshold corresponding to the target engineering service. In some optional embodiments, the preset threshold refers to the number of backup files corresponding to different target engineering services set in advance. Those skilled in the art can set the specific threshold of the number of backup files according to the actual engineering services.
[0065] Step S104, in the case where the determination in step S103 is yes, calculate the number of backup files to be deleted in the target engineering service. In some optional embodiments, when the number of backup files in the target engineering service is calculated and the preset threshold is known, the number to be deleted can be determined by subtracting the preset threshold from the number of backup files.
[0066] Step S105, sort the backup files according to the preset sorting rule to obtain a file list. In some optional embodiments, the preset sorting rule can be sorting according to the creation time of the backup files, so as to delete the backup files created earlier during the subsequent deletion process. Those skilled in the art can set the preset sorting rule according to the actual situation.
[0067] Step S106, delete the corresponding number of backup files in the file list according to the number to be deleted.
[0068] Step S107, detect whether the preset disk storage space corresponding to the photovoltaic energy storage system service is sufficient.
[0069] Step S108, in the case where the determination in step S107 is no, expand the preset disk.
[0070] By this method, it is possible to reduce the manual participation in service file management, avoid accidentally deleting important files, and improve the execution efficiency without considering the issue of personnel access rights, thereby realizing the automated management of the service files of the photovoltaic energy storage system and enhancing the stability and security of the photovoltaic energy storage system.
[0071] In some alternative embodiments, the step of sorting the backup files according to a preset sorting rule to obtain a file list includes: calculating a sorting score for the backup files according to the preset sorting rule; sorting the backup files in reverse order according to the sorting score to obtain a file list, and the backup files ranked earlier in the file list are preferentially deleted. Among them, the reverse sorting and the preferential deletion are corresponding. For example, in the case of reverse sorting, the highest ranked is the smallest sorted, that is, the one to be deleted. Therefore, in subsequent steps, the backup files ranked earlier are selected for deletion. On the contrary, if the ones ranked earlier in the file list have higher sorting scores, the backup files ranked later are preferentially deleted.
[0072] In some other alternative embodiments, the step of calculating a sorting score for the backup files according to a preset sorting rule generally may include: determining an evaluation type of the preset sorting rule, where the evaluation type includes any one or more of an importance level, a timeliness level, and a redundancy level; collecting attribute information of the backup files; evaluating according to the attribute information to obtain evaluation results of different evaluation types of the backup files; and calculating a sorting score for the backup files according to the evaluation results.
[0073] Among them, the step of evaluating according to the attribute information to obtain evaluation results of different evaluation types of the backup files generally includes: evaluating to obtain the importance level of the backup files in combination with the attribute information according to a preset importance evaluation rule, and the preset importance evaluation rule generally may include evaluating according to the service correlation degree, data type, and most recent access time in the attribute information.
[0074] The service correlation degree refers to the degree of relevance of the backup file to the engineering service in the photovoltaic energy storage system. A backup file with a high service correlation degree is usually crucial for the system operation because it contains configurations, logs, or other important data required for the normal operation of the service. The data type refers to the type of data in the backup file, and different types of data may have different importance and value for the system. For example, the data type may include database backup, system snapshot, etc. Different types of files have different meanings for the system operation, so the importance level will also be different. The most recent access time refers to the time when the backup file was last accessed or modified. This is an indicator to measure the activity of the file. Generally speaking, a file that has been recently accessed is more likely to be important. The closer the most recent access time is, the greater the possibility that the file has been frequently used or modified, so its importance is relatively high. By comprehensively evaluating the above three types of attribute information, the importance level of the backup files can be determined more reasonably. Those skilled in the art can set the preset importance evaluation rule according to the actual situation of different engineering services.
[0075] Secondly, the timeliness level of the backup file can also be evaluated based on the preset timeliness evaluation rules in combination with the attribute information. The preset timeliness evaluation rules generally include evaluating according to the creation time, modification frequency in the attribute information, and the business requirements of the target engineering service.
[0076] The creation time refers to the date and time when the backup file was initially created. This time point can be used to judge the newness of the file, thereby evaluating its timeliness. A relatively new backup file usually contains the latest data and configuration information. Therefore, compared with an older backup file, its timeliness is higher. The modification frequency refers to the frequency at which the backup file is updated. A file that is updated frequently usually contains the latest information and thus has higher timeliness. Some engineering services may need to update the configuration or data frequently to adapt to business changes. Therefore, the backup files of these engineering services have higher timeliness; while some engineering services may rarely change, so the timeliness of their backup files is lower. By comprehensively evaluating the above three types of attribute information, the timeliness level of the backup file can be determined more reasonably. Those skilled in the art can set the preset timeliness evaluation rules according to the actual situation of different engineering services.
[0077] In addition, the redundancy level of the backup file can also be evaluated based on the preset redundancy evaluation rules in combination with the attribute information. The preset redundancy evaluation rules generally include evaluating according to the data integrity and time span in the attribute information in combination with the recovery test; taking any one or more of the importance level, timeliness level, and redundancy level as the evaluation result.
[0078] Data integrity refers to the completeness of the data in the backup file, that is, whether the backup file completely contains all necessary data without missing or damaged parts. The time span refers to the time range covered by the backup file, that is, from the earliest backup time to the latest backup time. The time span can be used to evaluate the coverage and continuity of the backup file. A wider time span means that the backup file covers data for a longer time, so more time points can be selected during data recovery. The recovery test refers to performing a recovery operation on the backup file in a simulated environment to verify the effectiveness of the backup file and the reliability of the recovery process. Through the recovery test, the performance of the backup file in the actual recovery process can be evaluated, including the success rate of recovery, recovery time, and the accuracy of the recovered data. By comprehensively evaluating the above three types of attribute information, the redundancy level of the backup file can be determined more reasonably. Those skilled in the art can set the preset redundancy evaluation rules according to the actual situation of different engineering services.
[0079] In some other alternative embodiments, the steps of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient generally may include: The steps of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient include: obtaining a detection instruction for the preset disk; determining the retention time of the log file corresponding to each target engineering service according to the detection instruction; determining the business volume of each target engineering service per unit time and the average log generation volume of the business corresponding to each target engineering service per unit time according to the detection instruction; calculating the log generation volume of each target engineering service per unit time according to the business volume and the average log generation volume; merging the log generation volumes of each target engineering service per unit time to obtain the total log generation volume of all engineering services in the engineering service set per unit time; calculating the disk size required for the photovoltaic energy storage system to store the log file according to the retention time and the total log generation volume per unit time; and determining whether the storage space of the preset disk meets the disk size.
[0080] Through this solution, it is possible to calculate the total amount of logs generated by the target engineering service and the required disk size within the retention time according to the preset retention time, business volume, and the average log generation volume corresponding to each business per unit time. Among them, the log retention time and the unit time are generally determined in days. Those skilled in the art can set them according to the actual configuration.
[0081] After the steps of detecting whether the preset disk storage space corresponding to the target engineering service is sufficient, generally, it may further include: when the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient, setting a log storage policy for the preset disk, and the log storage policy includes: the retention time of the log file, the storage location of the log file, and the log generation volume of each target engineering service per unit time.
[0082] Figure 2 It is a schematic flowchart of managing backup files of a photovoltaic energy storage system service file management method according to an embodiment of the present invention; as Figure 2 shown, the process of managing backup files in this photovoltaic energy storage system service file management method at least includes the following steps S201 to step S207.
[0083] Step S201, enter the backup file directory. First, it is necessary to enter the directory where the engineering service backup files are located. This directory is unified for a certain engineering service, that is, all the files stored in this directory are the files corresponding to the engineering service.
[0084] Step S202, obtain the target name of the target engineering service.
[0085] Step S203, calculate the number of backup files. In some alternative embodiments, confirm the engineering service name as the keyword for retrieving files, and match the number of backup files T of the engineering service through regular expressions;
[0086] Step S204, determine whether the number of backup files exceeds a preset threshold. In some alternative embodiments, set the preset threshold as N. If the number of backup files does not exceed the preset threshold N, it means that there is no need to delete backup files, and this operation can be ended.
[0087] Step S205, in the case where the judgment in Step S204 is yes, calculate the number of backup files to be deleted in the target engineering service. An example of an optional algorithm is as follows: set the number to be deleted as M, then M = T - N.
[0088] Step S206, sort the backup files in reverse order according to a preset sorting rule to obtain a file list. An example of an optional preset sorting rule is as follows: sort in reverse order according to the creation time of the backup files, and the earlier part of the obtained file list represents the backup files with an earlier creation time.
[0089] In addition, the preset sorting rule can also be sorting according to any one or more of the importance level, timeliness level, and redundancy level. Those skilled in the art can set the preset sorting rule according to the actual situation.
[0090] Step S207, delete the corresponding number of backup files in the file list. In this embodiment, the first M files can be deleted in the file list.
[0091] Through this method, the backup files in the photovoltaic energy storage system can be automatically deleted by the program, avoiding risks such as server access permissions and misoperations caused by manual operations, and improving the stability and security of the system.
[0092] Figure 3 It is a schematic flowchart of the process of managing the log file of the photovoltaic energy storage system service file management method according to an embodiment of the present invention; as Figure 3 shown, the process of managing backup files in the photovoltaic energy storage system service file management method at least includes the following steps S301 to S309.
[0093] Step S301, determine the log retention time and unit time. In some alternative embodiments, the photovoltaic energy storage system can be generated using the springboot framework in the Linux system for engineering services, and the logback component is used for log management, and the log retention time is set as T, usually calculated in days, that is, T days, and the unit time is days.
[0094] Step S302: Determine the business volume of the target engineering service per unit time.
[0095] Step S303: Determine the average log generation volume of each business per unit time.
[0096] Step S304: Calculate the log generation volume of each target engineering service per unit time based on the business volume and the average log generation volume. In some alternative embodiments, if the business volume per unit time is set as m and the log generation volume per unit time is set as n, then for each target engineering service S n = m * n.
[0097] Step S305: Combine the log generation volumes of each target engineering service per unit time to obtain the total log generation volume of all engineering services in the engineering service set per unit time.
[0098] Step S306: Calculate the total log volume based on the retention time and the total log generation volume per unit time. If the total log volume is set as d, then d = (S1 + … + S n ) * T.
[0099] Step S307: Determine whether the storage space of the preset disk meets the disk size required for the total log volume.
[0100] Step S308: In the case where the determination in Step S307 is yes, expand the preset disk to meet the disk size required for the total log volume.
[0101] Step S309: In the case where the determination in Step S307 is no, set a log storage policy for the preset disk. In some alternative embodiments, the log storage policy generally may include the following aspects: the retention time T of the log file, the storage location of the log file, and the log generation volume S of each target engineering service per unit time n . Among them, setting the storage location of the log file generally can set it to the data disk, so as to prevent the log file from being stored on the system disk and avoid affecting the normal operation of the photovoltaic energy storage system. And setting the log generation volume S per unit time n can monitor the log generation situation of each engineering service. For example, when the log generation volume on a certain day is greater than S n a prompt message can be sent to remind the maintenance personnel to make adjustments to avoid the situation of log file storage failure.
[0102] Through this method, it can always ensure that the disk of the system meets the storage conditions of the files by relying on automated devices, making the server in a controllable state, which can not only prevent the server disk from being filled by abnormal traffic but also ensure the traceability of the service operation historical information, and improve the efficiency of system operation and maintenance work.
[0103] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any specific order, or that all operations of the method are included in every case. In addition, the method may include additional operations. Within the scope of the technical concept provided by the method of this embodiment, additional changes may be made to the above method.
[0104] It should be understood that in some embodiments, each part may be implemented by hardware, software, firmware, or a combination thereof. In the above embodiment, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
[0105] This embodiment also provides a computer program product 10, a computer-readable storage medium 20, and a computer device 30. Figure 4 is a schematic diagram of a computer program product 10 according to an embodiment of the present invention, Figure 5 is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention, Figure 6 is a schematic diagram of a computer device 30 according to an embodiment of the present invention. The computer program product 10 includes a computer program 11, and when the computer program 11 is executed by a processor 32, the steps of any of the above photovoltaic energy storage system service file management methods are implemented. The computer-readable storage medium 20 stores the above computer program 11, and when the computer program 11 is executed by a processor 32, the steps of the photovoltaic energy storage system service file management method of any of the above embodiments are implemented. The computer device 30 may include a memory 31, a processor 32, and a computer program 11 stored on the memory 31 and running on the processor 32.
[0106] The computer program 11 for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, configuration data of an integrated circuit, or source code or object code written in any combination of one or more programming languages and procedural programming languages. The computer program 11 may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider via the Internet). In some embodiments, to perform aspects of the present invention, an electronic circuit, including for example a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), may execute computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.
[0107] For the description of this embodiment, the computer program product 10 is a related product containing the computer program 11.
[0108] For the description of this embodiment, the computer-readable storage medium 20 is a tangible device capable of retaining and storing the computer program 11, which may be any device that can contain, store, communicate, propagate, or transport the program 11 for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of the computer-readable storage medium 20 include the following: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, and any suitable combination of the above.
[0109] The computer device 30 can be, for example, a server, a desktop computer, a laptop computer, a tablet computer, or a smart phone. In some examples, the computer device 30 can be a cloud computing node. The computer device 30 can be described in the general context of computer system executable instructions, such as program modules, executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer device 30 can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0110] The computer device 30 can include a processor 32 adapted to execute stored instructions and a memory 31 that provides temporary storage space for the operation of the instructions during operation. The processor 32 can be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory 31 can include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.
[0111] The computer device 30 can also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows data to be input and output with external devices that can be connected to the computer device. The network adapter / interface can provide communication between the computer device and a network, which is generally shown as a communication network.
[0112] At this point, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications consistent with the principles of the present invention can still be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized to cover all such other variations or modifications.
Claims
1. A photovoltaic energy storage system service file management method, comprising: Collecting the engineering service set and corresponding service files in the photovoltaic energy storage system, wherein the service files include backup files and log files; Calculate the number of backup files corresponding to each target engineering service in the engineering service set one by one; Determining whether the number of backup files exceeds a preset threshold corresponding to the target engineering service; If so, the number of backup files to be deleted in the target engineering service is calculated; Sorting the backup files according to a preset sorting rule to obtain a file list; Deleting a corresponding number of the backup files in the file list according to the number to be deleted; Detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient; If not, expanding the storage space of the preset disk; The step of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient comprises: Obtaining a detection instruction for the preset disk; Determine the retention time of the log file corresponding to each target engineering service according to the detection instruction; Determine the business volume of each target engineering service in a unit time and the average log generation volume of the business corresponding to each target engineering service in the unit time according to the detection instruction; Calculate the log generation amount of each target engineering service in the unit time according to the business volume and the average log generation amount; Combining the log generation amount of each target engineering service in the unit time to obtain the total log generation amount of all the engineering services in the engineering service set in the unit time; Calculate the disk size required by the photovoltaic energy storage system to store the log file according to the retention time and the total log generation amount per unit time; Determine whether the storage space of the preset disk satisfies the disk size.
2. The photovoltaic energy storage system service file management method according to claim 1, wherein: The step of sorting the backup files according to a preset sorting rule to obtain a file list comprises: Calculate the sorting score of the backup file according to the preset sorting rule; The backup files are sorted in reverse order according to the sorting scores to obtain the file list, and the backup files ranked first in the file list are deleted first.
3. The photovoltaic energy storage system service file management method according to claim 2, wherein: The step of calculating the sorting score of the backup file according to the preset sorting rule comprises: Determining an evaluation type of the preset sorting rule, the evaluation type including any one or more of importance level, timeliness level and redundancy level; Collecting attribute information of the backup file; Evaluate the backup file according to the attribute information to obtain evaluation results of different evaluation types; The ranking score of the backup file is calculated according to the evaluation result.
4. The photovoltaic energy storage system service file management method according to claim 3, wherein: The step of evaluating the backup file according to the attribute information to obtain evaluation results of different evaluation types includes: Obtaining the importance level of the backup file according to a preset importance evaluation rule combined with the attribute information, wherein the preset importance evaluation rule includes evaluating according to the service association, data type, and last access time in the attribute information; Obtaining the timeliness level of the backup file according to a preset timeliness evaluation rule combined with the attribute information, wherein the preset timeliness evaluation rule includes evaluating according to the creation time, modification frequency in the attribute information and the business requirements of the target engineering service; Obtaining the redundancy level of the backup file according to a preset redundancy evaluation rule combined with the attribute information, wherein the preset redundancy evaluation rule includes evaluating according to data integrity and time span in the attribute information combined with a recovery test; Any one or more of the importance level, the timeliness level, and the redundancy level are used as the evaluation result.
5. The photovoltaic energy storage system service file management method according to claim 1, wherein: The step of calculating the number of backup files corresponding to each target engineering service in the engineering service set one by one includes: Acquire the target name of the target engineering service according to the engineering service set; Obtaining a backup file corresponding to the target engineering service by matching the target name with a regular expression; The number of backup files corresponding to the target engineering service is calculated one by one.
6. The photovoltaic energy storage system service file management method according to claim 1, wherein: After the step of detecting whether the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient, the following step is further performed: When the preset disk storage space corresponding to the photovoltaic energy storage system is sufficient, a log storage strategy is set for the preset disk, and the log storage strategy includes: the retention time of the log file, the storage location of the log file, and the log generation volume of each target engineering service in the unit time.
7. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the photovoltaic energy storage system service file management method according to any one of claims 1 to 6 are implemented.
8. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the photovoltaic energy storage system service file management method according to any one of claims 1 to 6.
9. A computer device comprising a memory, a processor, and a machine executable program stored in the memory and running on the processor, wherein the processor implements the steps of the photovoltaic energy storage system service file management method according to any one of claims 1 to 6 when executing the machine executable program.
Citation Information
Patent Citations
Backup management method for continuous data protection, computer equipment and storage medium
CN114579368A
Log management method, log management device, storage medium and log management system
CN117076412A