CN117742447A - Clock self-adaptive adjustment method and controller - Google Patents

Clock self-adaptive adjustment method and controller Download PDF

Info

Publication number
CN117742447A
CN117742447A CN202410190970.6A CN202410190970A CN117742447A CN 117742447 A CN117742447 A CN 117742447A CN 202410190970 A CN202410190970 A CN 202410190970A CN 117742447 A CN117742447 A CN 117742447A
Authority
CN
China
Prior art keywords
clock
controller
storage medium
target
minimum
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.)
Granted
Application number
CN202410190970.6A
Other languages
Chinese (zh)
Other versions
CN117742447B (en
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.)
Shanghai Yunpan Semiconductor Co ltd
Nanjing Yuncheng Semiconductor Co ltd
Original Assignee
Shanghai Yunpan Semiconductor Co ltd
Nanjing Yuncheng Semiconductor Co ltd
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 Shanghai Yunpan Semiconductor Co ltd, Nanjing Yuncheng Semiconductor Co ltd filed Critical Shanghai Yunpan Semiconductor Co ltd
Priority to CN202410190970.6A priority Critical patent/CN117742447B/en
Publication of CN117742447A publication Critical patent/CN117742447A/en
Application granted granted Critical
Publication of CN117742447B publication Critical patent/CN117742447B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application relates to the field of controllers, and provides a clock self-adaptive adjustment method and a controller, wherein the method and the controller acquire starting configuration parameters of the controller; determining a controller target clock and a storage medium target clock according to a controller reference maximum clock, a storage medium reference maximum clock, a controller reference minimum clock, a storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock; the controller target clock and the storage medium target clock are stored in the storage medium, and the first identifier and the second identifier are modified, so that when the first identifier indicates that the controller clock does not carry out self-adaptive adjustment and the second identifier indicates that the storage medium clock does not carry out self-adaptive adjustment, the controller finishes starting according to the controller target clock and the storage medium target clock, and different controller target clocks and different storage target clocks exist for working environments under different conditions, and the flexibility of the starting speed of the controller and the robustness of the controller can be improved.

Description

