Memory card initialization method and device, equipment, medium and program product

By obtaining the level status of the detection pin in the terminal device and determining its fault condition, the memory card is initialized using the card scanning function, which solves the problem of high cost when detecting the pin failure, and realizes the normal use of the memory card and Cost reduction.

CN119292991APending Publication Date: 2025-01-10XIAMEN UNISOC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411459516.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, when detecting pin failures in terminal equipment, the detection pin needs to be replaced, resulting in high costs and cannot effectively reduce the initialization cost of the memory card.

Method used

By obtaining the level status of the detection pin, determining its fault condition, and using the card scanning function to initialize the memory card in the event of a fault, avoiding the replacement of the detection pin and directly implementing the initialization of the memory card.

Benefits of technology

In the case of detection pin failure, there is no need to replace the detection pin, and the memory card can be initialized directly through the card scanning function, which reduces the cost and realizes the normal use of the memory card.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292991A_ABST
    Figure CN119292991A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory card initialization method and device, equipment, a medium and a program product. The method is applied to the terminal equipment, an SOC chip and a card support are arranged in the terminal equipment, a detection pin is arranged in the SOC chip, and the detection pin is connected with the card support. The card holder is used for inserting a memory card. The method comprises the following steps: acquiring a level state of a detection pin; according to the level state, determining whether the detection pin fails or not; and under the condition that the pin fault is detected, performing initialization processing on the memory card through a card scanning function. According to the method provided by the embodiment of the invention, the detection pin does not need to be replaced, and the memory card can be directly initialized under the condition that the detection pin fails, so that the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of terminal devices, and in particular, to a method, apparatus, device, medium, and program product for initializing a memory card. Background Art

[0002] The card tray can be used to insert the memory card. The card tray can be inserted into the terminal device in a hot-swappable manner.

[0003] In the related art, when a terminal device is inserted with a card tray, the level state of the detection pin of the terminal device changes. The system on chip (SOC) chip in the terminal device can generate an interrupt request based on the change of the level state, and then initialize the memory card based on the interrupt request.

[0004] However, if the detection pin fails, the related art method needs to replace the detection pin at a high cost, so that the SOC chip generates an interrupt request based on the level change of the new detection pin, and then initializes the memory card based on the interrupt request. In other words, the related art method has the problem of high cost. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device, medium, and program product for initializing a memory card, which can initialize the memory card when a pin failure is detected, thereby reducing costs.

[0006] In a first aspect, an embodiment of the present application provides a method for initializing a memory card, which is applied to a terminal device, wherein a system on chip (SOC) chip and a card tray are provided in the terminal device, wherein a detection pin is provided in the SOC chip, and the detection pin is connected to the card tray; the card tray is used to insert the memory card; and the method comprises:

[0007] Get the level status of the detection pin;

[0008] According to the level status, determine whether the detection pin is faulty;

[0009] In the case of a pin failure, the memory card is initialized through the card scanning function.

[0010] In one implementation, determining whether a detection pin is faulty according to a level state includes:

[0011] According to the level state, determine whether the detection pin detects a preset level signal;

[0012] If yes, it is determined that the detection pin is not faulty;

[0013] If not, it is determined that the detection pin is faulty.

[0014] In one implementation, initializing the memory card through a card scanning function includes:

[0015] Performing the i-th initialization process on the memory card through the card scanning function, obtaining the i-th initialization result; the i-th initialization result is initialization success or initialization failure;

[0016] Here, i is 1, 2, ... in sequence until the i-th initialization result is successful initialization; and a preset time interval is set between each two adjacent initialization processes.

[0017] In one implementation, performing the i-th initialization process on the memory card through the card scanning function includes:

[0018] Determine the usage flag corresponding to the memory card;

[0019] Determine the usage status of the memory card according to the usage flag bit; the usage status is an idle state or an occupied state;

[0020] When the usage state is the idle state, the memory card is initialized for the i-th time through the card scanning function.

[0021] In one implementation, the method further includes:

[0022] When the i-th initialization result is that the initialization is successful, an alarm message is generated; the alarm message is used to indicate a detection pin failure;

[0023] Display and process the alarm information.

[0024] In one implementation, the method further includes:

[0025] In case the detection pin is not faulty, an interrupt request is generated;

