Storage space optimization method and device, terminal equipment and storage medium
Patent Information
- Application Number
- CN202210991780.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-08-17
AI Technical Summary
Traditional storage space optimization methods cannot effectively free up enough storage space, affecting the normal use of diagnostic equipment.
By monitoring the storage space usage of the target diagnostic equipment, if preset conditions are met, tasks such as cache cleanup, marked file cleanup, infrequently used vehicle software cleanup, redundant file cleanup, and non-vehicle software cleanup are performed to optimize storage space.
This effectively frees up more storage space, solves the problem that traditional methods cannot meet user needs, and ensures the normal operation of diagnostic equipment.
Smart Images

Figure CN115237354B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a storage space optimization method and device, a terminal equipment and a storage medium. BACKGROUND
[0002] Nowadays, more and more electrical elements are integrated in automobiles, and in the process of vehicle diagnosis, special diagnostic equipment such as automobile fault diagnosis instrument is often needed. The diagnostic equipment integrates various software, the volume of which gradually increases in the process of upgrading iteration, and some log files or cache data are also generated while using the software, so the available storage space of the diagnostic equipment becomes smaller and smaller, which will affect the normal use of the diagnostic equipment if the storage space is not released in time by cleaning data.
[0003] Usually, the cleaning of the storage space of the diagnostic equipment is completed by restoring factory settings or cleaning application cache. If the factory settings are restored, the related software needs to be downloaded again; if the application cache is cleaned, the storage space that can be released is also very limited. Therefore, the traditional storage space optimization method cannot meet the user's needs well. SUMMARY
[0004] The main purpose of the present application is to provide a storage space optimization method, device, terminal equipment and storage medium, which aims to solve the problem that the traditional storage space optimization method cannot meet the user's needs.
[0005] To achieve the above purpose, the present application provides a storage space optimization method, which comprises the following steps:
[0006] monitoring the storage space usage rate of a target diagnostic equipment;
[0007] if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks, wherein the types of the cleaning tasks include one or more of a cache cleaning task, a marker file cleaning task, a software for infrequently used vehicle models cleaning task, a redundant file cleaning task and a software for non-vehicle models cleaning task.
[0008] Optionally, the storage space optimization method further comprises the following steps:
[0009] if a newly generated file of the target diagnostic equipment is monitored, recording the marker information corresponding to the newly generated file;
[0010] The step of if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks comprises the following steps:
[0011] deleting the corresponding newly generated file according to the marker information.
[0012] Optionally, the step of executing the one or more cleaning tasks if the storage space usage rate meets the preset cleaning condition comprises:
[0013] reading a first software usage record of each vehicle software of the target diagnostic device in a first preset time period;
[0014] determining and deleting a vehicle software that is not used in the first preset time period based on the first software usage record.
[0015] Optionally, the step of executing the one or more cleaning tasks if the storage space usage rate meets the preset cleaning condition comprises:
[0016] reading a file usage record of each vehicle software of the target diagnostic device in a second preset time period;
[0017] determining and deleting a corresponding redundant file based on the file usage record and a preset file deletion rule.
[0018] Optionally, the step of executing the one or more cleaning tasks if the storage space usage rate meets the preset cleaning condition comprises:
[0019] reading a second software usage record of each non-vehicle software of the target diagnostic device in a third preset time period;
[0020] determining and deleting a non-vehicle software that is not used in the third preset time period based on the second software usage record.
[0021] Optionally, the storage space optimization method further comprises:
[0022] after any cleaning task is executed, determining whether the storage space usage rate meets a preset end condition;
[0023] if the storage space usage rate meets the preset end condition or all cleaning tasks are executed, ending the storage space cleaning process.
[0024] Optionally, after the step of determining whether the storage space usage rate meets the preset end condition after any cleaning task is executed, the method further comprises:
[0025] if the storage space usage rate meets the preset end condition, reducing the monitoring frequency of the storage space usage rate of the target diagnostic device.
[0026] Embodiments of the present application also provide a storage space optimization device, which comprises:
[0027] The detection module is configured to monitor a storage space usage rate of the target diagnostic device.
[0028] The cleaning module is configured to perform one or more preset cleaning tasks if the storage space usage rate meets preset cleaning conditions, wherein the types of the cleaning tasks include one or more of a cache cleaning task, a marker file cleaning task, a software for infrequently used vehicle models cleaning task, a redundant file cleaning task, and a software for non-vehicle models cleaning task.
[0029] The terminal device according to an embodiment of the present application comprises a memory, a processor, and a storage space optimization program stored in the memory and executable on the processor. When the storage space optimization program is executed by the processor, the steps of the storage space optimization method described above are implemented.
[0030] The computer readable storage medium according to an embodiment of the present application stores a storage space optimization program. When the storage space optimization program is executed by a processor, the steps of the storage space optimization method described above are implemented.
[0031] The storage space optimization method, device, terminal device, and storage medium according to the embodiments of the present application monitor the storage space usage rate of the target diagnostic device. If the storage space usage rate meets preset cleaning conditions, one or more preset cleaning tasks are performed. The types of the cleaning tasks include one or more of a cache cleaning task, a marker file cleaning task, a software for infrequently used vehicle models cleaning task, a redundant file cleaning task, and a software for non-vehicle models cleaning task. Based on the present application, the available storage space is determined to be insufficient by monitoring the storage space usage rate of the target diagnostic device. If the available storage space is insufficient, one or more cleaning tasks are further performed to optimize the storage space in depth, thereby solving the problem that the traditional storage space optimization method cannot meet the user's needs. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 The figure is a schematic diagram of the functional modules of the terminal device to which the storage space optimization device of the present application belongs.
[0033] Figure 2 The figure is a flowchart of the first exemplary embodiment of the storage space optimization method of the present application.
[0034] Figure 3 The figure is a flowchart of the second exemplary embodiment of the storage space optimization method of the present application.
[0035] Figure 4 The figure is a flowchart of the third exemplary embodiment of the storage space optimization method of the present application.
[0036] Figure 5Flowchart of a fourth exemplary embodiment of the storage space optimization method of the present application;
[0037] Figure 6 Flowchart of a fifth exemplary embodiment of the storage space optimization method of the present application;
[0038] Figure 7 Flowchart of a sixth exemplary embodiment of the storage space optimization method of the present application;
[0039] Figure 8 Flowchart of a seventh exemplary embodiment of the storage space optimization method of the present application;
[0040] Figure 9 Flowchart of an eighth exemplary embodiment of the storage space optimization method of the present application.
[0041] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are merely intended to explain the present application and are not intended to limit the present application.
[0043] The main solution of the embodiments of the present application is to monitor the storage space usage rate of a target diagnostic device; if the storage space usage rate meets preset cleaning conditions, one or more preset cleaning tasks are executed, wherein the types of the cleaning tasks include one or more of a cache cleaning task, a marked file cleaning task, a software for infrequently used vehicle type cleaning task, a redundant file cleaning task and a software for non-vehicle type cleaning task. Based on the solution of the present application, whether the available storage space is insufficient is determined by monitoring the storage space usage rate of the target diagnostic device, and if the available storage space is insufficient, one or more cleaning tasks are further executed to deeply optimize the storage space, thereby solving the problem that the traditional storage space optimization method cannot meet the user demand.
[0044] Specifically, refer to Figure 1 , Figure 1 The functional module diagram of the terminal device to which the storage space optimization apparatus of the present application belongs. The storage space optimization apparatus can be an apparatus independent of the terminal device and capable of optimizing the storage space, which can be carried on the terminal device in the form of hardware or software. The terminal device can be a smart mobile terminal such as a mobile phone or a tablet computer, and can also be a fixed terminal device or a server having a data processing function.
[0045] In the present embodiment, the terminal device to which the storage space optimization apparatus belongs at least includes an output module 110, a processor 120, a memory 130 and a communication module 140.
[0046] The memory 130 stores an operating system and a storage space optimization program. The storage space optimization device can store information such as the monitored storage space usage rate of the target diagnostic equipment, and if the storage space usage rate meets the preset cleaning condition, the storage space optimization device performs one or more preset cleaning tasks. The output module 110 can be a display screen or the like. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, and the like, and communicates with external equipment or a server through the communication module 140.
[0047] When the storage space optimization program in the memory 130 is executed by the processor, the following steps are implemented:
[0048] Monitoring the storage space usage rate of the target diagnostic equipment;
[0049] If the storage space usage rate meets the preset cleaning condition, performing one or more preset cleaning tasks, wherein the type of the cleaning task includes one or more of a cache cleaning task, a marker file cleaning task, a less frequently used vehicle software cleaning task, a redundant file cleaning task, and a non-vehicle software cleaning task
[0050] Further, when the storage space optimization program in the memory 130 is executed by the processor, the following steps are implemented:
[0051] If a newly generated file of the target diagnostic equipment is monitored, the marker information corresponding to the newly generated file is recorded.
[0052] Further, when the storage space optimization program in the memory 130 is executed by the processor, the following steps are implemented:
[0053] According to the marker information, the corresponding newly generated file is deleted.
[0054] Further, when the storage space optimization program in the memory 130 is executed by the processor, the following steps are implemented:
[0055] Reading the first software usage record of each vehicle software of the target diagnostic equipment within a first preset time period;
[0056] Based on the first software usage record, determining and deleting vehicle software that is not used within the first preset time period.
[0057] Further, when the storage space optimization program in the memory 130 is executed by the processor, the following steps are implemented:
[0058] Reading the file usage record of each vehicle software of the target diagnostic equipment within a second preset time period;
[0059] Based on the file usage record and a preset file deletion rule, a corresponding redundant file is determined and deleted.
[0060] Further, the storage space optimization program in the memory 130, when executed by the processor, further implements the following steps:
[0061] reading a second software usage record of each non-vehicle type software of the target diagnostic device within a third preset time period;
[0062] Based on the second software usage record, a non-vehicle type software that is not used within the third preset time period is determined and deleted.
[0063] Further, the storage space optimization program in the memory 130, when executed by the processor, further implements the following steps:
[0064] When any cleaning task is completed, it is determined whether the storage space usage rate meets a preset end condition;
[0065] If the storage space usage rate meets the preset end condition or all cleaning tasks are completed, the storage space cleaning process is ended.
[0066] Further, the storage space optimization program in the memory 130, when executed by the processor, further implements the following steps:
[0067] If the storage space usage rate meets the preset end condition, the monitoring frequency of the storage space usage rate of the target diagnostic device is reduced.
[0068] The embodiment achieves the above-mentioned scheme, specifically monitors the storage space usage rate of the target diagnostic device, and if the storage space usage rate meets a preset cleaning condition, executes one or more preset cleaning tasks, wherein the types of the cleaning tasks include one or more of a cache cleaning task, a marked file cleaning task, a non-vehicle type software cleaning task, a redundant file cleaning task, and a non-vehicle type software cleaning task. In the embodiment, the available storage space is determined by monitoring the storage space usage rate of the target diagnostic device, and if the available storage space is insufficient, one or more cleaning tasks are further executed to deeply optimize the storage space, thereby solving the problem that the traditional storage space optimization method cannot meet the user's demand.
[0069] Referring to Figure 2 The first embodiment of the storage space optimization method of the present application provides a flowchart, and the storage space optimization method comprises:
[0070] Step S10, monitoring the storage space usage rate of the target diagnostic device;
[0071] The execution subject of the embodiment can be a car fault diagnosis instrument or a diagnosis device with similar vehicle diagnosis function, the diagnosis device integrates diagnosis software (vehicle type software) for multiple vehicle types, and the diagnosis of different vehicle types can be completed through the vehicle type software. In addition, in addition to the vehicle type software for diagnosis, the diagnosis device also integrates other auxiliary software related to vehicle diagnosis and software unrelated to vehicle diagnosis (i.e. non-vehicle type software). The storage space can specifically refer to the storage space size of the storage module of the diagnosis device out of the factory, or the sum of the storage space size of the storage module of the diagnosis device out of the factory and the storage module extended later.
[0072] The diagnosis device runs a service or program for monitoring the storage space usage rate, and acquires specific data of the storage space usage rate at a certain frequency. For example, it is set to acquire the storage space usage rate of the diagnosis device once every 24 hours, and the storage space usage rate acquired at a certain time is 85%, that is, 85% of the storage space of the diagnosis device is occupied, and only 15% of the storage space is available.
[0073] Step S20, if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are executed, wherein the type of the cleaning task includes one or more of cache cleaning task, marker file cleaning task, infrequently used vehicle type software cleaning task, redundant file cleaning task and non-vehicle type software cleaning task.
[0074] In order to trigger the cleaning action when the storage space is insufficient, the cleaning condition needs to be set in advance. Specifically, a threshold value can be set, when the used storage space ratio is higher than the threshold value, or the unused storage space ratio is lower than the threshold value, that is, the cleaning task is triggered to be executed. For example, the threshold value is set to 80%, if the used storage space ratio is higher than 80%, the cleaning task is triggered to be executed.
[0075] The type of the cleaning task includes one or more of cache cleaning task, marker file cleaning task, infrequently used vehicle type software cleaning task, redundant file cleaning task and non-vehicle type software cleaning task. The above cleaning tasks can be executed together, or one or more of them can be executed according to actual needs, so as to achieve the effect of deep optimization of the storage space.
[0076] The embodiment realizes the above scheme, specifically by monitoring the storage space usage rate of the target diagnostic device; if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are executed, wherein the type of the cleaning task includes one or more of a cache cleaning task, a marker file cleaning task, a less frequently used vehicle model software cleaning task, a redundant file cleaning task, and a non-vehicle model software cleaning task. In the embodiment, whether the available storage space is insufficient is determined by monitoring the storage space usage rate of the target diagnostic device, and if the available storage space is insufficient, one or more cleaning tasks are further executed to deeply optimize the storage space, thereby solving the problem that the traditional storage space optimization method cannot meet the user's demand.
[0077] Further, with reference to Figure 3 , the second embodiment of the storage space optimization method of the present application provides a flowchart, based on the above Figure 2 , the storage space optimization method further includes:
[0078] Step S011, if a newly generated file of the target diagnostic device is monitored, the marker information corresponding to the newly generated file is recorded;
[0079] Specifically, the target diagnostic device runs a monitoring program or a monitoring service for a newly generated file when powered on. When a new file is generated in the target diagnostic device, it will be monitored by the monitoring program or the monitoring service. Further, the file information of the newly generated file is obtained, which can include one or more of the file name, path, file size, creation time, etc. Then, the file information is stored in a database, a data table or other data storage file created in the cloud or locally in advance. At the same time, the corresponding marker information is recorded or adjusted to the stored file information of the newly generated file to indicate that the file is a newly generated file. For example, the marker information "iNewFileFlag=1" indicates that a certain file is a newly generated file, and the marker information "iNewFileFlag=0" indicates that a certain file is not a newly generated file.
[0080] Step S20, if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are further refined, including:
[0081] Step S012, according to the marker information, the corresponding newly generated file is deleted.
[0082] Specifically, when the type of the executed cleaning task is the new file cleaning task, a database, a data table or other data storage file in which the file information of the newly generated file is stored is invoked, and then files with the new file flag information are queried or filtered out and further deleted. For example, all data items with the flag information of "iNewFileFlag=1" in the database, data table or other data storage file are queried, and then the files corresponding to the data items are determined as the newly generated files, and the newly generated files are further deleted.
[0083] In the embodiment, the newly generated files of the target diagnostic device are monitored and the corresponding flag information is recorded, so that the tracking of the newly generated files can be effectively realized, and more available storage space can be obtained by deleting the newly generated files.
[0084] Further, with reference to Figure 4 , the third embodiment of the storage space optimization method of the present application provides a flowchart, based on the above Figure 2 , step S20, if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are further refined, including:
[0085] Step S021, reading the first software usage record of each vehicle software of the target diagnostic device in the first preset time period;
[0086] The target diagnostic device integrates a plurality of vehicle software, and the user uses the vehicle software, and the target diagnostic device records the usage trace of the user to the vehicle software, that is, the first software usage record. Specifically, when the type of the executed cleaning task is the infrequently used vehicle software cleaning task, the first software usage record of each vehicle software of the target diagnostic device in the first preset time period is read. For example, the first preset time period is 30 days, the target diagnostic device integrates A vehicle software, B vehicle software and C vehicle software, and when the type of the executed cleaning task is the infrequently used vehicle software cleaning task, the software usage record of A vehicle software, B vehicle software and C vehicle software in the last 30 days is read.
[0087] Step S022, determining and deleting the vehicle software not used in the first preset time period based on the first software usage record.
[0088] Specifically, after reading the first software usage record, the first software usage record is analyzed. If the analysis result shows that one or more vehicle model software has not been used in the first preset time period, that is, it is not commonly used for the user of the target diagnostic equipment. Further, delete one or more infrequently used vehicle model software. For example, it is read that the software opening times of A vehicle model software, B vehicle model software and C vehicle model software in the last 30 days are 15 times, 20 times and 0 times respectively. It can be seen that the C vehicle model software is an infrequently used vehicle model software, and further, the C vehicle model software is deleted.
[0089] The embodiment obtains more available storage space by reading the software usage record of each vehicle model software of the target diagnostic equipment in a certain preset time period, determining some infrequently used vehicle model software, and then deleting these infrequently used vehicle model software.
[0090] Further, with reference to Figure 5 , the fourth embodiment of the storage space optimization method of the present application provides a flowchart, based on the above Figure 2 , step S20, if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are further refined, including:
[0091] Step S031, reading the file usage record of each vehicle model software of the target diagnostic equipment in the second preset time period;
[0092] Specifically, the target diagnostic equipment integrates a plurality of vehicle model software. When a user uses a certain vehicle model software or the target diagnostic equipment automatically calls a certain vehicle model software, the related files in the vehicle model software will also be used. At this time, the target diagnostic equipment will record the usage traces of these related files, that is, the file usage record. Specifically, when the type of the executed cleaning task is a redundant file cleaning task, the file usage record of each vehicle model software of the target diagnostic equipment in the second preset time period is read. For example, the second preset time period is 20 days, the target diagnostic equipment integrates A vehicle model software, and the file resources corresponding to the A vehicle model software include A1 file, A2 file and A3 file. When the type of the executed cleaning task is a redundant file cleaning task, the file usage record corresponding to A1 file, A2 file and A3 file in the last 20 days is read.
[0093] Step S032, based on the file usage record and the preset file deletion rule, determining and deleting the corresponding redundant file.
[0094] Specifically, after reading the file usage records, the file usage records are analyzed. If the analysis result shows that one or more files have not been used in a second preset time period, and the preset file deletion rule determines that these files are unnecessary, it can be determined that these files are redundant files. Further, one or more redundant files are deleted. For example, it is read that the file calling times of A1 file, A2 file and A3 file of A vehicle software in the last 20 days are 70 times, 0 times and 60 times respectively, and the preset file deletion rule determines that A2 file will not affect the normal operation of A vehicle software, so A2 file is a redundant file, and further, A2 file is deleted.
[0095] The above method can clean up the redundant files of one or more vehicle software.
[0096] The above method can clean up the redundant files of one or more vehicle software.
[0097] Further, with reference to Figure 6 , the fifth embodiment of the storage space optimization method of the present application provides a flowchart, based on the above Figure 2 , the embodiment shown in step S20, if the storage space usage rate meets the preset cleaning condition, the preset one or more cleaning tasks are further refined, including:
[0098] Step S041, reading the second software usage records of each non-vehicle software of the target diagnostic equipment in a third preset time period;
[0099] Specifically, the target diagnostic device is integrated with other auxiliary software related to vehicle diagnosis and software unrelated to vehicle diagnosis (i.e. non-vehicle software) such as license plate recognition software, extended oscilloscope software, extended sensor software, etc. in addition to the vehicle model software used for diagnosis. When the user uses these non-vehicle software, the target diagnostic device records the user's usage traces of these non-vehicle software, that is, the second software usage record. Specifically, when the type of the executed cleaning task is a non-vehicle software cleaning task, the second software usage record of each non-vehicle software of the target diagnostic device within the third preset time period is read. For example, the third preset time period is 15 days, the target diagnostic device is integrated with D non-vehicle software, E non-vehicle software and F non-vehicle software, and when the type of the executed cleaning task is a non-vehicle software cleaning task, the software usage record of D non-vehicle software, E non-vehicle software and F non-vehicle software within the last 15 days is read.
[0100] Step S042, based on the second software usage record, determining and deleting non-vehicle software that is not used within the third preset time period.
[0101] Specifically, after reading the second software usage record, the second software usage record is analyzed. If the analysis result shows that one or more non-vehicle software has not been used within the third preset time period, that is, it is not commonly used for the user of the target diagnostic device. Further, one or more non-vehicle software that is not commonly used is deleted. For example, it is read that the number of times D non-vehicle software, E non-vehicle software and F non-vehicle software are opened within the last 15 days is 0, 9 and 14 respectively. It can be seen that D non-vehicle software is non-vehicle software that is not commonly used, and further, D non-vehicle software is deleted.
[0102] The embodiment obtains more available storage space by reading the software usage record of each non-vehicle software of the target diagnostic device within a certain preset time period, determining some non-vehicle software that is not commonly used, and then deleting these non-vehicle software that is not commonly used.
[0103] Further, with reference to Figure 7 , the sixth embodiment of the storage space optimization method provides a flowchart, based on the above Figure 2 embodiments, the storage space optimization method further comprises:
[0104] Step S001, when any cleaning task is executed, it is determined whether the storage space usage rate meets the preset ending condition.
[0105] Specifically, when the storage space of the target diagnostic device is insufficient, one or more cleaning tasks among the cache cleaning task, the marked file cleaning task, the infrequently used vehicle model software cleaning task, the redundant file cleaning task, and the non-vehicle model software cleaning task can be executed. For the case that the storage space is not severely insufficient, it is possible to make the storage space reach the ideal state by executing part of the cleaning tasks, instead of executing all the cleaning tasks. Therefore, when any cleaning task is executed, the specific data of the storage space usage rate of the target diagnostic device is obtained, and then it is determined whether the storage space usage rate meets the preset ending condition based on the data. Specifically, a threshold value can be set, and when the used storage space ratio is higher than the threshold value or the unused storage space ratio is lower than the threshold value, it is determined that the preset ending condition is met. For example, the threshold value is set to 80%, and if the used storage space ratio is lower than 80% or the available storage space ratio is higher than 20%, it is determined that the preset ending condition is met.
[0106] Step S002, if the storage space usage rate meets the preset ending condition or all the cleaning tasks are executed, the storage space cleaning process is ended.
[0107] Specifically, if it is determined that the storage space usage rate meets the preset ending condition when a certain cleaning task is executed, it is indicated that the available storage space has reached the ideal state, and in order to avoid too many software or files being deleted, it is necessary to end the storage space cleaning process, and the remaining cleaning tasks are not executed.
[0108] If all the cleaning tasks are executed, whether the storage space usage rate meets the preset ending condition or not, no more cleaning actions about the storage space are executed, and at this time, it is also necessary to end the storage space cleaning process. On this basis, the user can be prompted to use other ways to optimize the storage space by pushing the reminding information to the display component or the voice playing component of the target diagnostic device.
[0109] The embodiment of the present application provides a flowchart of a storage space optimization method, and the method comprises the following steps.
[0110] Further, referring to Figure 8 , the seventh embodiment of the storage space optimization method of the present application provides a flowchart, which is based on the above-mentioned Figure 7 , and the step S001 comprises the following steps.
[0111] The step S003 comprises the following steps.
[0112] Specifically, if the storage space usage rate meets the preset ending condition when any cleaning task is completed, it indicates that the available storage space has reached an ideal state. At this time, the monitoring frequency of the storage space usage rate of the target diagnostic device is reduced by adjusting relevant parameters. For example, the monitoring frequency of the storage space usage rate of the target diagnostic device is adjusted from 30 days to 60 days.
[0113] The embodiment of the present application provides the above-mentioned method, and the monitoring frequency of the storage space usage rate of the target diagnostic device is reduced if the storage space usage rate meets the preset ending condition. In the embodiment, if the storage space usage rate meets the preset ending condition, that is, the storage space reaches an ideal state, the monitoring frequency of the storage space usage rate of the target diagnostic device can be further reduced, so that the computing resources of the target diagnostic device can be saved, and the influence on the normal operation of other programs can be reduced.
[0114] Further, referring to Figure 9 , the eighth embodiment of the storage space optimization method of the present application provides a flowchart.
[0115] The execution subject of the embodiment can be a car fault diagnosis instrument or a diagnosis device with similar vehicle diagnosis function, the diagnosis device integrates diagnosis software (vehicle type software) for multiple vehicle types, and the diagnosis of different vehicle types can be completed through the vehicle type software. In addition, in addition to the vehicle type software for diagnosis, the diagnosis device also integrates other auxiliary software related to vehicle diagnosis and software unrelated to vehicle diagnosis (i.e. non-vehicle type software). The storage space can specifically refer to the storage space size of the storage module of the diagnosis device shipped from the factory, or the sum of the storage space size of the storage module shipped from the factory and the storage module extended later.
[0116] The target diagnosis device runs a monitoring program or a monitoring service for newly generated files when powered on. When a new file is generated in the target diagnosis device, it will be monitored by the monitoring program or the monitoring service, and further, the file information of the newly generated file will be obtained, which can include one or more of the file name, path, file size, creation time, etc. Then, the file information is stored in the database, data table or other data storage file created in advance in the cloud or locally. At the same time, the corresponding mark information of the stored new file information record is adjusted to indicate that the file is a newly generated file. For example, the mark information "iNewFileFlag = 1" indicates that a certain file is a newly generated file, and the mark information "iNewFileFlag = 0" indicates that a certain file is not a newly generated file.
[0117] The diagnosis device runs a service or program to monitor the storage space usage rate, and obtains specific data of the storage space usage rate at a certain frequency. For example, it is set to obtain the storage space usage rate of the diagnosis device once every 24 hours, and the storage space usage rate obtained at a certain time is 85%, that is, 85% of the storage space of the diagnosis device is occupied, and only 15% of the storage space is available. In order to trigger the cleaning action when the storage space is insufficient, the cleaning condition needs to be set in advance. Specifically, a threshold value can be set, when the used storage space ratio is higher than the threshold value, or the unused storage space ratio is lower than the threshold value, that is, the cleaning task is triggered. For example, the threshold value is set to 80%, if the used storage space ratio is higher than 80%, the cleaning task is triggered. The types of cleaning tasks include cache cleaning task, mark file cleaning task, infrequently used vehicle type software cleaning task, redundant file cleaning task and non-vehicle type software cleaning task.
[0118] When the used storage space is higher than 80%, the cache cleaning task is executed first, and the system cache of the target diagnosis device or the cache of different vehicle type software and non-vehicle type software is cleaned.
[0119] Further, it is judged whether the used storage space is lower than 80%, if lower than 80%, the storage space cleaning process is ended, if not lower than 80%, the marked file cleaning task is executed. At this time, the database, data table or other data storage file in which the file information of the newly generated file is stored is called, then the file with the new file flag information is queried or filtered out, and the file is further deleted. For example, all data items with the marked information of "iNewFileFlag=1" in the database, data table or other data storage file are queried, then the file corresponding to the data item is determined as the newly generated file, and the newly generated file is further deleted.
[0120] Further, it is judged whether the used storage space is lower than 80%, if lower than 80%, the storage space cleaning process is ended, if not lower than 80%, the marked file cleaning task is executed. At this time, the database, data table or other data storage file in which the file information of the newly generated file is stored is called, then the file with the new file flag information is queried or filtered out, and the file is further deleted. For example, all data items with the marked information of "iNewFileFlag=1" in the database, data table or other data storage file are queried, then the file corresponding to the data item is determined as the newly generated file, and the newly generated file is further deleted.
[0121] Further, it is judged whether the used storage space is lower than 80%, if lower than 80%, the storage space cleaning process is ended, if not lower than 80%, the redundant file cleaning task is executed. At this time, the file usage records of each vehicle model software of the target diagnostic equipment in the second preset time period are read. For example, the second preset time period is 20 days, the target diagnostic equipment integrates A vehicle model software, the file resources corresponding to the A vehicle model software include A1 file, A2 file and A3 file, when the type of the cleaning task executed is the redundant file cleaning task, the file usage records corresponding to the A1 file, the A2 file and the A3 file in the last 20 days are read. After the file usage records are read, the file usage records are analyzed. If the analysis result shows that one or more files are not used in the second preset time period, and the preset file deletion rule judges that these files are unnecessary, it can be determined that these files are redundant files. Further, one or more redundant files are deleted. For example, it is read that the file calling times of the A1 file, the A2 file and the A3 file of the A vehicle model software in the last 20 days are 70 times, 0 times and 60 times respectively, and the A2 file is judged by the preset file deletion rule that it will not affect the normal operation of the A vehicle model software, it is known that the A2 file is a redundant file, and further, the A2 file is deleted. The above method can clean the redundant files of one or more vehicle model softwares.
[0122] Further, it is judged whether the used storage space is lower than 80%, if lower than 80%, the storage space cleaning process is ended, if not lower than 80%, the redundant file cleaning task is executed. At this time, the file usage records of each vehicle model software of the target diagnostic equipment in the second preset time period are read. For example, the second preset time period is 20 days, the target diagnostic equipment integrates A vehicle model software, the file resources corresponding to the A vehicle model software include A1 file, A2 file and A3 file, when the type of the cleaning task executed is the redundant file cleaning task, the file usage records corresponding to the A1 file, the A2 file and the A3 file in the last 20 days are read. After the file usage records are read, the file usage records are analyzed. If the analysis result shows that one or more files are not used in the second preset time period, and the preset file deletion rule judges that these files are unnecessary, it can be determined that these files are redundant files. Further, one or more redundant files are deleted. For example, it is read that the file calling times of the A1 file, the A2 file and the A3 file of the A vehicle model software in the last 20 days are 70 times, 0 times and 60 times respectively, and the A2 file is judged by the preset file deletion rule that it will not affect the normal operation of the A vehicle model software, it is known that the A2 file is a redundant file, and further, the A2 file is deleted. The above method can clean the redundant files of one or more vehicle model softwares.
[0123] In addition, if the storage space usage rate meets the preset end condition when any cleaning task is completed, it indicates that the available storage space has reached an ideal state. At this time, the monitoring frequency of the storage space usage rate of the target diagnostic device is adjusted by adjusting the related parameters. For example, the monitoring frequency of the storage space usage rate of the target diagnostic device is adjusted from 30 days of monitoring to 60 days of monitoring.
[0124] In the embodiment, whether the available storage space is insufficient is determined by monitoring the storage space usage rate of the target diagnostic device. If the available storage space is insufficient, one or more cleaning tasks are further executed in sequence to optimize the storage space in depth, thereby solving the problem that the conventional storage space optimization method cannot meet the user's demand.
[0125] In addition, the application also provides a storage space optimization device, which comprises:
[0126] The detection module is configured to monitor the storage space usage rate of the target diagnostic device.
[0127] The cleaning module is configured to execute one or more preset cleaning tasks if the storage space usage rate meets the preset cleaning condition, wherein the type of the cleaning task comprises one or more of a cache cleaning task, a marker file cleaning task, a less frequently used vehicle software cleaning task, a redundant file cleaning task, and a non-vehicle software cleaning task.
[0128] The storage space optimization device further comprises a marker unit and a marker file deletion unit. The marker unit is configured to record the marker information corresponding to the newly generated file if the newly generated file of the target diagnostic device is monitored. The marker file deletion unit is configured to delete the corresponding newly generated file according to the marker information.
[0129] The storage space optimization device further comprises a first software usage record reading unit and a vehicle software deletion unit. The first software usage record reading unit is configured to read the first software usage record of each vehicle software of the target diagnostic device within a first preset time period. The vehicle software deletion unit is configured to determine and delete the vehicle software that is not used within the first preset time period based on the first software usage record.
[0130] The storage space optimization device further comprises a file usage record reading unit and a redundant file deletion unit. The file usage record reading unit is configured to read the file usage record of each vehicle software of the target diagnostic device within a second preset time period. The redundant file deletion unit is configured to determine and delete the corresponding redundant file based on the file usage record and a preset file deletion rule.
[0131] The storage space optimization apparatus further comprises a second software usage record reading unit and a non-vehicle type software deleting unit; the second software usage record reading unit is configured to read second software usage records of each non-vehicle type software of the target diagnostic device within a third preset time period; and the non-vehicle type software deleting unit is configured to determine and delete non-vehicle type software that is not used within the third preset time period based on the second software usage records.
[0132] The storage space optimization apparatus further comprises a process end judging unit and a process end executing unit; the process end judging unit is configured to judge whether the storage space usage rate meets a preset end condition when any cleaning task is completed; and the process end executing unit is configured to end the storage space cleaning process if the storage space usage rate meets the preset end condition or all cleaning tasks are completed.
[0133] The storage space optimization apparatus further comprises a monitoring frequency adjusting unit; the monitoring frequency adjusting unit is configured to reduce the monitoring frequency of the storage space usage rate of the target diagnostic device if the storage space usage rate meets the preset end condition.
[0134] The principle and implementation process of the storage space optimization are achieved in the embodiment, and thus will not be described here again.
[0135] In addition, the embodiment of the present application further provides a terminal device, which comprises a memory, a processor, and a storage space optimization program stored in the memory and executable on the processor. The storage space optimization program, when executed by the processor, implements the steps of the storage space optimization method described above.
[0136] Since the storage space optimization program is executed by the processor, all the technical solutions of all the foregoing embodiments are adopted, and thus at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, which will not be described here again.
[0137] In addition, the embodiment of the present application further provides a computer readable storage medium, which stores a storage space optimization program. The storage space optimization program, when executed by the processor, implements the steps of the storage space optimization method described above.
[0138] Since the storage space optimization program is executed by the processor, all the technical solutions of all the foregoing embodiments are adopted, and thus at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, which will not be described here again.
[0139] Compared with the prior art, the storage space optimization method and device, the terminal device and the storage medium provided by the embodiments of the present application monitor the storage space usage rate of the target diagnostic equipment; if the storage space usage rate meets the preset cleaning condition, one or more preset cleaning tasks are executed, wherein the types of the cleaning tasks include one or more of a cache cleaning task, a marker file cleaning task, a software for infrequently used vehicle type cleaning task, a redundant file cleaning task and a software for non-vehicle type cleaning task. Based on the present application, it is judged whether the available storage space is insufficient by monitoring the storage space usage rate of the target diagnostic equipment. If the available storage space is insufficient, one or more cleaning tasks are further executed to deeply optimize the storage space, thereby solving the problem that the traditional storage space optimization method cannot meet the user's demand.
[0140] It should be noted that in this document, the terms "comprise", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of another identical element in the process, method, article or system that includes the element.
[0141] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0142] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) execute the method of each embodiment of the present application.
[0143] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation based on the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A storage space optimization method, characterized by, The storage space optimization method comprises: monitoring a storage space usage rate of a target diagnostic device; if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks, wherein the type of the cleaning task comprises one or more of a cache cleaning task, a marker file cleaning task, a less frequently used vehicle model software cleaning task, a redundant file cleaning task, and a non-vehicle model software cleaning task; The storage space optimization method further comprises: if a newly generated file of the target diagnostic device is monitored, recording marker information corresponding to the newly generated file; The step of if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks comprises: when the type of the executed cleaning task is a marker file cleaning task, deleting the corresponding newly generated file according to the marker information; The step of if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks comprises: when the type of the executed cleaning task is a less frequently used vehicle model software cleaning task, reading a first software usage record of each vehicle model software of the target diagnostic device within a first preset time period; based on the first software usage record, determining and deleting vehicle model software that is not used within the first preset time period; The step of if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks comprises: when the type of the executed cleaning task is a redundant file cleaning task, reading a file usage record of each vehicle model software of the target diagnostic device within a second preset time period; based on the file usage record and a preset file deletion rule, determining and deleting the corresponding redundant file.
2. The storage space optimization method of claim 1, wherein, The step of if the storage space usage rate meets a preset cleaning condition, performing one or more preset cleaning tasks comprises: reading a second software usage record of each non-vehicle model software of the target diagnostic device within a third preset time period; based on the second software usage record, determining and deleting non-vehicle model software that is not used within the third preset time period.
3. The storage space optimization method of claim 1, wherein, The storage space optimization method further comprises: when any cleaning task is executed, determining whether the storage space usage rate meets a preset end condition; if the storage space usage rate meets the preset end condition or all cleaning tasks are executed, ending the storage space cleaning process.
4. The storage space optimization method of claim 3, wherein, The step of when any cleaning task is executed, determining whether the storage space usage rate meets a preset end condition, further comprises: if the storage space usage rate meets the preset end condition, reducing the monitoring frequency of the storage space usage rate of the target diagnostic device.
5. A storage space optimization apparatus, characterized by, The storage space optimization device comprises: a detection module for monitoring a storage space usage rate of a target diagnostic device; The cleaning module is configured to execute one or more preset cleaning tasks if the storage space usage rate meets a preset cleaning condition, wherein the type of the cleaning task includes one or more of a cache cleaning task, a marker file cleaning task, a less frequently used vehicle software cleaning task, a redundant file cleaning task, and a non-vehicle software cleaning task. The storage space optimization apparatus is further configured to: If a newly generated file of the target diagnostic device is monitored, record the marker information corresponding to the newly generated file; The execution of the one or more preset cleaning tasks if the storage space usage rate meets the preset cleaning condition includes: When the type of the executed cleaning task is the marker file cleaning task, delete the corresponding newly generated file according to the marker information; The execution of the one or more preset cleaning tasks if the storage space usage rate meets the preset cleaning condition includes: When the type of the executed cleaning task is the less frequently used vehicle software cleaning task, read the first software usage record of each vehicle software of the target diagnostic device in a first preset time period; Determine and delete the vehicle software that is not used in the first preset time period based on the first software usage record; The execution of the one or more preset cleaning tasks if the storage space usage rate meets the preset cleaning condition includes: When the type of the executed cleaning task is the redundant file cleaning task, read the file usage record of each vehicle software of the target diagnostic device in a second preset time period; Determine and delete the corresponding redundant file based on the file usage record and a preset file deletion rule.
6. A terminal device, characterized by comprising: The terminal device includes a memory, a processor, and a storage space optimization program stored on the memory and executable on the processor, and the storage space optimization program, when executed by the processor, implements the steps of the storage space optimization method of any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a storage space optimization program, and the storage space optimization program, when executed by the processor, implements the steps of the storage space optimization method of any one of claims 1-4.
Citation Information
Patent Citations
Data processing method and device of storage equipment
CN114647619A