CN117056121A - Method and device for calculating gap amount of backup tape, electronic equipment and storage medium - Google Patents

Method and device for calculating gap amount of backup tape, electronic equipment and storage medium Download PDF

Info

Publication number
CN117056121A
CN117056121A CN202310883493.7A CN202310883493A CN117056121A CN 117056121 A CN117056121 A CN 117056121A CN 202310883493 A CN202310883493 A CN 202310883493A CN 117056121 A CN117056121 A CN 117056121A
Authority
CN
China
Prior art keywords
tape
historical
rollback
blank
consumption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310883493.7A
Other languages
Chinese (zh)
Inventor
刘钊
胡润芷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310883493.7A priority Critical patent/CN117056121A/en
Publication of CN117056121A publication Critical patent/CN117056121A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0682Tape device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for calculating the gap amount of a backup tape, electronic equipment and a storage medium, and relates to the technical field of big data or other related fields, wherein the method for calculating the gap amount of the backup tape comprises the following steps: collecting blank tape consumption of N historical periods and historical tape rollback quantity, and storing the blank tape consumption and the historical tape rollback quantity in a database; based on a preset polynomial function, respectively fitting blank tape consumption and historical tape rollback in N historical periods to obtain a blank tape consumption curve function and a historical tape rollback curve function; calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting; and sending the backup tape gap amount to the backup operation and maintenance terminal according to the preset time requirement. The invention solves the technical problem of unbalanced tape distribution caused by blind tape adding in the related technology.

Description

