SD card fault detection method and device

By acquiring the SD card's operational information to calculate anomaly values ​​and levels, the automation problem of SD card anomaly detection is solved, thereby improving the system's stability and flexibility.

CN120832277APending Publication Date: 2025-10-24XIAMEN UNISOC TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511312726.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

In existing technologies, there is a lack of automated solutions for SD card anomaly detection, which can lead to system malfunctions, especially prolonged access to SD cards with physical bad blocks or low performance, which may cause system crashes.

Method used

By acquiring various types of operational information from the SD card, such as data response time, read/write speed, granular response, and load information, outliers are calculated, and outlier levels are identified based on preset outlier level ranges and weights for automatic detection and processing.

Benefits of technology

It enables automatic detection and handling of SD card anomalies, improving system stability and reliability, reducing false positive rate, adapting to SD cards of different performance levels, and possessing good scalability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832277A_ABST
    Figure CN120832277A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an SD card fault detection method and device. The method comprises the following steps: acquiring various types of operation information of a target SD card; according to indexes corresponding to different operation information ranges in each preset type of operation information and the multiple types of operation information, determining indexes corresponding to the multiple types of operation information; according to the indexes corresponding to the multiple types of operation information and the preset weight corresponding to each type of abnormal information, an abnormal value is obtained through calculation; according to the abnormal value and abnormal value ranges respectively corresponding to a plurality of preset abnormal levels, identifying to obtain a current abnormal level; and according to preset processing measures corresponding to different abnormal levels and the current abnormal level, carrying out abnormal processing. Visibly, through the scheme of the embodiment of the invention, the problem of how to automatically detect and process the abnormity of the SD card can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information technology, in particular to a fault detection method and device of an SD card. BACKGROUND

[0002] As a common peripheral storage device, SD cards are widely used in various product terminals such as mobile phones and cameras. However, there are various types of SD cards on the market, with different performance. In addition, the SD card itself may be unable to guarantee that there is no physical bad block or low performance problem due to aging and other factors. If the system accesses the physical bad block of the SD card for a long time, or continuously issues read and write requests to the SD card with low performance, it will inevitably cause system abnormalities. However, there is still a lack of necessary solutions on how to automatically detect abnormalities. SUMMARY

[0003] The purpose of the embodiments of the present application is to provide a fault detection method and device of an SD card to solve the problem of how to automatically detect abnormalities of the SD card. The specific technical solutions are as follows: The first aspect of the embodiments of the present application provides a fault detection method of an SD card, which comprises: obtaining multiple types of running information of a target SD card; determining indices corresponding to the multiple types of running information respectively according to a pre-set index corresponding to each type of running information in different running information ranges, and the multiple types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index; calculating an abnormal value according to the indices corresponding to the multiple types of running information respectively and a pre-set weight corresponding to each type of abnormal information; identifying a current abnormal level according to the abnormal value and a pre-set abnormal value range corresponding to the multiple abnormal levels respectively; performing abnormal processing according to a pre-set processing measure corresponding to different abnormal levels and the current abnormal level.

[0004] In a possible implementation, the obtaining multiple types of running information of the target SD card comprises: periodically obtaining data response time information, read-write speed information, particle response information and load information of the target SD card.

[0005] In a possible implementation, the calculating an abnormal value according to the indices corresponding to the multiple types of running information respectively and the pre-set weight corresponding to each type of abnormal information comprises: The abnormal value is obtained by weighted summation according to the index corresponding to each type of operation information and the weight corresponding to each type of abnormal information.

[0006] In a possible implementation, the abnormal processing according to the processing measure corresponding to the different abnormal levels and the current abnormal level comprises: The Uevent event reporting is listened to by the Android Framework, and the abnormal level attached is identified, and the SD card is unloaded.

[0007] In a possible implementation, the abnormal processing according to the processing measure corresponding to the different abnormal levels and the current abnormal level comprises: The remove interface corresponding to the driver of the target SD card is called, the device node of the target SD card is deleted, and the registration information of the SD card is deleted.