[0026] In response to the interrupt request, the memory card is initialized through the card scanning function.

[0027] In a second aspect, an embodiment of the present application provides a memory card initialization device, which is applied to a terminal device, wherein a system on chip (SOC) chip and a card tray are provided in the terminal device, wherein a detection pin is provided in the SOC chip, and the detection pin is connected to the card tray; the card tray is used to insert the memory card; the device comprises:

[0028] An acquisition module is used to obtain the level status of the detection pin;

[0029] A processing module, used to determine whether the detection pin is faulty according to the level state;

[0030] The processing module is also used to initialize the memory card through a card scanning function when a pin failure is detected.

[0031] In one implementation, the processing module is specifically configured to:

[0032] According to the level state, determine whether the detection pin detects a preset level signal;

[0033] If yes, it is determined that the detection pin is not faulty;

[0034] If not, it is determined that the detection pin is faulty.

[0035] In one implementation, the processing module is specifically configured to:

[0036] Performing the i-th initialization process on the memory card through the card scanning function, obtaining the i-th initialization result; the i-th initialization result is initialization success or initialization failure;

[0037] Here, i is 1, 2, ... in sequence until the i-th initialization result is successful initialization; and a preset time interval is set between each two adjacent initialization processes.

[0038] In one implementation, the processing module is specifically configured to:

[0039] Determine the usage flag corresponding to the memory card;

[0040] Determine the usage status of the memory card according to the usage flag bit; the usage status is an idle state or an occupied state;

[0041] When the usage state is the idle state, the memory card is initialized for the i-th time through the card scanning function.

[0042] In one implementation, the processing module is further configured to:

[0043] When the i-th initialization result is that the initialization is successful, an alarm message is generated; the alarm message is used to indicate a detection pin failure;

[0044] Display and process the alarm information.

[0045] In one implementation, the processing module is further configured to:

[0046] In case the detection pin is not faulty, an interrupt request is generated;

[0047] In response to the interrupt request, the memory card is initialized through the card scanning function.

[0048] In a third aspect, the present application provides a chip having a computer program stored thereon, and when the computer program is executed by the chip, the method as described in any one of the first aspects is implemented.

[0049] In a fourth aspect, the present application provides a chip module having a computer program stored thereon. When the computer program is executed by the chip module, the method of any one of the first aspects is implemented.

[0050] In a fifth aspect, an embodiment of the present application provides a terminal device, including: a memory and a processor;

[0051] Memory stores computer-executable instructions;

[0052] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to the first aspect.

[0053] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, which are used to implement the method of the first aspect when the computer execution instructions are executed by a processor.

[0054] In a seventh aspect, an embodiment of the present application provides a computer program product, comprising computer execution instructions, which, when executed by a processor, enable the method of the first aspect to be executed.

[0055] The embodiments of the present application provide a method, device, equipment, medium, and program product for initializing a memory card. A system-on-chip (SOC) chip and a card tray are provided in the terminal device, and a detection pin is provided in the SOC chip, and the detection pin is connected to the card tray; the card tray is used to insert the memory card. The method includes: the terminal device obtains the level state of the detection pin, and determines whether the detection pin is faulty according to the level state. In the case of a fault in the detection pin, the terminal device can initialize the memory card through a card scanning function. In the method of the embodiment of the present application, when it is determined that the detection pin is faulty based on the level state of the detection pin, there is no need to replace the detection pin, and the memory card can be initialized directly through the card scanning function, thereby realizing the normal use of the memory card and reducing the cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 creative labor.

[0057] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0058] Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0059] Figure 3a A schematic diagram of a memory card initialization method is provided for an embodiment of the present application Figure 1 ;

[0060] Figure 3b A schematic diagram of a process of initialization processing provided in an embodiment of the present application;

[0061] Figure 3c A schematic diagram of the structure of another terminal device provided in an embodiment of the present application;

[0062] Figure 4a A schematic diagram of a memory card initialization method is provided for an embodiment of the present application Figure 2 ;

[0063] Figure 4b A schematic diagram of a level state change provided in an embodiment of the present application;

[0064] Figure 4c A schematic diagram of another level state change provided in an embodiment of the present application;