Method and device for calculating gap amount of backup tape, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of big data, in particular to a method and a device for calculating the gap amount of a backup tape, electronic equipment and a storage medium.
Background
In recent years, the backup throughput of a data center is continuously increased, a tape is used as the most main backup data storage medium, the demand of the tape is continuously increased along with the increasing of the data volume required to be backed up by the data center, and the operation and maintenance personnel are required to continuously add the quantity of the tape to ensure enough backup space.
In the related art, the future use trend of the tape cannot be predicted, so that the problem of unbalanced allocation caused by blindly mobilizing the tape exists, and resource shortage or resource waste is caused.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for calculating the gap amount of a backup tape, electronic equipment and a storage medium, which at least solve the technical problem of unbalanced tape distribution caused by blind tape adding in the related technology.
According to an aspect of the embodiment of the present invention, there is provided a method for calculating a backup tape gap amount, including: collecting blank tape consumption of N historical periods and historical tape rollback quantity, and storing the blank tape consumption and the historical tape rollback quantity into a database, wherein the blank tape consumption is the number of blank tapes which are needed to be occupied by newly added backup data, the historical tape rollback quantity is the number of tapes occupied by expired data, each data corresponds to a storage period, the expired data is data of which the storage period of occupied tapes exceeds the storage period, and N is a positive integer; fitting the blank tape consumption and the historical tape rollback in N historical periods respectively based on a preset polynomial function to obtain a blank tape consumption curve function and a historical tape rollback curve function; calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting; and sending the backup tape gap amount to a backup operation and maintenance terminal according to a preset time requirement.
Optionally, when collecting the historical tape rollback amount for N historical cycles, including: inquiring historical rollback time points of all magnetic tapes, wherein the historical rollback time points refer to expiration time points corresponding to the latest expired data in all data stored in each magnetic tape; positioning the tape which has been subjected to the rollback operation in each history period based on the history rollback time point, and defining the tape as a history tape; and counting the total number of the historical tapes in each historical period to obtain the historical tape rollback quantity of the N historical periods.
Optionally, the step of calculating the backup tape gap amount of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting includes: calculating blank tape consumption of the next period based on the blank tape consumption curve function, wherein the blank tape consumption of the next period refers to the total number of blank tapes occupied by newly added backup data in the next period; calculating a historical tape roll-back amount for the next cycle based on the historical tape roll-back curve function; and subtracting the historical tape rollback quantity of the next period from the blank tape consumption quantity of the next period to obtain the backup tape gap quantity of the next period.
Optionally, the step of fitting the blank tape consumption in N history periods to obtain a blank tape consumption curve function based on a preset polynomial function includes: acquiring N time parameters corresponding to the N historical periods, and corresponding the blank tape consumption of the N historical periods in the database to the N time parameters one by one; setting an initial polynomial function: f (F) b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Wherein F is b (t) is the calculated value of blank tape consumption, t is the time parameter, a 0 、a 1 …a m M is the highest order of the initial polynomial function for the parameters to be solved; obtaining the first K time parameters and the corresponding K blank tape consumption according to a time sequence, substituting the time parameters and the corresponding K blank tape consumption into the initial polynomial function, and calculating the parameter a to be solved 0 、a 1 …a m Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N; and determining the blank tape consumption curve function based on the preset polynomial function, N-K time parameters and corresponding N-K blank tape consumption amounts.
Optionally, the step of determining the blank tape consumption curve function based on the preset polynomial function, N-K of the time parameters, and corresponding N-K of the blank tape consumption amounts includes: step 1, any numerical value P in a preset positive integer set P is obtained, m=p in the preset polynomial function with the order to be determined, and a P-order preset polynomial function is obtained; step 2, substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K blank tape consumption calculated values; step 3, calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all blank tape consumption calculation values; repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set; and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as the blank tape consumption curve function.
Optionally, the preset fitting index formula is:wherein D is the fitting index, C b Calculating a variance value between the blank tape consumption and the blank tape consumption.
Optionally, the step of fitting the historical tape rollback in N historical cycles based on a preset polynomial function to obtain a historical tape rollback curve function includes: acquiring N time parameters corresponding to the N historical periods, and corresponding the historical tape rollback quantity of the N historical periods in the database to the N time parameters one by one; setting an initial polynomial function: f (F) h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is h (t) is the calculated value of the rolling back quantity of the historical tape, t is the time parameter, u 0 、u 1 …u r R is the highest order of the initial polynomial function for the parameters to be solved; acquiring the first K time parameters and the corresponding K historical tape rollbacks according to the time sequence order to substitute the initial polynomialA function for calculating the parameter u to be solved 0 、u 1 …u r Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N; and determining the historical tape roll-back curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K historical tape roll-back quantities.
Optionally, the step of determining the historical tape roll-back curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K historical tape roll-back amounts includes: step 1, any numerical value P in a preset positive integer set P is obtained, and r=p in the preset polynomial function with the order to be determined is made to obtain a P-order preset polynomial function; step 2, substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K historical tape rollback calculated values; step 3, calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all the historical tape rollback calculation values; repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set; and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as the historical tape rollback curve function.
Optionally, the preset fitting index formula is:wherein D is the fitting index, C h A variance value of the historical tape roll-back amount and the historical tape roll-back amount is calculated.
According to another aspect of the embodiment of the present invention, there is also provided a computing device for backup tape gap amount, including: the system comprises an acquisition unit, a storage unit and a database, wherein the acquisition unit is used for acquiring blank tape consumption of N historical periods and historical tape rollback quantity, the blank tape consumption is the number of blank tapes which are needed to be occupied by newly added backup data, the historical tape rollback quantity is the number of tapes occupied by expired data, each data corresponds to a storage period, the expired data is the data of which the storage period of the occupied tape exceeds the storage period, and N is a positive integer; the fitting unit is used for respectively fitting the blank tape consumption and the historical tape rollback in N historical periods based on a preset polynomial function to obtain a blank tape consumption curve function and a historical tape rollback curve function; the calculating unit is used for calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function which are obtained through fitting; and the sending unit is used for sending the backup tape gap amount to the backup operation and maintenance terminal according to the preset time requirement.
Optionally, the acquisition unit includes: the inquiring module is used for inquiring historical rollback time points of all magnetic tapes, wherein the historical rollback time points refer to expiration time points corresponding to the latest expired data in all data stored in each magnetic tape; the positioning module is used for positioning the tape which has undergone rollback operation in each history period based on the history rollback time point and defining the tape as a history tape; and the statistics module is used for counting the total number of the historical tapes in each historical period to obtain the historical tape rollback quantity of the N historical periods.
Optionally, the computing unit includes: a first calculation module, configured to calculate, based on the blank tape consumption curve function, a blank tape consumption of the next period, where the blank tape consumption of the next period refers to a total number of blank tapes occupied by newly added backup data in the next period; a second calculation module for calculating a historical tape roll-back amount for the next cycle based on the historical tape roll-back curve function; and a third calculation module, configured to subtract the historical tape rollback quantity of the next period from the blank tape consumption quantity of the next period to obtain a backup tape gap quantity of the next period.
Optionally, the fitting unit includes: a first acquisition module for acquiring the N history periodsCorresponding N time parameters, wherein the blank tape consumption of the N historical periods in the database is in one-to-one correspondence with the N time parameters; a first setting module, configured to set an initial polynomial function: f (F) b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Wherein F is b (t) is the calculated value of blank tape consumption, t is the time parameter, a 0 、a 1 …a m M is the highest order of the initial polynomial function for the parameters to be solved; a fourth calculation module for obtaining the first K time parameters and the corresponding K blank tape consumptions according to the time sequence order, substituting the first K blank tape consumptions into the initial polynomial function, and calculating the parameter a to be solved 0 、a 1 …a m Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N; the first determining module is used for determining the blank tape consumption curve function based on the preset polynomial function, N-K time parameters and corresponding N-K blank tape consumption amounts.
Optionally, the first determining module includes: the first obtaining submodule is used for executing the step 1 to obtain any numerical value P in a preset positive integer set P, and m=p in the preset polynomial function with the order to be determined to obtain a P-order preset polynomial function; the first generation entering sub-module is used for executing the step 2, and substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K blank tape consumption calculated values; the first calculating sub-module is used for executing the step 3, and calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all blank tape consumption calculated values; the first repeating submodule is used for repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and a fitting index set is obtained; the first selecting submodule is used for selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as the blank tape consumption curve function.
Optionally, the preset fitting index formula is:wherein D is the fitting index, C b Calculating a variance value between the blank tape consumption and the blank tape consumption.
Optionally, the fitting unit further comprises: the second acquisition module is used for acquiring N time parameters corresponding to the N historical periods, and enabling the historical tape rollback quantity of the N historical periods in the database to be in one-to-one correspondence with the N time parameters; a second setting module, configured to set an initial polynomial function: f (F) h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is h (t) is the calculated value of the rolling back quantity of the historical tape, t is the time parameter, u 0 、u 1 …u r R is the highest order of the initial polynomial function for the parameters to be solved; a fifth calculation module for obtaining the first K time parameters and the corresponding K historical tape rollback values according to the time sequence order, substituting the first K historical tape rollback values into the initial polynomial function, and calculating the parameter u to be solved 0 、u 1 …u r Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N; and the second determining module is used for determining the historical tape roll-back curve function based on the preset polynomial function, N-K time parameters and N-K corresponding historical tape roll-back quantities.
Optionally, the second determining module includes: the second obtaining submodule is used for executing the step 1 to obtain any numerical value P in a preset positive integer set P, and let r=p in the preset polynomial function with the order to be determined to obtain a P-order preset polynomial function; the second substituting sub-module is used for executing the step 2, and substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K historical tape rollback calculation values; the second calculation sub-module is used for executing the step 3, and calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all the historical tape rollback calculation values; the second repeating submodule is used for repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and a fitting index set is obtained; and the second selecting submodule is used for selecting the smallest fitting index in the fitting index set and taking the p-order preset polynomial function corresponding to the smallest fitting index as the historical tape rollback curve function.
Optionally, the preset fitting index formula is:wherein D is the fitting index, C h A variance value of the historical tape roll-back amount and the historical tape roll-back amount is calculated.
According to another aspect of the embodiment of the present invention, there is further provided a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, the device where the computer readable storage medium is controlled to execute the method for calculating the backup tape gap amount according to any one of the foregoing embodiments.
According to another aspect of the embodiments of the present invention, there is further provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method for calculating the backup tape gap amount according to any one of the above.
In the disclosure, a method for calculating gap amount of a backup tape is provided, firstly, blank tape consumption and historical tape rollback amount of N historical periods are collected and stored in a database, then, based on a preset polynomial function, the blank tape consumption and the historical tape rollback amount in the N historical periods are respectively fitted to obtain a blank tape consumption curve function and a historical tape rollback curve function, then, based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting, the gap amount of the backup tape of the next period is calculated, and finally, the gap amount of the backup tape is sent to a backup operation and maintenance terminal according to a preset time requirement.
In the method, the blank tape consumption and the historical tape rollback in the historical period are collected and fitted to obtain a blank tape consumption curve function and a historical tape rollback curve function, the blank tape consumption curve function and the historical tape rollback curve function are used for calculating the tape notch amount in the backup process of the next period, and the notch amount of the backup tape is sent to the backup operation and maintenance terminal to be used for indicating backup tape adding after the calculation is finished, so that the situation that the number of backup tape adding in the next period is matched with the notch amount of the backup requirement is ensured, and the technical problem that tape distribution is unbalanced due to blind tape adding in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of an alternative method of computing backup tape gap amounts in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method of predicting blank tape demand based on a VeritasNBU backup environment in accordance with embodiments of the application;
FIG. 3 is a schematic diagram of an alternative apparatus for predicting blank tape demand based on a VeritasNBU backup environment in accordance with embodiments of the invention;
FIG. 4 is a schematic diagram of an alternative backup tape gap amount computing device in accordance with an embodiment of the invention;
fig. 5 is a block diagram of a hardware architecture of an electronic device (or mobile device) for a method of computing a backup tape gap amount according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
To facilitate an understanding of the invention by those skilled in the art, some terms or nouns involved in the various embodiments of the invention are explained below:
VeritasNBU (NetBackup) is an enterprise-level data backup and recovery solution, is widely applied to backup environments of large organizations, has high expandability and flexibility, and can be suitable for enterprises with different scales and demands. By providing a powerful data protection function, the reliability and integrity of data are ensured, and the data can be quickly recovered when data is lost or disasters occur.
It should be noted that, the method and the device for calculating the gap amount of the backup tape in the present disclosure may be used in the case where the gap amount of the tape is calculated in the backup process in the big data field, and may also be used in the case where the gap amount of the tape is calculated in the backup process in any field other than the big data field, and the application field of the method and the device for calculating the gap amount of the backup tape in the present disclosure is not limited.
It should be noted that, related information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, calculated data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party, and the collection, use and processing of related data is required to comply with related laws and regulations and standards of related countries and regions, and is provided with corresponding operation entries for the user to select authorization or rejection. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
The following embodiments of the present invention can be applied to various systems/applications/devices that need to calculate the gap amount of a tape in the backup process, and can realize that a blank tape consumption curve function and a history tape rollback curve function are obtained by collecting and fitting blank tape consumption amount and history tape rollback amount in a history period, and the blank tape consumption curve function and the history tape rollback curve function are used to analyze and calculate the gap amount of the tape in the backup process of the next period, and after the calculation is completed, the gap amount of the backup tape is sent to a backup operation and maintenance terminal to be used for indicating backup adding.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a method of computing a backup tape gap amount, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical sequence is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in a different order than that illustrated herein.
FIG. 1 is a flowchart of an alternative method for calculating the backup tape gap amount according to an embodiment of the invention, as shown in FIG. 1, the method comprising the steps of:
Step S101, collecting blank tape consumption and historical tape rollback quantity of N historical periods, and storing the blank tape consumption and the historical tape rollback quantity into a database, wherein N is a positive integer.
Step S102, based on a preset polynomial function, blank tape consumption and historical tape rollback in N historical periods are fitted respectively to obtain a blank tape consumption curve function and a historical tape rollback curve function.
Step S103, based on the blank tape consumption curve function and the history tape rollback curve function obtained by fitting, the backup tape notch amount of the next period is calculated.
Step S104, the backup tape gap amount is sent to the backup operation and maintenance terminal according to the preset time requirement.
Through the steps, the blank tape consumption and the historical tape rollback of N historical periods can be collected and stored in a database, the blank tape consumption and the historical tape rollback of the N historical periods are respectively fitted based on a preset polynomial function to obtain a blank tape consumption curve function and a historical tape rollback curve function, then the backup tape gap of the next period is calculated based on the blank tape consumption curve function and the historical tape rollback curve function obtained through fitting, and finally the backup tape gap is sent to a backup operation and maintenance terminal according to a preset time requirement.
In the embodiment of the invention, the blank tape consumption curve function and the history tape rollback curve function are obtained by collecting and fitting the blank tape consumption quantity and the history tape rollback quantity in the history period, the blank tape consumption curve function and the history tape rollback curve function are used for calculating the tape notch quantity in the backup process of the next period, and the notch quantity of the backup tape is sent to the backup operation and maintenance terminal to be used for indicating the backup tape adding after the calculation is finished, so that the matching of the number of the backup tape adding in the next period and the notch quantity of the backup requirement is ensured, and the technical problem of unbalanced tape distribution caused by blind tape adding in the related technology is solved.
Embodiments of the present invention will be described in detail with reference to the above steps.
In the embodiment of the invention, the tape consumption and the historical tape rollback quantity during data backup are acquired through an API interface, a polynomial fitting method is adopted to obtain a tape consumption curve and a tape rollback curve, the tape consumption and the historical tape rollback quantity in a certain period/future period are calculated, the backup tape gap quantity is calculated, and the backup operation and maintenance terminal is instructed to perform tape adding operation (adding backup tape and blank tape) by using the calculation result.
Step S101, collecting blank tape consumption and historical tape rollback quantity of N historical periods, and storing the blank tape consumption and the historical tape rollback quantity into a database, wherein N is a positive integer.
It should be noted that, the blank tape consumption refers to the number of blank tapes that needs to be occupied by newly added backup data, the historical tape rollback refers to the number of tapes occupied by expired data, each data corresponds to a storage period, and the expired data refers to data that occupies the tape for a storage period exceeding the storage period.
In step S101, the method for collecting the blank tape consumption and the historical tape rollback amount in the historical period includes: monitoring tool collection, log file analysis, database queries, API calls, etc.
The method for collecting the monitoring tools comprises the steps that special monitoring tools are installed in a data center in advance before backup to collect real-time data and generate a monitoring report; the method for analyzing the log file needs to acquire a backup work log and analyze the log file to acquire the use data of the tape; the method for inquiring the database needs to use SQL inquiry sentences to search the related data stored in the database in the backup process, and uses the related data to calculate the use data of the tape; the API call mode needs to acquire the usage data of the related data computing tape by writing a script or calling an API interface of the backup software by using a calling tool.
Optionally, when collecting the historical tape rollback quantity of N historical periods in step S101, the method includes: inquiring historical rollback time points of all magnetic tapes, wherein the historical rollback time points refer to expiration time points corresponding to the latest expired data in all data stored in each magnetic tape; positioning the tape which has been subjected to the rollback operation in each history period based on the history rollback time point, and defining the tape as a history tape; and counting the total number of the historical tapes in each historical period to obtain the historical tape rollback quantity of N historical periods.
It should be noted that, when each data is stored in the tape, the retention period or retention time point of the data is defined according to the requirement in the corresponding backup policy, and a backup log is generated and stored in the database of the backup center, and the method for querying the rollback time point of the tape includes: and analyzing the backup strategy and querying the database.
The embodiment of the invention inquires about the historical rollback time point of the magnetic tape which has executed the rollback operation, and the magnetic tape can also generate the detailed rollback data of the rollback log record when the magnetic tape rolls back, comprising the following steps: the method for inquiring the historical rollback time point of the magnetic tape comprises the following steps of: query a database, etc.
It should be noted that, in the case that the tape (i.e., the history tape) that has undergone the rollback operation is not damaged, since the rollback operation has cleared the storage space in the tape, the history tape may still be put into the data backup process of the next period to receive data for backup storage.
It should be noted that in the embodiment of the present invention, the total number of the historical tapes in each of the N historical periods is counted, and the trend of the total number of the historical tapes over time is analyzed to approximately predict the roll-back amount of the historical tapes in each period in the future time period.
Step S102, based on a preset polynomial function, blank tape consumption and historical tape rollback in N historical periods are fitted respectively to obtain a blank tape consumption curve function and a historical tape rollback curve function.
It should be noted that, in addition to the polynomial fitting method set forth in step S102, the curve fitting method further includes: the above methods can be used for curve function fitting in the embodiments of the present invention.
Optionally, the step S102 of fitting the blank tape consumption in N history periods based on the preset polynomial function to obtain a blank tape consumption curve function includes: acquiring N time parameters corresponding to N historical periods, and corresponding blank tape consumption of the N historical periods in a database to the N time parameters one by one; setting an initial polynomial function: f (F) b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Wherein F is b (t) is the calculated value of blank tape consumption, t is the time parameter, a 0 、a 1 …a m For the parameters to be solved, m is the highest order of the initial polynomial function; acquiring the first K time parameters and the corresponding K blank tape consumption according to the time sequence order, substituting the first K time parameters and the corresponding K blank tape consumption into an initial polynomial function, and calculating a parameter a to be solved 0 、a 1 …a m Obtaining a calculation result, substituting the calculation result into an initial polynomial function to obtain a preset polynomial function with determined parameters, wherein K is an integer smaller than N; a blank tape consumption curve function is determined based on the preset polynomial function, the N-K time parameters and the corresponding N-K blank tape consumption amounts.
It should be noted that, the fitting software of the curve function may be at least one of the following: matlab, python open source library, origin plotting, excel build-in tool, gnupport data visualization.
Optionally, the step of determining a blank tape consumption curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K blank tape consumption amounts includes: step 1, any numerical value P in a preset positive integer set P is obtained, m=p in a preset polynomial function of an order to be determined, and a P-order preset polynomial function is obtained; step 2, substituting the N-K time parameters into a p-order preset polynomial function in sequence to obtain N-K blank tape consumption calculated values; step 3, calculating the fitting index of a p-order preset polynomial function based on a preset fitting index formula and all blank tape consumption calculation values; repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set; and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as a blank tape consumption curve function.
It should be noted that, the preset positive integer set P is a numerical value set of polynomial orders selected according to actual requirements in production, in the application scenario provided in this embodiment, in order to prevent the insufficient generalization capability after the over-fitting, the polynomial orders generally take positive integers less than or equal to 3, and under the condition that the fitting requirement is not met, the orders can be relaxed to less than or equal to 6, so the preset positive integer set P in the embodiment of the present invention is generally {1,2,3,4,5,6}.
Optionally, the preset fitting index formula is:wherein D is a fitting index, C b A variance value of the value and the blank tape consumption is calculated for the blank tape consumption.
The variance is calculated as:wherein i is the sequence number of the time parameter, t i Refers to the time parameter corresponding to the ith period, b i Refers to blank tape consumption in the ith period, F b (t i ) The calculated value of blank tape consumption in the ith time period is represented by the formula, wherein the range of the value of i in the variance calculation formula is N-K which is not less than i and not more than N.
In this embodiment, the variance is used to describe the discrete degree of the target data, so that the discrete degree between the calculated value and the true value of the blank tape consumption calculated by using the fitting curve and the time parameter can be measured, and the fitting degree and the generalization performance of the fitting curve can be further measured.
Optionally, step S102 is based on a preset polynomialA step of fitting the historical tape rollback in N historical cycles to a function of a historical tape rollback curve, comprising: acquiring N time parameters corresponding to N historical periods, and corresponding the historical tape rollback quantity of the N historical periods in the database to the N time parameters one by one; setting an initial polynomial function: f (F) h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is h (t) is the calculated value of the rolling back quantity of the historical tape, t is the time parameter, u 0 、u 1 …u r R is the highest order of the initial polynomial function for the parameters to be solved; acquiring the first K time parameters and the corresponding K historical tape rollback values according to the time sequence order, substituting the first K time parameters and the corresponding K historical tape rollback values into an initial polynomial function, and calculating a parameter u to be solved 0 、u 1 …u r Obtaining a calculation result, substituting the calculation result into an initial polynomial function to obtain a preset polynomial function with determined parameters, wherein K is an integer smaller than N; a historical tape roll-back curve function is determined based on the preset polynomial function, the N-K time parameters, and the corresponding N-K historical tape roll-back amounts.
Optionally, the step of determining a historical tape rollback curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K historical tape rollback amounts includes: step 1, any numerical value P in a preset positive integer set P is obtained, and r=p in a preset polynomial function of an order to be determined to obtain a P-order preset polynomial function; step 2, substituting the N-K time parameters into a p-order preset polynomial function in sequence to obtain N-K historical tape rollback calculation values; step 3, calculating the fitting index of a p-order preset polynomial function based on a preset fitting index formula and all the historical tape rollback calculated values; repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set; and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as a historical tape rollback curve function.
Optionally, the preset fitting index formula is:wherein D is a fitting index, C h A variance value of the historical tape roll-back amount and the historical tape roll-back amount is calculated.
The variance is calculated as:wherein i is the sequence number of the time parameter, t i Refers to the time parameter corresponding to the ith period, h i Refers to the historical tape roll-back quantity in the ith period, F h (t i ) The calculated value of the historical tape rollback quantity in the ith time period is represented by the formula, wherein the range of the calculated value of i in the variance calculation formula is N-K which is not less than i which is not more than N.
Step S103, based on the blank tape consumption curve function and the history tape rollback curve function obtained by fitting, the backup tape notch amount of the next period is calculated.
Optionally, the step of calculating the backup tape gap amount of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting includes: calculating blank tape consumption of the next period based on a blank tape consumption curve function, wherein the blank tape consumption of the next period refers to the total number of blank tapes occupied by newly added backup data in the next period; calculating a historical tape roll-back quantity of the next period based on the historical tape roll-back curve function; and subtracting the historical tape rollback quantity of the next period from the blank tape consumption quantity of the next period to obtain the backup tape gap quantity of the next period.
It should be noted that, to avoid resource waste, the newly added backup data may preferentially occupy the blank history tape that has been rolled back by the backup center, and if all available history tapes are occupied and still the backup data is not stored in the tape, the newly added blank tape is used to store the data.
In the embodiment of the invention, the blank tape consumption of the next period refers to the total number of blank tapes which are needed to be occupied by newly added backup data calculated by using a blank tape consumption curve function, the historical tape rollback of the next period refers to the total number of available historical tapes calculated by using the blank tape consumption curve function, and the backup tape notch of the next period can be obtained by subtracting the historical tape rollback from the blank tape consumption.
Step S104, the backup tape gap amount is sent to the backup operation and maintenance terminal according to the preset time requirement.
It should be noted that, the predetermined time requirement may be set according to the backup requirement, for example, the backup period is 30 days, and the time requirement may be set to 30 days, and the backup tape gap amount is calculated every 30 days and sent to the backup operation and maintenance terminal to remind adding the tape.
In the embodiment of the invention, the short-cut quantity of the magnetic tape is calculated according to the use condition of the magnetic tape in the history period and by combining a polynomial fitting method, a reference is provided for the tape adding operation of the backup operation and maintenance center, the unbalanced tape distribution caused by blind tape adding is prevented, and the problems of shortage of magnetic tape resources or resource waste are avoided.
According to the calculation method provided by the embodiment of the invention, the technical effects of automatically calculating the number of the magnetic tapes to be added and reducing the cost of manual calculation can be achieved.
The embodiment of the invention also introduces the concept of the fitting index, determines the highest order of the polynomial function according to the comparison standard of the fitting index, and prevents the curve from losing generalization performance due to over-fitting while meeting the fitting requirement of the curve function.
The invention is described below in connection with another specific embodiment.
FIG. 2 is a flowchart of an alternative method for predicting blank tape demand based on a VeritasNBU backup environment, as shown in FIG. 2, in accordance with embodiments of the invention, the method comprising the steps of:
s201, data acquisition: through the API interface provided by VeritaspBU, the use condition of the tape in the historical time period is collected, wherein the use condition comprises blank tape consumption and historical tape rollback quantity, the historical time period comprises N historical periods, and the historical periods are backup periods for data backup and rollback periods for rollback of the historical tape.
S202, function fitting: and fitting a blank tape consumption curve function and a historical tape rollback curve function respectively.
It should be noted that, the manner of function fitting includes: polynomial fitting, least squares fitting, power function fitting, exponential function fitting, logarithmic function fitting, nonlinear least squares fitting, polynomial fitting being preferred in embodiments of the invention.
It should be noted that, the software of function fitting includes: matlab, python open source library, origin mapping, excel build-in tool, gnupport data visualization, matlab fitting is preferred in embodiments of the invention.
S203, prediction calculation: and respectively calculating blank tape consumption and historical tape rollback in a future time period according to the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting.
S204, notch calculation: according to the calculation result of S203, the backup tape gap amount of a time period in the future is calculated, where the calculation method is as follows: the historical tape rollback is subtracted from the blank tape consumption for a future period of time.
S205, data pushing: and pushing the backup tape gap amount obtained by the calculation in the step S204 to a backup operation and maintenance center, and reminding of timely tape adding and tape adding quantity.
The function fitting process in step S202 is explained below.
S2021, based on the tape usage data acquired in step S201, acquiring a time parameter sequence t corresponding to the history period 1 、t 2 …t n And acquires a blank tape consumption sequence b corresponding to the n time parameters 1 、b 2 …b n Historical tape rollback sequence h 1 、h 2 …h n
Dividing the time sequence into two parts, and forming a fitting sub-sequence t by the first k time parameters 1 、t 2 …t k The last n-k time parameters form a distinguishing sub-sequence t n-k 、t n-k+1 …t n At the same time, willThe blank tape consumption sequence and the historical tape rollback sequence are also divided into a consumption fitting sub-sequence, a consumption judging sub-sequence, a rollback fitting sub-sequence and a rollback judging sub-sequence according to the dividing method, and the fitting sub-sequence t is divided into a plurality of sequences 1 、t 2 …t k And consuming the fitting subsequence and rolling back the fitting subsequence to form a fitting subsequence set, and judging the subsequence t n-k 、t n-k+1 …t n And the consumption discrimination subsequence and the rollback discrimination subsequence are integrated into a set of discrimination subsequences.
S2022, setting blank tape consumption to conform to initial polynomial function F b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Setting the historical tape rollback quantity to accord with an initial polynomial function F h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is b (t) is the calculated value of blank tape consumption, F h (t) is the calculated value of the historical tape roll-back quantity, a 0 、a 1 …a m And u 0 、u 1 …u r And m and r are respectively the highest orders of the polynomials, t is a time parameter, and the time parameter sequence can be substituted into a polynomial function in turn to obtain blank tape consumption and historical tape rollback of the corresponding period.
S2023, substituting the tape data in the step S2021 into the corresponding polynomial in the step S2022 for fitting, and calculating parameters to be solved to obtain a fitted curve function. The following is a schematic illustration of a fitting procedure of a blank tape consumption curve function.
Substituting the time fitting subsequence and the consumption fitting subsequence in the discrimination subsequence into the initial polynomial function F b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m The following set of equations is obtained:
and performing curve fitting according to ployfit (x, y, m) packaged in Matlab software, combining and analyzing the equation set to obtain parameters to be solved, substituting the parameters to be solved into an initial polynomial to obtain a polynomial with determined parameters, wherein independent variable x is a time parameter sequence, y is a blank tape consumption sequence, and m is the highest order of the self-defined polynomial. In order to prevent over fitting, m is generally a positive integer less than or equal to 3, if the fitting condition is not met, the value range of m can be widened to less than or equal to 6, and the blank tape consumption calculated value F when m takes different values is solved b (t)。
In order to prevent over fitting, a concept of fitting index is introduced, a time discrimination subsequence and a consumption discrimination subsequence in a discrimination subsequence set are utilized to discriminate the calculated value of the blank tape consumption, and the most suitable polynomial highest order is selected. The fitting index calculation formula is: Wherein D is a fitting index, C b For the variance value of the calculated value and the true value of the blank tape consumption, it should be noted that the calculation formula of the variance is: /> Wherein i is the sequence number of the time parameter, t i Refers to the time parameter corresponding to the ith period, b i Refers to blank tape consumption in the ith period, F b (t i ) The calculated value of blank tape consumption in the ith time period is represented by the formula, wherein the range of the value of i in the variance calculation formula is N-K which is not less than i and not more than N.
And substituting all values in the time discrimination subsequence and the consumption discrimination subsequence into a fitting index calculation formula in sequence to obtain a fitting index set, and taking an m polynomial function corresponding to the smallest fitting index in the fitting index set as a blank tape consumption curve function.
The above is a schematic description of a fitting process of a polynomial curve function using a blank tape consumption curve function as an example, the polynomial and sequence set are replaced with data corresponding to a historical tape rollback curve function, and the fitting process is repeated to obtain the historical tape rollback curve function.
And fitting to obtain a blank tape consumption curve function and a historical tape rollback curve function, and performing predictive calculation on the tape service condition of a future time period to further obtain the backup tape gap amount.
FIG. 3 is a schematic diagram of an alternative apparatus for predicting blank tape demand based on a VeritasNBU backup environment, as shown in FIG. 3, according to an embodiment of the invention, the apparatus comprising:
the data acquisition module 31 is configured to execute step S201; the trend fitting module 32 is configured to execute step S202; the usage calculating module 33 is configured to execute step S203; the notch calculating module 34 is configured to execute step S204; the data pushing module 35 is configured to execute step S205.
In the embodiment of the invention, the short-cut quantity of the magnetic tape is calculated according to the use condition of the magnetic tape in the history period and by combining a polynomial fitting method, a reference is provided for the tape adding operation of the backup operation and maintenance center, the unbalanced tape distribution caused by blind tape adding is prevented, and the problems of shortage of magnetic tape resources or resource waste are avoided.
According to the calculation method provided by the embodiment of the invention, the technical effects of automatically calculating the number of the magnetic tapes to be added and reducing the cost of manual calculation can be achieved.
The embodiment of the invention also introduces the concept of the fitting index, determines the highest order of the polynomial function according to the comparison standard of the fitting index, and prevents the curve from losing generalization performance due to over-fitting while meeting the fitting requirement of the curve function.
The invention is described below in connection with alternative embodiments.
Example two
The computing device for the backup tape gap amount provided in the present embodiment includes a plurality of implementation units, each implementation unit corresponding to each implementation step in the first embodiment.
FIG. 4 is a schematic diagram of an alternative apparatus for calculating a backup tape gap amount according to an embodiment of the present invention, as shown in FIG. 4, the apparatus for calculating a backup tape gap amount may include: an acquisition unit 41, a fitting unit 42, a calculation unit 43, a transmission unit 44, wherein,
the collecting unit 41 is configured to collect N blank tape consumption amounts of history periods and a history tape rollback amount, and store the blank tape consumption amounts and the history tape rollback amount in a database, where the blank tape consumption amounts refer to blank tape amounts required to be occupied by newly added backup data, the history tape rollback amount refers to tape amounts occupied by expired data, each data corresponds to a storage period, the expired data refers to data occupying a storage period of a tape beyond the storage period, and N is a positive integer;
a fitting unit 42, configured to fit the blank tape consumption and the historical tape rollback in N historical periods, respectively, based on a preset polynomial function, to obtain a blank tape consumption curve function and a historical tape rollback curve function;
A calculating unit 43, configured to calculate a backup tape gap amount of a next cycle based on the blank tape consumption curve function and the history tape rollback curve function obtained by fitting;
and the sending unit 44 is configured to send the backup tape gap amount to the backup operation and maintenance terminal according to a predetermined time requirement.
The above-mentioned calculation device for backup tape notch amount may collect the blank tape consumption amounts and the historical tape rollback amounts of N historical periods by the collection unit 41 and store them in the database, then fit the blank tape consumption amounts and the historical tape rollback amounts in the N historical periods by the fitting unit 42 based on the preset polynomial function to obtain the blank tape consumption curve function and the historical tape rollback curve function, then calculate the backup tape notch amount of the next period by the calculation unit 43 based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting, and finally send the backup tape notch amount to the backup operation and maintenance terminal by the sending unit 44 according to the predetermined time requirement.
In the embodiment of the invention, the blank tape consumption and the historical tape rollback quantity in the historical period are collected and fitted to obtain the blank tape consumption curve function and the historical tape rollback curve function, the blank tape consumption curve function and the historical tape rollback curve function are used for analyzing and calculating the tape notch quantity in the backup process of the next period, and the notch quantity of the backup tape is sent to the backup operation and maintenance terminal to be used for indicating the backup tape adding after the calculation is finished, so that the quantity of the backup tape adding in the next period is ensured to be matched with the notch quantity of the backup requirement, and the technical problem of unbalanced tape distribution caused by blind tape adding in the related art is solved.
Optionally, the acquisition unit comprises: the inquiring module is used for inquiring historical rollback time points of all magnetic tapes, wherein the historical rollback time points refer to expiration time points corresponding to the latest expired data in all data stored in each magnetic tape; the positioning module is used for positioning the tape which has undergone rollback operation in each history period based on the history rollback time point and defining the tape as a history tape; and the statistics module is used for counting the total number of the historical tapes in each historical period to obtain the historical tape rollback quantity of N historical periods.
Optionally, the computing unit includes: the first calculation module is used for calculating blank tape consumption of the next period based on a blank tape consumption curve function, wherein the blank tape consumption of the next period refers to the total number of blank tapes occupied by newly added backup data in the next period; a second calculation module for calculating a historical tape roll-back amount for a next cycle based on the historical tape roll-back curve function; and the third calculation module is used for subtracting the historical tape rollback quantity of the next period from the blank tape consumption quantity of the next period to obtain the backup tape gap quantity of the next period.
Optionally, the fitting unit includes: the first acquisition module is used for acquiring N time parameters corresponding to the N historical periods, and enabling blank tape consumption of the N historical periods in the database to be in one-to-one correspondence with the N time parameters; a first setting module, configured to set an initial polynomial function: f (F) b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Wherein F is b (t) is the calculated value of blank tape consumption, t is the time parameter, a 0 、a 1 …a m For the parameters to be solved, m is the highest order of the initial polynomial function; a fourth calculation module for obtaining the first K time parameters and the corresponding K blank tape consumption according to the time sequence order, substituting the first K time parameters and the corresponding K blank tape consumption into the initial polynomial function, and calculating the parameter a to be solved 0 、a 1 …a m Obtaining a calculation result, substituting the calculation result into an initial polynomial function to obtain a preset polynomial function with determined parameters, wherein K is an integer smaller than N; the first determining module is used for determining a blank tape consumption curve function based on a preset polynomial function, N-K time parameters and corresponding N-K blank tape consumption amounts.
Optionally, the first determining module includes: the first obtaining submodule is used for executing the step 1 to obtain any numerical value P in a preset positive integer set P, and m=p in a preset polynomial function of an order to be determined to obtain a P-order preset polynomial function; the first generation of sub-module is used for executing the step 2, and substituting N-K time parameters into a p-order preset polynomial function in sequence to obtain N-K blank tape consumption calculation values; the first calculating sub-module is used for executing the step 3, and calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all blank tape consumption calculation values; the first repeating submodule is used for repeating the steps 1 to 3 until all values in the preset positive integer set P are completely valued, and a fitting index set is obtained; the first selecting submodule is used for selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as a blank tape consumption curve function.
Optionally, the preset fitting index formula is:wherein D is a fitting index, C b A variance value of the value and the blank tape consumption is calculated for the blank tape consumption.
Optionally, the fitting unit further comprises: second getThe acquisition module is used for acquiring N time parameters corresponding to the N historical periods, and enabling the historical tape rollback quantity of the N historical periods in the database to be in one-to-one correspondence with the N time parameters; a second setting module, configured to set an initial polynomial function: f (F) h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is h (t) is the calculated value of the rolling back quantity of the historical tape, t is the time parameter, u 0 、u 1 …u r R is the highest order of the initial polynomial function for the parameters to be solved; a fifth calculation module for obtaining the first K time parameters and the corresponding K historical tape rollback values according to the time sequence order, substituting the first K time parameters and the corresponding K historical tape rollback values into the initial polynomial function, and calculating the parameter u to be solved 0 、u 1 …u r Obtaining a calculation result, substituting the calculation result into an initial polynomial function to obtain a preset polynomial function with determined parameters, wherein K is an integer smaller than N; and the second determining module is used for determining a historical tape roll-back curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K historical tape roll-back quantities.
Optionally, the second determining module includes: the second obtaining submodule is used for executing the step 1 to obtain any numerical value P in a preset positive integer set P, and let r=p in a preset polynomial function of an order to be determined to obtain a P-order preset polynomial function; the second substituting sub-module is used for executing the step 2, and substituting the N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K historical tape rollback calculated values; the second calculation sub-module is used for executing the step 3, and calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all the historical tape rollback calculation values; the second repeating submodule is used for repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and a fitting index set is obtained; and the second selecting submodule is used for selecting the smallest fitting index in the fitting index set and taking the p-order preset polynomial function corresponding to the smallest fitting index as a historical tape rollback curve function.
Optionally, the preset fitting index formula is:wherein D is a fitting index, C h A variance value of the historical tape roll-back amount and the historical tape roll-back amount is calculated.
The above-mentioned computing device for the backup tape gap amount may further include a processor and a memory, where the above-mentioned acquisition unit 41, fitting unit 42, computing unit 43, transmitting unit 44, etc. are stored as program units, and the processor executes the above-mentioned program units stored in the memory to implement the corresponding functions.
The processor includes a kernel, and the kernel fetches a corresponding program unit from the memory. The kernel can set one or more than one, and the backup tape gap amount is sent to the backup operation and maintenance terminal according to the preset time requirement by adjusting the kernel parameters.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), which includes at least one memory chip.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: collecting blank tape consumption of N historical periods and historical tape rollback quantity, and storing the blank tape consumption and the historical tape rollback quantity into a database, wherein the blank tape consumption is the number of blank tapes required to be occupied by newly added backup data, the historical tape rollback quantity is the number of tapes occupied by expired data, each data corresponds to a storage period, the expired data is the data occupying the storage period of the tape and exceeding the storage period, and N is a positive integer; based on a preset polynomial function, respectively fitting blank tape consumption and historical tape rollback in N historical periods to obtain a blank tape consumption curve function and a historical tape rollback curve function; calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting; and sending the backup tape gap amount to the backup operation and maintenance terminal according to the preset time requirement.
According to another aspect of the embodiments of the present invention, there is further provided a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where the computer program when executed controls a device in which the computer readable storage medium is located to perform the method for calculating the backup tape gap amount according to any one of the above.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method for calculating the backup tape gap amount of any of the above.
Fig. 5 is a block diagram of a hardware architecture of an electronic device (or mobile device) for a method of computing a backup tape gap amount according to an embodiment of the present invention. As shown in fig. 5, the electronic device may include one or more (shown in fig. 5 as 502a, 502b, … …,502 n) processors 502 (the processors 502 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, etc. processing means), a memory 504 for storing data. In addition, the method may further include: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a keyboard, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (12)