[0008] In a second aspect, the embodiment of the application provides a fault detection device of an SD card, which comprises: An information acquisition module is configured to acquire a plurality of types of operation information of a target SD card. An abnormality identification module is configured to determine an index corresponding to each type of operation information according to a preset index corresponding to each type of operation information and the plurality of types of operation information, wherein each type of operation information comprises one or more operation information ranges, and each operation information range corresponds to an index. An abnormal value calculation module is configured to calculate an abnormal value according to the index corresponding to each type of operation information and a preset weight corresponding to each type of abnormal information. A level identification module is configured to identify a current abnormal level according to the abnormal value and a preset abnormal value range corresponding to each abnormal level. An abnormal processing module is configured to perform abnormal processing according to a processing measure corresponding to each abnormal level and the current abnormal level.

[0009] In a possible implementation, the information acquisition module is specifically configured to periodically acquire data response duration information, read-write speed information, particle response information and load information of the target SD card.

[0010] In a possible implementation, the abnormal value calculation module is specifically configured to obtain the abnormal value by weighted summation according to the index corresponding to each type of operation information and the weight corresponding to each type of abnormal information.

[0011] In a possible implementation, the information obtaining module is specifically configured to periodically obtain the data response duration information, the read-write speed information, the grain response information, and the load information of the target SD card. The abnormality identifying module is specifically configured to identify one or more of the following: no grain response, read performance less than a first threshold, write performance less than a second threshold, long grain response time, and load rate greater than a third threshold, according to the data response duration information, the read-write speed information, the grain response information, and the load information of the target SD card, the abnormality information of the last period, and the preset reference information.

[0012] In a possible implementation, the abnormality value calculating module is specifically configured to perform weighted summation according to the multiple types of abnormality information and the preset weights corresponding to the no grain response, the read performance less than the first threshold, the write performance less than the second threshold, the long grain response time, and the load rate greater than the third threshold, respectively, to obtain the abnormality value.

[0013] In a possible implementation, the abnormality processing module is specifically configured to listen to the reporting of Uevent events through the Android Framework, and identify the abnormality level attached to the Uevent events, and unload the SD card.

[0014] In a possible implementation, the abnormality processing module is specifically configured to call a remove interface corresponding to the driver of the target SD card, delete the device node of the target SD card, and delete the registration information of the SD card.

[0015] Another aspect of the embodiment of the present application further provides an electronic device, which comprises: a memory configured to store a computer program; a processor configured to execute the program stored in the memory, to implement any of the above SD card fault detection methods.

[0016] Another aspect of the embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement any of the above SD card fault detection methods.

[0017] Another aspect of the embodiment of the present application further provides a computer program product containing instructions, which, when executed on a computer, causes the computer to perform any of the above SD card fault detection methods.

[0018] The embodiment of the present application has the following beneficial effects: The embodiment of the present application provides a kind of SD card fault detection method and device, the method comprises: obtaining the multiple types of operating information of target SD card;According to the index corresponding to different operating information range in each type of operating information of pre-set setting, and the multiple types of operating information, determine the index corresponding to the multiple types of operating information respectively, wherein each type of operating information includes one or more operating information range, each operating information range corresponds an index;According to the index corresponding to the multiple types of operating information respectively and the weight corresponding to each abnormal information pre-set, calculate to obtain abnormal value;According to the abnormal value and the abnormal value range corresponding to multiple abnormal grades pre-set respectively, identify to obtain current abnormal grade;According to the processing measure corresponding to different abnormal grades pre-set, and the current abnormal grade, carry out abnormal processing.It can be seen that, by the scheme of the embodiment of the present application, the abnormal information can be identified according to the multiple types of operating information of target SD card and pre-set reference information, so as to determine the current abnormal grade by the abnormal value range corresponding to multiple abnormal grades pre-set respectively by the identified abnormal information, so as to process the abnormality by the determined grade, so as to solve the problem of how to automatically detect the abnormality of SD card and the problem of processing.