[0065] Figure 5 A schematic diagram of the structure of a memory card initialization device provided by an exemplary embodiment of the present application;

[0066] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0068] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, such as processes, methods, systems, products, or devices that include a series of steps or units, which are not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0069] In this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, in this application, "equal to" can be used in conjunction with "greater than" or "less than". When "equal to" is used in conjunction with "greater than", the technical solution of "greater than" is adopted; when "equal to" is used in conjunction with "less than", the technical solution of "less than" is adopted.

[0070] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application.

[0071] See also Figure 1 , the application scenario includes terminal equipment.

[0072] In this application scenario:

[0073] The card tray can be used to insert the memory card. The card tray can be inserted into the terminal device in a hot-swappable manner.

[0074] In the related art, when a terminal device is inserted with a card tray, the level state of the detection pin of the terminal device changes. The system on chip (SOC) chip in the terminal device can generate an interrupt request based on the change of the level state, and then initialize the memory card based on the interrupt request.

[0075] However, in the method of the related art, if the detection pin fails, it is necessary to replace the detection pin at a high cost, so that the SOC chip generates an interrupt request based on the level change of the new detection pin, and then initializes the memory card based on the interrupt request.

[0076] The methods in the related art have the problem of high cost.

[0077] In order to solve the above technical problems, an embodiment of the present application provides a method for initializing a memory card, which does not require replacement of a detection pin. When it is determined that a detection pin is faulty based on the level state of the detection pin, the memory card can be initialized directly through a card scanning function, thereby achieving normal use of the memory card and reducing costs.

[0078] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0079] Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application.

[0080] See also Figure 2The terminal device is provided with a SOC chip 10 and a card tray 20.

[0081] The SOC chip 10 is provided with a detection pin 11 .

[0082] The detection pin 11 is connected to the card tray 20. In one implementation, the terminal device may include a card slot ( Figure 2 (not shown). The card slot can be used to insert the card tray 20. The detection pin 11 can be set in the card slot of the terminal device to connect with the card tray 20.

[0083] The card tray 20 is used to insert a memory card 21 .

[0084] The SOC chip 10 can be used to obtain the level state of the detection pin 11 .

[0085] The SOC chip 10 can determine whether the detection pin 11 is faulty according to the level state.

[0086] When the SOC chip 10 detects a fault in the pin 11 , it can initialize the memory card 21 through a card scanning function.

[0087] It should be noted that the memory card 21 may be a Secure Digital (SD) card, or other devices with storage functions, which is not limited in the embodiments of the present application.

[0088] It should be noted that the execution subject of the following method embodiment is a terminal device, and further, a SOC chip in the terminal device.

[0089] Figure 3a A schematic diagram of a memory card initialization method is provided for an embodiment of the present application Figure 1 . See Figure 3a , the method comprising:

[0090] S301: Obtain the level status of the detection pin.

[0091] First, the level status of the detection pin is described.

[0092] In one implementation:

[0093] In the case where the detection pin is not faulty, when the card tray is inserted into the terminal device (card tray is in place), the level state of the detection pin changes from a low level state to a high level state.

[0094] In the case of a detection pin failure, when the card tray is inserted into the terminal device (card slot of the terminal device), the level state of the detection pin is a low level state. Exemplarily, the failure of the detection pin may be that the air is humid and causes the detection pin to short-circuit.

[0095] In one implementation:

[0096] In the case where the detection pin is not faulty, when the card tray is inserted into the terminal device (card tray is in place), the level state of the detection pin changes from a high level state to a low level state.

[0097] In the case of a detection pin failure, when the card tray is inserted into the terminal device (card tray in place), the level state of the detection pin is a high level state.

[0098] In this embodiment, the terminal device can obtain the level state of the detection pin.

[0099] In one implementation, in a scenario where the card tray has been inserted into the terminal device, the terminal device can obtain the level status of the detection pin.

[0100] S302: Determine whether the detection pin is faulty according to the level state.

[0101] In this embodiment, the terminal device can determine whether the detection pin is faulty according to the level state of the detection pin.

[0102] In one implementation:

[0103] The terminal device can determine whether the detection pin detects a preset level signal according to the level status.

[0104] If yes, it is determined that the detection pin is not faulty.

[0105] If not, it is determined that the detection pin is faulty.

[0106] It should be noted that the preset level signal may be a rising edge signal, the preset level signal may be a falling edge signal, the preset level signal may be a high level signal, or the preset level signal may be a low level signal. The embodiment of the present application does not limit the preset level signal.

[0107] S303: When a pin failure is detected, the memory card is initialized by a card scanning function.

[0108] In this embodiment, the terminal device can initialize the memory card through the card scanning function when a pin failure is detected. It should be noted that the card scanning function can also be called an interrupt service function.

[0109] It can be understood that the SOC chip of the terminal device initializes the memory card through the card scanning function when a pin failure is detected. More specifically, the processor in the SOC chip initializes the memory card through the card scanning function when a pin failure is detected.

[0110] Next, the process of initializing the memory card by the terminal device through the card scanning function is described.

[0111] In one implementation:

[0112] When a pin failure is detected, the terminal device can perform the i-th initialization process on the memory card through the card scanning function to obtain the i-th initialization result, wherein the i-th initialization result is initialization success or initialization failure.

[0113] It should be noted that i is 1, 2, ... in sequence until the i-th initialization result is successful initialization.

[0114] It should also be noted that a preset time interval is set between each two adjacent initialization processes. Exemplarily, the preset time interval may be 1 second. That is, the terminal device may sleep for 1 second if the initialization fails. The terminal device may perform the initialization process after sleeping for 1 second.

[0115] In addition, in one implementation, the terminal device may also generate an alarm message when the initialization result of the i-th time is successful. The terminal device may display the alarm message, wherein the alarm message is used to indicate a fault in the detection pin.

[0116] It should be noted that, when the card tray is inserted in the terminal device, the terminal device can initialize the memory card (initialization successful); when the card tray is not inserted in the terminal device, the terminal device cannot initialize the memory card (initialization failed). Therefore, when the initialization is successful, the terminal device can determine that the card tray is inserted in the terminal device and the detection pin is faulty. The terminal device can issue an alarm to remind the user to replace the detection pin in time.

[0117] Next, the process of the terminal device performing the i-th initialization processing on the memory card through the card scanning function is described.

[0118] In one implementation:

[0119] The terminal device may determine the usage flag bit corresponding to the memory card. Exemplarily, the usage flag bit may be 0 or 1.

[0120] The terminal device can determine the usage status of the memory card according to the usage flag bit, wherein the usage status is an idle state or an occupied state.

[0121] When the usage status of the memory card is idle, the terminal device can perform the i-th initialization process on the memory card through the card scanning function.

[0122] Next, combine Figure 3b, a specific implementation process of initializing a storage card by a terminal device through a card scanning function is described.

[0123] Figure 3b A schematic diagram of an initialization process provided by an embodiment of the present application. Figure 3b As shown:

[0124] ① For the i-th initialization process, the terminal device performs initialization process on the memory card through the card scanning function to obtain the i-th initialization result. It should be noted that, in the first initialization process, i is 1.

[0125] ② The terminal device determines whether the i-th initialization result is successful initialization. If so, the process ends; if not, the process proceeds to step ③.

[0126] ③ After a preset time interval, the terminal device adds 1 to i.

[0127] It should be noted that after executing step ③, the terminal device can return to execute step ①.

[0128] Below, taking an initialization process as an example, the process of initializing the memory card by the terminal device through the card scanning function is explained.

[0129] The terminal device can send a soft reset command to the memory card through the card scanning function.

[0130] The terminal device can obtain the type and working mode of the memory card through the card scanning function. In one implementation, the terminal device can send a query command to the memory card through the card scanning function. The terminal device can obtain the response data sent by the memory card through the card scanning function, and determine the type and working mode of the memory card according to the response data.

[0131] The terminal device can determine the corresponding initialization command according to the type and working mode of the memory card through the card scanning function, and initialize the memory card according to the initialization command. The initialization command includes but is not limited to: clock frequency setting command, protocol setting command, block size setting command, etc.

[0132] In addition, the terminal device can determine the initialization result according to the response data and the value of the status register corresponding to the memory card after obtaining the response data sent by the memory card through the card scanning function. The initialization result is initialization success or initialization failure. It should be noted that the response data is sent by the memory card based on the initialization command.

[0133] S304: When the detection pin is not faulty, an interrupt request is generated.

[0134] S305: In response to the interrupt request, the memory card is initialized by a card scanning function.

[0135] In this embodiment, the terminal device may generate an interrupt request when the detection pin is not faulty. The terminal device may respond to the interrupt request and initialize the memory card through a card scanning function.

[0136] In one implementation:

[0137] Figure 3c This is a schematic diagram of the structure of another terminal device provided in an embodiment of the present application. Figure 3c As shown, the SOC chip 10 is provided with a detection pin 11 and a processor 12. The processor 12 is provided with a conversion circuit 121 and an external interrupt controller 122.

[0138] Based on the above terminal device structure, the process of generating an interrupt request by the terminal device and initializing the memory card through the card scanning function in response to the interrupt request is described in detail below.

[0139] The terminal device can convert the preset level signal into a digital signal through a conversion circuit in the processor. The preset level signal is detected by the detection pin. It can be understood that the preset level signal is an analog signal.

[0140] The terminal device can generate an interrupt request according to the digital signal through the external interrupt controller in the processor.

[0141] The terminal device can initialize the memory card through the card scanning function in response to the interrupt request through the processor.

[0142] Beneficial effects of this embodiment: In this embodiment, the terminal device can obtain the level status of the detection pin. The terminal device can determine whether the detection pin is faulty according to the level status. In the case of a fault in the detection pin, the terminal device can initialize the memory card through the card scanning function. The method of the embodiment of the present application does not require the cost of replacing the detection pin. When it is determined that the detection pin is faulty based on the level status of the detection pin, the memory card can be initialized directly through the card scanning function, thereby realizing the normal use of the memory card and reducing costs.

[0143] Figure 4a A schematic diagram of a memory card initialization method is provided for an embodiment of the present application Figure 2 . See Figure 4a , the method comprising:

[0144] S401: Obtain the level status of the detection pin.

[0145] In this embodiment, the terminal device can obtain the level state of the detection pin.

[0146] In one implementation, the terminal device may obtain the level state of the detection pin when the card tray has been inserted into the terminal device.

[0147] S402: Determine whether the detection pin detects a preset level signal according to the level state.

[0148] In this embodiment, the terminal device can determine whether the detection pin detects a preset level signal according to the level state of the detection pin.

[0149] If not, execute S403;

[0150] If yes, execute S405.

[0151] Next, a process of determining whether the detection pin detects a preset level signal according to the level status of the terminal device is described.

[0152] In one implementation:

[0153] In the case where the detection pin is not faulty, when the card tray is inserted into the terminal device (card tray is in place), the level state of the detection pin changes from a low level state to a high level state. The preset level signal may be a rising edge signal. The preset level signal may also be a high level signal.

[0154] In this embodiment, after acquiring the level state of the detection pin, the terminal device may determine that the detection pin detects a preset level signal when determining that the level state of the detection pin changes from a low level state to a high level state.

[0155] In one implementation:

[0156] In the case where the detection pin is not faulty, when the card tray is inserted into the terminal device (card tray is in place), the level state of the detection pin changes from a high level state to a low level state. The preset level signal can be a falling edge signal. The preset level signal can also be a low level signal.

[0157] In this embodiment, after acquiring the level state of the detection pin, the terminal device may determine that the detection pin detects a preset level signal when determining that the level state of the detection pin changes from a high level state to a low level state.

[0158] S403: Determine whether the detection pin is faulty.

[0159] In this embodiment, the terminal device may determine that the detection pin is faulty when it is determined that the detection pin does not detect a preset level signal.

[0160] Next, the reason why the terminal device determines that the detection pin fails when it determines that the detection pin does not detect a preset level signal is described.

[0161] In one implementation:

[0162] Figure 4b A schematic diagram of a level state change provided in an embodiment of the present application.

[0163] like Figure 4b As shown, when the detection pin is not faulty: when the card tray is not in place, the level state of the detection pin is a low level state; when the card tray is in place, the level state of the detection pin is a high level state. That is to say, at the moment (t) when the card tray is inserted into the terminal device, the level state of the detection pin changes from a low level state to a high level state. Accordingly, the preset level signal can be a rising edge signal, and the preset level signal can also be a high level signal.

[0164] When the card tray is inserted in the terminal device (card tray in place), if the detection pin does not detect the preset level signal, it means that the level state of the detection pin has not changed from a low level state to a high level state, that is, the detection pin is faulty.

[0165] In one implementation:

[0166] Figure 4c Another schematic diagram of the change of level state provided in the embodiment of the present application. Figure 4c As shown, when the detection pin is not faulty: when the card tray is not in place, the level state of the detection pin is a high level state; when the card tray is in place, the level state of the detection pin is a low level state. That is to say, at the moment (t) when the card tray is inserted into the terminal device, the level state of the detection pin changes from a high level state to a low level state. Accordingly, the preset level signal can be a falling edge signal, and the preset level signal can also be a low level signal.

[0167] When the card tray is inserted in the terminal device (card tray in place), if the detection pin does not detect the preset level signal, it means that the level state of the detection pin has not changed from a high level state to a low level state, that is, the detection pin is faulty.

[0168] S404: When a pin failure is detected, the memory card is initialized by a card scanning function.

[0169] In this embodiment, the terminal device can initialize the memory card through the card scanning function when a pin failure is detected.

[0170] The specific implementation process is the same as S303 and will not be repeated here.

[0171] S405: Determine whether the detection pin is faulty.

[0172] In this embodiment, the terminal device may determine that the detection pin is not faulty when it is determined that the detection pin detects a preset level signal.

[0173] S406: When the detection pin is not faulty, an interrupt request is generated.

[0174] S407: In response to the interrupt request, the memory card is initialized by a card scanning function.

[0175] In this embodiment, the terminal device may generate an interrupt request when the detection pin is not faulty. The terminal device may respond to the interrupt request and initialize the memory card through a card scanning function.

[0176] The specific implementation process is the same as S304 and S305 and will not be repeated here.

[0177] Beneficial effects of this embodiment: In this embodiment, the terminal device can obtain the level state of the detection pin, and determine whether the detection pin detects a preset level signal according to the level state. If not, the terminal device can determine that the detection pin is faulty, and initialize the memory card through the card scanning function; if so, the terminal device can determine that the detection pin is not faulty, generate an interrupt request, and initialize the memory card through the card scanning function in response to the interrupt request. The method of the embodiment of the present application determines whether the detection pin is faulty by determining whether the detection pin detects a preset level signal, thereby improving the fault detection efficiency of the detection pin. In addition, in the case of a faulty detection pin, the method of the embodiment of the present application does not require the cost of replacing the detection pin, and can directly initialize the memory card through the card scanning function, thereby realizing the normal use of the memory card and reducing costs.

[0178] Figure 5 A schematic diagram of a memory card initialization device provided for an exemplary embodiment of the present application. The memory card initialization device 50 is applied to a terminal device, wherein a system on chip (SOC) chip and a card tray are provided in the terminal device, wherein a detection pin is provided in the SOC chip, and the detection pin is connected to the card tray; and the card tray is used to insert the memory card.

[0179] See also Figure 5 The memory card initialization device 50 includes an acquisition module 51 and a processing module 52.

[0180] in,

[0181] An acquisition module 51 is used to acquire the level state of the detection pin;

[0182] A processing module 52, used to determine whether the detection pin is faulty according to the level state;

[0183] The processing module 52 is further used to initialize the memory card through a card scanning function when a pin failure is detected.

[0184] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0185] In one implementation, the processing module 52 is specifically configured to:

[0186] According to the level state, determine whether the detection pin detects a preset level signal;

[0187] If yes, it is determined that the detection pin is not faulty;

[0188] If not, it is determined that the detection pin is faulty.

[0189] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0190] In one implementation, the processing module 52 is specifically configured to:

[0191] Performing the i-th initialization process on the memory card through the card scanning function, obtaining the i-th initialization result; the i-th initialization result is initialization success or initialization failure;

[0192] Here, i is 1, 2, ... in sequence until the i-th initialization result is successful initialization; and a preset time interval is set between each two adjacent initialization processes.

[0193] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0194] In one implementation, the processing module 52 is specifically configured to:

[0195] Determine the usage flag corresponding to the memory card;

[0196] Determine the usage status of the memory card according to the usage flag bit; the usage status is an idle state or an occupied state;

[0197] When the usage state is the idle state, the memory card is initialized for the i-th time through the card scanning function.

[0198] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0199] In one implementation, the processing module 52 is further configured to:

[0200] When the i-th initialization result is that the initialization is successful, an alarm message is generated; the alarm message is used to indicate a detection pin failure;

[0201] Display and process the alarm information.

[0202] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0203] In one implementation, the processing module 52 is further configured to:

[0204] In case the detection pin is not faulty, an interrupt request is generated;

[0205] In response to the interrupt request, the memory card is initialized through the card scanning function.

[0206] The memory card initialization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0207] The embodiment of the present application also provides a chip. It can be understood that the chip can be a fifth generation mobile communication technology (5th Generation Mobile Communication Technology, referred to as 5G) chip.

[0208] A computer program is stored on the chip, and when the computer program is executed by the chip, the method of the above method embodiment is implemented.

[0209] The embodiment of the present application also provides a chip module. It can be understood that the chip module can be a 5G chip module.

[0210] A computer program is stored on the chip module, and when the computer program is executed by the chip module, the method of the above method embodiment is implemented.

[0211] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. It can be understood that the terminal device can be a 5G chip module.

[0212] See also Figure 6The terminal device 60 may include a processor 61 and a memory 62. Exemplarily, the processor 61 and the memory 62 are interconnected via a bus 63.

[0213] The memory 62 stores computer executable instructions;

[0214] The processor 61 executes the computer-executable instructions stored in the memory 62 , so that the processor 61 executes the method shown in the above method embodiment.

[0215] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0216] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the method of the above method embodiment is used to implement the method.

[0217] Accordingly, an embodiment of the present application may also provide a computer program product, including computer execution instructions, which, when executed by a processor, enable the method shown in the above method embodiment to be executed.