1. A method for calculating a backup tape gap amount, comprising:
collecting blank tape consumption of N historical periods and historical tape rollback quantity, and storing the blank tape consumption and the historical tape rollback quantity into a database, wherein the blank tape consumption is the number of blank tapes which are needed to be occupied by newly added backup data, the historical tape rollback quantity is the number of tapes occupied by expired data, each data corresponds to a storage period, the expired data is data of which the storage period of occupied tapes exceeds the storage period, and N is a positive integer;
fitting the blank tape consumption and the historical tape rollback in N historical periods respectively based on a preset polynomial function to obtain a blank tape consumption curve function and a historical tape rollback curve function;
calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function obtained by fitting;
And sending the backup tape gap amount to a backup operation and maintenance terminal according to a preset time requirement.
2. The computing method of claim 1, wherein, when collecting the historical tape rollback for N historical cycles, comprising:
inquiring historical rollback time points of all magnetic tapes, wherein the historical rollback time points refer to expiration time points corresponding to the latest expired data in all data stored in each magnetic tape;
positioning the tape which has been subjected to the rollback operation in each history period based on the history rollback time point, and defining the tape as a history tape;
and counting the total number of the historical tapes in each historical period to obtain the historical tape rollback quantity of the N historical periods.
3. The method of computing of claim 1, wherein the step of computing the backup tape gap amount for the next cycle based on the blank tape consumption curve function and the historical tape rollback curve function resulting from the fitting comprises:
calculating blank tape consumption of the next period based on the blank tape consumption curve function, wherein the blank tape consumption of the next period refers to the total number of blank tapes occupied by newly added backup data in the next period;
Calculating a historical tape roll-back amount for the next cycle based on the historical tape roll-back curve function;
and subtracting the historical tape rollback quantity of the next period from the blank tape consumption quantity of the next period to obtain the backup tape gap quantity of the next period.
4. The method of computing of claim 1, wherein fitting the blank tape consumption over N history periods based on a predetermined polynomial function results in a blank tape consumption curve function comprising:
acquiring N time parameters corresponding to the N historical periods, and corresponding the blank tape consumption of the N historical periods in the database to the N time parameters one by one;
setting an initial polynomial function: f (F) b (t)=a 0 t m +a 1 t m-1 +…+a m-1 t 1 +a m Wherein F is b (t) is the calculated value of blank tape consumption, t is the time parameter, a 0 、a 1 …a m For the parameters to be solved for,
m is the highest order of the initial polynomial function;
before acquisition according to time sequence orderSubstituting the K time parameters and the corresponding K blank tape consumption into the initial polynomial function to calculate the parameter a to be solved 0 、a 1 …a m Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N;
And determining the blank tape consumption curve function based on the preset polynomial function, N-K time parameters and corresponding N-K blank tape consumption amounts.
5. The computing method of claim 4, the step of determining the blank tape consumption profile function based on the preset polynomial function, N-K of the time parameters, and corresponding N-K of the blank tape consumption amounts, comprising:
step 1, any numerical value P in a preset positive integer set P is obtained, m=p in the preset polynomial function with the order to be determined, and a P-order preset polynomial function is obtained;
step 2, substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K blank tape consumption calculated values;
step 3, calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all blank tape consumption calculation values;
repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set;
and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as the blank tape consumption curve function.
6. The computing method of claim 5, wherein the preset fitting index formula is:
wherein D is the fitting index, C b Calculating a variance value between the blank tape consumption and the blank tape consumption.
7. The computing method of claim 1, wherein fitting the historical tape rollback over N historical cycles based on a preset polynomial function results in a historical tape rollback curve function comprising:
acquiring N time parameters corresponding to the N historical periods, and corresponding the historical tape rollback quantity of the N historical periods in the database to the N time parameters one by one;
setting an initial polynomial function: f (F) h (t)=u 0 t r +u 1 t r-1 +…+u r-1 t 1 +u r Wherein F is h (t) is the calculated value of the rolling back quantity of the historical tape, t is the time parameter, u 0 、u 1 …u r R is the highest order of the initial polynomial function for the parameters to be solved;
obtaining the first K time parameters and the corresponding K historical tape rollbacks according to a time sequence order, substituting the time parameters and the corresponding K historical tape rollbacks into the initial polynomial function, and calculating the parameter u to be solved 0 、u 1 …u r Obtaining a calculation result, substituting the calculation result into the initial polynomial function to obtain the preset polynomial function with determined parameters, wherein K is an integer smaller than N;
And determining the historical tape roll-back curve function based on the preset polynomial function, the N-K time parameters and the corresponding N-K historical tape roll-back quantities.
8. The computing method of claim 7, the step of determining the historical tape roll-back curve function based on the preset polynomial function, the N-K time parameters, and the corresponding N-K historical tape roll-back amounts, comprising:
step 1, any numerical value P in a preset positive integer set P is obtained, and r=p in the preset polynomial function with the order to be determined is made to obtain a P-order preset polynomial function;
step 2, substituting N-K time parameters into the p-order preset polynomial function in sequence to obtain N-K historical tape rollback calculated values;
step 3, calculating the fitting index of the p-order preset polynomial function based on a preset fitting index formula and all the historical tape rollback calculation values;
repeating the steps 1 to 3 until all the numerical values in the preset positive integer set P are completely valued, and obtaining a fitting index set;
and selecting the smallest fitting index in the fitting index set, and taking the p-order preset polynomial function corresponding to the smallest fitting index as the historical tape rollback curve function.
9. The computing method of claim 8, wherein the preset fitting index formula is:
wherein D is the fitting index, C h A variance value of the historical tape roll-back amount and the historical tape roll-back amount is calculated.
10. A computing device for backing up a gap amount of a tape, comprising:
the system comprises an acquisition unit, a storage unit and a database, wherein the acquisition unit is used for acquiring blank tape consumption of N historical periods and historical tape rollback quantity, the blank tape consumption is the number of blank tapes which are needed to be occupied by newly added backup data, the historical tape rollback quantity is the number of tapes occupied by expired data, each data corresponds to a storage period, the expired data is the data of which the storage period of the occupied tape exceeds the storage period, and N is a positive integer;
the fitting unit is used for respectively fitting the blank tape consumption and the historical tape rollback in N historical periods based on a preset polynomial function to obtain a blank tape consumption curve function and a historical tape rollback curve function;
the calculating unit is used for calculating the backup tape notch quantity of the next period based on the blank tape consumption curve function and the historical tape rollback curve function which are obtained through fitting;
And the sending unit is used for sending the backup tape gap amount to the backup operation and maintenance terminal according to the preset time requirement.
11. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program when run controls a device in which the computer readable storage medium is located to perform the method for calculating the backup tape gap amount according to any one of claims 1 to 9.
12. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of computing the backup tape gap amount of any of claims 1-9.
CN202310883493.7A 2023-07-18 2023-07-18 Method and device for calculating gap amount of backup tape, electronic equipment and storage medium Pending CN117056121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310883493.7A CN117056121A (en) 2023-07-18 2023-07-18 Method and device for calculating gap amount of backup tape, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310883493.7A CN117056121A (en) 2023-07-18 2023-07-18 Method and device for calculating gap amount of backup tape, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117056121A true CN117056121A (en) 2023-11-14