[0019] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.

[0021] Figure 1 A flowchart of the SD card fault detection method provided by the embodiment of the present application is shown in the figure. Figure 2a Another flowchart of the SD card fault detection method provided by the embodiment of the present application is shown in the figure. Figure 2b Another flowchart of the SD card fault detection method provided by the embodiment of the present application is shown in the figure. Figure 3 A structure diagram of the SD card fault detection device provided by the embodiment of the present application is shown in the figure. Figure 4 A structure diagram of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0022] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application are within the scope of protection of the present application.

[0023] The first aspect of the embodiments of the present application first provides a fault detection method of an SD card, referring to Figure 1 , Figure 1 A flowchart of an SD (Secure Digital Card, storage card) fault detection method provided by the embodiments of the present application is provided, and the method comprises the following steps: Step S11, obtaining multiple types of running information of a target SD card; Step S12, determining an index corresponding to each type of running information according to a preset index corresponding to a different running information range in each type of running information and the multiple types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index; Step S13, calculating an abnormal value according to the index corresponding to each type of running information and a preset weight corresponding to each type of abnormal information; Step S14, identifying a current abnormal level according to the abnormal value and a preset abnormal value range corresponding to each abnormal level; Step S15, performing abnormal processing according to a preset processing measure corresponding to each abnormal level and the current abnormal level.

[0024] Corresponding to step S11, the multiple types of running information of the target SD card can be obtained. For example, data response time information, read-write speed information, particle response information, load information, etc. Thus, the abnormality can be identified through the detected related information.

[0025] Corresponding to step S12, the index corresponding to each type of running information is determined according to a preset index corresponding to a different running information range in each type of running information and the multiple types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index. For example, for the read speed, multiple read speed ranges can be set, and then an index is set for each range. When the detected read speed is in different ranges, the corresponding index is determined.

[0026] Corresponding to the above step S13, according to the index corresponding to the plurality of types of running information respectively and the weight corresponding to each abnormal information preset, the abnormal value is calculated. Specifically, the index corresponding to the plurality of types of running information respectively and the weight can be multiplied, and then the calculation results of each abnormal information are summed to obtain the abnormal value.

[0027] Corresponding to the above step S14, according to the abnormal value and the abnormal value range corresponding to each abnormal level respectively preset, the current abnormal level is identified. The abnormal value range corresponding to each abnormal level can be created in advance, and then the abnormal value and the abnormal value range corresponding to each abnormal level are compared to determine the corresponding abnormal level.

[0028] Corresponding to the above step S15, according to the processing measure corresponding to different abnormal levels preset and the current abnormal level, when the abnormal processing is performed, the automatic processing of the abnormal SD card can be realized. Specifically, the abnormal information can be reported to the user for processing, or the current SD card can be deleted.

[0029] It can be seen that through the scheme of the embodiment of the present application, the abnormal information can be identified according to the plurality of types of running information of the target SD card and the preset reference information, so that the current abnormal level is determined through the abnormal value range corresponding to each abnormal level respectively preset according to the identified abnormal information, and the abnormal processing is performed through the determined level, thereby solving the problems of how to automatically detect and process the abnormality of the SD card.