[0218] These computer executable instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0219] These computer executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0220] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0221] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A method for initializing a memory card, characterized in that: Applied to a terminal device, the terminal device is provided with a system on chip SOC chip and a card tray, the SOC chip is provided with a detection pin, and the detection pin is connected to the card tray; The card tray is used to insert the memory card; the method comprises: Obtaining the level state of the detection pin; Determining whether the detection pin is faulty according to the level state; In the case of a fault in the detection pin, the memory card is initialized through a card scanning function.

2. The method according to claim 1, characterized in that Determining whether the detection pin is faulty according to the level state includes: According to the level state, determining whether the detection pin detects a preset level signal; If yes, it is determined that the detection pin is not faulty; If not, it is determined that the detection pin is faulty.

3. The method according to claim 1 or 2, characterized in that: Initializing the memory card through a card scanning function includes: Performing an i-th initialization process on the memory card through the card scanning function to obtain an i-th initialization result; the i-th initialization result is initialization success or initialization failure; Herein, the i is sequentially 1, 2, ..., until the i-th initialization result is the initialization success; and a preset time period is provided between each two adjacent initialization processes.

4. The method according to claim 3, characterized in that The memory card is initialized for the i-th time by the card scanning function, including: Determine a usage flag corresponding to the memory card; Determining the usage status of the memory card according to the usage flag; the usage status is an idle state or an occupied state; When the usage state is the idle state, the memory card is initialized for the i-th time through the card scanning function.

5. The method according to claim 3, characterized in that: The method further comprises: When the i-th initialization result is that the initialization is successful, generating an alarm message; the alarm message is used to indicate that the detection pin is faulty; The warning information is displayed.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In the case that the detection pin is not faulty, generating an interrupt request; In response to the interrupt request, the memory card is initialized by the card scanning function.

7. A memory card initialization device, characterized in that: Applied to a terminal device, the terminal device is provided with a system on chip SOC chip and a card tray, the SOC chip is provided with a detection pin, and the detection pin is connected to the card tray; The card tray is used to insert the memory card; the device comprises: An acquisition module, used for acquiring the level state of the detection pin; A processing module, used for determining whether the detection pin is faulty according to the level state; The processing module is further configured to initialize the memory card through a card scanning function when the detection pin fails.

8. A terminal device, characterized in that: include: Memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The method comprises computer-executable instructions, which, when executed by a processor, enable the method according to any one of claims 1 to 6 to be performed.