Data migration method and device applied to optical fiber early warning system
By setting the target parameters of data storage cycle and percentage threshold in the fiber early warning system, data migration is intelligently processed, and the problem of service crash caused by full disk space in the fiber early warning system is solved, and efficient and flexible data aging processing is achieved.
Patent Information
- Application Number
- CN202510182439.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-10
AI Technical Summary
In existing fiber early warning systems, the disk space is full and the service crash is caused. The existing data aging methods are not intelligent enough, which may lead to untimely migration.
A data migration method and device are provided. By obtaining the target parameters set in the optical fiber early warning system, including the data storage period and the percentage threshold, it is determined whether the triggering condition is met. If it is met, data that exceeds the data storage period or reaches the percentage threshold will be migrated to the backup storage server.
Through intelligent data migration methods, we can effectively avoid disk space fullness, prevent service crashes, reduce storage costs, and ensure the flexibility and efficiency of data aging processing.
Smart Images

Figure CN120123316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical fiber early warning, and particularly to a data migration method and device applied to an optical fiber early warning system. Background Art
[0002] In an optical fiber early warning system, each optical fiber uploads an original npy file every minute, and the original npy file is converted into a waterfall chart file in the optical fiber early warning system. When the number of optical fibers is large, the file storage occupies a large amount of disk space, and it is necessary to age the historical data. Otherwise, the server often crashes due to the disk space being full.
[0003] Currently, the existing data aging method relies on manual data migration processing. However, due to its lack of intelligence, there may be a situation where the migration is not timely, resulting in the problem that the disk space is full and the service crashes. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] In view of the above-mentioned disadvantages and deficiencies of the prior art, the present invention provides a data migration method and device applied to an optical fiber early warning system, which solves the technical problem that the service crashes due to the disk space being full in the prior art.
[0006] (2) Technical Solutions
[0007] To achieve the above object, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a data migration method applied to an optical fiber early warning system. The data migration method is applied to a main server in a data migration system. The data migration system includes a backup storage server and a main server deployed with an optical fiber early warning system. The data migration method includes: obtaining target parameters set on an optical fiber early warning page of the optical fiber early warning system; wherein the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent the threshold of the percentage of the current disk occupancy to the total disk occupancy; determining whether the trigger condition of any one of the target parameters is satisfied; if the trigger condition of the data retention period is satisfied, migrating some of the data that exceeds the data retention period to the backup storage server; if the trigger condition of the percentage threshold is satisfied, migrating some of the data in the current disk to the backup storage server.
[0009] In a possible embodiment, if the trigger condition of the data storage period is satisfied, a part of the data that exceeds the data storage period is migrated to the backup storage server, including: if the data storage period is reached, the first data that exceeds the data storage period is searched; the data with the alarm count not equal to 0 and the view count equal to 0 in the first data that exceeds the data storage period is filtered out to obtain the filtered data; the files corresponding to the filtered data are migrated to the backup storage server.
[0010] In a possible embodiment, if the trigger condition of the percentage threshold is satisfied, a part of the data in the current disk is migrated to the backup storage server, including: if the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, the second data that exceeds the data storage period in the current disk is searched; based on the file size and the view count of each file in all the files corresponding to the second data that exceeds the data storage period in the current disk, the characteristic value of each file in all the files is calculated; the median of all the characteristic values is determined, and the difference between each characteristic value and the median is calculated, and the file corresponding to the difference greater than the preset value is determined as the file to be migrated; the file to be migrated is migrated to the backup storage server.
[0011] In a possible embodiment, the data migration method further includes: during the data migration process, the data migration address in the backup storage server is recorded; if an access instruction for accessing the migrated data is received, the target data migration address corresponding to the migrated data is determined, and a data recovery instruction carrying the target data migration address is sent to the backup storage server, so that the backup storage server restores the data corresponding to the target data migration address to the main server based on the data recovery instruction.
[0012] In a possible embodiment, the target parameter further includes the data aging time interval; the data migration method further includes: if the trigger condition of the data aging time interval is satisfied, the data that exceeds the data aging time interval is aged.
[0013] Second aspect, an embodiment of the present invention provides a data migration device applied to an optical fiber early warning system. The data migration device is applied to a main server in a data migration system. The data migration system includes a backup storage server and a main server deployed with an optical fiber early warning system. The data migration device includes: an acquisition module, configured to acquire target parameters set on an optical fiber early warning page of the optical fiber early warning system; wherein the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent a threshold of the percentage of the current disk occupancy and the total disk occupancy; a judgment module, configured to judge whether a triggering condition of any one of the target parameters is satisfied; a migration module, configured to, if the triggering condition of the data retention period is satisfied, migrate some of the data that exceeds the data retention period to the backup storage server; the migration module is further configured to, if the triggering condition of the percentage threshold is satisfied, migrate some of the entire data of the current disk to the backup storage server.
[0014] In a possible embodiment, the migration module is specifically configured to: if the data retention period is reached, search for first data that exceeds the data retention period; filter out data with a non-zero alarm count and a zero view count among the first data that exceeds the data retention period to obtain filtered data; migrate the files corresponding to the filtered data to the backup storage server.
[0015] In a possible embodiment, the migration module is specifically configured to: if the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, search for second data that exceeds the data retention period in the current disk; calculate the characteristic value of each file among all the files corresponding to the second data that exceeds the data retention period in the current disk based on the file size and the view count of each file; determine the median of all the characteristic values, calculate the difference between each characteristic value and the median, and determine the files corresponding to the differences greater than a preset value as the files to be migrated; migrate the files to be migrated to the backup storage server.
[0016] In a possible embodiment, the data migration device further includes: a recording module, configured to record the data migration address in the backup storage server during the data migration process; a data recovery module, configured to, if an access instruction for accessing the migrated data is received, determine the target data migration address corresponding to the migrated data, and send a data recovery instruction carrying the target data migration address to the backup storage server, so that the backup storage server can recover the data corresponding to the target data migration address to the main server based on the data recovery instruction.
[0017] In a possible embodiment, the target parameter further includes a data aging time interval; the data migration device further includes: an aging module, configured to age the data that exceeds the data aging time interval if the triggering condition of the data aging time interval is satisfied.
[0018] In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is run by a processor, the method described in the first aspect or any optional implementation manner of the first aspect is executed.
[0019] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor, and when the electronic device runs, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the method described in the first aspect or any optional implementation manner of the first aspect is executed.
[0020] In a fifth aspect, the present application provides a computer program product, and when the computer program product runs on a computer, the computer is caused to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0021] (III) Beneficial effects
[0022] The beneficial effects of the present invention are:
[0023] An embodiment of the present application provides a data migration method and device applied to an optical fiber early warning system, by obtaining target parameters set on an optical fiber early warning page of the optical fiber early warning system; where the target parameters include a data storage period and a percentage threshold, and the percentage threshold is used to represent a threshold of the percentage of the current disk occupancy to the total disk occupancy; determining whether the triggering condition of any one of the target parameters is satisfied; if the triggering condition of the data storage period is satisfied, migrating some of the data that exceeds the data storage period to a backup storage server; if the triggering condition of the percentage threshold is satisfied, migrating some of the data in the current disk to a backup storage server, so as to migrate and process historical data through this solution, reduce storage costs, and prevent service crashes caused by excessive disk space occupancy.
[0024] To make the above objects, features, and advantages to be achieved by the embodiments of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. Description of the drawings
[0025] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0026] Figure 1 Shows a schematic diagram of a data migration system provided by an embodiment of the present application;
[0027] Figure 2 Shows a flowchart of a data migration method applied to an optical fiber early warning system provided by an embodiment of the present application;
[0028] Figure 3 Shows a structural block diagram of a data migration device applied to an optical fiber early warning system provided by an embodiment of the present application. Detailed implementation manners
[0029] To better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the accompanying drawings through specific implementation manners.
[0030] In addition to the problem that the service crashes due to the disk space being full, the existing data aging method also has the following problems:
[0031] The data aging method is rigid and not flexible enough;
[0032] Since it is manually deleted, it may age some useful data.
[0033] Based on this, the embodiments of the present application provide a data migration method and device applied to an optical fiber early warning system. By obtaining target parameters set on the optical fiber early warning page of the optical fiber early warning system, where the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent the threshold of the percentage of the current disk occupancy to the total disk occupancy; determining whether the trigger condition of any one of the target parameters is satisfied; if the trigger condition of the data retention period is satisfied, migrating some of the data that exceeds the data retention period to the backup storage server; if the trigger condition of the percentage threshold is satisfied, migrating some of the data in the current disk to the backup storage server, thereby migrating and processing the historical data through this solution, reducing the storage cost, and preventing the service from crashing due to excessive disk space occupancy.
[0034] To better understand the above technical solution, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more clear and thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0035] Please refer to Figure 1 , Figure 1 which shows a schematic diagram of a data migration system provided by an embodiment of the present application. As Figure 1 shown, this application scenario includes a main server deployed with an optical fiber early warning system and a backup storage server communicatively connected to the main server. Among them, the main server has relatively high performance requirements, and the backup storage server only has certain requirements for write performance.
[0036] It should be understood that the server type of the main server, the server type of the backup storage server, etc. can all be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0037] Here, it should be noted that although Figure 1 a backup storage server is taken as an example for description, those skilled in the art can set the number of backup storage servers communicatively connected to the main server according to actual needs, and the embodiments of the present application are not limited thereto.
[0038] Continuing to refer to Figure 2 , Figure 2 which shows a flowchart of a data migration method applied to an optical fiber early warning system provided by an embodiment of the present application. As Figure 2 shown, this data migration method can be applied to the main server in the data migration system; this data migration method includes:
[0039] Step S210, obtaining target parameters set on the optical fiber early warning page of the optical fiber early warning system. Among them, the target parameters include a data retention period, a data aging time interval, and a percentage threshold, and the percentage threshold is used to represent the threshold of the percentage of the current disk occupancy to the total disk occupancy.
[0040] Specifically, the optical fiber early warning system is deployed on the main server, and a setting page including parameters such as a data retention period, a data aging time interval, and a percentage threshold is provided in the optical fiber early warning system. Among them, the data retention period is the period for data retention; the data aging time interval can be the time interval for data aging; the percentage threshold can be the threshold for representing the percentage of the current disk occupancy to the total disk occupancy.
[0041] In addition, the user can set target parameters including data storage period, data aging time interval, and percentage threshold on the optical fiber warning page. After input, the user can click "Save" to complete the setting.
[0042] It should be understood that the specific duration of the data storage period, the specific duration of the data aging time interval, and the specific value of the percentage threshold can all be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0043] For example, the percentage threshold can be 80% or 85%, etc.
[0044] Step S220: Determine whether the trigger condition of any one of the target parameters is satisfied.
[0045] Step S230: If the trigger condition of the data storage period is satisfied, migrate some of the data that exceeds the data storage period to the backup storage server.
[0046] Optionally, when the data storage period is reached, search for the first data that exceeds the data storage period; filter out the data with a non-zero alarm count and a zero view count among the first data that exceeds the data storage period to obtain the filtered data; migrate the files corresponding to the filtered data to the backup storage server.
[0047] To facilitate the understanding of step S230, the following will be described through specific embodiments.
[0048] Specifically, the npy file can be passed as input to the optical fiber warning system after being collected by the collection end. The optical fiber warning system stores the file path as / npy / {optical fiber id} / {date} / {specific time}.npy, and key information such as its corresponding time, optical fiber ID, npy file address, and file size in the corresponding waterfall chart of the database. Then, the npy file is converted into a png file through the internal waterfall chart conversion script of the optical fiber warning system. The saved path of the converted png file is / png / {optical fiber id} / {date} / {specific time}.png, and the png file path is updated to the corresponding npy data in the database waterfall chart.
[0049] In addition, for the optical fiber warning system, it is necessary to pay attention to the npy files and waterfall charts related to alarms. After an alarm is generated, record the npy files and the converted waterfall chart files generated during the corresponding time period of the optical fiber where the current alarm is located. Therefore, when an alarm is generated, the data corresponding to the corresponding time and optical fiber can be searched in the database, and the data can be updated by incrementing the field of the alarm count data in the corresponding data of the database waterfall chart by 1.
[0050] Also, when the user views the historical waterfall chart, according to the filtering conditions set by the user, find the data in the corresponding waterfall chart in the database and increment the view count field by 1.
[0051] Based on the above, a timing task can be set in the optical fiber early warning system, and the timing task can determine whether the data storage period is reached according to the data storage period set in step S210. If the data storage period is reached, find the first data that exceeds the data storage period, and filter out the data in the first data that exceeds the data storage period where the alarm count is not 0 and the view count is 0 to obtain the filtered data. Also, migrate the files corresponding to the filtered data to the backup storage server, and update the migrated address to the database.
[0052] Step S240, if the triggering condition of the percentage threshold is met, migrate some of the data in the current disk to the backup storage server.
[0053] Optionally, if the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, find the second data in the current disk that exceeds the data storage period; calculate the eigenvalue of each file in all the files corresponding to the second data in the current disk that exceeds the data storage period based on the file size and view count of each file; determine the median of all the eigenvalues, calculate the difference between each eigenvalue and the median, and determine the files corresponding to the differences greater than the preset value as the files to be migrated; migrate the files to be migrated to the backup storage server. Among them, the eigenvalue is the ratio of the view count of the current file to its file size.
[0054] To facilitate the understanding of step S240, the following will be described through specific embodiments.
[0055] Specifically, a listener can be set to monitor the mounted disks of the directories where the npy files and png files are located, and according to the percentage threshold set in step S210, monitor whether the disk space value (i.e., the percentage of the current disk occupancy and the total disk occupancy) is greater than or equal to the percentage threshold. When the disk space value is greater than or equal to the percentage threshold, find the second data in the current disk that exceeds the data storage period, and based on the file size du and view count pv of each file in all the files corresponding to the second data in the current disk that exceeds the data storage period, calculate the eigenvalue ω of each file in all the files, and it can be calculated by the following formula:
[0056]
[0057] In the formula, ω i represents the eigenvalue of the i-th file; pv i represents the view count of the i-th file; dui Represents the file size of the i-th file.
[0058] After obtaining the eigenvalue ω of all files, the system can traverse all the eigenvalues ω to find the median M e , and the screening method for screening the data to be migrated is to create two arrays. One array is the array L smaller than the median, and the other array is the array M larger than the median. Assume ω 1 is the median M e , judge ω 2 whether it is greater than ω 1 , if ω 2 is greater than ω 1 , then put ω 2 into the array M, otherwise put it into the array L, and repeat the above steps to judge the grouping of the eigenvalues of other files in turn until when judging ω m , if |L.length - M.length| > the specified value, then determine ω m as the median M e . Where m is a positive integer greater than 1; L.length is the number of eigenvalues in the array L; M.length is the number of eigenvalues in the array M; the specific value of the specified value can be set according to actual needs. For example, the specified value can be 2 or 3, etc.
[0059] Subsequently, the difference between ω 1 -ω m can be calculated. If the difference is greater than the preset value, then put ω 1 into the array M, otherwise put it into the array L, and repeat the above steps, then the final array M and the final array L are obtained.
[0060] Subsequently, the files corresponding to the final array L can be migrated to the backup storage server, and the migrated address is updated to the database.
[0061] It should be noted here that during the data migration process in step S230 and step S240, the data migration address in the backup storage server is recorded. If an access instruction for accessing the migrated data is received, the target data migration address corresponding to the migrated data is determined, and a data recovery instruction carrying the target data migration address is sent to the backup storage server, so that the backup storage server can recover the data corresponding to the target data migration address to the main server based on the data recovery instruction.
[0062] That is to say, when the user accesses the aged data that has been migrated, the corresponding file is found according to the migrated address stored in the database table and restored to the system, ensuring that the data required by the user will not be lost even if it ages.
[0063] Step S250: if the triggering condition of the data aging time interval is met, the data exceeding the data aging time interval is aged, wherein the aging may refer to deleting the data.
[0064] Therefore, with the help of the above technical solution, the present application migrates historical data through the solution, reduces storage costs, and prevents service crashes caused by excessive disk space usage.
[0065] In addition, this application also records the number of alarms and browsing times of the data, thereby marking the hotspot data to ensure the retention of the hotspot data.
[0066] It should be understood that the above-mentioned data migration method applied to the optical fiber early warning system is only exemplary, and those skilled in the art may make various modifications based on the above-mentioned method, and the modified scheme also belongs to the protection scope of this application.
[0067] See also Figure 3 , Figure 3 A structural block diagram of a data migration device 300 applied to a fiber optic early warning system provided by an embodiment of the present application is shown. It should be understood that the data migration device 300 is capable of executing each step in the above method embodiment. The specific functions of the data migration device 300 can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The data migration device 300 includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the data migration device 300. Specifically, the data migration device 300 is applied to the main server in the data migration system, and the data migration system includes a backup storage server and a main server deployed with a fiber optic early warning system; the data migration device 300 includes:
[0068] The acquisition module 310 is used to acquire the target parameters set on the optical fiber warning page of the optical fiber warning system; wherein the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent the percentage threshold of the current disk occupancy and the total disk occupancy;
[0069] A judgment module 320 is used to judge whether a trigger condition of any parameter in the target parameters is met;
[0070] A migration module 330, configured to migrate part of the data exceeding the data retention period to a backup storage server if a trigger condition of the data retention period is met;
[0071] The migration module 330 is further configured to, if a trigger condition for a percentage threshold is met, migrate some of the data in the current disk to the backup storage server.
[0072] In a possible embodiment, the migration module 330 is specifically configured to: if a data storage period is reached, search for first data that exceeds the data storage period; filter out data with a non-zero alarm count and a zero view count in the first data that exceeds the data storage period to obtain filtered data; and migrate the files corresponding to the filtered data to the backup storage server.
[0073] In a possible embodiment, the migration module 330 is specifically configured to: if the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, search for second data in the current disk that exceeds the data storage period; calculate the characteristic value of each file in all the files corresponding to the second data that exceeds the data storage period in the current disk based on the file size and view count of each file; determine the median of all the characteristic values, calculate the difference between each characteristic value and the median, and determine the files corresponding to the differences greater than a preset value as the files to be migrated; and migrate the files to be migrated to the backup storage server.
[0074] In a possible embodiment, the data migration device 300 further includes:
[0075] A recording module (not shown), configured to record the data migration address in the backup storage server during the data migration process;
[0076] A data recovery module (not shown), configured to, if an access instruction for accessing the migrated data is received, determine the target data migration address corresponding to the migrated data, and send a data recovery instruction carrying the target data migration address to the backup storage server, so that the backup storage server restores the data corresponding to the target data migration address to the main server based on the data recovery instruction.
[0077] In a possible embodiment, the target parameter further includes a data aging time interval;
[0078] The data migration device 300 further includes:
[0079] An aging module (not shown), configured to age the data that exceeds the data aging time interval if a trigger condition for the data aging time interval is met.
[0080] Since the device described in the above embodiments of the present invention is the device used to implement the method of the above embodiments of the present invention, based on the method described in the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the device, and thus will not be elaborated herein. Any device used in the method of the above embodiments of the present invention falls within the scope of protection of the present invention.
[0081] This application provides a storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the method described in the embodiment.
[0082] This application also provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the method described in the method embodiment.
[0083] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0084] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions.
[0085] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several apparatuses, several of these apparatuses can be embodied by the same hardware. The use of the words first, second, third, etc. is only for convenience of expression and does not denote any order. These words can be understood as part of the element name.
[0086] In addition, it should be noted that in the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0087] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications after learning the basic creative concepts. Therefore, the claims should be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.
[0088] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention should also include these modifications and variations.
Claims
1. A data migration method applied to an optical fiber early warning system, characterized in that: The data migration method is applied to a main server in a data migration system, wherein the data migration system includes a backup storage server and a main server on which the optical fiber early warning system is deployed; The data migration method comprises: Obtaining target parameters set on the optical fiber warning page of the optical fiber warning system; wherein the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent a percentage threshold of the current disk occupancy and the total disk occupancy; Determine whether a trigger condition of any parameter in the target parameters is met; If the triggering condition of the data retention period is met, part of the data exceeding the data retention period is migrated to the backup storage server; If the trigger condition of the percentage threshold is met, part of the data in the entire data of the current disk is migrated to the backup storage server.
2. The data migration method according to claim 1, characterized in that: If the triggering condition of the data retention period is met, part of the data exceeding the data retention period is migrated to the backup storage server, including: If the data storage period is reached, searching for the first data exceeding the data storage period; Filter out the data whose alarm times are not 0 and browsing times are 0 in the first data exceeding the data storage period, and obtain the filtered data; Migrate the files corresponding to the filtered data to the backup storage server.
3. The data migration method according to claim 1, characterized in that: If the trigger condition of the percentage threshold is met, part of the data of the current disk is migrated to the backup storage server, including: If the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, searching the current disk for second data that exceeds the data retention period; Calculate a characteristic value of each file in all the files based on the file size and the number of views of each file in all the files corresponding to the second data exceeding the data retention period in the current disk; Determine the median of all the characteristic values, calculate the difference between each characteristic value and the median, and determine the file corresponding to the difference greater than a preset value as the file to be migrated; Migrate the files to be migrated to the backup storage server.
4. The data migration method according to claim 2 or 3, characterized in that: The data migration method further comprises: During the data migration process, recording the data migration address in the backup storage server; If an access instruction for accessing migrated data is received, the target data migration address corresponding to the migrated data is determined, and a data recovery instruction carrying the target data migration address is sent to the backup storage server, so that the backup storage server can restore the data corresponding to the target data migration address to the main server based on the data recovery instruction.
5. The data migration method according to claim 1, characterized in that: The target parameters further include a data aging time interval; The data migration method further includes: If the triggering condition of the data aging time interval is met, the data exceeding the data aging time interval is aged.
6. A data migration device used in an optical fiber early warning system, characterized in that: The data migration device is applied to a main server in a data migration system, and the data migration system includes a backup storage server and a main server on which the optical fiber early warning system is deployed; The data migration device comprises: An acquisition module, used for acquiring target parameters set on the optical fiber warning page of the optical fiber warning system; wherein the target parameters include a data retention period and a percentage threshold, and the percentage threshold is used to represent a percentage threshold of the current disk occupancy and the total disk occupancy; A judgment module, used to judge whether a trigger condition of any parameter in the target parameters is met; A migration module, configured to migrate part of the data exceeding the data retention period to the backup storage server if a trigger condition of the data retention period is met; The migration module is further configured to migrate part of all the data on the current disk to the backup storage server if the trigger condition of the percentage threshold is met.
7. The data migration device according to claim 6, characterized in that: The migration module is specifically used for: if the data retention period is reached, searching for the first data that exceeds the data retention period; filtering out the data whose alarm times are not 0 and whose browsing times are 0 in the first data that exceeds the data retention period, to obtain the filtered data; and migrating the files corresponding to the filtered data to the backup storage server.
8. The data migration device according to claim 6, characterized in that: The migration module is specifically used to: if the percentage of the current disk occupancy and the total disk occupancy is greater than or equal to the percentage threshold, search for second data in the current disk that exceeds the data storage period; Calculate a characteristic value of each file in all the files based on the file size and the number of views of each file in all the files corresponding to the second data exceeding the data retention period in the current disk; Determine the median of all the characteristic values, calculate the difference between each characteristic value and the median, and determine the file corresponding to the difference greater than a preset value as the file to be migrated; Migrate the files to be migrated to the backup storage server.
9. The data migration device according to claim 6 or 7, characterized in that: The data migration device further comprises: A recording module, used to record the data migration address in the backup storage server during the data migration process; A data recovery module is used to determine a target data migration address corresponding to the migrated data if an access instruction for accessing the migrated data is received, and send a data recovery instruction carrying the target data migration address to the backup storage server, so that the backup storage server can restore the data corresponding to the target data migration address to the main server based on the data recovery instruction.
10. The data migration device according to claim 6, characterized in that: The target parameters further include a data aging time interval; The data migration device also includes: The aging module is used to age the data exceeding the data aging time interval if the triggering condition of the data aging time interval is met.