[0030] In a possible implementation, the obtaining the multiple types of running information of the target SD card includes: periodically obtaining data response duration information, read / write speed information, particle response information, and load information of the target SD card. In the embodiment of the application, the obtaining the multiple types of running information of the target SD card can obtain multiple information. For example, when a read / write request is sent, it refers to a register write interface being called to write a register of an SD card host controller to send a command, and the information mainly counted by this node includes: time: a command initiation time, used to calculate a total time consumption of a current command together with a time counted at an interruption; a command parameter: used to determine whether the command is a read command or a write command, to facilitate separate statistics of read and write conditions; and a data amount: a total data amount of read / write of the current command, used to calculate a read / write rate together with the time consumption. For another example, when an interruption response representing a request completion / error is sent, it refers to a normal interruption generated by the SD card host controller due to a request completion, or an error interruption generated due to an error, and then a registered interruption callback function is called, and the information mainly counted by this node includes: time: a command end or error time, used to calculate a total time consumption of a current command together with an initiation time; and an interruption type: used to determine whether the interruption is a normal interruption of a request completion or an error interruption such as a particle non-response. For another example, periodicity refers to recording, in a period, a time consumption of all read / write commands normally completed, an average rate of read / write (a total time consumption of read / write / the total data amount of write), a time consumption of error read / write commands, and an SD card load (a total time consumption of all read / write commands normally completed and errors / the period time). Compared with the index calculated by a file system layer, the key information recorded by the above scheme in a driver layer, and the key indexes of the SD card read / write time consumption, rate, and load calculated by statistics, can ignore software overheads caused by I / O queue scheduling strategies, and can better reflect real conditions of particles.

[0031] In the embodiments of the present application, error interrupt analysis (such as timeout error, sampling error, etc.) can also be obtained; in open source projects (such as Linux Kernel), the public SD card driver code usually has certain error retransmission and fault tolerance mechanism. When such mechanism encounters an abnormal SD card, the SD card will still continuously initiate access requests after an error occurs, causing the system IOWAIT (the percentage of time that the CPU is in an idle state due to waiting for disk I / O operations to complete) to continuously increase, affecting the overall system performance. To more effectively identify and handle abnormal SD cards, an "error interrupt analysis" index is introduced to count the types and number of errors of the SD card in a monitoring period. This index helps the driver to more accurately assess the stability and availability of the SD card. Load evaluation (the proportion of total read and write time and error handling time to cycle time); for low-performance SD cards, if only the read and write rates and response times less than a set value are used to judge their status, the conditions are too simple and may lead to misjudgment. After introducing the "load" index, the actual workload of the SD card in a unit cycle can be comprehensively evaluated, including the proportion of time occupied by normal reading and writing and error handling. Compared with simply relying on read and write rates or response times, this index can improve the compatibility and adaptability of the system to low-speed but normally functioning SD cards. Continuous cycle anomaly statistics (continuous anomaly cycle statistics are continuously counted); considering that some SD abnormal indicators have a low impact coefficient in a single cycle, but if they occur continuously in multiple consecutive cycles, they may still have a cumulative impact on system stability. This paper introduces a mechanism for counting consecutive cycle anomalies, so that SD card anomaly identification is no longer limited to single statistics in the current cycle, but can comprehensively evaluate the abnormal occurrence trend in consecutive cycles. This can dynamically adjust the weight and impact factor of low-impact abnormal events, thereby improving the sensitivity and accuracy of anomaly identification, making SD card status evaluation more comprehensive and covering more potential abnormal scenarios. System-level indicators (such as IOWAIT); the purpose of introducing "system-level indicators" is to complete the evaluation and processing of the SD card status before the actual occurrence of system-level anomalies, thereby improving the timeliness and accuracy of the response. At the same time, this mechanism helps to avoid relying solely on the driver layer to set overly strict judgment criteria, preventing false positives and incorrectly unloading SD cards when the system load is low. By combining the system running state, the scheme improves accuracy while enhancing compatibility and adaptability to low-performance SD cards, achieving a more intelligent and stable anomaly handling strategy. Traditional anomaly detection logic mostly uses a hard matching method of "condition A (and / or) condition B (and / or) … condition N", such as the description in the prior art: "when the average of the read and write speed test results is greater than a preset value, the average of the response time is less than a preset value, and the average of the response time is greater than a preset value, an SD card normal evaluation is generated; when any one of the average of the read and write speed test results is less than a preset value, the average of the response time is greater than a preset value, or the average of the response time is less than a preset value, an SD card anomaly evaluation is generated".Although such methods are clear in structure and easy to understand, they have obvious limitations: as the number of judgment conditions increases, the logic complexity increases exponentially; at the same time, since each indicator is only set with a single threshold, it is difficult to fully cover complex actual scenarios. For example, in a situation where a certain condition is met while other conditions are not met but close to the threshold, there may still be hidden abnormal risks, but the traditional method is difficult to identify. The present scheme adopts a single indicator multi-interval grading evaluation mechanism, and for each single indicator, instead of setting a single fixed threshold, it is divided into multiple intervals according to its characteristics, and each interval corresponds to a different abnormal score. At the same time, the evaluation method of the overall abnormal level of the SD card is also optimized, which is no longer dependent on the logic of "condition matching", but rather each indicator is treated as an independent individual, and its abnormal score is calculated separately, and the weighted sum is combined with the respective weights to finally obtain the comprehensive abnormal level of the SD card. The method of the present application embodiment can: identify the scene of single indicator severe abnormality; it can also identify the superimposed scene of multiple indicators slight abnormality; reduce the misjudgment rate, improve the sensitivity of the system to abnormal state; better adapt to SD cards of different performance levels, improve compatibility and practicality.

[0032] In a possible implementation, the abnormal value is calculated according to the index corresponding to each type of running information and the preset weight corresponding to each type of abnormal information, and includes: performing weighted summation according to the index corresponding to each type of running information and the preset weight corresponding to each type of abnormal information to obtain the abnormal value. The method of the embodiment of the application can improve the scalability and maintainability. In subsequent function expansion, if a new detection index needs to be added, only the multi-interval scoring rules of the index and the weight thereof need to be defined, without modifying the existing logic and without coupling processing with other indexes. Therefore, the development cost of the new index is extremely low, and the stability and consistency of the original system are not affected, which significantly improves the scalability and flexibility of the scheme. The processing mechanism after detecting the SD card abnormality can be detected. When the abnormality level of the SD card is detected to exceed the preset processing threshold, the system has high flexibility in the processing strategy. First, whether to trigger processing when the abnormality level exceeds the threshold for the first time or to perform the operation after multiple detections can be determined according to system requirements. For example, some systems have strong fault tolerance and do not necessarily need to be processed immediately when the first abnormality occurs. When the SD card abnormality processing is performed, the user-perceptible or user-imperceptible processing mode can be selected according to the actual scene: user-imperceptible processing: the system can choose to silently unload the SD card or directly remove the SD card driver without notifying the user, which is suitable for background maintenance or devices with low requirements on user experience. User-perceptible processing: according to the severity of the abnormality level, the processing strategy is further refined. For example, when the abnormality is not serious, only the user is notified and is suggested to actively unload; when the abnormality seriously affects the stability of the system or there is a high risk, the SD card is forcibly unloaded, and then the user is notified that the SD card has been removed. The flexibility of the processing mechanism makes it able to adapt to different system performance requirements and customer customization needs, while taking into account the implementation complexity and practicality, facilitating deployment and optimization in various terminal devices. The method of the embodiment of the application can improve the expansion capability; based on the flexibility of the foregoing abnormality detection and processing strategy, the scheme has good scalability and can adapt to various scenes and needs, and only a small amount of adjustment is needed to realize the diversification of functions. For example, in some cases, the SD card abnormality does not necessarily originate from the storage card itself, but may be caused by hardware problems such as poor welding, unreasonable PCB wiring design, etc. Although the driver layer can perceive hardware reset events or individual command / data line communication abnormalities through the hostcontroller, the system level often lacks an effective judgment mechanism for these underlying errors, resulting in continuous attempts to mount the SD card even if the hardware continues to report errors, wasting system resources and even affecting user experience.By introducing the hardware reset result, command / data line sampling exception and other bottom layer perception information into the scheme detection index, and assigning a higher abnormal weight to it, the unstable mounting behavior caused by hardware problems can be effectively identified, thereby expanding the present scheme to a mechanism for screening and evaluating the hardware connection state of the SD card. For example, in some application scenarios with high and continuous requirements for the performance of the SD card (such as high-definition video recording, driving recording, monitoring equipment, etc.), if the SD card cannot maintain a certain continuous write rate, it may cause video file damage or system abnormality. By taking “whether the continuous write rate meets the standard” as one of the key indicators, setting it as a hard threshold, and giving it a higher abnormal weight when it does not meet the standard, the performance of the SD card can be effectively evaluated and screened at the system level, thereby expanding the present scheme to scenarios that meet specific performance requirements, and realizing intelligent access control of the SD card. In summary, by flexibly adjusting the index definition and its weight setting, the present scheme can not only be used for basic SD card abnormal detection and processing, but also be further expanded to multiple application scenarios such as hardware problem identification and SD card performance access control, and has good universality and customizability.

[0033] In a possible implementation, the abnormality processing according to the preset processing measures corresponding to different abnormality levels and the current abnormality level comprises: unloading the SD card by listening to the reporting of a Uevent event of an Android Framework and identifying the abnormality level attached thereto. The method of the embodiment of the application is mainly applicable to most product forms with a display screen, and in order to improve the product experience, the user needs to be notified when the SD card is actively removed. When the driver identifies that the abnormality level of the SD card may affect the system, the Uevent event is reported through the Linux Uevent mechanism, and the abnormality level of the SD card and other related information are attached in the event. The upper layer (such as the Android Framework) listens to the Uevent event, obtains the abnormality level of the SD card reported by the driver, and comprehensively judges whether the "SD card is actively unloaded" or "the user is only notified to continue to use the card, which may cause system-level problems" according to the IOWAIT and other parameters reflecting the system I / O situation of the current system. In a possible implementation, the abnormality processing according to the preset processing measures corresponding to different abnormality levels and the current abnormality level comprises: calling a remove interface corresponding to the driver of the target SD card, deleting the device node of the target SD card, and deleting the registration information of the SD card. This scheme is mainly applicable to the case where there is no display screen and the user does not need to be notified, and the case where the product has special requirements and the user does not need to perceive the SD card. In this scheme, when the driver identifies that the abnormality level of the SD card may cause system-level influence, the remove interface corresponding to the SD card driver is called. The interface usually deletes the device node of the SD card and deletes the related information registered by the SD card, so that the SD card will not be remounted in the subsequent use process. Before the above two schemes are executed, the number of SD card abnormalities that can be tolerated before the unloading / removing of the SD card is executed can also be specified to modify the tolerance degree of different product forms / different use scenarios to the bad card / slow card of the SD card. In addition, the rate threshold and the weight of each abnormality point can also be modified in the SD card abnormality detection stage to achieve this purpose.

[0034] In order to illustrate the scheme of the embodiment of the application, a specific embodiment is described below with reference to Figure 2a and Figure 2b , comprising: By analyzing the known serious system problems caused by the SD card, the known abnormality points of the SD card are summarized as follows: No response: the grain cannot respond to the command or cannot reply / write data after the host sends a read / write command, which can be identified by an error interrupt, and the reason can be that a physical bad block of the SD card is accessed; Low rate: the rate of reading and writing is counted respectively, which can assist in determining whether the SD card is mainly slow in reading or slow in writing. When the rate is lower than the specified threshold, it is considered abnormal (the rate threshold can be determined according to the minimum rate required by the use scenario, or it can be determined according to the rate mode and frequency of the SD card according to the SD standard protocol) Long data response time: the time from the response of the particle to a read / write command to the time when the data of the command is returned from the SD card side or the time when the write to the SD card is completed is too long, which is another indicator of rate; Load rate greater than the third threshold: the proportion of the total time of SD card reading and writing or errors to the cycle time, the higher the value, the higher the load of the SD card, and the system has more time to wait for I / O; Abnormality of the last statistical cycle: for some low-risk abnormalities, the abnormality of the last statistical cycle can be used to assist in judgment to see if the abnormality is continuous. If the low-risk abnormality is continuous, the weight needs to be increased accordingly; The severity of the problems caused by the above different abnormal points is different. For example, the item "load rate greater than the third threshold" may occur when the data amount of the upper layer request is greater than the processing capacity of the bottom layer particle in the cycle time, but the load rate greater than the third threshold for a short time may not cause system abnormality. For example, the item "particle non-response", the influence of this abnormality is relatively large, the "command failure retransmission mechanism" and the "mechanism of splitting into several single block read / write after multiple block read / write failure" in the kernel mmc driver will make the system access the particle physical bad block for a long time. Long-term continuous access may also make the particle firmware have no time to trigger its bad block processing mechanism, causing serious I / O (input / output) blocking of the system. Therefore, all abnormal points cannot be considered as a whole, and further distinction needs to be made according to the possible risk degree.