Family

ID=88659822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310883493.7A Pending CN117056121A (en) 2023-07-18 2023-07-18 Method and device for calculating gap amount of backup tape, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117056121A (en)

Similar Documents

Publication Publication Date Title
WO2022267735A1 (en) Service data processing method and apparatus, computer device, and storage medium
CN107491970B (en) Real-time anti-cheating detection monitoring method and system and computing equipment
US11163735B2 (en) Database capacity estimation for database sizing
CN109447496B (en) Electricity stealing behavior judgment method and terminal equipment
CN111798988A (en) Risk area prediction method and device, electronic equipment and computer readable medium
Kanoun et al. Software reliability trend analyses from theoretical to practical considerations
CN111800807A (en) Method and device for alarming number of base station users
CN117056121A (en) Method and device for calculating gap amount of backup tape, electronic equipment and storage medium
US20160306555A1 (en) Storage capacity regression
CN111159515A (en) Data processing method and device and electronic equipment
CN113780666B (en) Missing value prediction method and device and readable storage medium
CN116027202A (en) Battery health evaluation method, device, computer equipment and storage medium
CN115659411A (en) Method and device for data analysis
CN115185794A (en) Analysis method and device of service call chain and electronic equipment
CN116127149B (en) Quantification method and system for health degree of graph database cluster
CN107957942B (en) SQL script fault repairing method and terminal thereof
CN116382924B (en) Recommendation method and device for resource allocation, electronic equipment and storage medium
CN108259552B (en) Case processing system and method
CN111177131A (en) Electricity consumption data detection method and device, computer equipment and storage medium
WO2024060168A1 (en) Timing recommendation of server decommissioning
CN110113228B (en) Network connection detection method and device
CN109146092B (en) Single machine system maintenance method and device
CN117112444A (en) Application system evaluation method, device, storage medium and processor
CN115510129A (en) Data fluctuation attribution analysis method, system and related device
CN113609385A (en) Browsing information pushing method, system and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination