CN115509465B - Sector management method and device, electronic equipment and storage medium - Google Patents
Sector management method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115509465B CN115509465B CN202211454252.2A CN202211454252A CN115509465B CN 115509465 B CN115509465 B CN 115509465B CN 202211454252 A CN202211454252 A CN 202211454252A CN 115509465 B CN115509465 B CN 115509465B
- Authority
- CN
- China
- Prior art keywords
- sector
- sectors
- expired
- processed
- renewal
- 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.)
- Active
Links
- 238000007726 management method Methods 0.000 title claims description 32
- 238000012797 qualification Methods 0.000 claims abstract description 29
- 238000000034 method Methods 0.000 claims abstract description 22
- 238000013507 mapping Methods 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 2
- 230000004913 activation Effects 0.000 description 6
- 230000002035 prolonged effect Effects 0.000 description 4
- 238000005538 encapsulation Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005034 decoration Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009472 formulation Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0637—Permissions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The method comprises the steps of determining expired sectors and provisional sectors from target sectors, wherein the provisional sectors are unexpired sectors with a time length less than or equal to a first preset time length from an expiration date, then inquiring the qualification for each expired sector to obtain all qualified sectors, the qualified sectors are sectors with qualification for continuation, then obtaining the respective corresponding continuation periods of the to-be-processed sectors, and the to-be-processed sectors comprise the provisional sectors and the qualified sectors and are respectively subjected to continuation on the basis of the respective corresponding continuation periods of the to-be-processed sectors. The method and the device have the effect of facilitating management of continuation of the sector.
Description
Technical Field
The present application relates to the field of disk management and utilization, and in particular, to a sector management method and apparatus, an electronic device, and a storage medium.
Background
A sector refers to a divided area on a disk. Each magnetic track on the magnetic disk is equally divided into a plurality of arc segments, the arc segments are sectors of the magnetic disk, and the reading and writing of the hard disk take the sectors as basic units. The sectors are used to store data that is needed or generated at the time of operation.
However, if a user activates and uses a large number of sectors, the user may spend a great deal of time and effort in renewing the expired sectors at a later time.
Disclosure of Invention
In order to facilitate management of continuation of a sector, the present application provides, inter alia, a method, an apparatus, an electronic device, and a storage medium for sector management.
In a first aspect, the present application provides a sector management method, which adopts the following technical solutions:
a method of sector management, comprising:
determining an expired sector and a provisional sector from target sectors, wherein the provisional sector is an unexpired sector with an expiration date less than or equal to a first preset time length;
inquiring the renewal qualification of each expired sector to obtain all qualified sectors, wherein the qualified sectors are sectors with the renewal qualification;
acquiring a continuation period corresponding to each to-be-processed sector, wherein the to-be-processed sectors comprise a temporary sector and a qualified sector;
and respectively carrying out the continuation on each sector to be processed based on the continuation period respectively corresponding to each sector to be processed.
By adopting the technical scheme, the electronic equipment can determine an expired sector and an adjacent sector to be expired from the target sector, and further determine a qualified sector which can be renewed in the expired sector; and then acquiring a renewal period corresponding to each qualified sector and each temporary sector, and renewing each qualified sector and each temporary sector based on the corresponding renewal period, so that the expired sectors can be normally used, and meanwhile, the use time of the sectors to be expired can be prolonged.
In one possible implementation, the determining an expired sector and a provisional sector from among the target sectors includes:
calling a mapping table corresponding to the target sectors, wherein the mapping table comprises the expiration date of each target sector;
querying a mapping table to determine all expired sectors and unexpired sectors;
determining all pre-expired sectors based on the expiration date and the first preset time length of each unexpired sector;
judging whether the number of all the pre-provisional sectors is greater than a preset economic threshold value, wherein the economic threshold value is a positive integer;
if yes, determining all the pre-temporary sectors as temporary sectors;
if not, determining the number of the temporary sectors to be 0.
By adopting the technical scheme, after all the pre-temporary sectors are determined by the expiration date and the first preset time, in order to reduce the number of subsequent renewals, when the number of the pre-temporary sectors is greater than or equal to the economic threshold, all the pre-temporary sectors are determined as sectors needing to be renewed, and if the number of the pre-temporary sectors is less than the economic threshold, the number of the temporary sectors is determined to be 0, so that all the pre-temporary sectors need to wait for the renewal.
In one possible implementation, before querying for renewal qualification for each of the expired sectors, the method further comprises:
querying an expiration time and a resumable time for each of the expired sectors;
and determining the renewal qualification of each sector based on the expiration time length and the resumable time length of each expired sector, wherein the expiration time length of the sectors with the renewal qualification does not exceed the preset default time length, and the difference between the resumable time length and the expiration time length is not less than a preset second preset time length.
By adopting the technical scheme, before the qualification for renewal of the expired sectors is inquired, the expiration time of the expired sectors is determined according to the expiration time and the resumable time of the expired sectors, and the qualification for renewal of each expired sector is determined according to the comparison between the difference value of the expiration time and the default time and the second preset time.
In a possible implementation manner, the obtaining the continuation periods corresponding to the sectors to be processed respectively includes:
acquiring a preset first period as a continuation period corresponding to each to-be-processed sector; or
And acquiring the renewal period corresponding to each sector to be processed in the designated period input by the user.
By adopting the technical scheme, the renewal cycle of each to-be-processed sector is determined to be the same first cycle, so that the expired sectors can expire in the same date later, and the convenience of subsequent batch sector management is improved; and acquiring a designated period input by the user as a renewal period corresponding to each to-be-processed sector, so that the actual requirements of the user can be met.
In a possible implementation manner, if the first cycle and the specified cycle are not acquired, the method further includes:
acquiring the resumable duration corresponding to each to-be-processed sector as the resumable period corresponding to each to-be-processed sector; or
And acquiring a shortest period which is the duration period of each to-be-processed sector, wherein the shortest period is the shortest duration in the available duration periods respectively corresponding to each to-be-processed sector.
By adopting the technical scheme, the number of times of late-stage renewal can be reduced, so that the current to-be-processed sector can be stably used for a long time; each to-be-processed period is continued through the shortest period, so that the current to-be-processed sectors can expire on the same date, and the convenience of batch sector management is further improved.
In a possible implementation manner, the respectively performing continuation on the sectors to be processed based on the continuation cycles respectively corresponding to the sectors to be processed includes, for any sector to be processed:
acquiring a version type corresponding to any sector to be processed;
acquiring a corresponding continuation instruction based on the version type corresponding to any sector to be processed;
and carrying out reservation on any sector to be processed based on the reservation instruction and the reservation period corresponding to the sector to be processed.
By adopting the technical scheme, the corresponding renewal instruction is determined according to the version of the sector, so that the renewal step is smooth, the probability of errors is reduced, and the renewal efficiency is improved.
In one possible implementation manner, the approving any sector to be processed based on the renewal instruction and the renewal cycle corresponding to the sector to be processed includes:
carrying out real-time renewal on any expired sector based on a renewal command and a renewal period corresponding to the expired sector;
and before a reservation date, carrying out reservation on any temporary sector based on a reservation instruction and a reservation period corresponding to any temporary sector, wherein the reservation date is the earliest expiration date corresponding to all temporary sectors.
By adopting the technical scheme, the renewal is carried out when all current temporary sectors are to become the expired sectors, and new adjacent sectors are possibly generated between the current time and the reservation date, so that the newly generated temporary dates can be renewed together on the renewal date, and simultaneously, more sectors can be renewed to expire on the same date, thereby improving the convenience of batch sector management.
In a second aspect, the present application provides a sector management apparatus, which adopts the following technical solutions:
a sector management apparatus, comprising:
the system comprises a determining module, a determining module and a judging module, wherein the determining module is used for determining an expired sector and a provisional sector from target sectors, and the provisional sector is an unexpired sector with the time length less than or equal to a first preset time length from an expiration date;
the first inquiry module is used for inquiring the continuation qualification of each expired sector to obtain all qualified sectors, wherein the qualified sectors are sectors with the continuation qualification;
a continuation period obtaining module, configured to obtain a continuation period corresponding to each to-be-processed sector, where the to-be-processed sectors include a temporary sector and a qualified sector;
and the continuation module is used for respectively continuing each sector to be processed based on the continuation period respectively corresponding to each sector to be processed.
By adopting the technical scheme, the device can determine an expired sector and an adjacent sector to be expired from the target sector, and further determine a qualified sector which can be renewed in the expired sector; and then acquiring a renewal period corresponding to each qualified sector and each temporary sector, and renewing each qualified sector and each temporary sector based on the corresponding renewal period, so that the expired sectors can be normally used, and meanwhile, the use time of the sectors to be expired can be prolonged.
In a possible implementation manner, when the determining module determines the expired sector and the provisional sector from the target sectors, the determining module is specifically configured to:
calling a mapping table corresponding to the target sectors, wherein the mapping table comprises the expiration date of each target sector;
querying a mapping table to determine all expired sectors and unexpired sectors;
determining all pre-dated sectors based on the expiration date and a first preset time duration of each non-expired sector;
judging whether the number of all the pre-temporary sectors is greater than a preset economic threshold value, wherein the economic threshold value is a positive integer;
if yes, determining all the pre-temporary sectors as temporary sectors;
and if not, determining that the number of the temporary sectors is 0.
In one possible implementation, the apparatus further includes:
a second query module, configured to query the expiration duration and the resumable duration of each expired sector;
and the renewal qualification determining module is used for determining the renewal qualification of each sector based on the expiration time length and the resumable time length of each expired sector, wherein the expiration time length of the renewal qualified sector does not exceed the preset default time length, and the difference between the resumable time length and the expiration time length is not less than the preset second preset time length.
In a possible implementation manner, when the continuation period acquiring module acquires the continuation periods corresponding to the sectors to be processed, it is specifically configured to:
acquiring a preset first period as a continuation period corresponding to each to-be-processed sector; or
And acquiring the renewal period corresponding to each sector to be processed in the designated period input by the user.
In one possible implementation, the apparatus further includes:
the first obtaining module is used for obtaining the renewable duration corresponding to each to-be-processed sector as the renew period corresponding to each to-be-processed sector; or
And the second acquisition module is used for acquiring a shortest period which is the duration period of each to-be-processed sector, wherein the shortest period is the shortest duration in the available duration periods respectively corresponding to each to-be-processed sector.
In a possible implementation manner, when the continuation module performs respective continuation on each to-be-processed sector based on the continuation cycle respectively corresponding to each to-be-processed sector, for any to-be-processed sector, the continuation module is specifically configured to:
acquiring a version type corresponding to any sector to be processed;
acquiring a corresponding continuation instruction based on the version type corresponding to any sector to be processed;
and carrying out reservation on any sector to be processed based on the reservation instruction and the reservation period corresponding to the sector to be processed.
In one possible implementation manner, when the renewal module renews any pending sector based on the renewal instruction and the renewal cycle corresponding to the pending sector, the renewal module is specifically configured to:
carrying out real-time renewal on any expired sector based on a renewal command and a renewal period corresponding to the expired sector;
and before a reservation date, carrying out reservation on any temporary sector based on a reservation instruction and a reservation period corresponding to any temporary sector, wherein the reservation date is the earliest expiration date corresponding to all temporary sectors.
In a third aspect, the present application provides an electronic device, which adopts the following technical solutions:
an electronic device, comprising:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: the sector continuation method described above is performed.
In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, comprising: a computer program is stored which can be loaded by a processor and which performs the above-described sector renewal method.
In summary, the present application includes at least one of the following beneficial technical effects:
1. the electronic equipment can determine expired sectors and adjacent sectors to be expired from the target sectors, and further determine qualified sectors which can be renewed in the expired sectors; then obtaining a renewal period corresponding to each qualified sector and each provisional sector, and renewing each qualified sector and each provisional sector based on the corresponding renewal period, so that the expired sectors can be normally used, and meanwhile, the use time of the sectors to be expired can be prolonged, compared with renewing the sectors after expiration, the number of renewal times is reduced, the time and the energy required by a user are reduced, and the convenience of renewing the sectors is improved;
2. the renewal period of each to-be-processed sector is determined as the same first period, so that the expired sectors can expire in the same date later, and the convenience of subsequent batch sector management is improved; acquiring a designated period input by a user as a renewal period corresponding to each to-be-processed sector, so that the actual requirements of the user can be met;
3. the number of times of late renewal can be reduced, so that the current to-be-processed sector can be stably used for a long time; each to-be-processed period is continued through the shortest period, so that the current to-be-processed sectors can expire on the same date, and the convenience of batch sector management is further improved.
Drawings
FIG. 1 is a flow chart illustrating a sector management method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a sector management apparatus in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to figures 1-3.
A person skilled in the art, after reading the present description, may make modifications as required without inventive contribution to the present embodiments, but shall be protected by the patent laws within the scope of the claims of the present application.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In addition, the term "and/or" herein is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
An embodiment of the present application provides a sector management method, which is executed by an electronic device, and referring to fig. 1, the method includes steps S101 to S104, where:
step S101, an expired sector and a provisional sector are determined from the target sectors, wherein the provisional sector is an unexpired sector with a time length less than or equal to a first preset time length from an expiration date.
The sectors have an activation period and a maximum usage duration when the encapsulation is activated. The last day of the activation period, i.e., the expiration date; sectors that exceed the expiration date are expired sectors where the use of data in the sector is limited or unusable.
In the embodiment of the present application, the target sector may be a sector within a specified range of the user, or may be all sectors under the account of the user. Therefore, each time of the renewal needs to pack data uplink, so a certain Gas cost is needed, when the expired sector is determined, the temporary sector is determined at the same time, so that the occurrence of the situation that a plurality of renewals are needed is reduced, and the consumption of the Gas cost can also be reduced. The first preset time period is a positive integer, but for a specific value, the embodiment of the present application is not particularly limited, as long as it is convenient to screen out the sectors to be expired for renewal, so as to reduce the number of renewals.
Step S102, inquiring the renewal qualification of each expired sector to obtain all qualified sectors, wherein the qualified sectors are sectors with the renewal qualification.
In the embodiment of the present application, it can be determined, through querying, which of the expired sectors are qualified sectors qualified for renewal and which are sectors not qualified for renewal, and the renewal is performed on the qualified sectors.
Step S103, obtaining the renewal cycle corresponding to each to-be-processed sector, wherein the to-be-processed sectors comprise a temporary sector and a qualified sector.
In the embodiment of the present application, for each to-be-processed sector, its continuation period may be the same period, or may be different periods corresponding to each other. The renewal period should be a positive integer and greater than a predetermined threshold to reduce low value sector renewal; because the renewal cycle is shorter, the number of renewal times is increased, and more Gas cost is generated. For example, the preset threshold may be 50 days; if a sector has a maximum usage duration of 540 days, has been used for 500 days, and is currently in an expired state, then a time duration is agreed upon, and the time duration is only 40 days at the maximum, so that the duration period of the sector may be changed to 0, i.e., the sector may not be agreed upon. The specific value of the preset threshold is not limited in the embodiments of the present application.
And step S104, respectively carrying out renewal on each sector to be processed based on the renewal cycle respectively corresponding to each sector to be processed.
In the embodiment of the application, the renewal is performed based on the renewal period corresponding to each to-be-processed sector, so as to prolong the use duration of the unexpired sectors, and simultaneously enable the expired sectors to be used.
The electronic equipment can determine expired sectors and adjacent sectors to be expired from the target sectors, and further determine qualified sectors which can be renewed in the expired sectors; and then acquiring a renewal period corresponding to each qualified sector and each temporary sector, and renewing each qualified sector and each temporary sector based on the corresponding renewal period, so that the expired sectors can be normally used, and meanwhile, the use time of the sectors to be expired can be prolonged.
Further, in order to reduce the number of successive rounds and thus save the Gas cost, step S101 may further include steps S1011 (not shown) -S1016 (not shown), wherein:
step S1011, calling a mapping table corresponding to the target sector, wherein the mapping table comprises the expiration date of each target sector;
step S1012, look up mapping table to determine all expired sectors and unexpired sectors.
Specifically, the mapping table at least includes an expiration date corresponding to each target sector, and in order to determine the identity of each sector, each sector should be set with a unique number, and in the mapping table, the expiration date should be associated with the number of the corresponding sector. All expired sectors and all unexpired sectors are obtained through query by the current time and the expiration date of each target sector. Further, in order to improve the accuracy of the query result, the mapping table may further store the first activation time corresponding to each sector, the historical duration period information, and the maximum available duration of each sector. The expiration status of each sector can be verified based on the first activation date of each sector, as well as the historical renewal period and current date of each sector.
Step S1013, all pre-dated sectors are determined based on the expiration date and the first preset time length of each non-expired sector.
Specifically, the time to be expired corresponding to each unexpired sector is determined based on the current time and the expiration date of each unexpired sector, and if the time to be expired is less than a first preset time length, the time is a pre-provisional sector; however, whether the pre-temporary sector can be determined as a temporary sector that needs to be renewed requires a further determination in step S104.
Step S1014, judging whether the number of all the pre-temporary sectors is larger than a preset economic threshold value, wherein the economic threshold value is a positive integer;
step S1015, if yes, all the pre-temporary sectors are determined to be temporary sectors;
step S1016, if not, determining that the number of the temporary sectors is 0.
Specifically, if the number of the currently determined temporary sectors is small, because the temporary sectors are still in a usable state, it is not necessary to perform advance renewal, and therefore, the number of the temporary sectors is determined to be 0, and only the expired sectors need to be renewed; when a new temporary sector is generated later, the number of the temporary sectors is large, and the temporary sectors can be all subjected to renewal at one time so as to reduce the number of times of renewal. The specific number of economic thresholds is not specifically limited in this application, so long as it is convenient to reduce the number of renewals.
Further, before step S102, the sector management method further includes step SA1 (not shown in the figure) and step SA2 (not shown in the figure), wherein:
step SA1, inquiring the expiration time and the resumable time of each expired sector.
Specifically, in step S1011, the mapping table is already obtained, the expiration date of each expired sector is determined from the mapping table, and the expired duration is determined by combining the current time; and determining the date of the first activation encapsulation of the expired sector and the maximum use duration corresponding to the expired sector from the mapping table, and further determining the resumable duration of the expired sector.
Step SA12, determining a renewal qualification of each sector based on the expiration time length of each expired sector and the resumable time length, wherein the expiration time length of the sectors with the renewal qualification does not exceed the preset default time length, and the difference between the renewal time length and the expiration time length is not less than the preset second preset time length.
Specifically, a default duration for an expired sector, i.e., an expiration time that does not exceed the default duration, may be used again. For an expired sector, the expired sector is qualified for renewal by screening expired sectors having expired durations less than or equal to the buffer period and then determining that their duration of renewal is positive.
Further, in step S103, four ways including a way one, a way two, a way three, and a way four are obtained for the continuation cycle, wherein:
and in the first mode, the preset first period is obtained as the continuation period corresponding to each to-be-processed sector.
Specifically, the first period is a preset positive integer, that is, for each sector to be processed, the continuation period for which it will continue is the same. On the one hand, the method can meet the special requirements of users, and simultaneously can simplify the renewal step.
And secondly, acquiring a renewal period corresponding to each to-be-processed sector in the designated period input by the user.
Specifically, the user can set conditions to determine different formulation periods for different sectors to be processed, so that the actual requirements of the user can be further met. Meanwhile, the same renewal cycle is used, so that the current expired sectors can expire on the same date next time, the expiration of different sector intervals is reduced, and the unified management of the batch sectors is more convenient.
When the user inputs the appointed period, the second execution mode is prioritized; if the user does not input the designated period under the condition that the mode three or the mode four is not triggered, the mode one is preferentially executed.
Further, if the first cycle in the first mode is not acquired and the specified cycle in the second mode is not acquired, the third mode or the fourth mode is executed.
And thirdly, acquiring the resumable time duration corresponding to each to-be-processed sector as the resumable period corresponding to each to-be-processed sector.
Specifically, after the mapping table has been obtained, the maximum usage duration corresponding to each to-be-processed sector can be obtained from the mapping table, and the maximum duration of continuation corresponding to each to-be-processed sector, that is, the duration of continuation, can be obtained by combining the current time and the first activation encapsulation date of each sector. And carrying out the continuation by the corresponding sustainable duration of each to-be-processed sector, so that the number of times of late-stage continuation can be reduced, and the current to-be-processed sector can be stably used for a longer time.
And fourthly, acquiring the shortest period as the duration period of each to-be-processed sector, wherein the shortest period is the shortest duration in the duration periods respectively corresponding to the to-be-processed sectors.
Specifically, the first method can only enable the sectors which are expired currently to expire at the same date in the later period; and by determining the shortest period of the sustainable duration in each sector to be processed and carrying out the sustainable duration on each sector to be processed through the shortest period, the sectors to be processed can expire on the same date, and the convenience of batch sector management is further improved.
Further, step S104 may include step SB1 (not shown in the figure) -step SB3 (not shown in the figure), in which:
step SB1, obtaining version types corresponding to any sectors to be processed;
step SB2, obtaining a corresponding renewal instruction based on the version type corresponding to any sector to be processed;
and step SB3, continuing the contract for any sector to be processed based on the contract order and the contract continuation period corresponding to the sector to be processed.
Specifically, different versions correspond to different sectors with different succession parameters and requirements. For example, for sector continuation of V1 version, the instruction setup-miner sectors extend is needed; the command setup-miner sectors renew is required for sector continuation of the V1-1 version. After the version of the sector is determined, the corresponding instruction is selected to continue the corresponding continuation period for the corresponding to-be-processed sector.
Further, when proceeding with the continuation of the sectors to be processed, the expired sectors and the temporary sectors may be separately continued, that is, step SB3 may include steps SB31 and SB32, in which:
step SB31, any expired sector is subject to real-time renewal based on the renewal command and the renewal period corresponding to the expired sector.
In particular, for expired sectors, real-time renewal enables the expired sectors to be returned to service sooner.
Step SB32, before the reservation date, a reservation is made to any temporary sector based on the renewal instruction and the renewal period corresponding to any temporary sector, and the reservation date is the earliest expiration date corresponding to all temporary sectors.
Specifically, when the provisional sector is subjected to the renewal, the immediate renewal may not be performed. The method comprises the steps of firstly determining the expiration date corresponding to each temporary sector needing to be renewed, then determining the earliest expiration date as the date when all temporary sectors needing to be renewed start to be renewed, namely, renewing when all temporary sectors are to be changed into the expiration sectors, and possibly returning new adjacent sectors to be generated between the current time and the reservation date, so that the newly generated temporary dates can be renewed together on the renewal date, further the number of times of renewal can be reduced, meanwhile, more sectors can be renewed to expire on the same date, and the convenience of batch sector management is improved.
The foregoing embodiments describe a sector management method from the perspective of method flow, and the following embodiments describe a sector management apparatus from the perspective of virtual modules or virtual units, for details, see the following embodiments.
An embodiment of the present application provides a sector management apparatus, as shown in fig. 2, the sector management apparatus 200 may specifically include a determining module 201, a first querying module 202, a renewal cycle acquiring module 203, and a renewal module 204, where:
a determining module 201, configured to determine an expired sector and a provisional sector from the target sectors, where the provisional sector is an unexpired sector that is less than or equal to a first preset time period from an expiration date;
a first query module 202, configured to query a continuation qualification of each expired sector to obtain all qualified sectors, where a qualified sector is a sector with a continuation qualification;
a renewal cycle acquiring module 203, configured to acquire a renewal cycle corresponding to each to-be-processed sector, where the to-be-processed sectors include a temporary sector and a qualified sector;
the continuation module 204 is configured to continue each of the sectors to be processed based on the continuation periods respectively corresponding to the sectors to be processed.
By adopting the technical scheme, the method has the advantages that,
in a possible implementation manner, when the determining module 201 determines the expired sector and the provisional sector from the target sectors, it is specifically configured to:
calling a mapping table corresponding to the target sectors, wherein the mapping table comprises the expiration date of each target sector;
querying a mapping table to determine all expired sectors and unexpired sectors;
determining all pre-dated sectors based on the expiration date and a first preset time duration of each non-expired sector;
judging whether the number of all the pre-temporary sectors is greater than a preset economic threshold value, wherein the economic threshold value is a positive integer;
if yes, determining all the pre-temporary sectors as temporary sectors;
if not, determining the number of the temporary sectors to be 0.
In a possible implementation manner, the sector management apparatus 200 further includes:
the second query module is used for querying the expiration time and the sustainable time of each expired sector;
and a continuation qualification determining module, configured to determine a continuation qualification of each sector based on the expiration duration and the resumable duration of each expired sector, wherein the expiration duration of a renewal qualified sector does not exceed a preset default duration, and the difference between the resumable duration and the expiration duration is not less than a preset second preset duration.
In a possible implementation manner, when the continuation period acquiring module 203 acquires the continuation periods corresponding to the sectors to be processed, it is specifically configured to:
acquiring a preset first period as a continuation period corresponding to each to-be-processed sector; or
And acquiring the renewal period corresponding to each sector to be processed in the designated period input by the user.
In a possible implementation manner, the sector management apparatus 200 further includes:
the first obtaining module is used for obtaining the renewable duration corresponding to each to-be-processed sector as the renew period corresponding to each to-be-processed sector; or
And the second acquisition module is used for acquiring the shortest period as the continuation period of each to-be-processed sector, wherein the shortest period is the shortest duration in the sustainable durations respectively corresponding to the to-be-processed sectors.
In a possible implementation manner, when the continuation module 204 performs continuation on each to-be-processed sector based on the continuation cycle respectively corresponding to each to-be-processed sector, for any to-be-processed sector, specifically:
acquiring a version type corresponding to any sector to be processed;
acquiring a corresponding continuation instruction based on the version type corresponding to any sector to be processed;
and carrying out reservation on any sector to be processed based on the reservation instruction and the reservation period corresponding to the sector to be processed.
In one possible implementation manner, when the reservation module 204 performs a reservation on any pending sector based on a reservation instruction and a reservation period corresponding to the pending sector, the method is specifically configured to:
carrying out real-time renewal on any expired sector based on a renewal command and a renewal period corresponding to the expired sector;
and before the reservation date, carrying out the renewal on any temporary sector based on the renewal instruction and the renewal period corresponding to any temporary sector, wherein the reservation date is the earliest expiration date corresponding to all temporary sectors.
In an embodiment of the present application, an electronic device is provided, as shown in fig. 3, where the electronic device 300 shown in fig. 3 includes: a processor 301 and a memory 303. Wherein processor 301 is coupled to memory 303, such as via bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that the transceiver 304 is not limited to one in practical applications, and the structure of the electronic device 300 is not limited to the embodiment of the present application.
The Processor 301 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 301 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
The Memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 303 is used for storing application program codes for executing the scheme of the application, and the processor 301 controls the execution. The processor 301 is configured to execute application program code stored in the memory 303 to implement the aspects illustrated in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. But also a server, etc. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.
Claims (8)
1. A method for sector management, comprising:
determining an expired sector and a provisional sector from target sectors, wherein the provisional sector is an unexpired sector with an expiration date less than or equal to a first preset time length;
inquiring the renewal qualification of each expired sector to obtain all qualified sectors, wherein the qualified sectors are sectors with the renewal qualification;
obtaining a continuation period corresponding to each to-be-processed sector, wherein the to-be-processed sectors comprise temporary sectors and qualified sectors;
respectively carrying out continuation on each sector to be processed based on a continuation period respectively corresponding to each sector to be processed;
the determining an expired sector and a provisional sector from the target sectors includes:
calling a mapping table corresponding to the target sectors, wherein the mapping table comprises the expiration date of each target sector;
querying a mapping table to determine all expired sectors and unexpired sectors;
determining all pre-dated sectors based on the expiration date and a first preset time duration of each non-expired sector;
judging whether the number of all the pre-temporary sectors is greater than a preset economic threshold value, wherein the economic threshold value is a positive integer;
if yes, determining all the pre-temporary sectors as temporary sectors;
if not, determining that the number of the temporary sectors is 0;
the obtaining of the continuation period corresponding to each to-be-processed sector includes determining whether the continuation period is greater than or equal to a preset threshold, where the preset threshold is not less than 0, and the continuation period is a positive integer; if the continuation period is less than a preset threshold value, modifying the continuation period to be 0;
determining all pre-dated sectors based on the expiration date and the first preset duration of each non-expired sector, including: determining the time to be expired corresponding to each unexpired sector based on the current time and the expiration date of each unexpired sector, and if the time to be expired is less than a first preset time length, determining the sector to be pre-expired;
before querying for renewal eligibility of each of the expired sectors, further comprising:
querying an expiration time and a resumable time for each of the expired sectors;
and determining the renewal qualification of each sector based on the expiration time length and the resumable time length of each expired sector, wherein the expiration time length of the sectors with the renewal qualification does not exceed the preset default time length, and the difference between the resumable time length and the expiration time length is not less than a preset second preset time length.
2. The method according to claim 1, wherein the obtaining the renewal cycle corresponding to each of the sectors to be processed comprises:
acquiring a preset first period as a continuation period corresponding to each to-be-processed sector; or
And acquiring the renewal period corresponding to each sector to be processed in the designated period input by the user.
3. The method according to claim 2, wherein if the first cycle and the designated cycle are not acquired, further comprising:
acquiring the resumable duration corresponding to each to-be-processed sector as the resumable period corresponding to each to-be-processed sector; or
And acquiring a shortest period which is the duration period of each to-be-processed sector, wherein the shortest period is the shortest duration in the available duration periods respectively corresponding to each to-be-processed sector.
4. A sector management method according to any one of claims 1 to 3, wherein said respectively proceeding continuation for each of the sectors to be processed based on the continuation cycle respectively corresponding to each of the sectors to be processed comprises, for any one of the sectors to be processed:
acquiring a version type corresponding to any sector to be processed;
acquiring a corresponding continuation instruction based on the version type corresponding to any sector to be processed;
and carrying out reservation on any sector to be processed based on the reservation instruction and the reservation period corresponding to the sector to be processed.
5. The method of claim 4, wherein the reserving any pending sector based on the renewal command and the renewal cycle corresponding to the pending sector comprises:
carrying out real-time renewal on any expired sector based on a renewal command and a renewal period corresponding to the expired sector;
and before a reservation date, carrying out reservation on any temporary sector based on a reservation instruction and a reservation period corresponding to any temporary sector, wherein the reservation date is the earliest expiration date corresponding to all temporary sectors.
6. A sector management apparatus, comprising:
the system comprises a determining module, a determining module and a judging module, wherein the determining module is used for determining an expired sector and a provisional sector from target sectors, and the provisional sector is an unexpired sector with the time length less than or equal to a first preset time length from an expiration date;
the first inquiry module is used for inquiring the renewal qualification of each expired sector to obtain all qualified sectors, and the qualified sectors are sectors with the renewal qualification;
a continuation period obtaining module, configured to obtain a continuation period corresponding to each to-be-processed sector, where the to-be-processed sectors include a temporary sector and a qualified sector;
the appointment continuation module is used for respectively carrying out appointment continuation on each sector to be processed based on the appointment continuation period respectively corresponding to each sector to be processed;
when the determining module determines the expired sector and the provisional sector from the target sectors, the determining module is specifically configured to:
calling a mapping table corresponding to the target sectors, wherein the mapping table comprises the expiration date of each target sector;
querying a mapping table to determine all expired sectors and unexpired sectors;
determining all pre-dated sectors based on the expiration date and a first preset time duration of each non-expired sector;
judging whether the number of all the pre-temporary sectors is greater than a preset economic threshold value, wherein the economic threshold value is a positive integer;
if yes, determining all the pre-temporary sectors as temporary sectors;
if not, determining that the number of the temporary sectors is 0;
the determining module, when determining all the pre-dated sectors based on the expiration date and the first preset duration of each non-expired sector, is specifically configured to: determining the time to be expired corresponding to each unexpired sector based on the current time and the expiration date of each unexpired sector, and if the time to be expired is less than a first preset time length, determining the sector to be pre-expired;
the device also includes:
a second query module, configured to query an expiration duration and a resumable duration of each of the expired sectors;
and the renewal qualification determining module is used for determining the renewal qualification of each sector based on the expiration time length and the resumable time length of each expired sector, wherein the expiration time length of the renewal qualified sector does not exceed the preset default time length, and the difference between the resumable time length and the expiration time length is not less than the preset second preset time length.
7. An electronic device, comprising:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: performing the sector management method of any one of claims 1-5.
8. A computer-readable storage medium, comprising: a computer program which can be loaded by a processor and which performs the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211454252.2A CN115509465B (en) | 2022-11-21 | 2022-11-21 | Sector management method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211454252.2A CN115509465B (en) | 2022-11-21 | 2022-11-21 | Sector management method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115509465A CN115509465A (en) | 2022-12-23 |
CN115509465B true CN115509465B (en) | 2023-03-28 |
Family
ID=84513891
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211454252.2A Active CN115509465B (en) | 2022-11-21 | 2022-11-21 | Sector management method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115509465B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124294A (en) * | 2019-12-11 | 2020-05-08 | 大唐微电子技术有限公司 | Sector mapping information management method and device, storage medium and equipment |
CN113672415A (en) * | 2021-07-09 | 2021-11-19 | 济南浪潮数据技术有限公司 | Disk fault processing method, device, equipment and storage medium |
CN114035741A (en) * | 2021-09-27 | 2022-02-11 | 北京航天时代激光导航技术有限责任公司 | Data storage method, device, equipment and medium for FLASH life optimization |
CN114153392A (en) * | 2021-11-29 | 2022-03-08 | 浙江大华技术股份有限公司 | Object storage data storage management method, device and equipment |
CN114968121A (en) * | 2022-06-06 | 2022-08-30 | 北京万里红科技有限公司 | Method and device for reading data in storage medium, electronic equipment and medium |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3958776B2 (en) * | 2003-09-05 | 2007-08-15 | 富士通株式会社 | Magneto-optical disk apparatus and data writing method for magneto-optical disk |
JP4377349B2 (en) * | 2005-03-22 | 2009-12-02 | 富士通株式会社 | Magnetic disk device, magnetic disk device performance adjustment method, and magnetic disk access method |
KR101792868B1 (en) * | 2010-11-25 | 2017-11-02 | 삼성전자주식회사 | Flash memory device and reading method thereof |
FR2977047B1 (en) * | 2011-06-22 | 2013-08-16 | Starchip | METHOD FOR MANAGING ENDURANCE OF NONVOLATILE MEMORIES |
US8917464B2 (en) * | 2013-01-03 | 2014-12-23 | International Business Machines Corporation | Utilization of disk buffer for background replication processes |
CN104268040B (en) * | 2014-09-16 | 2016-04-06 | 深圳市腾讯计算机***有限公司 | A kind of disk performance detection method and device |
US10445001B2 (en) * | 2017-01-10 | 2019-10-15 | Winbond Electronics Corporation | Memory control scheme for flash memory devices |
CN108234483B (en) * | 2017-12-29 | 2021-09-28 | 五八有限公司 | User login contract continuing method, device, terminal and storage medium |
CN114223189B (en) * | 2019-10-08 | 2024-06-04 | 深圳市欢太科技有限公司 | Time length statistics method, device, electronic equipment and computer readable medium |
CN111400298A (en) * | 2020-04-17 | 2020-07-10 | Oppo广东移动通信有限公司 | Data processing method and device and computer readable storage medium |
CN113778977A (en) * | 2020-10-29 | 2021-12-10 | 北京京东尚科信息技术有限公司 | Data processing method and data processing device |
CN112817527B (en) * | 2021-01-21 | 2024-06-04 | 深圳市显控科技股份有限公司 | Power-down data storage method, singlechip and computer-readable storage medium |
CN112948287B (en) * | 2021-03-29 | 2023-06-20 | 成都新易盛通信技术股份有限公司 | SD card read-write method and system based on Hashmap caching mechanism |
CN115017236B (en) * | 2022-07-04 | 2023-03-21 | 北京百度网讯科技有限公司 | Data processing method, device and equipment based on block chain and storage medium |
-
2022
- 2022-11-21 CN CN202211454252.2A patent/CN115509465B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124294A (en) * | 2019-12-11 | 2020-05-08 | 大唐微电子技术有限公司 | Sector mapping information management method and device, storage medium and equipment |
CN113672415A (en) * | 2021-07-09 | 2021-11-19 | 济南浪潮数据技术有限公司 | Disk fault processing method, device, equipment and storage medium |
CN114035741A (en) * | 2021-09-27 | 2022-02-11 | 北京航天时代激光导航技术有限责任公司 | Data storage method, device, equipment and medium for FLASH life optimization |
CN114153392A (en) * | 2021-11-29 | 2022-03-08 | 浙江大华技术股份有限公司 | Object storage data storage management method, device and equipment |
CN114968121A (en) * | 2022-06-06 | 2022-08-30 | 北京万里红科技有限公司 | Method and device for reading data in storage medium, electronic equipment and medium |
Non-Patent Citations (4)
Title |
---|
Buğra Gedik等.Disk-Based Management of Interaction Graphs.《 IEEE Transactions on Knowledge and Data Engineering》.2014,第2689 - 2702页. * |
李为 ; 刘嘉勇 ; .一种基于分区引导扇区控制的移动存储介质安全控制方法.成都信息工程学院学报.2007,(01),全文. * |
詹磊,***,潘清.实时磁盘调度算法研究.海军工程大学学报.2004,(05),全文. * |
郑嘉琦.保存硬盘主引导扇区数据一法.电子与电脑.1995,(11),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN115509465A (en) | 2022-12-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8825617B2 (en) | Limiting deduplication based on predetermined criteria | |
KR101752042B1 (en) | Allocation of alias registers in a pipelined schedule | |
US9569381B2 (en) | Scheduler for memory | |
US20080140691A1 (en) | Method, Device and Computer Program Product for Optimizing File Placement in a Storage System | |
US9081658B2 (en) | Storage device and data management method thereof | |
CN112882663B (en) | Random writing method, electronic equipment and storage medium | |
CN113625973B (en) | Data writing method, device, electronic equipment and computer readable storage medium | |
CN114036078A (en) | Method and system for managing cache devices in a storage system | |
US12001880B2 (en) | Multi-core system and method of controlling operation of the same | |
TWI728357B (en) | Method and device for generating serial number | |
US20140115600A1 (en) | Submitting operations to a shared resource based on busy-to-success ratios | |
CN113312182B (en) | Cloud computing node, file processing method and device | |
CN115509465B (en) | Sector management method and device, electronic equipment and storage medium | |
CN101799832A (en) | Method for rapidly writing mass data into database once | |
US8555005B2 (en) | Memory managing apparatus and method using a pointer indicator bit to perform garbage collection | |
CN101441608A (en) | Multi-source access control device and method of register | |
CN112882847B (en) | Barrage message processing method, device and system | |
CN106991058B (en) | Method and device for processing pre-fetched files | |
US11099739B2 (en) | System and method for accessing redundant array of independent disks | |
Elphinstone | Virtual Memory in a 64-bit Microkernel | |
CN113031908B (en) | Ordered data processing method and computing device | |
WO2021244212A1 (en) | Method and system for dynamically assigning cpu resources to one or more applications | |
EP4180939A1 (en) | Storage device and method performing processing operation requested by host | |
CN114912990A (en) | Data processing method and device | |
CN115695432A (en) | Load balancing method and device, electronic equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A sector management method, device, electronic device, and storage medium Effective date of registration: 20231108 Granted publication date: 20230328 Pledgee: Guotou Taikang Trust Co.,Ltd. Pledgor: Hangzhou Fangzhou Technology Co.,Ltd. Registration number: Y2023980064456 |