File conversion method, equipment, storage medium and device
Through matrix processing of HDFS files and LSTM model prediction, the storage mode is dynamically adjusted, which solves the problem of resource waste and computing pressure caused by fixed storage methods in the big data platform, realizes intelligent identification and storage mode conversion of hot and cold data, and improves Improve data query efficiency.
Patent Information
- Application Number
- CN202311346120.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2024-10-18
AI Technical Summary
Big data platforms have a single fixed storage method for hot data and cold data, which leads to a waste of storage resources and increases system computing pressure.
By matrixing historical HDFS files, using the LSTM model to predict the file hot data threshold, and dynamically adjusting the storage mode according to the prediction results, converting from EC to three copies or vice versa, to achieve intelligent identification of hot and cold data and intelligent storage mode Convert.
It effectively avoids waste of storage resources, reduces system computing pressure, improves data query efficiency, and adapts to changes in data usage in different periods.
Smart Images

Figure CN118796759A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a file conversion method, equipment, storage medium and device. Background Art
[0002] Compared with three copies, HDFS file EC can improve storage efficiency and save a lot of storage costs, network bandwidth and other resources. However, EC data needs to be encoded and decoded when querying, and the query efficiency is much lower than that of three copies.
[0003] In a big data platform in a cloud-native environment, in order to improve data query efficiency, frequently used hot data is often stored in three copies. However, in order to save storage and network resource overhead, some cold data that is rarely used but will be used in special scenarios such as audits and regulatory inspections will be stored in EC mode.
[0004] Currently, the big data platform will set a fixed cycle by investigating the actual data usage. The data within the cycle is stored as hot data in three copies, and the data outside the cycle is stored as cold data in EC. However, since the usage cycle of a data table will change at different times, if a fixed time is used to split the hot and cold data, a large amount of cold data in the current time will be stored as hot data, wasting storage resources and increasing the computing pressure of the system. Summary of the invention
[0005] The main purpose of the present invention is to provide a file conversion method, equipment, storage medium and device, aiming to solve the technical problem that the current big data platform wastes storage resources and increases the system computing pressure due to the single fixed storage method for hot data and cold data.
[0006] To achieve the above object, the present invention provides a file conversion method, which comprises the following steps: Matrix the historical HDFS file usage data to obtain file feature data; Predicting the number of days of a file hot data threshold based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; Converting the predicted hot data threshold into a threshold date according to the current system time; The target file is retrieved according to the threshold date and the target file is converted into a target version for storage.
[0007] Optionally, the step of performing matrix processing on the historical HDFS file usage data to obtain file feature data includes: Get HDFS file usage data at each time point; The HDFS file usage data at each time point is matrixed according to preset features to obtain file feature data.
[0008] Optionally, the preset features include: the blood relationship between HDFS files, the number of HDFS file queries and the time range of usage data, whether the current time is a holiday, whether the current time is during a marketing activity, and whether the current time is the beginning of the month. The step of matrixing the HDFS file usage data at each time point according to the preset features to obtain file feature data includes: Matrixing the HDFS file usage data at each time point according to the blood relationship between the HDFS files to obtain a first matrix; Matrixing the HDFS file usage data at each time point according to the number of HDFS file queries and the time range of the usage data to obtain a second matrix; Matrix the HDFS file usage data at each time point according to whether the current time is a holiday to obtain a third matrix; Matrix the HDFS file usage data at each time point according to whether the current time is during a marketing activity, to obtain a fourth matrix; The HDFS file usage data at each time point is matrixed according to whether the current time is the beginning of the month, to obtain a fifth matrix; File feature data is determined according to the first matrix, the second matrix, the third matrix, the fourth matrix, and the fifth matrix.
[0009] Optionally, the step of predicting the file hot data threshold days based on the preset LSTM model and the file feature data to obtain the predicted hot data threshold includes: Based on a preset LSTM model, effective information is extracted from the file feature data according to the time series to obtain an effective feature set; The number of days of a file hot data threshold is predicted according to the effective feature set to obtain a predicted hot data threshold.
[0010] Optionally, the step of retrieving the target file according to the threshold date and converting the target file into a target version for storage includes: Searching the file directory corresponding to the threshold date to obtain the target file; The target file is copied to a preset file library according to the file mode corresponding to the target file.
[0011] Optionally, the step of copying the target file to a preset file library according to the file mode corresponding to the target file includes: If the file mode corresponding to the target file is an EC mode file, the hot data date file of the corresponding file in the EC file library is automatically copied to the three-copy file library; If the file mode corresponding to the target file is a three-copy mode file, the non-hot data date file of the corresponding file in the three-copy file library is automatically copied to the EC file library.
[0012] Optionally, before the step of matrixing the historical HDFS file usage data to obtain the file feature data, the step further includes: Sample data of big data HDFS file usage in the past two years read from the sample library; The sample data is input into the initial LSTM model for training to obtain a preset LSTM model.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also proposes a file conversion device, which includes a memory, a processor, and a file conversion program stored in the memory and executable on the processor, wherein the file conversion program is configured to implement the file conversion steps described above.
[0014] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a file conversion program is stored, and when the file conversion program is executed by a processor, the steps of the file conversion method described above are implemented.
[0015] In addition, to achieve the above object, the present invention also provides a file conversion device, the file conversion device comprising: The matrix conversion module is used to process the historical HDFS file usage data into a matrix to obtain file feature data; A hot data prediction module is used to predict the number of days of a file hot data threshold based on a preset LSTM model and the file feature data, and obtain a predicted hot data threshold; A date conversion module, used for converting the predicted hot data threshold into a threshold date according to the current system time; The file conversion module is used to retrieve the target file according to the threshold date and convert the target file into a target version for storage.
[0016] The present invention obtains file feature data by matrixing historical HDFS file usage data; predicts the file hot data threshold days based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; converts the predicted hot data threshold into a threshold date according to the current system time; retrieves a target file according to the threshold date and converts the target file into a target version for storage. Compared with the current big data platform, which wastes storage resources and increases system computing pressure due to the single fixed storage method for hot data and cold data, the present invention introduces an LSTM model and realizes intelligent identification of hot and cold data in each period and intelligent conversion of data table HDFS files in EC and three-copy storage modes according to different usage of data in the table in different periods. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a structural schematic diagram of a file conversion device in a hardware operating environment involved in an embodiment of the present invention; Figure 2 It is a flowchart of the first embodiment of the file conversion method of the present invention; Figure 3 A schematic diagram of HDFS file EC and three-copy intelligent conversion according to the first embodiment of the file conversion method of the present invention; Figure 4 A schematic diagram of a flow chart of a second embodiment of a file conversion method of the present invention; Figure 5 A schematic diagram of matrix conversion in the second embodiment of the file conversion method of the present invention; Figure 6 A schematic diagram of matrix conversion of the blood relationship between HDFS files in the second embodiment of the file conversion method of the present invention; Figure 7 A schematic diagram of matrix conversion of the number of HDFS file queries and the time range of the used data in the second embodiment of the file conversion method of the present invention; Figure 8 This is a schematic diagram of matrix conversion of whether the current time is a holiday in the second embodiment of the file conversion method of the present invention; Fig. 9 This is a schematic diagram of matrix conversion of whether the current time is during a marketing activity in the second embodiment of the file conversion method of the present invention; Fig.10 This is a schematic diagram of matrix conversion of whether the current time is the beginning of the month in the second embodiment of the file conversion method of the present invention; Fig.11 It is a structural block diagram of the first embodiment of the file conversion device of the present invention.
[0018] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0020] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a file conversion device in a hardware operating environment according to an embodiment of the present invention.
[0021] like Figure 1 As shown, the file conversion device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and the user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable memory (Non-volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0022] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the file conversion device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0023] like Figure 1 As shown, the memory 1005 identified as a data processing storage medium may include an operating system, a network communication module, a user interface module, and a file conversion program.
[0024] exist Figure 1 In the file conversion device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the file conversion device calls the file conversion program stored in the memory 1005 through the processor 1001, and executes the file conversion method provided by the embodiment of the present invention.
[0025] Based on the above hardware structure, an embodiment of the file conversion method of the present invention is proposed.
[0026] Reference Figure 2 , Figure 2 The figure is a flow chart of the first embodiment of the file conversion method of the present invention, and provides the first embodiment of the file conversion method of the present invention.
[0027] In this embodiment, the file conversion method includes the following steps: Step S10: Matrix the historical HDFS file usage data to obtain file feature data.
[0028] It should be noted that the execution subject in this embodiment can be a device including a file conversion system, such as: a computer, a tablet, a mobile phone or a notebook, and can also be other devices that can achieve the same or similar functions. The file conversion system includes a file conversion function. In this embodiment and the following embodiments, the file conversion method of the present invention is explained using a computer as an example.
[0029] It is understandable that the historical HDFS file usage data may be data corresponding to the access conditions of HDFS files in the historical period, and the data may include file processing lineage, time range of other files, number of file queries, and time range of used data, etc.
[0030] In a specific implementation, the historical HDFS file usage data is matrixed to obtain file feature data, which is data corresponding to various features in a matrix form.
[0031] Furthermore, to illustrate the construction process of the preset LTSM model, the step S10 also includes: reading sample data of the usage of big data HDFS files in the past two years from the sample library; inputting the sample data into the initial LSTM model for training to obtain the preset LSTM model.
[0032] It should be noted that the training process includes reading sample data, importing the LTSM model for training, and obtaining training results. Among them, the sample data of the usage of big data HDFS files in the past two years is read from the sample library. The sample data is imported into the initial LSTM model for training to obtain the model for hot data and cold data prediction. It is understandable that LSTM can use time series to analyze inputs, where only part of the information needs to be remembered for a long time, while some information can be left unremembered. At the same time, the "memory" of the neural network can be processed dynamically, because some information may be of high value at the beginning, but its value gradually decays later. Therefore, a mechanism for "forgetting" specific information is also set in LSTM. When the LSTM model is trained, the recursive neural network's "memory" of the input data is realized through the unit state. Ct represents the "memory" of the neuron after time t. This vector covers the "summary" of the neural network for all input information before time t+1. As a special RNN network, LSTM is different from other recurrent neural networks in that each module in its repeated module chain contains four network layers: (1) LSTM_1 forget gate: For the cell state in the LSTM at the previous moment, in order to prevent too much memory from affecting the neural network's processing of the current input, some "outdated" component information in the previous cell state will be forgotten.
[0033] (2) LSTM_2&3 memory gate: extracts valid information from the current input, filters the extracted valid information, and gives a rating (0 ~ 1) to each component. The higher the rating, the more memories will enter the unit state in the end.
[0034] (3) LSTM_4 output gate: The output layer first integrates the current input value with the output value of the previous moment, and then processes it through the sigmoid function and tanh function to calculate the output at time t.
[0035] In the specific implementation, in order to perform time series prediction, a fully connected layer (hidden layer) is added after LSTM, and the dimension of the final output tensor is changed. The final output is a numerical value of the predicted HDFS file hot data threshold days. This data is then compared with historical data to determine the model prediction accuracy, thereby obtaining the optimal model, and the optimal model output is used as the preset LSTM model.
[0036] Step S20: predicting the file hot data threshold days based on the preset LSTM model and the file feature data to obtain the predicted hot data threshold.
[0037] It should be noted that the preset LSTM model is a pre-trained model for predicting the number of hot data threshold days. The model can analyze the file feature data according to the time series to obtain the predicted hot data threshold.
[0038] Furthermore, the step S20 includes: extracting effective information from the file feature data according to the time series based on a preset LSTM model to obtain a valid feature set; predicting the file hot data threshold days according to the valid feature set to obtain a predicted hot data threshold.
[0039] It should be noted that, by using the preset LSTM model to extract effective information from file feature data according to the time series, a valid feature set is obtained, and the file hot data threshold days are predicted based on the valid feature set to obtain the predicted hot data threshold. The predicted hot data threshold is a numerical value, so that the file hot data date can be determined later according to the current time of the system.
[0040] In the specific implementation, this solution uses the LSTM model to learn the access status of HDFS files at different times and automatically calculates the threshold of hot data at the current time.
[0041] Step S30: converting the predicted thermal data threshold into a threshold date according to the current system time.
[0042] It should be noted that the hot data threshold output by the LSTM model is read and converted into the threshold date according to the current system time. For example, if the current time is 20200101 and the LSTM model predicts that the hot data threshold of the HDFS file file1 is 30, the actual hot data date should be 20191202.
[0043] Step S40: Retrieve the target file according to the threshold date and convert the target file into a target version for storage.
[0044] It should be noted that, in order to further illustrate the present solution, the prediction results output by the LSTM model are converted into hot data thresholds, and the prediction results are converted into threshold dates for target file retrieval and corresponding storage.
[0045] Furthermore, the step S40 also includes: searching the file directory corresponding to the threshold date to obtain the target file; and copying the target file to a preset file library according to the file mode corresponding to the target file.
[0046] It should be noted that the target file is obtained by searching the file directory corresponding to the threshold date; and the target file is copied to the preset file library according to the file mode corresponding to the target file.
[0047] Furthermore, the step of copying the target file to a preset file library according to the file mode corresponding to the target file includes: if the file mode corresponding to the target file is an EC mode file, the hot data date file of the corresponding file in the EC file library is automatically copied to the three-copy file library; if the file mode corresponding to the target file is a three-copy mode file, the non-hot data date file of the corresponding file in the three-copy file library is automatically copied to the EC file library.
[0048] It should be noted that if the file mode corresponding to the target file is an EC mode file, the hot data date file of the corresponding file in the EC file library will be automatically copied to the three-copy file library; if the file mode corresponding to the target file is a three-copy mode file, the non-hot data date file of the corresponding file in the three-copy file library will be automatically copied to the EC file library.
[0049] For specific implementation, please refer to Figure 3 The diagram of HDFS file EC and three-copy intelligent conversion is shown. By introducing the LSTM model, the LSTM model is used to learn the access situation of HDFS files at different times, automatically calculate the threshold of hot data at the current time, and complete the intelligent conversion of EC and three-copy data through an automatic program according to the time threshold of hot data. Therefore, according to the different usage of data in the table in different periods, the intelligent identification of hot and cold data in each period and the intelligent conversion of data table HDFS files in the two storage modes of EC file library and three-copy file library are realized. Compared with the fixed hot data threshold configuration, which cannot be adjusted automatically, a large amount of manual work is required for manual sorting and adjustment in the scenario of a large number of batch HDFS data files. This solution can realize the intelligent identification of hot and cold data in each period and the intelligent conversion of data table HDFS files in the two storage modes of EC and three copies according to the different usage of data in the table in different periods.
[0050] This embodiment obtains file feature data by matrixing historical HDFS file usage data; predicts the file hot data threshold days based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; converts the predicted hot data threshold into a threshold date according to the current system time; retrieves the target file according to the threshold date and converts the target file into a target version for storage. Compared with the current big data platform, which wastes storage resources and increases system computing pressure due to the single fixed storage method for hot data and cold data, this embodiment introduces an LSTM model and realizes intelligent identification of hot and cold data in each period and intelligent conversion of data table HDFS files in EC and three-copy storage modes according to different usage of data in the table in different periods.
[0051] Based on the above Figure 2The first embodiment shown in FIG. 1 is a second embodiment of the file conversion method of the present invention, referring to FIG. Figure 4 , Figure 4 A flowchart of a second embodiment of a file conversion method according to the present invention.
[0052] In this embodiment, the step S10 further includes: Step S101: Obtain HDFS file usage data at each time point.
[0053] It should be noted that by obtaining the HDFS file usage data at each time point, the HDFS file usage data includes the blood relationship between data processing between HDFS files and the time range of other files involved in the processing, the number of HDFS file queries and the time range of data used, whether the current time is a holiday, whether the current time is during a marketing campaign, and whether the current time is the beginning of the month.
[0054] Step S102: Matrix the HDFS file usage data at each time point according to preset features to obtain file feature data.
[0055] It should be noted that the preset features include: the blood relationship between HDFS files, the number of HDFS file queries and the time range of usage data, whether the current time is a holiday, whether the current time is during a marketing campaign, and whether the current time is the beginning of the month.
[0056] It is understandable that the HDFS file usage data at each time point is matrixed according to the blood relationship between HDFS files, the number of HDFS file queries and the time range of the usage data, whether the current time is a holiday, whether the current time is during a marketing campaign, and whether the current time is the beginning of the month to obtain file feature data.
[0057] Furthermore, the step S102 also includes: matrixing the HDFS file usage data at each time point according to the blood relationship between HDFS files to obtain a first matrix; matrixing the HDFS file usage data at each time point according to the number of HDFS file queries and the time range of the usage data to obtain a second matrix; matrixing the HDFS file usage data at each time point according to whether the current time is a holiday to obtain a third matrix; matrixing the HDFS file usage data at each time point according to whether the current time is during a marketing activity to obtain a fourth matrix; matrixing the HDFS file usage data at each time point according to whether the current time is the beginning of the month to obtain a fifth matrix; and determining file feature data based on the first matrix, the second matrix, the third matrix, the fourth matrix, and the fifth matrix.
[0058] It should be noted that, in order to further illustrate the data matrix conversion process, reference Figure 5 The matrix conversion diagram shown in the figure uses the data of HDFS files in various application scenarios as features and converts them into matrix form. In big data, HDFS files come from data collection or are calculated based on other HDFS files. Therefore, there is a blood relationship between files, which can be converted into a matrix in the following way to form the features in the input parameters. The specific method for matrixing sample data is as follows: matrixing the HDFS file data according to the blood relationship between HDFS files, the number of HDFS file queries and the time range of data use, whether the current time is a holiday, whether the current time is during a marketing campaign, and whether the current time is the beginning of the month.
[0059] Among them, the matrix needs to be numerical, so the file name is encoded, and the date used in the bloodline file is converted into a date difference through "T-file date". At the same time, the parameter matrix has fixed rows and columns, and the missing information is filled with 0.
[0060] It is understandable that the matrix conversion diagram based on the blood relationship between HDFS files is referenced Figure 6 , HDFS file query times and the time range of the data used matrix conversion diagram reference Figure 7 , whether the current time is a holiday matrix conversion diagram reference Figure 8 ,Whether the current time is during the marketing campaign, matrix conversion diagram reference Fig. 9 , whether the current time is the beginning of the month or not, matrix conversion diagram reference Fig.10 Note: The 1st to 5th of each month are considered the beginning of the month.
[0061] In the specific implementation, the HDFS file usage data at each time point is matrixed according to the blood relationship between HDFS files through the above conversion method to obtain a first matrix; the HDFS file usage data at each time point is matrixed according to the number of HDFS file queries and the time range of the usage data to obtain a second matrix; the HDFS file usage data at each time point is matrixed according to whether the current time is a holiday to obtain a third matrix; the HDFS file usage data at each time point is matrixed according to whether the current time is during a marketing activity to obtain a fourth matrix; the HDFS file usage data at each time point is matrixed according to whether the current time is the beginning of the month to obtain a fifth matrix; the file feature data is determined according to the first matrix, the second matrix, the third matrix, the fourth matrix and the fifth matrix.
[0062] This embodiment obtains file feature data by matrixing historical HDFS file usage data; predicts the file hot data threshold days based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; converts the predicted hot data threshold into a threshold date according to the current system time; retrieves the target file according to the threshold date and converts the target file into a target version for storage. Compared with the current big data platform, which wastes storage resources and increases system computing pressure due to the single fixed storage method for hot data and cold data, this embodiment introduces an LSTM model and realizes intelligent identification of hot and cold data in each period and intelligent conversion of data table HDFS files in EC and three-copy storage modes according to different usage of data in the table in different periods.
[0063] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a file conversion program is stored, and when the file conversion program is executed by a processor, the steps of the file conversion method described above are implemented.
[0064] Reference Fig.11 , Fig.11 It is a structural block diagram of the first embodiment of the file conversion device of the present invention.
[0065] The matrix conversion module 10 is used to perform matrix processing on the historical HDFS file usage data to obtain file feature data; A hot data prediction module 20 is used to predict the number of days of a file hot data threshold based on a preset LSTM model and the file feature data, and obtain a predicted hot data threshold; A date conversion module 30, used to convert the predicted thermal data threshold into a threshold date according to the current system time; The file conversion module 40 is used to retrieve the target file according to the threshold date and convert the target file into a target version for storage.
[0066] This embodiment obtains file feature data by matrixing historical HDFS file usage data; predicts the file hot data threshold days based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; converts the predicted hot data threshold into a threshold date according to the current system time; retrieves the target file according to the threshold date and converts the target file into a target version for storage. Compared with the current big data platform, which wastes storage resources and increases system computing pressure due to the single fixed storage method for hot data and cold data, this embodiment introduces an LSTM model and realizes intelligent identification of hot and cold data in each period and intelligent conversion of data table HDFS files in EC and three-copy storage modes according to different usage of data in the table in different periods.
[0067] Furthermore, the matrix conversion module 10 is also used to obtain HDFS file usage data at each time point; the HDFS file usage data at each time point is matrixed according to preset features to obtain file feature data.
[0068] Furthermore, the preset features include: the blood relationship between HDFS files, the number of HDFS file queries and the time range of usage data, whether the current time is a holiday, whether the current time is during a marketing activity, and whether the current time is the beginning of the month. The matrix conversion module 10 is also used to matrix the HDFS file usage data at each time point according to the blood relationship between the HDFS files to obtain a first matrix; matrix the HDFS file usage data at each time point according to the number of HDFS file queries and the time range of usage data to obtain a second matrix; matrix the HDFS file usage data at each time point according to whether the current time is a holiday to obtain a third matrix; matrix the HDFS file usage data at each time point according to whether the current time is during a marketing activity to obtain a fourth matrix; matrix the HDFS file usage data at each time point according to whether the current time is at the beginning of the month to obtain a fifth matrix; determine file feature data based on the first matrix, the second matrix, the third matrix, the fourth matrix and the fifth matrix.
[0069] Furthermore, the hot data prediction module 20 is also used to extract effective information from the file feature data according to the time series based on the preset LSTM model to obtain a valid feature set; predict the file hot data threshold days according to the valid feature set to obtain the predicted hot data threshold.
[0070] Furthermore, the file conversion module 40 is further configured to search the file directory corresponding to the threshold date to obtain the target file; and copy the target file to a preset file library according to the file mode corresponding to the target file.
[0071] Furthermore, the file conversion module 40 is also used to automatically copy the hot data date file of the corresponding file in the EC file library to the three-copy file library if the file mode corresponding to the target file is an EC mode file; if the file mode corresponding to the target file is a three-copy mode file, the non-hot data date file of the corresponding file in the three-copy file library is automatically copied to the EC file library.
[0072] Furthermore, the file conversion device also includes a model building module, which is used to read sample data of big data HDFS file usage in the past two years from a sample library; input the sample data into an initial LSTM model for training to obtain a preset LSTM model.
[0073] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0074] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0075] In addition, for technical details not fully described in this embodiment, reference can be made to the file conversion method provided in any embodiment of the present invention, and will not be repeated here.
[0076] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0077] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order and these words may be interpreted as names.
[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0079] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A file conversion method, It is characterized in that The file conversion method comprises the following steps: Matrix the historical HDFS file usage data to obtain file feature data; Predicting the number of days of a file hot data threshold based on a preset LSTM model and the file feature data to obtain a predicted hot data threshold; Converting the predicted hot data threshold into a threshold date according to the current system time; The target file is retrieved according to the threshold date and the target file is converted into a target version for storage.
2. The file conversion method according to claim 1, It is characterized in that The step of performing matrix processing on the historical HDFS file usage data to obtain file feature data includes: Get HDFS file usage data at each time point; The HDFS file usage data at each time point is matrixed according to preset features to obtain file feature data.
3. The file conversion method according to claim 2, It is characterized in that The preset features include: the blood relationship between HDFS files, the number of HDFS file queries and the time range of usage data, whether the current time is a holiday, whether the current time is during a marketing activity, and whether the current time is the beginning of the month. The step of matrixing the HDFS file usage data at each time point according to the preset features to obtain file feature data includes: Matrixing the HDFS file usage data at each time point according to the blood relationship between the HDFS files to obtain a first matrix; Matrixing the HDFS file usage data at each time point according to the number of HDFS file queries and the time range of the usage data to obtain a second matrix; Matrix the HDFS file usage data at each time point according to whether the current time is a holiday to obtain a third matrix; Matrix the HDFS file usage data at each time point according to whether the current time is during a marketing activity, to obtain a fourth matrix; The HDFS file usage data at each time point is matrixed according to whether the current time is the beginning of the month, to obtain a fifth matrix; File feature data is determined according to the first matrix, the second matrix, the third matrix, the fourth matrix, and the fifth matrix.
4. The file conversion method according to claim 1, It is characterized in that The step of predicting the file hot data threshold days based on the preset LSTM model and the file feature data to obtain the predicted hot data threshold includes: Based on a preset LSTM model, effective information is extracted from the file feature data according to the time series to obtain an effective feature set; The number of days of a file hot data threshold is predicted according to the effective feature set to obtain a predicted hot data threshold.
5. The file conversion method according to claim 1, It is characterized in that The step of retrieving the target file according to the threshold date and converting the target file into a target version for storage comprises: Searching the file directory corresponding to the threshold date to obtain the target file; The target file is copied to a preset file library according to the file mode corresponding to the target file.
6. The file conversion method according to claim 5, It is characterized in that The step of copying the target file to a preset file library according to the file mode corresponding to the target file includes: If the file mode corresponding to the target file is an EC mode file, the hot data date file of the corresponding file in the EC file library is automatically copied to the three-copy file library; If the file mode corresponding to the target file is a three-copy mode file, the non-hot data date file of the corresponding file in the three-copy file library is automatically copied to the EC file library.
7. The file conversion method according to claim 1, It is characterized in that Before the step of matrixing the historical HDFS file usage data to obtain the file feature data, the method further includes: Sample data of big data HDFS file usage in the past two years read from the sample library; The sample data is input into the initial LSTM model for training to obtain a preset LSTM model.
8. A file conversion device, It is characterized in that The file conversion device comprises: a memory, a processor, and a file conversion program stored in the memory and executable on the processor, wherein the file conversion program implements the file conversion method according to any one of claims 1 to 7 when executed by the processor.
9. A storage medium, It is characterized in that The storage medium stores a file conversion program, and when the file conversion program is executed by the processor, the file conversion method according to any one of claims 1 to 7 is implemented.
10. A file conversion device, It is characterized in that The device comprises: The matrix conversion module is used to process the historical HDFS file usage data into a matrix to obtain file feature data; A hot data prediction module is used to predict the number of days of a file hot data threshold based on a preset LSTM model and the file feature data, and obtain a predicted hot data threshold; A date conversion module, used for converting the predicted hot data threshold into a threshold date according to the current system time; The file conversion module is used to retrieve the target file according to the threshold date and convert the target file into a target version for storage.
Citation Information
Cited By
Data storage method and device, equipment and storage medium
CN121008752A