Clock self-adaptive adjustment method and controller
Technical Field
The embodiment of the application relates to the field of controllers, in particular to a clock self-adaptive adjustment method and a controller.
Background
Most of the devices are provided with controllers for controlling the working states of the devices, the controllers comprise storage media, and fixed clocks of the controllers and the fixed clocks of the storage media are generally set in the storage media, so that the controllers and the storage media work according to corresponding fixed working frequencies.
In the prior art, the fixed clock of the controller and the fixed clock of the storage medium are set in the storage medium, so that the starting speed of the controller is not adjustable, fixed and not changeable, the flexibility is poor, and the operation environment under different conditions cannot be adapted.
Disclosure of Invention
The embodiment of the application aims to provide a clock self-adaptive adjustment method, so that the starting speed of a controller can be adjusted according to the environment, and the flexibility of the starting speed of the controller is improved.
In order to solve the above technical problems, an embodiment of the present application provides a clock adaptive adjustment method, including:
acquiring controller starting configuration parameters in a storage medium connected with a controller; the controller startup configuration parameters include: a controller reference maximum clock, a storage medium reference maximum clock, a controller reference minimum clock, a storage medium reference minimum clock, a first identifier and a second identifier; the first identifier is used for indicating whether the controller clock is adaptively adjusted, and the second identifier is used for indicating whether the storage medium clock is adaptively adjusted;
If the first identifier indicates controller clock self-adaptive adjustment and the second identifier indicates storage medium clock self-adaptive adjustment, determining a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock;
and storing the controller target clock and the storage medium target clock into a storage medium, and modifying the first identifier and the second identifier so that when the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock does not perform adaptive adjustment, the controller completes starting according to the controller target clock and the storage medium target clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock, and comprises the following steps:
And if the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock, and comprises the following steps:
taking the controller reference maximum clock as a controller current clock, and taking the storage medium reference maximum clock as a storage medium current clock;
performing read operation verification on a preset standard file by adopting the current clock of the controller and the current clock of the storage medium, and judging whether the read operation verification is successful or not; if the read operation verification fails, sequentially reducing the current clock of the controller and the current clock of the storage medium until the read operation verification of the preset standard file by the current clock of the controller and the current clock of the storage medium is successful, wherein the current clock of the controller is greater than or equal to the reference minimum clock of the controller, and the current clock of the storage medium is greater than or equal to the reference minimum clock of the storage medium;
If the last reduced clock of the current clock of the controller and the current clock of the storage medium is the current clock of the controller, determining the target clock of the controller according to the current clock of the controller, the last clock before the current clock of the controller is reduced and the current clock of the storage medium;
and determining the target clock of the storage medium according to the current clock of the storage medium, the last clock before the current clock of the storage medium is reduced and the target clock of the controller.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines the controller target clock according to the current clock of the controller, the last clock before the current clock of the controller is reduced and the current clock of the storage medium, and comprises the following steps:
determining a controller intermediate clock according to the current clock of the controller and the last clock before the current clock of the controller is reduced;
if the read operation verification of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium is successful, determining the target clock of the controller according to the controller intermediate clock, the last clock before the current clock of the controller is reduced and the current clock of the storage medium;
If the read operation check of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium fails, determining the target clock of the controller according to the controller intermediate clock, the current clock of the controller and the current clock of the storage medium.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines a storage medium target clock according to the current clock of the storage medium, the last clock before the current clock of the storage medium is reduced and the controller target clock, and comprises the following steps:
determining a storage medium intermediate clock according to the current clock of the storage medium and the last clock before the current clock of the storage medium is reduced;
if the read operation verification of the preset standard file by adopting the storage medium intermediate clock and the controller target clock is successful, determining the storage medium target clock according to the storage medium intermediate clock, the last clock before the current clock of the storage medium is reduced and the controller target clock;
if the read operation check of the preset standard file by adopting the storage medium intermediate clock and the controller target clock fails, determining the storage medium target clock according to the storage medium intermediate clock, the storage medium current clock and the controller target clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock, and comprises the following steps:
if the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is less than or equal to the preset storage medium minimum clock, judging the validity of the controller target clock according to the controller reference maximum clock and the controller reference minimum clock;
if the controller target clock is valid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the controller reference maximum clock;
and if the controller target clock is invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the preset controller minimum clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock, and comprises the following steps:
if the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is larger than the preset storage medium minimum clock, judging the validity of the storage medium target clock according to the storage medium reference maximum clock and the storage medium reference minimum clock;
if the storage medium target clock is valid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the controller reference maximum clock;
and if the storage medium target clock is invalid, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which determines a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock, and comprises the following steps:
if the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is greater than the preset storage medium minimum clock, judging the validity of the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock;
if the controller target clock and the storage medium target clock are invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference minimum clock, the preset storage medium minimum clock, the controller reference minimum clock and the preset controller minimum clock;
If the controller target clock is valid, the storage medium target clock is invalid, and the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock;
if the controller target clock is invalid, the storage medium target clock is valid, and the controller target clock and the storage medium target clock are determined according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the preset controller minimum clock;
and if the controller target clock and the storage medium target clock are valid, determining the controller target clock and the storage medium target clock according to the controller reference minimum clock, the controller reference maximum clock, the storage medium reference minimum clock and the storage medium reference maximum clock.
The embodiment of the application also provides a clock self-adaptive adjustment method, which further comprises the following steps:
if the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock does not perform adaptive adjustment, determining that the preset controller minimum clock is the controller target clock and determining that the preset storage medium minimum clock is the storage medium target clock;
If the first identifier indicates that the controller clock is adaptively adjusted and the second identifier indicates that the storage medium clock is not adaptively adjusted, the preset storage medium minimum clock is used as the storage medium target clock; determining the controller target clock according to the controller reference minimum clock, the controller reference maximum clock, a preset controller minimum clock and the storage medium target clock;
and if the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock performs adaptive adjustment, taking the preset minimum controller clock as the target controller clock, and determining the target storage medium clock according to the minimum storage medium reference clock, the maximum storage medium reference clock, the minimum preset storage medium clock and the target controller clock.
The embodiment of the application also provides a controller, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the clock adaptation method described above.
The application provides a clock self-adaptive adjustment method and a controller, wherein the controller obtains controller starting configuration parameters, and the configuration parameters comprise: a controller reference maximum clock, a storage medium reference maximum clock, a controller reference minimum clock, a storage medium reference minimum clock, a first identifier and a second identifier; the first identifier is used for indicating whether the controller clock is adaptively adjusted, and the second identifier is used for indicating whether the storage medium clock is adaptively adjusted; if the first identifier indicates the controller clock to adaptively adjust and the second identifier indicates the storage medium clock to adaptively adjust, determining a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock and the preset storage medium minimum clock; the controller target clock and the storage medium target clock are stored in the storage medium, the first identifier and the second identifier are modified, so that when the first identifier indicates that the controller clock does not carry out self-adaptive adjustment and the second identifier indicates that the storage medium clock does not carry out self-adaptive adjustment, the controller finishes starting according to the controller target clock and the storage medium target clock.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings.
Fig. 1 is a flowchart of a first clock adaptive adjustment method according to an embodiment of the present application;
FIG. 2 is a flowchart of a second clock adaptation method according to an embodiment of the present application;
FIG. 3 is a flowchart of a third clock adaptation method according to an embodiment of the present application;
FIG. 4 is a flowchart of a fourth clock adaptation method according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of a fifth clock adaptation method according to an embodiment of the present application;
FIG. 6 is a flowchart of a sixth clock adaptation method according to an embodiment of the present application;
FIG. 7 is a flowchart of a seventh clock adaptation method according to an embodiment of the present disclosure;
FIG. 8 is a flowchart of an eighth clock adaptation method provided by an embodiment of the present application;
FIG. 9 is a flowchart of a ninth clock adaptation method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a controller according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, as will be appreciated by those of ordinary skill in the art, in the various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. However, the technical solutions claimed in the present application can be implemented without these technical details and with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not be construed as limiting the specific implementation of the present application, and the embodiments may be mutually combined and referred to without contradiction.
In order to solve the technical problem of clock fixing in the prior art, an embodiment of the present application relates to a clock adaptive adjustment method, which is applied to fig. 1, and specifically includes the following steps.
Step 101, acquiring a controller starting configuration parameter in a storage medium connected with a controller.
After the controller is powered on, the system initialization flow is completed, including initialization of a processor, a clock, a storage medium and the like, after the initialization, the controller loads a configuration file in the storage medium connected with the controller, analyzes the controller starting configuration parameters, and the controller starting configuration parameters comprise: the controller refers to the maximum clock, the storage medium refers to the maximum clock, the first identifier and the second identifier, wherein the first identifier is used for indicating whether the controller clock is adaptively adjusted, the second identifier is used for indicating whether the storage medium clock is adaptively adjusted, namely, the first identifier and the second identifier are used for judging whether the controller needs to carry out clock adaptive adjustment.
The controller firstly takes a preset minimum controller clock and a preset minimum storage medium clock which are preset in a nonvolatile power-down register as working clocks to acquire and obtain a configuration file in a storage medium, wherein a controller reference maximum clock, a storage medium reference maximum clock, a first identifier and a second identifier in the configuration file can be manually set by a user. Specifically, the user can input the changed controller starting configuration parameters through the man-machine interaction interface so as to update the controller starting configuration parameters in the storage medium.
In an example implementation, the trigger condition for performing the clock adaptive adjustment method (to obtain the configuration parameter in the storage medium connected to the controller) may be a trigger condition input by the user through the man-machine interaction interface, and of course, other trigger conditions may also be used, such as a preset controller start time interval, etc., which is not limited in this embodiment of the present application.
Step 102, if the first identifier indicates the controller clock adaptive adjustment and the second identifier indicates the storage medium clock adaptive adjustment, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock, and the preset storage medium minimum clock.
The controller clock and the storage medium clock represent the working frequencies thereof, the higher the working frequency is, the higher the starting rate of the controller is, and the smaller the time spent for starting the controller is, therefore, the final controller target clock and storage medium target clock can be determined according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock and the preset storage medium minimum clock, and the controller target clock and the storage medium target clock are as large as possible in the working range, so that the starting time of the controller is shortened.
The controller minimum clock and the storage medium minimum clock are the minimum clock of the controller work and the minimum clock of the storage medium work stored in the nonvolatile power-down register in the controller, and the controller and the storage medium can work normally by the aid of the controller minimum clock and the storage medium.
The ranges of the controller reference maximum clock, the controller reference minimum clock, and the preset controller minimum clock may be ranges in which the controller target clock is located, and the ranges of the storage medium reference maximum clock, the storage medium reference minimum clock, and the preset storage medium minimum clock may be ranges in which the storage medium target clock is located.
Step 103, storing the controller target clock and the storage medium target clock in the storage medium, and modifying the first identifier and the second identifier.
The controller target clock and the storage medium target clock are written into the storage medium for storage, so that the controller can be directly extracted and used when restarting, or the working clock is modified into the controller target clock and the storage medium target clock in the process of starting the controller.
And when the first mark is 1, the controller clock self-adaptive adjustment is indicated, and when the second mark is 1, the storage medium clock self-adaptive adjustment is indicated. When the target controller clock and the target storage medium clock are obtained, the first identifier and the second identifier are modified to be 0, so that the controller can finish starting directly according to the controller target clock and the storage medium target clock. In an example embodiment, if the first identifier and the second identifier read by the controller next time are both 0, the controller is directly started by using the stored target controller clock and the target storage medium clock and the controller is started.
In an example embodiment, if the controller target clock and the storage medium target clock have been obtained, the user may reset the values of the first identifier and the second identifier through the human-computer interaction interface, for example, if the user finds that the working environment changes, the user may reset the values of the first identifier and the second identifier to 1 through the human-computer interaction interface, at this time, even if the controller target clock and the storage medium target clock already exist, the controller is still forced to enter the clock adaptive adjustment method, and the latest controller target clock and the storage medium target clock are determined again, so that the latest controller target clock and the storage medium target clock adapt to the latest working environment, and the robustness of the controller is improved.
According to the method, through self-adaptive adjustment of the controller clock and the storage medium clock, different controller target clocks and different memory target clocks exist for working environments under different conditions, the flexibility of the starting speed of the controller and the robustness of the controller can be improved, and the method is suitable for use scenes of the controller externally connected with the storage medium, so that the controller can start a system externally connected with the storage medium.
Based on the clock adaptive adjustment method shown in fig. 1, the embodiment of the present application further provides another clock adaptive adjustment method, and step 102 of determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock, and the preset storage medium minimum clock specifically includes the following steps.
And if the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock, determining a controller target clock and a storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock.
If the controller reference minimum clock is smaller than or equal to the preset controller minimum clock, a clock is necessarily existed between the controller reference minimum clock and the controller reference maximum clock, so that the controller can work normally; similarly, when the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock, it is stated that a clock must exist between the storage medium reference minimum clock and the storage medium reference maximum clock, so that the storage medium can work normally, and therefore, the controller target clock can be selected from the controller reference maximum clock and the controller reference minimum clock, and the storage medium target clock can be selected from the storage medium reference maximum clock and the storage medium reference minimum clock.
The embodiment of the application realizes the determination of the controller target clock and the storage medium target clock under the condition that the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock.
On the basis of the clock adaptive adjustment method shown in the above embodiment, the embodiment of the present application further provides another clock adaptive adjustment method, as shown in fig. 2, where the steps described above specifically include the following steps according to a controller reference maximum clock, a controller reference minimum clock, a storage medium reference maximum clock, and a storage medium reference minimum clock.
Step 201, taking the controller reference maximum clock as the current clock of the controller and the storage medium reference maximum clock as the current clock of the storage medium.
In the embodiment of the application, the controller and the storage medium can work by gradually reducing the controller reference maximum clock and the storage medium reference maximum clock to finally determine a larger controller target clock and a larger storage medium target clock.
Step 202, performing read operation verification on a preset standard file by adopting a current clock of a controller and a current clock of a storage medium, and judging whether the read operation verification is successful or not; if the read operation check fails, sequentially reducing the current clock of the controller and the current clock of the storage medium until the read operation check of the current clock of the controller and the current clock of the storage medium on the preset standard file is successful, wherein the current clock of the controller is greater than or equal to the reference minimum clock of the controller, and the current clock of the storage medium is greater than or equal to the reference minimum clock of the storage medium.
The preset standard file may be a Manifest file in a storage medium, and of course, may also be other standard files, which is not specifically limited in the embodiments of the present application.
The controller current clock and the storage medium current clock are adopted to carry out read operation verification on the preset standard file, and the controller can be understood to carry out read operation verification on the preset standard file by adopting the controller current clock and the storage medium current clock under the working environment.
Whether the read operation check is successful or not can be understood as that the controller adopts the current clock of the controller and the current clock of the storage medium to perform read operation on the preset standard file, and whether the hash value is correct or not is checked.
When the current clock of the controller and the current clock of the storage medium are sequentially reduced, the current clock of the controller can be reduced first, whether the verification is successful or not is judged, if the verification is failed, the current clock of the storage medium is reduced, whether the verification is successful or not is judged, and the like. Of course, the current clock of the storage medium can be reduced first, and if the verification fails, the current clock of the controller can be reduced. The order of reduction is not particularly limited in the embodiments of the present application.
The controller current clock after the reduction must be between the controller reference maximum clock and the controller reference minimum clock, and the storage medium clock after the reduction must be between the storage medium reference maximum clock and the storage medium reference minimum clock.
In an example implementation, the current clock of the controller and the current clock of the storage medium may be reduced in half sequentially, and of course, the current clock of the storage medium and the current clock of the controller may be reduced in half sequentially, where in the embodiment of the present application, the order of reducing is not specifically limited. Of course, the same magnitude reduction may be adopted, and the embodiment of the present application is not particularly limited. In an example implementation, the current clocks of the controller and the current clocks of the storage medium are sequentially reduced by the same amplitude, if the current clocks of the controller and the current clocks of the storage medium are respectively 10 and 6, the amplitude can be 2, after the first reduction is performed due to the failure of the read operation check, the current clocks of the controller and the current clocks of the storage medium are respectively 8 and 6, if the second reduction is performed due to the failure of the read operation check, the current clocks of the controller and the current clocks of the storage medium are respectively 8 and 4, and so on.
For example, when the current clocks of the controller and the current clocks of the storage medium are reduced in half in turn, if the current clocks of the controller and the current clocks of the storage medium are respectively 10 and 6, after the first reduction of the read operation check failure, the current clocks of the controller and the current clocks of the storage medium are respectively 5 and 6, after the second reduction of the read operation check failure, the current clocks of the controller and the current clocks of the storage medium are respectively 5 and 3, and so on.
In step 203, if the last reduced clock of the current clock of the controller and the current clock of the storage medium is the current clock of the controller, the target clock of the controller is determined according to the current clock of the controller, the last clock before the current clock of the controller is reduced, and the current clock of the storage medium.
When the current clocks of the controller and the current clocks of the storage medium are sequentially reduced, if the current clocks of the controller and the current clocks of the storage medium are respectively 10 and 6, after the first reduction of the read operation check failure, the current clocks of the controller and the current clocks of the storage medium can be respectively 5 and 6, and the read operation check of the preset standard file is successfully performed by adopting the current clocks 5 of the controller and the current clocks 6 of the storage medium, the last reduced clock is the current clock of the controller (the current clock of the controller is reduced from 10 to 5, and the current clock of the storage medium is unchanged). If the controller current clock 5 and the storage medium current clock 6 are adopted to perform the read operation check failure on the preset standard file, after the read operation check failure is reduced for the second time, the controller current clock and the storage medium current clock can be respectively 5 and 3, and if the controller current clock 5 and the storage medium current clock 3 are adopted to perform the read operation check on the preset standard file successfully, the last reduced clock is the storage medium current clock (the controller current clock is unchanged, and the storage medium current clock is reduced from 6 to 3).
If the last reduced clock is the current clock of the controller, the target clock of the controller is determined first. When determining the controller target clock, determining according to the current clock of the controller, the last clock before the current clock of the controller is reduced, and the current clock of the storage medium, and of course, directly taking the current clock of the controller as the controller target clock.
Step 204, determining a storage medium target clock according to the storage medium current clock, the last clock before the storage medium current clock is reduced, and the controller target clock.
After the controller target clock is determined, the storage medium target clock needs to be determined, and when the storage medium target clock is determined, the determination is performed according to the current storage medium clock, the last clock before the current storage medium clock is reduced, and the controller target clock, and of course, the current storage medium clock can also be directly used as the storage medium target clock.
In an example implementation, if the last reduced clock of the current clock of the controller and the current clock of the storage medium is the current clock of the storage medium, the target clock of the storage medium is determined according to the current clock of the storage medium, the last clock before the current clock of the storage medium is reduced, and the current clock of the controller, and then the target clock of the controller is determined according to the current clock of the controller, the last clock before the current clock of the controller is reduced, and the target clock of the storage medium.
In an example implementation, the order in which the controller target clock and the storage medium target clock are determined is not particularly limited.
According to the embodiment of the application, specific implementation details of the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock, so that the controller target clock approximates to the controller working maximum clock, and the storage medium target clock approximates to the storage medium working maximum clock.
On the basis of the clock self-adaptive adjustment method shown in fig. 2, another clock self-adaptive adjustment method is further provided in the embodiment of the present application, as shown in fig. 3, in step 202, a current clock of a controller and a current clock of a storage medium are adopted to perform read operation verification on a preset standard file, and whether the read operation verification is successful is judged, which specifically includes the following steps.
Step 301, performing at least one reading operation on the preset standard file by using the current clock of the controller and the current clock of the storage medium to obtain a content body of at least one preset standard file and at least one corresponding first check value.
And performing a read operation on the preset standard file by adopting the current clock of the controller and the current clock of the storage medium, so as to obtain a content body (body) of the preset standard file and at least one corresponding first check value (first check value of the body).
In an example implementation, the first check value may be a hash value of the content body, where the first check value is obtained from a preset location in a preset standard file.
In this embodiment of the present application, if only one reading operation is performed, there may be an accidental situation of misreading, so in order to improve the accuracy of verification, at least one reading operation is performed.
Step 302, performing validity check on the content body of each preset standard file to obtain a second check value corresponding to the content body of each preset standard file.
In an example implementation, hash recalculation is performed on the content body to obtain a second check value corresponding to the content body.
Step 303, determining whether the second check value corresponding to the content body of each preset standard file is equal to the first check value corresponding to the content body of each preset standard file.
And judging whether the first check value obtained each time is equal to the second check value obtained by corresponding calculation each time.
Step 304, if the current clocks are equal, the current clock of the controller and the current clock of the storage medium check the read operation performed on the preset standard file successfully.
If the current clocks are equal, the current clocks of the controller and the current clocks of the storage medium are considered to be successful in checking the read operation of the preset standard file, and the current clocks of the controller and the current clocks of the storage medium can be used in the working environment.
In step 305, if the non-uniformity is equal, the read operation check performed by the current clock of the controller and the current clock of the storage medium on the preset standard file fails.
According to the embodiment of the application, through at least one reading operation on the preset standard file and the equality of the check values, whether the current clock of the controller and the current clock of the storage medium meet the current working environment can be determined.
On the basis of the clock adaptive adjustment method shown in fig. 2, another clock adaptive adjustment method is further provided in this embodiment, as shown in fig. 4, in step 203, a controller target clock is determined according to a current clock of the controller, a last clock before the current clock of the controller is reduced, and a current clock of a storage medium, which specifically includes the following steps.
In step 401, a controller intermediate clock is determined according to the current clock of the controller and the last clock before the current clock of the controller is reduced.
If the last reduced clock is the current clock of the controller, the current clock of the controller and the last clock before the current clock of the controller are corresponding to the current clock of the storage medium, on the basis, the current clock of the controller and the current clock of the storage medium successfully carry out read operation verification on the preset standard file, but the last clock before the current clock of the controller is reduced and the current clock of the storage medium fail to carry out read operation verification on the preset standard file, so that the maximum clock of the controller is positioned in the middle of the current clock of the controller and the last clock before the current clock of the controller is reduced.
In an example implementation, the controller intermediate clock is determined using a dichotomy, i.e., the controller intermediate clock is: the intermediate value of the last clock before the controller's current clock is reduced is rounded down. Of course, a method such as a dichotomy method may be adopted, and the method may be further rounded up, and is not particularly limited in the embodiment of the present application.
In step 401', the read operation performed on the preset standard file by using the intermediate clock of the controller and the current clock of the storage medium is checked to be successful.
If the read operation check performed on the preset standard file by using the controller intermediate clock and the current clock of the storage medium is successful, step 402 is entered, and the controller target clock is determined according to the controller intermediate clock, the last clock before the current clock of the controller is reduced, and the current clock of the storage medium.
If the read operation check of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium is successful, the maximum working clock of the controller is positioned in the middle of the last clock before the controller intermediate clock and the current clock of the controller are reduced, so that the target clock of the controller can be determined according to the controller intermediate clock, the last clock before the controller current clock is reduced and the current clock of the storage medium.
In an example implementation, if the iteration number of the intermediate clock is preset to be 1, and the read operation check performed on the preset standard file by using the intermediate clock of the controller and the current clock of the storage medium is successful, the intermediate clock of the controller is used as the target clock of the controller.
In an example implementation, if the iteration number of the intermediate clock is preset to be 2, and the read operation verification performed on the preset standard file by using the intermediate clock of the controller and the current clock of the storage medium is successful, determining the second intermediate clock of the controller according to the last clock before the current clock of the controller is reduced and the intermediate clock of the controller, if the read operation verification performed on the preset standard file by using the second intermediate clock of the controller and the current clock of the storage medium is successful, taking the second intermediate clock of the controller as the target clock of the controller, and if the read operation verification performed on the preset standard file by using the second intermediate clock of the controller and the current clock of the storage medium is failed, taking the intermediate clock of the controller as the target clock of the controller.
The larger the iteration number of the intermediate clock is, the closer the obtained controller target clock is to the maximum working clock of the controller.
In an example implementation, the intermediate clock may determine the ending condition not to be the number of iterations, but may also be other conditions, which are not particularly limited in the embodiments of the present application.
If the read operation check performed on the preset standard file by using the controller intermediate clock and the current clock of the storage medium fails, step 403 is performed, and the controller target clock is determined according to the controller intermediate clock, the current clock of the controller and the current clock of the storage medium.
If the read operation check of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium fails, the controller working maximum clock is positioned in the middle of the controller intermediate clock and the current clock of the controller, so that the controller target clock can be determined according to the controller intermediate clock, the current clock of the controller and the current clock of the storage medium.
In an example implementation, if the iteration number of the intermediate clock is preset to be 1, and the read operation verification performed on the preset standard file by using the intermediate clock of the controller and the current clock of the storage medium fails, the current clock of the controller is used as the target clock of the controller.
In an example implementation, if the iteration number of the intermediate clock is preset to be 2, and the read operation verification performed on the preset standard file by using the intermediate clock of the controller and the current clock of the storage medium fails, determining the second intermediate clock of the controller according to the current clock of the controller and the intermediate clock of the controller continuously, if the read operation verification performed on the preset standard file by using the second intermediate clock of the controller and the current clock of the storage medium succeeds, taking the second intermediate clock of the controller as the target clock of the controller, and if the read operation verification performed on the preset standard file by using the second intermediate clock of the controller and the current clock of the storage medium fails, taking the current clock of the controller as the target clock of the controller.
The embodiment of the application realizes the specific implementation method for determining the target clock of the controller when the last reduced clock in the current clock of the controller and the current clock of the storage medium is the current clock of the controller.
On the basis of the clock adaptive adjustment method shown in fig. 2, another clock adaptive adjustment method is further provided in this embodiment, as shown in fig. 5, in step 204, a storage medium target clock is determined according to a storage medium current clock, a last clock before the storage medium current clock is reduced, and a controller target clock, which specifically includes the following steps.
Step 501, determining a storage medium intermediate clock according to a storage medium current clock and a last clock before the storage medium current clock is reduced.
The implementation of this step 501 is similar to the implementation of step 401 described above, and will not be repeated here.
In an example implementation, the method for determining the intermediate clock of the storage medium may be different from or the same as the method for determining the intermediate clock of the controller, and is not particularly limited in the embodiments of the present application.
In step 501', a storage medium intermediate clock and a controller target clock are adopted to check whether the read operation performed on the preset standard file is successful.
If the read operation check performed on the preset standard file by using the storage medium intermediate clock and the controller target clock is successful, step 502 is entered, and the storage medium target clock is determined according to the storage medium intermediate clock, the last clock before the current clock of the storage medium is reduced, and the controller target clock.
The implementation of step 502 is similar to the implementation of step 402 described above, and will not be described in detail herein.
If the read operation check performed on the preset standard file by using the storage medium intermediate clock and the controller target clock fails, step 503 is entered, and the storage medium target clock is determined according to the storage medium intermediate clock, the storage medium current clock and the controller target clock.
The implementation of this step 503 is similar to the implementation of step 403 described above, and will not be described in detail here.
The embodiment of the application realizes the specific implementation method for determining the target clock of the storage medium after the target clock of the controller is determined.
On the basis of the clock adaptive adjustment shown in fig. 1, the embodiment of the present application further provides another clock adaptive adjustment method, as shown in fig. 6, in step 102, the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock, and the preset storage medium minimum clock, which specifically includes the following specific steps.
In step 601, if the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is less than or equal to the preset storage medium minimum clock, the validity of the controller target clock is determined according to the controller reference maximum clock and the controller reference minimum clock.
For example, if the storage medium reference minimum clock is less than or equal to the preset storage medium, if the controller reference minimum clock is 6, the preset controller minimum clock is 4, and the controller reference maximum clock is 10, then the controller target clock is determined first between the controller reference minimum clock and the controller reference maximum clock (10-6), if the controller target clock does not exist in the range, the controller target clock is considered to be invalid in the range, and then the controller target clock is necessarily between the controller reference minimum clock and the preset controller minimum clock (6~4). If a clock can be found between the controller reference minimum clock and the controller reference maximum clock (10-6) such that the verification is successful, then the determination of the controller target clock can continue within this range.
In step 602, if the controller target clock is valid, the controller target clock and the storage medium target clock are determined according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock, and the controller reference maximum clock.
The specific implementation of this step 602 is similar to the implementation of fig. 2 described above, and will not be described in detail herein.
If the controller target clock is invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the preset controller minimum clock.
The specific implementation of this step 603 is similar to the implementation of fig. 2 described above, and will not be repeated here.
The embodiment of the application realizes the specific realization method for determining the controller target clock and the storage medium target clock under the condition that the controller reference minimum clock is larger than the preset controller minimum clock and the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock.
On the basis of the clock adaptive adjustment shown in fig. 1, the embodiment of the present application further provides another clock adaptive adjustment method, as shown in fig. 7, in step 102, the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock, and the preset storage medium minimum clock, which specifically includes the following specific steps.
In step 701, if the controller reference minimum clock is less than or equal to the preset controller minimum clock and the storage medium reference minimum clock is greater than the preset storage medium minimum clock, the validity of the storage medium target clock is determined according to the storage medium reference maximum clock and the storage medium reference minimum clock.
For example, if the controller reference minimum clock is less than or equal to the preset controller, if the storage medium reference minimum clock is 6, the preset storage medium minimum clock is 4, and the storage medium reference maximum clock is 10, determining a storage medium target clock first (10-6) between the storage medium reference minimum clock and the storage medium reference maximum clock, and if the storage medium target clock does not exist in the range, considering that the storage medium target clock is invalid in the range, then the storage medium target clock must be intermediate between the storage medium reference minimum clock and the preset controller minimum clock (6~4). If a clock can be found between the storage medium reference minimum clock and the storage medium reference maximum clock (10-6) so that the verification is successful, then the determination of the storage medium target clock can continue within this range.
In step 702, if the storage medium target clock is valid, the controller target clock and the storage medium target clock are determined according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock, and the controller reference maximum clock.
The specific implementation of this step 702 is similar to the implementation of fig. 2 described above, and will not be repeated here.
In step 703, if the storage medium target clock is invalid, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock.
The specific implementation of this step 703 is similar to the implementation of fig. 2 described above, and will not be described in detail here.
The embodiment of the application realizes the specific realization method for determining the controller target clock and the storage medium target clock under the condition that the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is larger than the preset storage medium minimum clock.
On the basis of the clock adaptive adjustment shown in fig. 1, the embodiment of the present application further provides another clock adaptive adjustment method, as shown in fig. 8, in step 102, the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, the preset controller minimum clock, and the preset storage medium minimum clock, which specifically includes the following specific steps.
In step 801, if the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is greater than the preset storage medium minimum clock, the validity of the controller target clock and the storage medium target clock is determined according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock, and the storage medium reference minimum clock.
If the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is greater than the preset storage medium minimum clock, the controller target clock may be determined first between the controller reference minimum clock and the controller reference maximum clock, and the storage medium target clock may be determined between the storage medium reference minimum clock and the storage medium reference maximum clock.
Step 802, if the controller target clock and the storage medium target clock are invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference minimum clock, the preset storage medium minimum clock, the controller reference minimum clock, and the preset controller minimum clock.
If there is no controller target clock between the controller reference minimum clock and the controller reference maximum clock such that the controller operates normally (the controller target clock is inactive within the range), and there is no storage medium target clock between the storage medium reference minimum clock and the storage medium reference maximum clock such that the storage medium operates normally (the storage medium target clock is inactive within the range), then the storage medium target clock must be determined between the storage medium reference minimum clock and the preset storage medium minimum clock, and the controller target clock must be determined between the controller reference minimum clock and the preset controller minimum clock.
Step 803, if the controller target clock is valid, the storage medium target clock is invalid, and the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock.
If there is a controller target clock between the controller reference minimum clock and the controller reference maximum clock such that the controller operates normally (the controller target clock is valid within the range), but there is no storage medium target clock between the storage medium reference minimum clock and the storage medium reference maximum clock such that the storage medium operates normally (the storage medium target clock is invalid within the range), then the storage medium target clock must be determined between the storage medium reference minimum clock and the preset storage medium minimum clock, and the controller target clock must be determined between the controller reference minimum clock and the controller reference maximum clock.
In step 804, if the controller target clock is invalid, the storage medium target clock is valid, and the controller target clock and the storage medium target clock are determined according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock, and the preset controller minimum clock.
If there is no controller target clock between the controller reference minimum clock and the controller reference maximum clock such that the controller operates normally (the controller target clock is inactive within the range), but there is a storage medium target clock between the storage medium reference minimum clock and the storage medium reference maximum clock such that the storage medium operates normally (the storage medium target clock is active within the range), then the storage medium target clock must be determined between the storage medium reference minimum clock and the storage medium reference maximum clock, and the controller target clock must be determined between the controller reference minimum clock and the preset controller minimum clock.
If both the controller target clock and the storage medium target clock are valid, the controller target clock and the storage medium target clock are determined according to the controller reference minimum clock, the controller reference maximum clock, the storage medium reference minimum clock, and the storage medium reference maximum clock, step 805.
If there is a controller target clock between the controller reference minimum clock and the controller reference maximum clock such that the controller operates normally (the controller target clock is valid within the range), but there is a storage medium target clock between the storage medium reference minimum clock and the storage medium reference maximum clock such that the storage medium operates normally (the storage medium target clock is valid within the range), then determining the storage medium target clock between the storage medium reference minimum clock and the storage medium reference maximum clock may continue, and determining the controller target clock between the controller reference minimum clock and the controller reference maximum clock may continue.
The embodiment of the application realizes the specific implementation method for determining the controller target clock and the storage medium target clock under the condition that the reference minimum clock of the controller is larger than the preset controller minimum clock and the reference minimum clock of the storage medium is larger than the preset storage medium minimum clock.
On the basis of the clock self-adaptive adjustment shown in fig. 1, the embodiment of the application also provides another clock self-adaptive adjustment method, which further comprises the following specific steps.
If the first identifier indicates that the controller clock does not perform self-adaptive adjustment and the second identifier indicates that the storage medium clock does not perform self-adaptive adjustment, a preset controller minimum clock and a preset storage medium minimum clock in the nonvolatile power-down register are obtained, the preset controller minimum clock is determined to be a controller target clock, and the preset storage medium minimum clock is determined to be a storage medium target clock.
On the basis of the clock self-adaptive adjustment shown in fig. 1, the embodiment of the application also provides another clock self-adaptive adjustment method, which further comprises the following specific steps.
If the first identifier indicates that the controller clock is adaptively adjusted and the second identifier indicates that the storage medium clock is not adaptively adjusted, the preset storage medium minimum clock is used as a storage medium target clock; and determining the controller target clock according to the controller reference minimum clock, the controller reference maximum clock, a preset controller minimum clock and the storage medium target clock.
Specifically, as shown in fig. 9, the method includes the following specific steps.
Step 901, if the first identifier indicates that the controller clock is adaptively adjusted and the second identifier indicates that the storage medium clock is not adaptively adjusted, the controller reference maximum clock is used as the current clock of the controller, and the preset storage medium minimum clock is used as the target clock of the storage medium.
If the first identifier indicates that the storage medium does not perform clock self-adaptive adjustment, a preset storage medium minimum clock in the nonvolatile power-down register is directly determined to be used as a storage medium target clock, and no change is made to the preset storage medium minimum clock.
In another example implementation, if the first identifier indicates that the controller clock does not adaptively adjust, and the second identifier indicates that the storage medium clock adaptively adjusts, the preset controller minimum clock is used as the controller target clock, no change is made to the preset controller minimum clock, and the storage medium reference maximum clock is used as the current clock of the storage medium.
Step 901', determine whether the controller reference minimum clock is less than or equal to the preset controller minimum clock.
If the controller reference minimum clock is less than or equal to the preset controller minimum clock, the process proceeds to step 902, where the controller target clock is determined according to the controller reference maximum clock, the controller reference minimum clock, and the storage medium target clock.
Specifically, if the read operation check of the preset standard file by using the controller current clock and the storage medium target clock, which are the maximum reference clocks of the controller, fails, the controller current clock is reduced until the read operation check of the preset standard file by using the controller current clock and the storage medium target clock is successful, and the controller current clock is greater than or equal to the minimum reference clocks of the controller.
And adjusting the current clock of the controller which needs to be adjusted in a self-adaptive manner, in the adjusting process, firstly adopting the current clock of the controller and the target clock of the storage medium to carry out read operation on the preset standard file, checking whether the read operation is successful, if the check fails, indicating that the current clock of the controller is too large, the current clock needs to be reduced, can be reduced in a halving way, can be reduced in a fixed amplitude, and can be reduced in other ways until the current clock of the controller and the target clock of the storage medium carry out the read operation on the preset standard file to check successfully.
In another example implementation, if the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock performs adaptive adjustment, a read operation performed on the preset standard file by using the current storage medium clock and the target controller clock is performed, and if the read operation check fails, the current storage medium clock is reduced until the read operation check performed on the preset standard file by the current storage medium clock and the target controller clock is successful, and the current storage medium clock is greater than or equal to the reference minimum storage medium clock. .
If the controller reference minimum clock is greater than the preset controller minimum clock, step 903 is entered, where the controller target clock is determined according to the controller reference maximum clock, the controller reference minimum clock, the preset controller minimum clock, and the storage medium target clock.
Specifically, the effectiveness of a controller target clock is judged according to a controller reference maximum clock and a controller reference minimum clock; if the controller target clock is valid, determining the controller target clock according to the storage medium target clock, the controller reference minimum clock and the controller reference maximum clock. If the controller target clock is invalid, determining the controller target clock according to the storage medium target clock, the controller reference minimum clock and the preset controller minimum clock.
In another example implementation, if the first identifier indicates that the controller clock does not perform adaptive adjustment, and the second identifier indicates that the storage medium clock adaptively adjusts, taking the storage medium reference maximum clock as the current storage medium clock, taking the preset controller minimum clock as the controller target clock, and if the storage medium reference minimum clock is less than or equal to the preset storage medium minimum clock, determining the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock and the controller target clock; if the storage medium reference minimum clock is larger than the preset storage medium minimum clock, determining a storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the preset storage medium minimum clock and the controller target clock.
The embodiment of the application realizes the specific realization method that the controller clock and the storage medium clock are not self-adaptively adjusted at the same time.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
An embodiment of the present application relates to a controller, as shown in fig. 10, including: at least one processor 1001; and a memory 1002 communicatively coupled to the at least one processor 1001; the memory 1002 stores instructions executable by the at least one processor 1001, and the instructions are executed by the at least one processor 1001, so that the at least one processor 1001 can perform the clock adaptive adjustment method in the above embodiments.
Where the memory 1002 and the processor 1001 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors 1001 and the memory 1002.
Embodiments of the present application relate to a computer-readable storage medium storing a computer program. The computer program implements the above-described method embodiments when executed by a processor.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments described herein. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments in which the present application is implemented and that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (10)