[0035] In a second aspect, an SD card fault detection device is provided, as shown in Figure 3 , the device comprises: An information acquisition module 301 is configured to acquire a plurality of types of running information of a target SD card; An abnormality identification module 302 is configured to determine an index corresponding to each type of running information according to a preset index corresponding to each type of running information in each type of running information range, and the plurality of types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index; An abnormal value calculation module 303 is configured to calculate an abnormal value according to the index corresponding to each type of running information and the weight corresponding to each type of abnormal information; A level identification module 304 is configured to identify the current abnormality level based on the abnormal value and the abnormal value ranges corresponding to the preset abnormality levels; The exception handling module 305 is configured to handle the exception according to the pre-set handling measures corresponding to different exception levels and the current exception level.

[0036] In a possible implementation, the information acquisition module is specifically configured to periodically acquire data response duration information, read / write speed information, particle response information, and load information of the target SD card.

[0037] In a possible implementation, the abnormal value calculation module is specifically configured to perform weighted summation based on the indices corresponding to the multiple types of operating information and the preset weights corresponding to each type of abnormal information to obtain the abnormal value.

[0038] In a possible implementation, the exception handling module is specifically configured to monitor the reporting of Uevent events through the Android Framework, identify the accompanying exception level, and unmount the SD card.

[0039] In a possible implementation, the exception handling module is specifically configured to call a remove interface corresponding to the driver of the target SD card, delete the device node of the target SD card, and delete the registration information of the SD card.

[0040] It can be seen that through the device of the embodiment of the present application, abnormal information can be identified based on various types of operating information of the target SD card and pre-set benchmark information, so that the current abnormal level can be determined through the abnormal value range corresponding to the identified abnormal information and the pre-set multiple abnormal levels, and the abnormality can be handled according to the determined level, thereby solving the problem of how to automatically detect and handle the abnormality of the SD card.

[0041] The present application also provides an electronic device, such as Figure 4 Shown, including: Memory 401, used for storing computer programs; The processor 402 is configured to execute the program stored in the memory 401 by performing the following steps: Get various types of running information of the target SD card; Identifying and obtaining multiple types of abnormal information based on the multiple types of operating information and pre-set benchmark information, wherein the multiple types of abnormal information include: one or more of: no response from a particle, read performance less than a first threshold, write performance less than a second threshold, long particle response time, and a load rate greater than a third threshold; According to the plurality of types of abnormal information and the preset weight corresponding to each type of abnormal information, an abnormal value is calculated; According to the abnormal value and the preset abnormal value range corresponding to each abnormal level, a current abnormal level is identified; According to the preset processing measure corresponding to each abnormal level and the current abnormal level, abnormal processing is performed.

[0042] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0043] The communication interface is used for communication between the electronic device and other devices.

[0044] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0045] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. It can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0046] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the fault detection method of any SD card are implemented.

