Embedded eMMC protocol consistency-oriented conflict test method and system
By calculating conflict risk values to screen high-risk combinations and performing injection tests, the problem of insufficient risk coverage in complex scenarios in eMMC testing is solved, enabling in-depth detection and risk warning of eMMC devices and improving the detection capability before product deployment.
Patent Information
- Application Number
- CN202511211473.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-11-18
AI Technical Summary
Existing eMMC testing lacks sufficient coverage of potential risks in complex scenarios, especially in detecting illegal or conflicting commands during data transmission, deletion, and verification. This makes it difficult to detect deeper issues such as data inconsistency and state pollution, and these problems are likely to be exposed after product deployment.
By defining a set of protocol states and key commands, the system calculates conflict risk values, filters high-risk combinations and performs conflict injection tests, captures anomalous results, outputs visual charts, including dynamic feedback loops to update the conflict matrix, and identifies new risk patterns.
Systematically investigate anomalies before product deployment, provide accurate test results, prevent potential risks, and improve the stability and reliability of eMMC devices.
Smart Images

Figure CN120979991A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of embedded storage device testing, in particular to a conflict test method and system for embedded eMMC protocol consistency. BACKGROUND
[0002] The current eMMC test is insufficient in covering potential risks in complex scenarios. Although the conventional test can cover basic functions and simple boundary conditions, it seriously ignores the abnormal behaviors caused by executing illegal or conflicting commands (such as interrupt commands, switching commands, selected commands, etc.) in critical operation states (such as data transmission, deletion, and verification processes). The lack of such combined testing, combined with insufficient detection of timing boundary deviations and command conflicts, makes it difficult to effectively discover deep-seated problems such as data inconsistency and state pollution caused by such combinations. These hidden dangers are easily overlooked in standard protocol verification and are often latent, only to be exposed after a period of product deployment, which can cause serious customer problems and unpredictable consequences.
[0003] Therefore, there is an urgent need for a combined test method that can target these protocol states and specific command sequences (such as interrupts, switches, and selections) to systematically detect and prevent such risks. SUMMARY
[0004] The present application aims to overcome the shortcomings of the prior art and provide a conflict test method and system for embedded eMMC protocol consistency, which is suitable for combined testing of interrupt commands, switching commands, and selected commands in data transmission, deletion, and verification protocol states.
[0005] The purpose of the present application is achieved by the following technical solutions:
[0006] In a first aspect, a conflict test method for embedded eMMC protocol consistency is provided, which defines a set S containing various protocol states and a key command set C containing various key commands. The conflict risk value of a key command Cj sent in a protocol state Si is calculated and represented as Rij, where i and j are intermediate variables. A plurality of conflict risk values higher than a preset threshold are selected from all conflict risk values to filter out a group of key commands and protocol states corresponding to each conflict risk value higher than the preset threshold, and the combination of the two is defined as having a high conflict risk. According to the obtained multiple groups of key commands and protocol states with high conflict risks, command conflict injection testing is performed, including forcibly sending one or more key commands with high conflict risks to a device in a certain protocol state for detection and capturing of abnormal results. Finally, the test results are output and converted into a visual chart.
[0007] The beneficial effects of the present application are: by screening the state-command combination with a conflict risk value higher than the preset threshold for conflict injection testing, injecting a protocol-unallowed or high-risk command Cj in the critical operation window period of the target protocol state Si, a key command Cj that should not be sent in this state or has a high conflict risk can be forcibly sent when the device is in a certain critical protocol state Si and performs its normal operation process, thereby simulating an illegal command sequence or an unfavorable timing condition. Then, based on the simulation, abnormal results can be captured, thereby checking abnormal conditions as much as possible before product deployment to obtain accurate detection results.
[0008] Further, each element in the key command set is a command conforming to the eMMC protocol; the protocol state set S={S1, S2,..., Sn}, wherein each element in the set represents each protocol state, and each protocol state is an execution state conforming to the eMMC protocol.
[0009] Further, the conflict risk value of a key command Cj sent in a certain protocol state Si is represented by Rij, which includes: R ij=α·I illegal(Si,C j)+β·F damage(Si,C j)·T critical(Si,C j) wherein I illegal is whether the protocol allows the command to be executed in the state, taking the value 0 or 1; Fdamage is the data damage probability, taking the value 0-1; T critical is the timing sensitivity, taking the value 0-1; and α, β are coefficients, taking the value 0-1.
[0010] Further, when the T critical>0.7, an exponential amplification mechanism is introduced, which includes:
[0011] The conflict risk value is modified as:
[0012] Rij=α·Iillegal(Si,Cj)+β·Fdamage(Si,Cj)·(3Tcritical(Si,Cj)-0.7)Rij=α·Iillegal(Si,Cj)+β·Fdamage(Si,Cj)·(3Tcritical(Si,Cj)-0.7)
[0013] wherein the limit threshold is 0.7 and the base is 3, so as to avoid calculation result jumping by continuous smooth transition.
[0014] Further, the forcibly sending one or more critical commands with high collision risk includes at least one of the following execution manners: injecting the critical commands with high collision risk at a specific time point during the duration of a certain protocol state; injecting the critical commands with high collision risk at a specific sub-stage of a certain protocol state; continuously injecting multiple critical collision commands with high collision risk during the duration of a certain protocol state.
[0015] Further, the detecting and capturing abnormal results include: data integrity verification to obtain a result of whether the number of transmission blocks is consistent; state register pollution detection to obtain a result of whether an illegal bit is set; buffer residual detection to obtain a result of whether there is unemptied data; when at least one of the test results of the data integrity verification, the state register pollution detection, and the buffer residual detection is abnormal, capturing one or more corresponding abnormal results and outputting the one or more abnormal results as a defect feature record as a detection result.
[0016] Further, the dynamic feedback loop further includes: when a new risk mode that is not defined in the protocol specification is detected in the detection result, updating the conflict matrix Rconflict parameter; updating the conflict matrix Rconflict parameter includes: when an illegal combination is detected, setting the Iillegal value of the corresponding critical state and critical command combination to 1; when very irregular data damage is detected, updating the data damage probability value F damage, including: accessing data to obtain a historical damage probability value and received protocol state Si, critical command Cj, and current damage severity D_new, updating the data damage probability value F damage = k1xF_damageh + k2xD_new; wherein k1 + k2 = 1; when a new timing sensitive point is found, updating T critical to the maximum value of the historical value of the last round and the measured sensitivity obtained in the detection result; based on the updated parameter, recalculating the conflict risk value, if the new conflict risk value exceeds a preset threshold, starting a new round of conflict injection test, otherwise terminating.
[0017] Further, the dynamic feedback loop further includes: performing boundary scan testing on the open transmission operation, and identifying a risk mutation point on the timing boundary by controlling a stop command (CMD12) to be sent with a microsecond level delay.
[0018] Further, the new risk mode includes at least one of the following: an unexpected register state bit change; a new type of data damage feature; an unrecorded timing sensitive window.
[0019] On the other hand, a conflict testing system for embedded eMMC protocol conformance is disclosed, comprising: a storage device storing a computer program for implementing the conflict testing method for embedded eMMC protocol conformance; and a processor performing read and write operations on the storage device to execute the computer program stored on the storage device. Attached Figure Description
[0020] Figure 1 This application provides a conflict testing method for embedded eMMC protocol conformance according to some embodiments.
[0021] Figure 2 This is a schematic diagram illustrating the injection of conflict commands and the detection process according to some embodiments of this application;
[0022] Figure 3 This is an exemplary case of execution conflict injection according to some embodiments of this application;
[0023] Figure 4 This is a flowchart illustrating the detection process (triple defect detection) according to some embodiments of this application;
[0024] Figure 5 A pie chart showing the distribution of triple defect results according to some embodiments of this application;
[0025] Figure 6 This is a flowchart illustrating the timing scan of a boundary scene according to some embodiments of this application;
[0026] Figure 7 This is a graph showing the detection results of risk mutation points according to some embodiments of this application;
[0027] Figure 8 A conflict matrix heatmap of protocol state-key commands according to some embodiments of this application;
[0028] Figure 9 The following are timing boundary scan waveforms according to some embodiments of this application;
[0029] Figure 10 This is a comparison chart of data block transmission consistency according to some embodiments of this application;
[0030] Figure 11 This is a simplified flowchart illustrating the feedback loop according to some embodiments of this application. Detailed Implementation
[0031] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] See Figures 1-11 This invention provides a conflict testing method and system for embedded eMMC protocol conformance.
[0033] According to the conflict testing method for embedded eMMC protocol conformance according to the embodiments of this application, refer to Figure 1 and Figure 2 Understand that the definition includes a set S containing various protocol states and a set C containing various key commands; the protocol states described here can be any execution state of the storage hardware device (such as an eMMC device), and the key commands are externally issued instructions or instructions triggered by the device itself. Key commands can be input to the storage hardware device to achieve state switching.
[0034] In this embodiment, the conflict risk value of a key command Cj sent under a certain protocol state Si is represented by Rij, where i and j are intermediate variables. That is, for any protocol state, it can be combined with any key command Cj to calculate the conflict risk. Thus, based on the defined key commands and protocol state variables, all possible conflict risk scenarios can be comprehensively obtained and retrieved in subsequent steps, facilitating free combination testing. For example, a command conflict matrix RconflictR can be established, where the element Rij in matrix R represents the conflict risk value of sending command Cj under state Si.
[0035] Then, select multiple conflict risk values that are higher than a preset threshold among all conflict risk values, and filter out a set of key commands and protocol states corresponding to each conflict risk value that exceeds the preset threshold. These are defined as combinations of the two that have a high conflict risk. The preset threshold can be set according to needs or actual conditions.
[0036] According to the obtained multiple sets of critical commands and protocol states with high conflict risks, the command conflict injection test comprises: forcibly sending one or more critical commands with high conflict risks to the device in a certain protocol state for detection and capturing of abnormal results. In other words, the conflict injection test is performed by screening state-command combinations with conflict risk values higher than a preset threshold, so as to inject a protocol-unallowed or high-risk command Cj in the critical operation window period of the target protocol state Si. When the device is in a certain critical protocol state Si and performs a normal operation process, a critical command Cj that should not be sent or has a high conflict risk in the state is forcibly sent to simulate an illegal command sequence or an adverse timing condition. Then, based on the simulation, abnormal results can be captured, so that abnormal conditions can be checked as much as possible before product deployment, and accurate detection results can be obtained.
[0037] Subsequently, the eMMC device is taken as an example for illustration, wherein the critical command set can be various instructions in the eMMC device, such as CMD6, CMD7, CMD12, CMD15, CMD23, CMD18, and CMD25, and the critical command set is C = {CMD6, CMD7, CMD12, CMD15, CMD23, CMD18, CMD25}. Similarly, the protocol states include DELETE_ACTIVE, TRANSFER_ACTIVE, VERIFY_ACTIVE, DEVICE_SELECTED, and the like, and for the purpose of simplification, each different protocol state is denoted as S1, S2,..., Sn, and the protocol state set is S = {S1, S2,..., Sn}. Specifically, the protocol state set and the command set can be checked in the eMMC protocol document, such as the JEDEC standard, to ensure the accuracy of the states and the commands. The CMD6 is used to switch the working mode or configure parameters of the eMMC, the CMD7 is used to select or deselect the current device, the CMD12 is used to forcibly terminate the current data transmission (read / write), the CMD15 is used to make the device enter the Inactive state (low-power mode), the CMD23 is used to pre-set the data block quantity of subsequent multiple read / write operations, the CMD18 is used to continuously read multiple data blocks from a specified address, and the CMD25 is used to continuously write multiple data blocks to a specified address. The DELETE_ACTIVE is used to indicate that the device is performing an erasing operation, the TRANSFER_ACTIVE is used to indicate that the device has been selected by the CMD7 and is currently performing data transmission (read / write), the VERIFY_ACTIVE is used to indicate that the device is performing a data verification operation (such as returning a verification progress when the state is queried by the CMD13), and the DEVICE_SELECTED is used to indicate that the device has been selected by the host through the CMD7 (RCA matching) and is in a communicable state.
[0038] In some embodiments, the calculation of the conflict risk value of a key command Cj sent under a certain protocol state Si, denoted by Rij, specifically includes:
[0039] R ij=α·Iillegal(Si,C j)+β·F damage(Si,C j)·T critical(Si,C j);
[0040] Where I illegal indicates whether the protocol allows the command to be executed in this state, with a value of 0 or 1; F damage is the probability of data corruption, with a value of 0 to 1; T critical is the timing sensitivity, with a value of 0 to 1; α and β are both coefficients, with values of 0 to 1; and Si,Cj in parentheses represents a specific protocol state-critical command combination (Si,Cj), which serves as an explanation.
[0041] In detail, "I illegal" can be determined according to eMMC protocol specifications, such as the state transition table of JESD84-B51. For example, CMD7 is 1 in the TRANSFER_ACTIVE state, indicating illegality. "F damage" can be determined based on historical fault statistics and expert evaluation. For example, CMD15 is 0.9 in the DELETE_ACTIVE state. "T critical" can be determined through timing sensitivity experiments. For example, CMD12 in block transmission is 0.8. The weighting coefficient α is the protocol violation weight, which is chosen as 0.6 in some examples. β is the data corruption weight, which can be chosen as 0.4. Of course, both can be optimized and adjusted according to the JEDEC standard JESD218C.
[0042] In some examples, to enhance high-risk identification, when T_critical > 0.7, the risk value calculation introduces an exponential amplification mechanism with a growth rate of up to 3 times, including: modifying the conflict risk value to: Rij = α·Iillegal(Si,Cj) + β·Fdamage(Si,Cj)·(3 Tcritical(Si,Cj) -0.7)Rij=α·Iillegal(Si,Cj
[0043] )+β·Fdamage(Si,Cj)·(3 Tcritical(Si,Cj) -0.7) where the exponential function provides asymptotic acceleration; specifically, by limiting the threshold to 0.7 and the base to 3, the calculation results are avoided by abrupt changes through a continuous and smooth transition, that is, the function is continuous at Tcritical = 0.7.
[0044] In other words, the aforementioned method introduces a piecewise function and an exponential amplification mechanism on the basis of the original formula, as specifically defined below:
[0045] When T critical ≤ 0.7:
[0046] Rij = a • Iillegal(Si, Cj) + b • Fdamage(Si, Cj) • Tcritical(Si, Cj) Rij = a • Iillegal(Si, Cj) + b • Fdamage(Si, Cj) • Tcritical(Si, Cj)
[0047] When Tcritical> 0.7:
[0048] Rij = a • Iillegal(Si, Cj) + b • Fdamage(Si, Cj) • (3 Tcritical-0.7 )Rij = a • Iillegal(Si, Cj) + b • Fdamage(Si, Cj) • (3T critical-0.7 )
[0049] It can be understood that the non-linear accelerated growth is achieved by function 3 (Tcritical-0.7) , so as to strictly meet the described amplification factor behavior, achieve continuity by simple constant correction, and provide real acceleration in the Tcritical> 0.7 area. For example, refer to the actual value of the subscript:
[0050]
[0051] In some examples, the technical effect verification (numerical value is an example) is as follows:
[0052] Suppose a command has the following parameters in state Si: a = 0.8, b = 0.9
[0053] Iillegal= 0 (legal command)
[0054] Fdamage= 0.6.
[0055] Then the following table is obtained:
[0056]
[0057]
[0058] It can be seen that when the threshold value is above 0.7, the risk value increases exponentially from linear growth as the timing sensitivity increases by 0.1. When Tcriticalapproaches 1.0, the actual risk value is increased by more than 39% compared to the original formula, which meets the design intention of "high-risk scenarios need to be strengthened".
[0059] Further, forcibly sending one or more critical commands with high conflict risk includes at least one of the following execution modes, including:
[0060] The critical command with high conflict risk is injected at a specific time point during the duration of a certain protocol state, for example, the CMD7 command is injected at t=50 μs after the start of data transmission when the protocol state is data transmission. Or the critical command with high conflict risk is injected at a specific sub-stage of a certain protocol state, for example, the CMD15 command is injected at the verification stage when the protocol state is performing a block erase operation. Or a plurality of critical conflict commands with high conflict risk are continuously injected during the duration of a certain protocol state; for example, the CMD12, CMD7, etc. commands are continuously injected in the TRANSFER_ACTIVE state. Thus, according to the actual protocol state, different injection strategies can be selected to detect the corresponding high conflict risk situation.
[0061] For another example, Figure 3 As shown, for example, at the first level, the conflict injection test is performed from the test entrance, the conflict test flow is started, the abnormal operation scenario is simulated, and the system robustness is verified. At the second level, the conflict injection point is executed, the CMD7 is inserted in the data transmission, the device switching command is injected in the regular data transmission process, the bus conflict processing capability is tested, the CMD12 is inserted in the block transmission, the stop command is injected in the middle of the block data transmission, and the transmission interruption recovery mechanism is tested. At the third level, specific operations are performed, including:
[0062] Branch one is the CMD7 injection flow, including: monitoring the state machine to monitor the system state register in real time, waiting for an injectable opportunity, confirming the TRANSFER_ACTIVE state, and confirming that the system is in the data transmission stage when the state machine shows the "transfer active" flag. The device switching command CMD7 is inserted, and the device selection command (CMD7) is forced to be sent, simulating the device hot plug scenario. The specific parameter setting is: target device ID=0x01, the timing control is: inserted at the rising edge of the clock. The conflict response is recorded: the following key indicators are captured and recorded, the state machine jump trajectory (such as jumping to the ERROR_STATE); the data loss amount statistics, and the bus recovery time.
[0063] Branch two is the CMD12 injection flow, including positioning the transmission stage, monitoring the transmission progress through the block counter; identifying the pre-defined block transmission: triggering injection when the system enters the pre-defined block transmission window, inserting the stop command CMD12 in the block transmission gap. Timing requirement: after the CRC check is completed, before the next block starts, voltage disturbance: superimposing ±5% voltage fluctuation. The conflict response needs to capture and record the following key indicators: the number of incomplete blocks, the amount of residual data in the buffer
[0064] Further, in combination with Figure 4 It is understood that the abnormal results are detected and captured, including:
[0065] First stage, test entry input, start triple defect detection.
[0066] Second stage, core detection module, including:
[0067] Data integrity check, verify data transmission accuracy, get the result of whether the number of transmission blocks is consistent, such as performing, performing CRC check, data pattern comparison. State register pollution detection, check hardware state exception, get the result of whether there is an illegal bit set, such as ILLEGAL_COMMAND, check whether the state machine is locked (lock flag), whether there is an ECC error flag (ECC Error Flag). Buffer residue detection, ensure that there is no residue in cache management, get the result of whether there is unempty data; such as DMA cache residue (DMACache Residue), verify whether the pointer is reset.
[0068] Further, in the third stage shown, specific detection items include:
[0069] Verify data integrity: block number comparison, get the consistency of the number of sending / receiving blocks; CRC check gets the verification of data packet integrity; pattern comparison gets the comparison of preset data pattern. Register pollution verification: illegal command bit gets the detection of undefined operation code; state machine locking finds deadlock state; ECC error captures memory correction. Buffer residue verification: unempty data realizes scanning of residual data; DMA cache checks DMA controller residue; pointer reset verifies buffer pointer to zero.
[0070] And, the three core modules are executed in parallel, and all detection results are summarized to generate a unified report, that is, data integrity check, state register pollution detection and buffer residue detection can be performed synchronously, which can be called triple defect detection. When there is an abnormal test result, one or more corresponding abnormal results are captured and output as the test result. For example, the results of data pattern comparison, ECC error flag and whether the buffer pointer is reset are extracted and recorded as defect characteristics.
[0071] In some examples, the classification of the aforementioned three detection results is as shown in the following table: Figure 5
[0072] In some specific examples, for open transmission operation, that is, the eMMC device is in a protocol state of data transmission (read or write) but has not been completed / ended (which can be called timing boundary); in this state, data blocks are being transmitted between the host and the device. Therefore, in this example, boundary scan testing is also performed on the open transmission operation, and a stop command (CMD12) is sent through microsecond-level delay control to identify the risk mutation point on the timing boundary.
[0073] Specifically, referring to Figure 6 Fig. 1 shows a risk mutation point detection diagram, and a risk value is detected to increase to 8.32 at a timing point of 820 μs, so that a risk mutation point can be determined.
[0074] The second stage is a core test module, including:
[0075] Microsecond delay control to configure precise timing parameters; send CMD12 command to implement key operation instruction execution; identify risk mutation points to monitor system stability.
[0076] The third stage is a specific configuration / detection item, including:
[0077] Delay control: control in the range of 0.1-5.0 μs to cover typical transmission delay; control in steps of 0.1 μs to ensure high-precision scanning; control frequency of 100 times per point to ensure statistical significance.
[0078] Among them, the CMD12 performs: block transmission gap to accurately insert interrupt timing, control ±5% voltage tolerance to simulate power supply fluctuation. Control <100 ps jitter to strictly control clock quality.
[0079] And, risk identification: data loss rate mutation identifies communication reliability critical point, state machine jump identifies abnormal state transition capture; buffer overflow identifies storage capacity limit threshold; current fluctuation identifies power integrity monitoring.
[0080] Thus, the timing control and command sending module work together to output data for the risk identification module to analyze, and finally generate a comprehensive risk report.
[0081] In some examples, referring to Figure 7 Fig. 1 shows a risk mutation point detection diagram, and a risk value is detected to increase to 8.32 at a timing point of 820 μs, so that a risk mutation point can be determined.
[0082] Finally, based on the output test report after executing the foregoing steps, the test report is a visual chart.
[0083] For example, a data visualization tool such as the matplotlib library of Python can be used to generate heat maps, flowcharts, waveform charts, etc. For example, a risk heat map can be generated based on matrix data, a defect distribution chart can be based on test result data, and a timing waveform chart can need to record the time stamp of command sending and draw.
[0084] In one example, the generated protocol state-command conflict matrix Rconflict heat map is as shown in Figure 8As shown, the red area in the figure represents high-risk combinations, such as executing CMD7 in the TRANSFER_ACTIVE state. The timing boundary scan waveform chart in the foregoing example is referenced Figure 9 As shown, as illustrated, the CMD12 command triggers an illegal interruption at 470 s. The data block transmission consistency comparison chart is referenced Figure 10 As shown, in an actual case, the actual transmission block number deviation is as high as -7.13%, and the chart verifies the robustness of the data transmission process under the regular timing deviation, and the correlation analysis can be performed in combination with the mutation points in the timing scan chart to find out how much the CMD12 command is delayed to cause the nonlinear change.
[0085] In some specific examples, the detection result is:
[0086] The top three combinations with conflict risks are (TRANSFER_ACTIVE, CMD7) with a risk value of 9.7, (DELETE_ACTIVE, CMD12) with a risk value of 9.51, and (VERIFY_ACTIVE, CMD25) with a risk value of 6.12. Typical defect modes are data block loss caused by timing deviation (accounting for 42%), state machine deadlock caused by illegal command (28%), and dirty data residue caused by buffer not being emptied (23%).
[0087] Further, in combination with Figure 11 It is also possible to introduce a dynamic feedback loop mechanism to enhance the adaptability of the test system.
[0088] Specifically, since the initial I illegal, F damage and other coefficient values are determined based on the protocol document, in the test result, it is possible to identify new risk modes that are not defined in the protocol document in the detection result, such as detecting unexpected register state changes (such as unexpected setting of the ECC_ERROR flag), new partial block damage features, or unrecorded timing sensitive windows (such as a dramatic increase in failure rate in the 45-55 s interval). In this case, the conflict matrix Rconflict is updated, including:
[0089] If a new illegal command combination is found, the I illegal value of the corresponding state-command combination is set to 1. In detail, the illegal state has a Boolean characteristic (non-0 or 1), and once the illegal combination is detected, it must be permanently marked as 1 (irreversible operation).
[0090] When detecting an irregular data damage, the data damage probability value F damage of the corresponding state-command combination in the conflict matrix is updated according to the weighting strategy, using the parameterized weight coefficients k1 and k2, and k1+k2=1 must be satisfied; and the historical value (F_damageh) before the test must be used instead of the current value.
[0091] For example, define configurable coefficients (example values, actual should be loaded from configuration), k1 = 0.7 based on historical weight, k2 = 0.3 based on new data weight.
[0092] The weighted update logic is:
[0093] Execute F_damageh = self.conflict_matrix.get_prev_damage_probability(Si, Cj), which means access the data to obtain the historical damage probability value.
[0094] Suppose the protocol state to which the current test result is directed is Si, the injected key command is Cj, and the test result of the current damage severity D_new, as in the previous step, the historical damage probability value F_damageh of the state-command combination saved before the test is called; then the updated value is generated by the weighted calculation formula data damage probability value F_damage = k1 x F_damageh + k2 x D_new; finally, the updated F_damage is written to the corresponding position of the conflict matrix, and the updated value will be saved as the historical value snapshot of the subsequent test, so as to ensure the reasonable fusion of historical data and new test data and avoid the pollution of real-time updated data.
[0095] In more detail, the following can be executed:
[0096] Si = test_result.state, Cj = test_result.command, F_damageh = self.conflict_matrix.get_prev_damage_probability(Si, Cj) to call the protocol state Si and the key command Cj.
[0097] Update F_damage[Si][Cj] = k1 * F_damage_prev + k2 * test_result.damage_severity; where F_damage_prev = F_damageh[Si][Cj] is the data damage probability value of the last round, which needs to save the historical value before the test (to avoid real-time update pollution), and test_result.damage_severity is the current damage severity D_new.
[0098] And add the constraint: |k1 + k2 - 1| < ε (ε is a small error tolerance, recommended to take 1 x e -5 ) to prevent parameter errors.
[0099] For the newly emerged timing sensitive point, the initial T critical is reserved by max function and updated by the larger value between the initial value and the measured value in the test result. The updated conflict matrix Rconflict will recalculate the risk value, whose formula remains Rij = a I illegal + b (F damage T critical), but uses the updated coefficients.
[0100] If a new high-risk combination (risk value exceeds the preset threshold) is generated after recalculation, the system will automatically generate precise test cases for this combination (such as microsecond-level injection in a specific timing window) and start a new round of conflict injection testing, forming a closed loop of testing to analysis to optimization to retesting. This cycle continues until no new risk patterns are detected in the latest round of testing, and finally outputs a test report containing the dynamic optimization process.
[0101] For example, when a new risk pattern is detected, such as in the test of the CMD23 command in the TRANSFER_ACTIVE state, the initial parameters are set as I illegal = 0 (legal command), F damage = 0.3 (moderate damage probability), and T critical = 0.4 (low timing sensitivity). The initial risk value is calculated as: 0.6 * 0 + 0.4 * (0.3 * 0.4) = 0.048.
[0102] Then, by injecting the CMD23 command at 50μs after the start of block transmission, the test result reveals two abnormalities: the data damage probability rises to 65% (a new partial block damage feature appears) and the UNDERRUN_ERROR flag in the state register is set.
[0103] At this time, the system triggers the matrix update mechanism: first, update the F damage value from 0.3 to 0.7 (using a weighted algorithm of 0.8 * original value + 0.2 * measured value 0.65), and update the T critical value to 0.8 (since 50μs is a critical timing point, take the maximum value of the original value 0.4 and the measured value 0.8). Recalculate the risk value based on the updated parameters to get the new risk value as 0.6 * 0 + 0.4 * (0.7 * 0.8) = 0.224, which is 4.6 times higher than the initial value.
[0104] Therefore, this change automatically marks the (TRANSFER_ACTIVE, CMD23) combination as high-risk, driving the system to generate three sets of microsecond-level timing test vectors (such as 45μs / 50μs / 55μs injection points) to start a new round of stress testing.
[0105] The conflict test system for embedded eMMC protocol consistency according to the embodiment of the present application comprises a storage and a processor. The storage stores a computer program for implementing the conflict test method for embedded eMMC protocol consistency in the foregoing embodiments; and the processor performs read and write operations on the storage to execute the computer program stored on the storage.
[0106] The above merely describes the preferred embodiments of the present application, and it should be understood that the present application is not limited to the forms disclosed herein, and should not be considered as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concepts described herein, by the above teachings or related art or knowledge. Any modification and change made by those skilled in the art without departing from the spirit and scope of the present application shall fall within the protection scope of the claims of the present application.
Claims
1. A conflict testing method for embedded eMMC protocol conformance, characterized in that, Define a set S containing various protocol states and a set C containing various key commands. Calculate the conflict risk value of a key command Cj sent under a certain protocol state Si, denoted by Rij, where i and j are intermediate variables. Select multiple conflict risk values that are higher than a preset threshold among all conflict risk values, and filter out a set of key commands and protocol states corresponding to each conflict risk value that is higher than the preset threshold. Define the combination of the two as having a high conflict risk. Based on the obtained sets of key commands and protocol states with high conflict risk, command conflict injection testing includes: forcibly sending one or more key commands with high conflict risk to a device in a certain protocol state in order to detect and capture abnormal results; Finally, the test results are output and converted into visual charts.
2. The conflict testing method for embedded eMMC protocol conformance according to claim 1, characterized in that, Each element in the key command set is a command that conforms to the eMMC protocol; wherein, the protocol state set S = {S1, S2, ..., Sn}, each element in the set represents a protocol state, and each protocol state is an execution state that conforms to the eMMC protocol.
3. The conflict testing method for embedded eMMC protocol conformance according to claim 1, characterized in that, The calculation of the conflict risk value of a key command Cj sent under a certain protocol state Si, denoted by Rij, includes: Rij=α·Iillegal(Si,Cj)+β·Fdamage(Si,Cj)·Tcritical(Si,Cj) Wherein, Iillegal is whether the protocol allows the command to be executed in this state, with a value of 0 or 1; Fdamage is the probability of data corruption, with a value of 0 to 1; Tcritical is the timing sensitivity, with a value of 0 to 1; α and β are both coefficients, with values of 0 to 1.
4. The conflict testing method for embedded eMMC protocol conformance according to claim 3, characterized in that, When T_critical > 0.7, the exponential amplification mechanism is introduced, including: Modify the conflict risk value to: Rij=α·Illegal(Yes,Cj)+β·Fdamage(Yes,Cj)·(3 Tcritical(Si,Cj) −0.7)Rij=α·Illegal(I,Cj)+β·Fdamage(I,Cj)·(3 Tcritical(Si,Cj) −0.7)? The threshold is set to 0.7 and the base is 3 to avoid abrupt changes in the calculation results through a smooth and continuous transition.
5. The conflict testing method for embedded eMMC protocol conformance according to claim 1, characterized in that, The forced sending of one or more critical commands with a high risk of conflict includes at least one of the following execution methods: Inject the critical command that has a high risk of conflict with it at a specific point in time during the duration of a certain protocol state; Inject the critical command that has a high risk of conflict with a specific sub-phase of a certain protocol state; During the duration of a certain protocol state, multiple critical conflict commands with a high risk of conflict are continuously injected.
6. The conflict testing method for embedded eMMC protocol conformance according to claim 1, characterized in that, The process of detecting and capturing abnormal results includes: Data integrity verification is performed to determine whether the number of transported blocks is consistent. Status register contamination detection to determine if any illegal bits have been set. Buffer residue detection determines whether there is any data that has not been cleared. When at least one of the test results of data integrity verification, status register contamination detection, and buffer residue detection is abnormal, one or more corresponding abnormal results are captured and output as defect feature records as detection results.
7. The conflict testing method for embedded eMMC protocol conformance according to claim 2 or 3, characterized in that, Also includes: Boundary scan tests are performed on open transport operations, and the stop command CMD12 is sent with microsecond-level delay to identify risky abrupt changes on the timing boundary.
8. The conflict testing method for embedded eMMC protocol conformance according to claim 1, characterized in that, It also includes dynamic feedback loops: If a new risk pattern not defined in the protocol specification is detected in the detection results, the conflict matrix Rconflict parameter is updated. Updating the conflict matrix Rconflict parameters includes: When an illegal combination is detected, the I illegal value of the corresponding key state and key command combination is set to 1; When abnormal data corruption is detected, the data corruption probability value Fdamage is updated, including: Access the data to obtain historical damage probability values, as well as the received protocol status Si, key commands Cj, and current damage severity D_new, and update the data damage probability value F_damage = k1 × F_damageh + k2 × D_new; where k1 + k2 = 1; When a new time-series sensitive point is discovered, T critical is updated to the maximum value between the historical value from the previous round and the measured sensitivity obtained from the detection results; The conflict risk value is recalculated based on the updated parameters. If the new conflict risk value exceeds the preset threshold, a new round of conflict injection testing is started; otherwise, the test is terminated.
9. The conflict testing method for embedded eMMC protocol conformance according to claim 8, characterized in that, The new risk modes include at least one of the following: unexpected changes in register status bits; new data corruption features; Unrecorded time-sensitive window.
10. A conflict testing system for embedded eMMC protocol conformance, characterized in that, include: A storage device storing a computer program for implementing the conflict testing method for embedded eMMC protocol conformance as described in any one of claims 1-9; A processor that performs read and write operations on the memory to execute computer programs stored on the memory.