1. A method for adaptively adjusting a clock, the method comprising:
Acquiring controller starting configuration parameters in a storage medium connected with a controller; the controller startup configuration parameters include: a controller reference maximum clock, a storage medium reference maximum clock, a controller reference minimum clock, a storage medium reference minimum clock, a first identifier and a second identifier; the first identifier is used for indicating whether the controller clock is adaptively adjusted, and the second identifier is used for indicating whether the storage medium clock is adaptively adjusted;
if the first identifier indicates controller clock self-adaptive adjustment and the second identifier indicates storage medium clock self-adaptive adjustment, determining a controller target clock and a storage medium target clock according to the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock and a preset storage medium minimum clock;
and storing the controller target clock and the storage medium target clock into a storage medium, and modifying the first identifier and the second identifier so that when the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock does not perform adaptive adjustment, the controller completes starting according to the controller target clock and the storage medium target clock.
2. The method of claim 1, wherein determining the controller target clock and the storage medium target clock based on the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock, and a preset storage medium minimum clock comprises:
and if the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is smaller than or equal to the preset storage medium minimum clock, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock.
3. The method of claim 2, wherein determining the controller target clock and the storage medium target clock based on the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock, and the storage medium reference minimum clock comprises:
Taking the controller reference maximum clock as a controller current clock, and taking the storage medium reference maximum clock as a storage medium current clock;
performing read operation verification on a preset standard file by adopting the current clock of the controller and the current clock of the storage medium, and judging whether the read operation verification is successful or not; if the read operation verification fails, sequentially reducing the current clock of the controller and the current clock of the storage medium until the read operation verification of the preset standard file by the current clock of the controller and the current clock of the storage medium is successful, wherein the current clock of the controller is greater than or equal to the reference minimum clock of the controller, and the current clock of the storage medium is greater than or equal to the reference minimum clock of the storage medium;
if the last reduced clock of the current clock of the controller and the current clock of the storage medium is the current clock of the controller, determining the target clock of the controller according to the current clock of the controller, the last clock before the current clock of the controller is reduced and the current clock of the storage medium;
and determining the target clock of the storage medium according to the current clock of the storage medium, the last clock before the current clock of the storage medium is reduced and the target clock of the controller.
4. The method of claim 3, wherein determining the controller target clock based on the controller current clock, a last clock before the controller current clock is reduced, and the storage medium current clock, comprises:
determining a controller intermediate clock according to the current clock of the controller and the last clock before the current clock of the controller is reduced;
if the read operation verification of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium is successful, determining the target clock of the controller according to the controller intermediate clock, the last clock before the current clock of the controller is reduced and the current clock of the storage medium;
if the read operation check of the preset standard file by adopting the controller intermediate clock and the current clock of the storage medium fails, determining the target clock of the controller according to the controller intermediate clock, the current clock of the controller and the current clock of the storage medium.
5. The method of claim 3, wherein determining the storage medium target clock based on the storage medium current clock, a last clock before the storage medium current clock was reduced, and the controller target clock, comprises:
Determining a storage medium intermediate clock according to the current clock of the storage medium and the last clock before the current clock of the storage medium is reduced;
if the read operation verification of the preset standard file by adopting the storage medium intermediate clock and the controller target clock is successful, determining the storage medium target clock according to the storage medium intermediate clock, the last clock before the current clock of the storage medium is reduced and the controller target clock;
if the read operation check of the preset standard file by adopting the storage medium intermediate clock and the controller target clock fails, determining the storage medium target clock according to the storage medium intermediate clock, the storage medium current clock and the controller target clock.
6. The method of claim 1, wherein determining the controller target clock and the storage medium target clock based on the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock, and a preset storage medium minimum clock comprises:
If the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is less than or equal to the preset storage medium minimum clock, judging the validity of the controller target clock according to the controller reference maximum clock and the controller reference minimum clock;
if the controller target clock is valid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the controller reference maximum clock;
and if the controller target clock is invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the preset controller minimum clock.
7. The method of claim 1, wherein determining the controller target clock and the storage medium target clock based on the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock, and a preset storage medium minimum clock comprises:
If the controller reference minimum clock is smaller than or equal to the preset controller minimum clock and the storage medium reference minimum clock is larger than the preset storage medium minimum clock, judging the validity of the storage medium target clock according to the storage medium reference maximum clock and the storage medium reference minimum clock;
if the storage medium target clock is valid, determining the controller target clock and the storage medium target clock according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the controller reference maximum clock;
and if the storage medium target clock is invalid, determining the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock.
8. The method of claim 1, wherein determining the controller target clock and the storage medium target clock based on the controller reference maximum clock, the storage medium reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock, a preset controller minimum clock, and a preset storage medium minimum clock comprises:
If the controller reference minimum clock is greater than the preset controller minimum clock and the storage medium reference minimum clock is greater than the preset storage medium minimum clock, judging the validity of the controller target clock and the storage medium target clock according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference maximum clock and the storage medium reference minimum clock;
if the controller target clock and the storage medium target clock are invalid, determining the controller target clock and the storage medium target clock according to the storage medium reference minimum clock, the preset storage medium minimum clock, the controller reference minimum clock and the preset controller minimum clock;
if the controller target clock is valid, the storage medium target clock is invalid, and the controller target clock and the storage medium target clock are determined according to the controller reference maximum clock, the controller reference minimum clock, the storage medium reference minimum clock and the preset storage medium minimum clock;
if the controller target clock is invalid, the storage medium target clock is valid, and the controller target clock and the storage medium target clock are determined according to the storage medium reference maximum clock, the storage medium reference minimum clock, the controller reference minimum clock and the preset controller minimum clock;
And if the controller target clock and the storage medium target clock are valid, determining the controller target clock and the storage medium target clock according to the controller reference minimum clock, the controller reference maximum clock, the storage medium reference minimum clock and the storage medium reference maximum clock.
9. The method of clock adaptation adjustment according to claim 1, wherein the method further comprises:
if the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock does not perform adaptive adjustment, determining that the preset controller minimum clock is the controller target clock and determining that the preset storage medium minimum clock is the storage medium target clock;
if the first identifier indicates that the controller clock is adaptively adjusted and the second identifier indicates that the storage medium clock is not adaptively adjusted, the preset storage medium minimum clock is used as the storage medium target clock; determining the controller target clock according to the controller reference minimum clock, the controller reference maximum clock, a preset controller minimum clock and the storage medium target clock;
If the first identifier indicates that the controller clock does not perform adaptive adjustment and the second identifier indicates that the storage medium clock performs adaptive adjustment, the preset controller minimum clock is used as the controller target clock; and determining the storage medium target clock according to the storage medium reference minimum clock, the storage medium reference maximum clock, a preset storage medium minimum clock and the controller target clock.
10. A controller, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the clock adaptation method of any one of the preceding claims 1 to 9.
CN202410190970.6A 2024-02-21 2024-02-21 Clock self-adaptive adjustment method and controller Active CN117742447B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410190970.6A CN117742447B (en) 2024-02-21 2024-02-21 Clock self-adaptive adjustment method and controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410190970.6A CN117742447B (en) 2024-02-21 2024-02-21 Clock self-adaptive adjustment method and controller

