Method, device, electronic device and readable storage medium for adjusting bit rate
By acquiring hard drive temperature values and adjusting the bitrate, the problem of data loss caused by excessive mechanical hard drive temperature was solved, ensuring the performance and reliability of the hard drive and the device.
Patent Information
- Application Number
- CN202210169972.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2042-02-23
AI Technical Summary
Increased temperature in mechanical hard drives leads to decreased read/write speeds, resulting in data loss during writing and reduced device performance and reliability.
By obtaining the current temperature value of the hard drive, the target hard drive temperature range is determined, and the write bitrate is adjusted based on the temperature-bitrate percentage relationship to match the actual bandwidth of the hard drive and avoid data loss.
Dynamically adjust the hard drive bitrate to match the actual bandwidth, avoid data loss, ensure hard drive performance and device reliability, and operate simply and at low cost.
Smart Images

Figure CN114625317B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method, device, electronic device and readable storage medium for adjusting bit rate. Background Art
[0002] Currently, for devices whose internal storage media is a mechanical hard disk, as the temperature of the mechanical hard disk increases, the read and write rate of the mechanical hard disk will decrease, which will cause data to be lost when written to the mechanical hard disk, thereby reducing the performance and reliability of the device. Summary of the invention
[0003] The embodiments of the present application provide a method, device, electronic device and readable storage medium for adjusting bit rate, which can solve the problem of data loss when writing to a mechanical hard disk due to high temperature of the mechanical hard disk.
[0004] In a first aspect, an embodiment of the present application provides a method for adjusting a bit rate, including:
[0005] Acquire a current temperature value of the hard disk, and determine a target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set;
[0006] Based on the temperature-bitrate percentage correspondence relationship, determine the target bitrate percentage corresponding to the target hard disk temperature range;
[0007] The bit rate written to the hard disk is adjusted to a target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
[0008] Furthermore, the hard disk temperature interval set includes at least one hard disk temperature interval, and before obtaining the current temperature value of the hard disk, the method further includes:
[0009] For each hard disk temperature range, calculating a theoretical rate at which an external device writes to the hard disk;
[0010] measuring an actual rate at which the external device writes to the hard disk;
[0011] Calculating the bit rate percentage of the hard disk in the hard disk temperature range according to the theoretical rate and the actual rate;
[0012] According to each hard disk temperature range and the corresponding bit rate percentage, the temperature-bit rate percentage correspondence relationship is obtained.
[0013] Further, the calculating of the theoretical rate at which the external device writes to the hard disk includes:
[0014] The theoretical rate is obtained by multiplying the theoretical bandwidth of the external device writing to the hard disk and the number of write paths;
[0015] The number of write paths is the number of external devices connected to the hard disk.
[0016] Further, the calculating, according to the theoretical rate and the actual rate, the bit rate percentage of the hard disk in the hard disk temperature range includes:
[0017] The theoretical rate is divided by the actual rate to obtain the bit rate percentage of the hard disk in the hard disk temperature range.
[0018] Furthermore, before obtaining the current temperature value of the hard disk, the method further includes:
[0019] Based on a preset ambient temperature interval set, the temperature value of the hard disk is acquired to obtain the hard disk temperature interval set corresponding to the ambient temperature interval set.
[0020] Furthermore, after adjusting the bit rate written to the hard disk to the target bit rate, the method further includes:
[0021] Based on the target bit rate, the data collected by the external device is written into the hard disk.
[0022] Furthermore, after obtaining the current temperature value of the hard disk, the method further includes:
[0023] If the current temperature value is greater than the warning temperature value, the hard disk is powered off and / or an alarm is issued.
[0024] In a second aspect, an embodiment of the present application provides a device for adjusting a bit rate, including:
[0025] An acquisition unit, used to obtain the current temperature value of the hard disk;
[0026] A determination unit, configured to determine a target hard disk temperature interval in which the current temperature value is located based on a pre-stored hard disk temperature interval set;
[0027] Based on the temperature-bitrate percentage correspondence relationship, determine the target bitrate percentage corresponding to the target hard disk temperature range;
[0028] The adjustment unit is used to adjust the bit rate written to the hard disk to a target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method as described in any one of the above-mentioned first aspects when executing the computer program.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.
[0032] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0033] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0034] The embodiment of the present application obtains the current temperature value of the hard disk, and determines the target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set; determines the target bit rate percentage corresponding to the target hard disk temperature range based on the temperature-bit rate percentage correspondence; adjusts the bit rate written to the hard disk to the target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage. The bit rate of the hard disk can be dynamically adjusted based on the bit rate percentages of different hard disk temperature ranges to adjust the data bandwidth written to the hard disk, avoiding data loss due to a large difference between the written data bandwidth and the actual bandwidth of the hard disk, thereby ensuring the performance and reliability of the hard disk, and further ensuring the performance and reliability of the device using the hard disk, and the method is simple to operate, stable, reliable, and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 is a flowchart of a method for adjusting bit rate provided in an embodiment of the present application;
[0037] Figure 2 is a flowchart of a method for adjusting bit rate provided in another embodiment of the present application;
[0038] Figure 3 is a structural diagram of a device for adjusting bit rate provided in an embodiment of the present application;
[0039] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0041] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0042] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0043] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0044] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0045] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0046] When the temperature of the mechanical hard disk in the device increases, the read and write speed of the mechanical hard disk will decrease, resulting in data loss when writing to the mechanical hard disk, thereby reducing the performance and reliability of the device.
[0047] For example, the storage media used in vehicle security equipment are mostly mechanical hard disks. When the temperature of the mechanical hard disk is high, the data written to the mechanical hard disk in the vehicle security equipment will be lost, reducing the performance and reliability of the vehicle security equipment.
[0048] Figure 1 FIG. 1 is a flow chart of a method for adjusting bit rate provided in an embodiment of the present application. As an example and not a limitation, Figure 1 As shown, the method includes:
[0049] S101: Acquire a current temperature value of a hard disk, and determine a target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set.
[0050] For example, the temperature value of the hard disk can be read through SMART (Self Monitoring Analysis And Reporting Technology) in the hard disk, thereby obtaining the current temperature value of the hard disk.
[0051] Specifically, the hard disk temperature interval set includes at least one hard disk temperature interval, and the corresponding hard disk temperature interval is determined according to the current temperature value to obtain the target hard disk temperature interval.
[0052] S102: Determine a target bit rate percentage corresponding to a target hard disk temperature range based on a temperature-bit rate percentage correspondence relationship.
[0053] The bit rate percentage is the bit rate written to the hard disk as a percentage of the original bit rate in the hard disk temperature range. The bit rate percentage indicates that in the hard disk temperature range, the actual rate of writing to the hard disk has changed and is not equal to the theoretical rate of writing to the hard disk, and the bit rate has also changed accordingly, becoming a few percentages of the original bit rate.
[0054] S103: adjusting the bit rate written to the hard disk to the target bit rate, wherein the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
[0055] Among them, the bit rate percentage corresponding to the target bit rate is the percentage of the target bit rate to the original bit rate. When the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage, the amount of data written to the hard disk can be adjusted to make the data bandwidth written to the hard disk match the actual bandwidth written to the hard disk.
[0056] The embodiment of the present application obtains the current temperature value of the hard disk, and determines the target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set; determines the target bit rate percentage corresponding to the target hard disk temperature range based on the temperature-bit rate percentage correspondence; adjusts the bit rate written to the hard disk to the target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage. The bit rate of the hard disk can be dynamically adjusted based on the bit rate percentages of different hard disk temperature ranges to adjust the data bandwidth written to the hard disk, avoiding data loss due to a large difference between the written data bandwidth and the actual bandwidth of the hard disk, thereby ensuring the performance and reliability of the hard disk, and further ensuring the performance and reliability of the device using the hard disk, and the method is simple to operate, stable, reliable, and low cost.
[0057] Figure 2 FIG. 1 is a flow chart of a method for adjusting bit rate provided by another embodiment of the present application. As an example but not a limitation, Figure 2 As shown, before obtaining the current temperature value of the hard disk, it also includes:
[0058] S201: For each hard disk temperature range, calculating a theoretical rate at which an external device writes to the hard disk.
[0059] Specifically, the theoretical bandwidth of the external device writing to the hard disk is multiplied by the number of write paths to obtain the theoretical rate; wherein the number of write paths is the number of external devices connected to the hard disk.
[0060] For example, the external device is a 1080P camera, and the corresponding theoretical bandwidth for writing to the hard disk is 1.5MB / s; there are 15 1080P cameras connected to the hard disk, that is, there are 15 writing paths, then the theoretical rate = 1.5MB / s*15 = 22.5MB / s.
[0061] S202: Measure the actual rate at which the external device writes to the hard disk.
[0062] For example, you can enter a hard disk write command on the hard disk to print the actual rate of the external device writing to the hard disk in real time, so as to measure the actual rate. Hard disk write command: . / smrfs_test_tool_v500mixwrite / dev / sda mn; where smrfs_test_tool_v500 is a compiled file of the theoretical bandwidth of the external device writing to the hard disk, mixwrite is a dual-stream write, sda is the current hard disk drive letter; m represents the print level, a total of 0-4 levels, the higher the level, the more prints, m = 0, 1, 2, 3, 4; n represents the number of write paths.
[0063] S203: Calculate the bit rate percentage of the hard disk in the hard disk temperature range according to the theoretical rate and the actual rate.
[0064] Specifically, the theoretical rate is divided by the actual rate to obtain the bit rate percentage of the hard disk in the hard disk temperature range.
[0065] For example, if within a certain hard disk temperature range, the theoretical rate is 22.5 MB / s and the actual rate is 20 MB / s, then the bit rate percentage = 20 MB / s ÷ 22.5 MB / s = 88%.
[0066] S204: Obtaining a temperature-bit rate percentage correspondence relationship according to each hard disk temperature range and the corresponding bit rate percentage.
[0067] For example, the pre-stored hard disk temperature range set includes [60°C, 65°C], (65°C, 70°C], (70°C, 75°C], (75°C, 80°C], (80°C, 87°C), and the bit rate percentage of each hard disk temperature range is shown in the following table:
[0068] Hard disk temperature range Write channels Theoretical rate Actual rate Bitrate Percentage 60℃-65℃ 15 22.5MB / s 22.5MB / s 100% 65℃-70℃ 15 22.5MB / s 22.5MB / s 100% 70℃-75℃ 15 22.5MB / s 20MB / s 88% 75℃-80℃ 15 22.5MB / s 18MB / s 80% 80℃-87℃ 15 22.5MB / s 5MB / s 22%
[0069] This embodiment calculates the theoretical rate at which an external device writes to the hard disk for each hard disk temperature range; measures the actual rate at which the external device writes to the hard disk; calculates the bit rate percentage of the hard disk in the hard disk temperature range based on the theoretical rate and the actual rate; obtains a temperature-bit rate percentage correspondence based on each hard disk temperature range and the corresponding bit rate percentage to obtain an accurate bit rate percentage, thereby obtaining an accurate temperature-bit rate percentage correspondence.
[0070] In another embodiment, before calculating the theoretical rate at which data collected by the external device is written to the hard disk for each hard disk temperature range, the method further includes:
[0071] Based on a preset ambient temperature interval set, a temperature value of the hard disk is acquired to obtain a hard disk temperature interval set corresponding to the ambient temperature interval set.
[0072] For example, the ambient temperature is divided into 5°C intervals to obtain an ambient temperature interval set of [40°C, 45°C], (45°C, 50°C], (50°C, 55°C], (55°C, 60°C], (60°C, 65°C). The hard disk temperature value is obtained based on the ambient temperature interval, and the hard disk temperature interval corresponding to the ambient temperature interval is obtained, thereby obtaining the corresponding hard disk temperature interval set. The corresponding relationship is shown in the following table:
[0073] Ambient temperature range Hard disk temperature range 40℃-45℃ 60℃-65℃ 45℃-50℃ 65℃-70℃ 50℃-55℃ 70℃-75℃ 55℃-60℃ 75℃-80℃ 60℃-65℃ 80℃-87℃
[0074] On this basis, the bit rate percentages in each ambient temperature range are obtained, as shown in the following table:
[0075] Ambient temperature range Hard disk temperature range Write channels Theoretical rate Actual rate Bitrate Percentage 40℃-45℃ 60℃-65℃ 15 22.5MB / s 22.5MB / s 100% 45℃-50℃ 65℃-70℃ 15 22.5MB / s 22.5MB / s 100% 50℃-55℃ 70℃-75℃ 15 22.5MB / s 20MB / s 88% 55℃-60℃ 75℃-80℃ 15 22.5MB / s 18MB / s 80% 60℃-65℃ 80℃-87℃ 15 22.5MB / s 5MB / s 22%
[0076] In another embodiment, after adjusting the bit rate of the hard disk to the target bit rate, the method further includes:
[0077] Based on the target bit rate, the data collected by the external device is written to the hard disk.
[0078] This embodiment writes data to the hard disk based on the target bit rate through an external device, thereby avoiding data loss caused by a large difference between the written data bandwidth and the actual bandwidth of the hard disk, thereby ensuring the performance and reliability of the hard disk.
[0079] In another embodiment, after obtaining the current temperature value of the hard disk, the method further includes:
[0080] If the current temperature value is greater than the warning temperature value, the hard disk will be powered off and / or an alarm will be issued.
[0081] The warning temperature value can be set according to the actual application scenario or hardware performance. The warning temperature value indicates that the current temperature value of the hard disk has exceeded the operating temperature limit and the hard disk needs to be powered off to protect the hard disk. An alarm can also be performed to remind the user.
[0082] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0083] Corresponding to the method described in the above embodiment, for the convenience of explanation, only the part related to the embodiment of the present application is shown.
[0084] Figure 3 is a schematic diagram of the structure of the device for adjusting the bit rate provided in the embodiment of the present application. As an example and not a limitation, Figure 3 As shown, the device comprises:
[0085] The acquisition unit 10 is used to acquire the current temperature value of the hard disk.
[0086] The determination unit 11 is used to determine the target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set.
[0087] Based on the temperature-bitrate percentage correspondence relationship, determine the target bitrate percentage corresponding to the target hard disk temperature range.
[0088] The adjustment unit 12 is used to adjust the bit rate written into the hard disk to a target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
[0089] In another embodiment, it further includes a calculation unit and a corresponding unit;
[0090] A calculation unit, for calculating a theoretical rate at which an external device writes to the hard disk for each hard disk temperature range;
[0091] Used to measure the actual rate at which external devices write to the hard disk;
[0092] Used to calculate the bit rate percentage of the hard disk in the hard disk temperature range based on the theoretical rate and actual rate.
[0093] The corresponding unit is used to obtain a temperature-bit rate percentage corresponding relationship according to each hard disk temperature range and the corresponding bit rate percentage.
[0094] In another embodiment, the acquisition unit is further configured to acquire the temperature value of the hard disk based on a preset ambient temperature interval set, so as to obtain a hard disk temperature interval set corresponding to the ambient temperature interval set.
[0095] In another embodiment, the device further comprises an exception handling unit,
[0096] The exception processing unit is used to power off the hard disk and / or issue an alarm if the current temperature value is greater than the warning temperature value.
[0097] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 2 of this embodiment includes: at least one processor 20 ( Figure 4 Only one is shown in the figure), a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, wherein the processor 20 implements the steps of any of the above-mentioned method embodiments when executing the computer program 22.
[0098] The electronic device 2 may be a computing device such as a vehicle-mounted security device, a detection device, an auxiliary device, etc. The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 2 and does not constitute a limitation on the electronic device 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0099] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0100] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 2. Further, the memory 21 may also include both an internal storage unit of the electronic device 2 and an external storage device. The memory 21 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0101] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0102] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0103] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0104] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0107] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0108] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for adjusting bit rate, characterized in that: include: For each hard disk temperature range, the theoretical bandwidth of the external device writing to the hard disk is multiplied by the number of write paths to obtain the theoretical rate, where the number of write paths is the number of external devices connected to the hard disk; measuring an actual rate at which the external device writes to the hard disk; Dividing the theoretical rate by the actual rate to obtain a bit rate percentage of the hard disk in the hard disk temperature range; According to each hard disk temperature range and the corresponding bit rate percentage, a temperature-bit rate percentage correspondence relationship is obtained; Acquire a current temperature value of the hard disk, and determine a target hard disk temperature range in which the current temperature value is located based on a pre-stored hard disk temperature range set; Based on the temperature-bitrate percentage correspondence relationship, determine the target bitrate percentage corresponding to the target hard disk temperature range; The bit rate written to the hard disk is adjusted to a target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
2. The method according to claim 1, characterized in that Before obtaining the current temperature value of the hard disk, the method further includes: Based on a preset ambient temperature interval set, the temperature value of the hard disk is acquired to obtain the hard disk temperature interval set corresponding to the ambient temperature interval set.
3. The method according to claim 1, characterized in that After the bit rate of writing to the hard disk is adjusted to the target bit rate, the method further includes: Based on the target bit rate, the data collected by the external device is written into the hard disk.
4. The method according to claim 1, characterized in that After obtaining the current temperature value of the hard disk, the method further includes: If the current temperature value is greater than the warning temperature value, the hard disk is powered off and / or an alarm is issued.
5. A device for adjusting bit rate, characterized in that: include: The corresponding relationship determination module is used to, for each hard disk temperature range, multiply the theoretical bandwidth of the external device writing to the hard disk and the number of write paths to obtain a theoretical rate, wherein the number of write paths is the number of external devices connected to the hard disk; measure the actual rate at which the external device writes to the hard disk; divide the theoretical rate by the actual rate to obtain the bit rate percentage of the hard disk in the hard disk temperature range; and obtain a temperature-bit rate percentage corresponding relationship according to each hard disk temperature range and the corresponding bit rate percentage; An acquisition unit, used to obtain the current temperature value of the hard disk; A determination unit, configured to determine a target hard disk temperature interval in which the current temperature value is located based on a pre-stored hard disk temperature interval set; Based on the temperature-bitrate percentage correspondence relationship, determine the target bitrate percentage corresponding to the target hard disk temperature range; The adjustment unit is used to adjust the bit rate written to the hard disk to a target bit rate, and the bit rate percentage corresponding to the target bit rate is less than or equal to the target bit rate percentage.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Temperature control method and device for magnetic disk
CN107507636A
Method and system for realizing reliable reading and writing of data, and storage medium
CN109375869A