[0047] In a further embodiment provided in the present application, a computer program product including instructions, which when executed on a computer, causes the computer to perform the fault detection method of any of the SD cards in the above embodiments.

[0048] In the above embodiments, the implementation can be wholly or partially in software, hardware, firmware or any combination thereof. When implemented in software, the implementation can be in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer program instructions cause the computer to perform the processes or functions described in the embodiments of the present application. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a solid state disk (SSD), etc.

[0049] It should be noted that in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the element.

[0050] Various embodiments are described in related manner in the specification, and the same or similar parts among various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device, electronic device, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the method embodiments.

[0051] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for detecting a failure of an SD card, the method comprising: The method comprises: acquiring multiple types of running information of a target SD card; determining indices corresponding to the multiple types of running information according to pre-set indices corresponding to different running information ranges in each type of running information, and the multiple types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index; calculating an abnormal value according to the indices corresponding to the multiple types of running information and pre-set weights corresponding to each type of abnormal information; identifying a current abnormal level according to the abnormal value and pre-set abnormal value ranges corresponding to multiple abnormal levels respectively; performing abnormal processing according to pre-set processing measures corresponding to different abnormal levels and the current abnormal level.

2. The method of claim 1, wherein, The acquiring of the multiple types of running information of the target SD card comprises: periodically acquiring data response duration information, read-write speed information, particle response information, and load information of the target SD card.

3. The method of claim 1, wherein, The calculating of the abnormal value according to the indices corresponding to the multiple types of running information and the pre-set weights corresponding to each type of abnormal information comprises: performing weighted summation according to the indices corresponding to the multiple types of running information and the pre-set weights corresponding to each type of abnormal information to obtain the abnormal value.

4. The method of claim 1, wherein, The performing of the abnormal processing according to the pre-set processing measures corresponding to different abnormal levels and the current abnormal level comprises: unloading the SD card by listening to reporting of a Uevent event and identifying an abnormal level attached to the Uevent event through an Android Framework.

5. The method of claim 1, wherein, The performing of the abnormal processing according to the pre-set processing measures corresponding to different abnormal levels and the current abnormal level comprises: calling a remove interface corresponding to a driver of the target SD card, deleting a device node of the target SD card, and deleting registration information of the SD card.

6. A failure detection apparatus of an SD card, characterized by comprising: The device comprises: an information acquisition module configured to acquire multiple types of running information of a target SD card; an abnormality identification module configured to determine indices corresponding to the multiple types of running information according to pre-set indices corresponding to different running information ranges in each type of running information, and the multiple types of running information, wherein each type of running information comprises one or more running information ranges, and each running information range corresponds to an index; an abnormal value calculation module configured to calculate an abnormal value according to the indices corresponding to the multiple types of running information and pre-set weights corresponding to each type of abnormal information; a level identification module configured to identify a current abnormal level according to the abnormal value and pre-set abnormal value ranges corresponding to multiple abnormal levels respectively; an abnormal processing module configured to perform abnormal processing according to pre-set processing measures corresponding to different abnormal levels and the current abnormal level.

7. The device of claim 6, wherein: the information acquisition module is specifically configured to periodically acquire data response duration information, read-write speed information, particle response information, and load information of the target SD card.

8. The apparatus of claim 6, wherein, the abnormal value calculation module is specifically configured to perform weighted summation according to the index corresponding to each type of operation information and the weight corresponding to each type of abnormal information pre-set, to obtain the abnormal value.

9. An electronic device, comprising: including: a memory for storing a computer program; a processor for executing the program stored on the memory, to implement the method of any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Solid state disk running method and device and electronic equipment

    CN117331729A

  • Instrument abnormal state identification method based on deep learning

    CN118277931A

  • Fault detection method and system for fan frequency converter based on big data

    CN120275737A

  • Edge heterogeneous Internet of Things operation and maintenance chassis data processing method and system

    CN120602309A

  • Anomaly detection device, anomaly detection system, anomaly detection method and program

    JP2023114670A