Publications (2)

Publication Number Publication Date
CN117742447A true CN117742447A (en) 2024-03-22
CN117742447B CN117742447B (en) 2024-05-10

Family

ID=90259567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410190970.6A Active CN117742447B (en) 2024-02-21 2024-02-21 Clock self-adaptive adjustment method and controller

Country Status (1)

Country Link
CN (1) CN117742447B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004287760A (en) * 2003-03-20 2004-10-14 Seiko Epson Corp Semiconductor device, semiconductor circuit, electronic equipment and clock supply control method
JP2004287761A (en) * 2003-03-20 2004-10-14 Seiko Epson Corp Semiconductor device, semiconductor circuit, electronic equipment and clock supply control method
CN110830608A (en) * 2019-11-14 2020-02-21 腾讯科技(深圳)有限公司 Global unique identifier generation method, device, equipment and storage medium
CN114499732A (en) * 2022-02-09 2022-05-13 中央广播电视总台 Clock calibration method and device, computer equipment and readable storage medium
WO2024012156A1 (en) * 2022-07-14 2024-01-18 中国移动通信有限公司研究院 Clock signal state information reporting method and apparatus
CN117579207A (en) * 2022-08-08 2024-02-20 华为技术有限公司 Clock synchronization guaranteeing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004287760A (en) * 2003-03-20 2004-10-14 Seiko Epson Corp Semiconductor device, semiconductor circuit, electronic equipment and clock supply control method
JP2004287761A (en) * 2003-03-20 2004-10-14 Seiko Epson Corp Semiconductor device, semiconductor circuit, electronic equipment and clock supply control method
CN110830608A (en) * 2019-11-14 2020-02-21 腾讯科技(深圳)有限公司 Global unique identifier generation method, device, equipment and storage medium
CN114499732A (en) * 2022-02-09 2022-05-13 中央广播电视总台 Clock calibration method and device, computer equipment and readable storage medium
WO2024012156A1 (en) * 2022-07-14 2024-01-18 中国移动通信有限公司研究院 Clock signal state information reporting method and apparatus
CN117579207A (en) * 2022-08-08 2024-02-20 华为技术有限公司 Clock synchronization guaranteeing method and device

Also Published As

Publication number Publication date
CN117742447B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
US7983870B2 (en) Integrated circuit and method for determining the operating range of an integrated circuit
KR20210001883A (en) Method and apparatus for processing set of loop instructions, device and medium
TW202109513A (en) Method and device for concurrently executing transactions in block chain
WO2022156512A1 (en) Method and apparatus for firmware upgrade, device, and storage medium
CN117742447B (en) Clock self-adaptive adjustment method and controller
CN110716723A (en) Firmware upgrading method and system
CN114215654B (en) Correction method and device of oil injection angle, electronic equipment and computer storage medium
CN116431186A (en) Upgrading method, device and medium of vehicle-mounted ECU
CN111459413A (en) Method and device for improving SSD performance, computer equipment and storage medium
CN113010236B (en) Program execution method, device, equipment and storage medium
CN110083393B (en) Flash memory and implantable medical device
CN114035831A (en) CPLD upgrading method, system and computer readable storage medium
KR20210151498A (en) System and method for updating of vehicle
CN112596766A (en) Software upgrading method and device based on Bootloader
CN111176686A (en) BIOS upgrading method and system, electronic equipment and storage medium
CN112599172B (en) Data writing method and device of electronic control unit and storage medium
CN110059005B (en) Program detection method of flash memory and implantable medical device
US7490232B2 (en) Disk device using disk to rewrite firmware and firmware determination method
CN116090406B (en) Random verification method and device for ping-pong configuration circuit, upper computer and storage medium
CN110060726B (en) Program detection method of flash memory and implantable medical device
KR20230053949A (en) Method and apparatus for designing structures using artificial intelligence-based finite element method
JP2019168834A (en) Electronic control device
CN114417081B (en) Processing method, device, system and storage medium
CN113703552B (en) Method, device and storage medium for regulating and controlling heat dissipation of server
CN113867509B (en) Autonomous identification method for resetting processor

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