Method and device for predecting a subsequent command or a command sequence

The method and device in embedded systems use a dynamically updated prediction table to optimize command processing by prioritizing frequently used sequences, addressing inefficiencies and adaptability issues in resource-constrained environments.

WO2026124747A1PCT designated stage Publication Date: 2026-06-18ASSA ABLOY AB

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ASSA ABLOY AB
Filing Date
2024-12-09
Publication Date
2026-06-18

AI Technical Summary

Technical Problem

Existing command dispatching mechanisms in embedded systems are inefficient due to linear computational complexity and lack of adaptability to dynamic changes in command sequences, particularly in resource-constrained environments like ISO 7816-compliant smart cards.

Method used

A method and device utilizing a prediction table that dynamically updates based on historical command patterns, incrementing counter values for matched commands and decrementing others to prioritize frequently used sequences, optimizing resource usage and reducing latency.

🎯Benefits of technology

Enhances the efficiency and adaptability of command processing by predicting subsequent commands or sequences with minimal computational overhead, improving performance in diverse and changing transaction scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2024085364_18062026_PF_FP_ABST
    Figure EP2024085364_18062026_PF_FP_ABST
Patent Text Reader

Abstract

Method and device for predicting a subsequent command or a command sequence The disclosure relates to a method and a device for predicting a subsequent command in an embedded system. The disclosure further relates to a method and device for predicting a command sequence in an embedded system. The method involves receiving a command including an instruction code (INS), accessing a prediction table containing at least one entry with a previously received instruction code and an associated counter value, incrementing the counter of the matching entry, and providing the subsequent command prediction based on the entry with the highest counter value. The device comprises an input unit for receiving commands, a memory unit for storing the prediction table, and a processing unit configured to execute the method steps. This invention improves command processing efficiency in embedded systems by dynamically learning and predicting frequently occurring commands, reducing latency and computational overhead.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] 40178.AAB.P100PC S / Sp / kt

[0002] 1

[0003] Description

[0004] Method and device for predicting a subsequent command or a command sequence

[0005] The disclosure relates to a method and device for predicting a subsequent command in an embedded system. Additionally, or alternatively, the disclosure relates to a method and device for predicting a command sequence in an embedded system. Further a computer program is provided that includes instructions which, when executed by a computer, cause the computer to perform the method at least in part.

[0006] In embedded systems, command dispatchers commonly utilize a looping mechanism to match received commands to corresponding function calls. This conventional approach, while functional, is inherently inefficient. In the worst-case scenario, every command entry must be sequentially verified, resulting in a linear computational complexity. Such inefficiency becomes particularly problematic in embedded devices, where computational resources are limited, and high performance is required.

[0007] To mitigate these inefficiencies, static configurations are often employed to predict the next command. These configurations rely on predefined, fixed mappings of commands and their expected successors. For example, specific commands might be predicted based on typical sequences, such as authentication followed by data reading. However, these static approaches lack adaptability and fail to accommodate dynamic changes in command usage patterns, thereby limiting their practical application in varying operational contexts.

[0008] Current solutions are further constrained by their inability to learn from past command executions. Without the capacity to dynamically adjust predictions based on observed patterns, static configurations are inadequate for optimizing performance in systems with frequent changes in command sequences. Additionally, static configurations are not suited to scenarios involving diverse transactions, where varying command sequences need to be processed efficiently.

[0009] The reliance on extensive loops or rigid static configurations leads to delays in command execution, undermining the performance requirements of modern embedded systems, including but not limited to ISO 7816-compliant smart card operations. These inefficiencies highlight the pressing need for a solution that can adaptively predict subsequent commands or command sequences with minimal computational overhead. 40178.AAB.P100PC S / Sp / kt

[0010] 2

[0011] With regard to the outlined prior art, the objective of the present disclosure is to provide a method and / or a device, each of which is suitable for enriching the state of the art.

[0012] This objective is achieved by the features of the independent claims. The further independent claims and the dependent claims respectively contain optional further developments of the disclosure.

[0013] The objective is achieved, according to a first aspect, by a method for predicting a subsequent command in an embedded system. The method comprises several method steps.

[0014] In a first step, a command including an instruction code, INS, is received. A command can refer to a specific request or instruction sent to the embedded system, typically formatted as per a predefined protocol, such as ISO 7816 for smart cards. The instruction code (INS) is a unique identifier associated with the command, enabling the method and device to differentiate between various functions. In particular, the instruction code identifies the command. Receiving the command ensures that the method and device initiates processing based on real-time inputs, facilitating dynamic operations. It ensures that the method and device can react dynamically to incoming commands, forming the basis for predictive analysis. In the sense of the disclosure, predicting a subsequent command can refer to the process of estimating or identifying the next command likely to occur based on historical patterns or statistical analysis. The subsequent command can refer to the command that is expected to follow a currently received command in a sequence, as determined by analyzing past command sequences.

[0015] In a further step, accessing a prediction table of the received command containing at least one entry takes place. The entry includes an instruction code of a previously received command and an associated counter value, CNT. A prediction table can be a structured data storage, such as an array or a database, used to store historical command patterns and their frequencies. Each command can has its own prediction table. Each entry in the table comprises a previously received instruction code and an associated counter value (CNT), which tracks how frequently the command follows a specific sequence. Accessing the prediction table provides the necessary historical context for the received command, enabling the method and device to evaluate patterns and probabilities. It enables to leverage historical data to predict the likelihood of subsequent commands, reducing processing latency. 40178.AAB.P100PC S / Sp / kt

[0016] 3

[0017] Further, an incrementing the counter value of the entry whose instruction code matches the instruction code of the received command is performed. Incrementing the counter value (CNT) for a matching entry updates the table to reflect the latest command pattern, dynamically adjusting the frequency data. This can ensure that the prediction table remains current and accurately represents the most recent device behavior. Dynamically updates the command frequency data to can improve the accuracy of subsequent predictions.

[0018] In a further step, the predicted subsequent command based on the entry with the highest counter value is provided. Providing the predicted subsequent command involves identifying the entry in the prediction table with the highest counter value (CNT), which represents the command most likely to follow based on historical patterns. This prediction is then used to optimize method and device performance by preemptively preparing for the next likely command. It can reduce the computational burden of identifying the next command and enhances method and device efficiency by preemptively preparing for the most probable operations.

[0019] The method offers a number of benefits. Among other things, the method can offer significant advantages in optimizing the efficiency and performance of embedded systems, particularly in scenarios where low-latency operations are critical, such as smart cards compliant with ISO 7816 standards. By dynamically predicting subsequent commands using a structured prediction table, the method eliminates the inefficiencies of traditional looping mechanisms that require sequential verification of commands, thereby reducing computational complexity from O(n) to a more streamlined process. The dynamic adjustment of a counter value based on real-time inputs allows to learn and adapt to evolving command usage patterns, ensuring accurate predictions even in diverse and changing transaction scenarios. Furthermore, the method enhances resource efficiency by limiting the size of the prediction table while prioritizing frequently used commands, making it ideal for resource-constrained environments. The ability to handle command sequences through the incorporation of parameters like instruction codes and command count ensures flexibility and scalability, enabling the method to optimize workflows across a wide range of embedded applications.

[0020] For application cases or application situations that may arise during the executed methods and are not explicitly described herein, it may be provided that, according to the method, 40178.AAB.P100PC S / Sp / kt

[0021] 4 an error message and / or a prompt for user feedback is output, and / or a default setting and / or a predetermined initial state is set.

[0022] The methods may involve a computer-implemented method, meaning that one, several, or all steps of the methods can be at least partially performed by a computer or a data processing device, optionally a computing device, in particular the device disclosed herein. Where appropriate, it may be provided to execute the steps in a sequence different from that described.

[0023] The following will explain possible refinements of the above-described aspects of the disclosure in detail. Each of the refinements mentioned below can further develop and specify the above-mentioned method either separately or in combination.

[0024] According to an embodiment, the method further comprises decrementing the counter values of the remaining entries in the prediction table, provided that more than one entry exists in the prediction table. This function contributes to ensuring that the prediction table remains dynamically balanced by reducing the influence of less frequently used entries, thereby maintaining an accurate representation of the most relevant command sequences. Further, it can be dynamically reduced the influence of older or less frequently used command sequences. By decrementing the counter values, it is ensured that the prediction table remains focused on the most relevant and frequently occurring command sequences. This results in a more accurate prediction of subsequent commands, minimizing computational overhead and improving the efficiency of command processing. This embodiment may also prevent stale data from skewing the prediction accuracy, allowing the method and device to adapt more effectively to real-time changes in command patterns.

[0025] According to an embodiment, the method further comprises replacing an entry with the lowest counter value when a new instruction code is received that is not present in the prediction table. This feature allows to adapt to new command patterns by discarding the least relevant data, ensuring that the prediction table retains only the most pertinent entries for prediction accuracy. Replacing the entry with the lowest counter value ensures that the prediction table always prioritizes the most relevant and frequently occurring commands while maintaining an optimal size. This approach enables to adapt to new command patterns by discarding less relevant data, ensuring continuous improvement in prediction accuracy. This mechanism reduces memory usage and computational complexity by keeping the prediction table focused on the most current command 40178.AAB.P100PC S / Sp / kt

[0026] 5 sequences, thereby enhancing the methods and device’s ability to handle dynamic and unpredictable command scenarios effectively.

[0027] It may be provided that the prediction table contains at least three entries. Having a minimum of three entries in the prediction table enables the method and device to maintain a sufficient historical record for accurate predictions without overburdening system memory. This embodiment can ensure that the prediction table is neither too small to be effective nor too large to become inefficient. With at least three entries, it can identify and analyze patterns in command sequences, resulting in reliable predictions and balanced resource utilization. This configuration can serve as a baseline for scalability, allowing further customization based on the methods and device’s operational needs.

[0028] It may be provided that the prediction table is dynamically adjusted during runtime to adapt to different command processing sequences. This function enables to respond to changing operational scenarios by updating the prediction table in real-time, thereby enhancing the accuracy and relevance of predictions. Dynamic adjustment of the prediction table during runtime can further ensures an adaption to varying operational conditions and command processing requirements. It enables the device to optimize the table size and structure based on real-time command sequences, ensuring that predictions remain accurate regardless of changes in usage patterns. By dynamically updating the table, the device avoids becoming outdated and enhances its responsiveness, resulting in improved processing speeds and reduced delays in command handling.

[0029] It may be provided that the prediction table supports a fixed maximum number of entries, and entries exceeding this limit are managed by replacing the one with the lowest counter value. Supporting a fixed maximum number of entries ensures efficient memory usage and prevents the prediction table from growing uncontrollably, which could lead to resource constraints. By replacing the entry with the lowest counter value when the limit is reached, the system maintains focus on the most relevant data while discarding less useful information. This embodiment allows to handle high volumes of command sequences efficiently, ensuring consistent prediction accuracy and reliable performance in resource-constrained environments.

[0030] It may be provided that the prediction table dynamically resizes during runtime based on the complexity of the received commands. It allows the device to efficiently allocate resources and scale the prediction table to handle varying command complexities, 40178.AAB.P100PC S / Sp / kt

[0031] 6 ensuring adaptability and efficiency in diverse operational scenarios. Dynamic resizing of the prediction table during runtime allows the method and device to allocate memory and computational resources flexibly, based on the complexity and volume of incoming commands. Further, it ensures that the method and device can handle varying workloads effectively, scaling up for complex command sequences and scaling down when demand is lower. This adaptability enhances efficiency and ensures that high prediction accuracy can be maintained without wasting resources, even in unpredictable or highly variable operational environments.

[0032] It may be provided that a maximum counter value, MaxCNT, of the counter value for the entry is configurable, enabling adjustment of the prediction’s response to changing command sequences. Configurable maximum counter values allow to fine-tune the weighting of command sequences based on their frequency and relevance. By setting an appropriate MaxCNT, the device can prioritize more frequently used commands while ensuring that older, less relevant commands do not dominate the prediction process. It enables greater adaptability and precision in handling dynamic command patterns, ensuring that the method and device responds appropriately to changes in usage over time.

[0033] It may be provided that a value for incrementing and / or decrementing applied to the counter value is configurable during runtime to allow dynamically changing command patterns. This function allows the device to adjust the learning rate of the prediction mechanism, ensuring adaptability to real-time changes in command usage patterns. Further, configurable increment and decrement values enable the device to adjust the rate at which command sequence priorities are updated. This flexibility allows the method and device to adapt more quickly or gradually to changing command patterns, depending on the specific operational requirements. By fine-tuning these values during runtime, the method and device achieves greater precision in updating the prediction table, ensuring that frequently used commands are accurately prioritized without overreacting to shortterm anomalies.

[0034] It may be provided that the prediction table is configured to prioritize commands used in security and / or authentication scenarios, as described in ISO 7816-compliant systems. Prioritizing commands used in security and authentication scenarios ensures that critical operations are processed with higher accuracy and reduced latency. This embodiment is particularly important in ISO 7816-compliant systems, where secure and efficient handling of authentication-related commands is essential. By focusing on these commands, the 40178.AAB.P100PC S / Sp / kt

[0035] 7 method and device enhances the reliability and speed of security-sensitive operations, ensuring compliance with industry standards and improving overall device robustness in secure environments.

[0036] It may be provided that the method also includes sorting the entries in the prediction table by e.g., sequence counter values, prioritizing entries with higher sequence counter values. The prediction table is sorted based on sequence counter values, with higher values taking precedence. This prioritization ensures that the most frequently occurring sequences are given higher predictive weight. Streamlines the prediction process by focusing computational resources on the most relevant sequences, can reduce processing time and improving accuracy.

[0037] Up to now, the disclosure has been described with respect to the claimed method. Features, advantages or alternative embodiments herein can be assigned to the other claimed objects (e.g., methods, device, computer program product) and vice versa. In other words, the subject matter which is claimed or described with respect to the claimed method can be improved with features described or claimed in the context of the device and vice versa. In this case, the structural units of the device are embodied by functional features of the method and vice versa, respectively. Generally, in computer science a software implementation and a corresponding hardware implementation are equivalent. Thus, for example, a method step for “storing” data may be performed with a storage unit and respective instructions to write data into the storage. For the sake of avoiding redundancy, although the device may also be used in the alternative embodiments described with reference to the method, these embodiments are not explicitly described again for the device.

[0038] Furthermore, the objective is achieved according to another aspect of the disclosure by a method for predicting a command sequence in an embedded system. The method comprises several method steps. The method can be implemented as a computer- implemented method.

[0039] The method begins by receiving multiple commands, each of which includes a unique instruction code (INS) that identifies the specific type of command. In particular, the instruction code identifies the command. Receiving commands in this manner allows the system to collect the necessary input for further processing and prediction. It enables the method and device to initiate prediction by capturing real-time inputs, ensuring that the prediction process reflects the current operational context. 40178.AAB.P100PC S / Sp / kt

[0040] 8

[0041] In a further step, a global prediction table is accessed that is configured to store at least three entries. Accessing the global prediction table provides the system with a structured data store containing historical patterns of command sequences. This table is configured to store at least three entries to maintain a sufficient dataset for accurate predictions without excessive memory use. That ensures the availability of historical data for command sequence prediction while maintaining computational efficiency.

[0042] Each entry comprises:

[0043] A sequence of instruction codes representing a sequence of commands. Each entry in the prediction table includes a sequence of instruction codes, allowing the system to track and analyze patterns of command sequences over time. This sequence-based structure provides the basis for predicting subsequent commands. It enables the identification and analysis of recurring command patterns, improving the system's ability to predict subsequent sequences.

[0044] A sequence counter tracking the frequency of the corresponding sequence of instruction codes. The sequence counter maintains a numerical value indicating how often a particular sequence of instruction codes has occurred. This dynamic counter updates with each matching sequence, reflecting the frequency of command sequences. I can be ensured that the prediction table dynamically adjusts to reflect the most commonly used command sequences, enhancing the accuracy of predictions.

[0045] A command count parameter indicating the total number of commands in the sequence. The command count parameter specifies the total number of commands in a stored sequence, allowing the system to differentiate between sequences of varying lengths.

[0046] This parameter provides additional context for more precise predictions. It enables the device to handle sequences of different lengths efficiently, improving scalability and adaptability in dynamic environments.

[0047] In a further step, an incrementing the sequence counter of an entry in the global prediction table if the received sequence of instruction codes matches the stored sequence of instruction codes takes place. When a received sequence matches an existing entry, the corresponding sequence counter is incremented. This update reflects the latest occurrence of the sequence, reinforcing its relevance in the prediction process.

[0048] Dynamically updates the prediction table to emphasize frequently occurring sequences, ensuring that predictions remain accurate and relevant. 40178.AAB.P100PC S / Sp / kt

[0049] 9

[0050] Further, a sorting the entries in the global prediction table by sequence counter values, prioritizing entries with higher sequence counter values, is performed. The prediction table is sorted based on sequence counter values, with higher values taking precedence. This prioritization ensures that the most frequently occurring sequences are given higher predictive weight. Streamlines the prediction process by focusing computational resources on the most relevant sequences, can reduce processing time and improving accuracy.

[0051] In a further step, a predicted command sequence using the entry with the highest sequence counter value is provided. The method concludes by identifying and providing the command sequence with the highest sequence counter value as the predicted sequence. This prediction reflects the most likely subsequent sequence based on historical patterns. Reducing latency and enhances system performance by preemptively identifying and preparing for the next command sequence.

[0052] The following will explain possible refinements of the above-described method for predicting a command sequence in an embedded system. Each of the refinements mentioned below can further develop and specify the above-mentioned method either separately or in combination.

[0053] It may be provided that the command count parameter indicates the total number of commands in a sequence and is used for handling sequences of varying lengths in the global prediction table. This function allows the method to efficiently manage command sequences of differing lengths without requiring separate processing logic for each possible sequence size. The implementation of this feature results in better scalability and adaptability in handling diverse command patterns. For the purposes of the present disclosure, a command count parameter can refer to a numerical attribute stored in the global prediction table that specifies the total number of commands in a recorded sequence.

[0054] It may be provided that an end-of-transaction indicator is used to determine when a command sequence is complete. This function allows to accurately identify the end of a command sequence, ensuring that only complete sequences are added to or evaluated within the global prediction table. The inclusion of this feature enables better segmentation and management of command data, reducing errors associated with incomplete or incorrectly segmented sequences. For the purposes of the present disclosure, an end-of- transaction indicator can refer to a specific flag or marker in the system that signifies the completion of a transaction or command sequence. 40178.AAB.P100PC S / Sp / kt

[0055] 10

[0056] It may be provided that the global prediction table is optimized to include only command sequences that occur above a defined frequency threshold. This function allows the system to focus its resources on processing and predicting the most relevant and frequently occurring command sequences. By filtering out fewer common sequences, the system reduces memory usage and computational overhead, ensuring faster and more accurate predictions. The implementation of this feature results in a more efficient use of system resources, particularly in environments with limited computational or memory capacity. For the purposes of the present disclosure, a defined frequency threshold can refer to a configurable numerical limit that specifies the minimum number of occurrences a command sequence must have before being included in the prediction table. Before included in the prediction table, it can be stored, e.g., in the prediction table itself but not considered for predictions usage.

[0057] It may be provided that the global prediction table supports predictions for sequences of commands by using a single table capable of storing multiple sequences. This function enables the method to handle a diverse range of command sequences within a unified structure, simplifying management and reducing the complexity of the prediction process. By using a single table to store multiple sequences, the system ensures efficient memory utilization and streamlined access to historical data for prediction purposes. The inclusion of this feature allows for better scalability and adaptability in environments with varying command patterns. For the purposes of the present disclosure, a single table capable of storing multiple sequences can refer to a centralized data structure, such as an array or database, designed to store and manage several independent command sequences within the same logical framework.

[0058] It may be provided that the global prediction table considers a fixed maximum number of commands per sequence, and sequences exceeding this limit are truncated. This function ensures that the system maintains a consistent and manageable prediction table size, avoiding the inefficiencies associated with overly long sequences. By truncating sequences that exceed the fixed limit, the system balances memory usage and prediction accuracy, ensuring that essential patterns are retained while unnecessary data is discarded. This implementation results in optimized resource allocation and improved processing efficiency in dynamic environments. For the purposes of the present disclosure, a "fixed maximum number of commands per sequence" can refer to a predefined numerical limit that specifies the maximum allowable length of a command 40178.AAB.P100PC S / Sp / kt

[0059] 11 sequence stored in the prediction table, with excess commands being ignored or truncated.

[0060] It may be provided that an end-of-transaction indicator is used to determine when a command sequence is complete. This function ensures that command sequences are properly segmented, avoiding issues related to incomplete data. By activating this feature, the system benefits from improved data integrity and more reliable prediction results.

[0061] It may be provided that the method further comprises evaluating historical command sequences to dynamically refine the increment and decrement values of sequence counters. This function allows the system to adaptively adjust the weight assigned to command sequences based on their observed frequency, enhancing the accuracy and relevance of predictions. By analyzing historical patterns, the system achieves better alignment with real-time operational requirements.

[0062] It may be provided that static and dynamic command sequences are distinguished, and static sequences are stored separately to optimize memory usage. This function contributes to efficient resource allocation by isolating sequences that do not change frequently, ensuring that dynamic memory resources are focused on processing variable or new data. This distinction makes it possible to achieve faster predictions and reduces computational overhead.

[0063] It may be provided that a minimum number of occurrences of a command sequence is required before its instruction codes are added to the global prediction table. This function allows the system to filter out infrequent or irrelevant sequences, ensuring that the prediction table remains concise and focused on meaningful patterns. The implementation of this feature results in improved prediction efficiency and reduced memory usage.

[0064] In another aspect, the disclosure relates to a device for predicting a subsequent command in an embedded system. The device comprises:

[0065] - an input unit configured to receive a command including an instruction code, INS;

[0066] - a memory unit configured to store a prediction table containing at least one entry, wherein each entry includes: an instruction code of a previously received command, and an associated counter value, CNT;

[0067] - a processing unit configured to:

[0068] Access the prediction table of the received command; 40178.AAB.P100PC S / Sp / kt

[0069] 12

[0070] Increment the counter value of the entry whose instruction code matches the instruction code of the received command; and

[0071] Provide the predicted subsequent command based on the entry with the highest counter value.

[0072] In another aspect, the disclosure relates to a device for predicting a command sequence in an embedded system.

[0073] - an input unit configured to receive a plurality of commands, each command comprising an instruction code, INS;

[0074] - a memory unit configured to store a global prediction table with at least three entries, wherein each entry comprises: a sequence of instruction codes representing a sequence of commands; a sequence counter tracking the frequency of the corresponding sequence of instruction codes; and a command count parameter indicating the total number of commands in the sequence;

[0075] - a processing unit configured to:

[0076] Access the global prediction table;

[0077] Increment the sequence counter of an entry in the global prediction table if the received sequence of instruction codes matches the stored sequence of instruction codes;

[0078] Sort the entries in the global prediction table by sequence counter values, prioritizing entries with higher sequence counter values; and

[0079] Provide a predicted command sequence using the entry with the highest sequence counter value.

[0080] The devices may, for example, be an electronic control unit (ECU). The electronic control unit can be an intelligent processor-controlled unit capable of communicating with other modules, for instance, via a different wired or wireless communication interfaces.

[0081] Implementation options for the interfaces may include, but are not limited to, technologies such as Bluetooth, Bluetooth Low Energy (BLE), Wi-Fi (WLAN), Near Field Communication (NFC), and / or other forms of wireless communication that provide secure data transmission. The interfaces can be designed based on criteria such as range, energy consumption, security requirements, and compatibility.

[0082] The above-described with reference to the methods applies analogously to the devices and vice versa. 40178.AAB.P100PC S / Sp / kt

[0083] 13

[0084] The above-described can be summarized in other words and in a possible more specific embodiment of the disclosure as described below, wherein the following description is not to be construed as limiting to the disclosure.

[0085] The idea can be split into predicting the next command or the next command sequence. Apart from a static configuration, which command is expected after a specific command (e.g., reading data after an authentication), we describe here a dynamic approach to predict the next command. The data from the past need to be remembered, which requires a non-volatile memory holding this data.

[0086] To predict the next command, each command need to hold some information of the next command. As an example, 3 entries for the next command are used in the following drawing and explanation. “INS” means Instruction Code of the command and “Cnt” means Counter. The “1” on top of the INS and Cnt fields mean that the field size can be just 1 Byte. At the beginning all INS and Cnt fields are empty (Cnt=0). The Counter field is an unsigned value. The Counter value zero means, that the entry is empty I free.

[0087] If a command with a specific INS is received as the next command, the Counter of the matching INS is incremented, and all other ones are decremented. If an entry becomes zero, it becomes empty I free. If the INS is not present in the prediction table, it will be added if there is an empty entry or it is replaced with an entry with the lowest Counter. For performance reason it is beneficial if the prediction table is always sorted by the Counter e.g., Cnt1 > Cnt2 > Cnt3 figure above.

[0088] Each implementation can choose their own parameters to adjust for better prediction. The maximum Counter value (“MaxCnt”), the increment (“Inc”) and the decrement (“Dec”) value. These values allow to adjust the reaction on changing command sequences.

[0089] Examples:

[0090] MaxCnt = 5, Increment = 1 , Decrement = 1

[0091] MaxCnt = 10, Increment = 1, Decrement = 2

[0092] Example:

[0093] INS2 received as next command; old Cnt values are [10, 2, 1]

[0094] The prediction of a command sequence is more complicated and need to be tracked globally. Means, the prediction table will become bigger and is accessible globally. We also need to pre-define the command sequence size.

[0095] As an example, we use again 3 entries, and each entry does hold 5 INS of a command sequence (“MaxCmd”). 40178.AAB.P100PC S / Sp / kt

[0096] 14

[0097] The behaviour and usage are the same as predicting the next command, which was explained above. If the command sequence is longer than the MaxCmd, additional commands are just ignored in the prediction algorithm.

[0098] The main difference is the number of INS per entry, which reflects a command sequence. Depending on the implementation, the prediction table can be of static size, or it can resize depending on the received command sequences.

[0099] It might be reasonable to specify a minimum number of commands before the command sequence will be added to the prediction table.

[0100] It is good practice to use an end of transaction command or indicator to be able to know when the command sequence is finished.

[0101] If MaxCmd is lower than the command sequence size, an additional parameter with the number of total commands can be added to the prediction table (e.g., “CmdCnt”). This allows to use smaller tables for longer command sequences.

[0102] Example of a command sequence:

[0103] Authentication parti , Authentication part 2, Read datal , Read data2, Write data3.

[0104] Instead of only remembering the INS, also other information of a command can be added. This allows also to predict sub-functionality of commands. The configuration parameters of the prediction table (MaxCnt, Inc, Dex, MaxCmd) can be made changeable e.g., manual or automatically during runtime.

[0105] The solution can be easily used to extend an existing implementation. It is small in code size and does not need a lot of memory.

[0106] The prediction is learning from the previous commands or command sequences, which allows to have a generic implementation for different use cases.

[0107] Furthermore, a computer program is provided, comprising instructions which, when executed by a computer, cause the computer to perform or partially perform the method described above. The program code of the computer program may be in any code format, particularly in a code suitable for controlling motor vehicles. The above-described with reference to the control device, the motor vehicle, and the method applies analogously to the computer program and vice versa.

[0108] Additionally, a computer-readable medium, particularly a computer-readable storage medium, is provided. The computer-readable medium comprises instructions which, when executed by a computer, cause the computer to perform or partially perform the method 40178.AAB.P100PC S / Sp / kt

[0109] 15 described above. This means that a computer-readable medium can be provided which includes the computer program as defined above. The computer-readable medium may be any digital data storage device, such as a USB stick, a hard drive, a CD-ROM, an SD card, or an SSD card (or SSD drive / SSD hard drive).

[0110] The computer program does not necessarily have to be stored on such a computer- readable storage medium to be made available to the motor vehicle; it can also be obtained via the Internet or from other external sources. The above-described with reference to the method, the control device, the computer program, and the motor vehicle applies analogously to the computer-readable medium and vice versa.

[0111] The disclosure also encompasses combinations of the features of the described embodiments. Thus, the disclosure also includes implementations that feature a combination of the characteristics of several described embodiments, provided the embodiments are not described as being mutually exclusive.

[0112] Brief Descriptions of the Drawings

[0113] In the following, the disclosure will further be described with reference to exemplary embodiments illustrated in the figures, in which:

[0114] Fig. 1 schematically shows a device for predicting a subsequent command in an embedded system;

[0115] Fig. 2 schematically shows a device for predicting a command sequence in an embedded system;

[0116] Fig. 3 schematically shows a flow chart of the method for predicting a subsequent command in an embedded system, and

[0117] Fig. 4 schematically shows a flow chart of the method for predicting a command sequence in an embedded system.

[0118] Detailed Description

[0119] In the following description, for purposes of explanation and not limitation, specific details are set forth, in order to provide a thorough understanding of the current disclosure. It will 40178.AAB.P100PC S / Sp / kt

[0120] 16 be apparent to one skilled in the art that the current disclosure may be practiced in other embodiments that depart from these specific details. For example, the skilled artisan will appreciate that the current disclosure may be practiced with any application for different functionalities or for different computing entities.

[0121] Figure 1 shows a device 10 for predicting a subsequent command 30 in an embedded system. The device 10 comprises an input unit 11 , a memory unit 12, and a processing unit 13, all working together to enable efficient prediction of commands 30. The input unit 11 is configured to receive a command 30, including its associated instruction code (INS). Upon reception, this instruction code forms the basis for accessing a prediction table located in the memory unit 12. The prediction table stores data relevant to command prediction, including at least one entry. Each entry comprises an instruction code corresponding to a previously received command 30 and an associated counter value (CNT) that indicates the frequency with which the specific instruction code has been encountered.

[0122] The processing unit 13 is the computational core of the device 10 and is responsible for multiple tasks. First, it accesses the prediction table associated with the received command 30 to locate an entry whose instruction code matches the instruction code of the received command 30. When a match is found, the processing unit 13 increments the counter value of the corresponding entry. If other entries exist in the table, the counter values of those entries are decremented, ensuring that the system dynamically prioritizes entries reflecting the most frequently occurring commands. If a new instruction code is received that is not present in the table, and the table has available space, the processing unit 13 adds a new entry. If no space is available, the entry with the lowest counter value is replaced with the new instruction code, and its counter is initialized. The prediction table is designed to remain sorted based on descending counter values, enabling the processing unit to quickly identify the entry with the highest counter value, which represents the predicted subsequent command. This prediction is provided as the output of the processing unit.

[0123] The memory unit 12 supports the efficient operation of the prediction mechanism by storing the prediction table, which can be dynamically adjusted during runtime to reflect changes in the frequency or sequence of received commands. The prediction table can consist of two columns including in the first column the instruction code and in the second column the counter value for the instruction. The prediction table can contain several entries (row) associated with the number of instructions. The prediction table can be 40178.AAB.P100PC S / Sp / kt

[0124] 17 configured to have a fixed maximum size, with entries managed by replacing those with the lowest counter values when the table exceeds this size. Alternatively, the table may dynamically resize during runtime, depending on the complexity of the received command 30 sequences. Further configurability of the prediction system is provided through parameters such as the maximum counter value (MaxCNT), the increment value, and the decrement value. These parameters can be adjusted during runtime to optimize the behavior of the device 10 based on changing command patterns.

[0125] The prediction mechanism implemented in the processing unit 13 is designed to enhance the performance of command dispatchers. By predicting the subsequent command 30 based on a dynamically updated table of historical command data, the system reduces the time required for command processing. This approach is particularly advantageous for embedded systems, where computational resources and memory are often limited. The device 10 is small in code size and memory requirements, making it suitable for integration into existing embedded systems.

[0126] Further features are reflected in how the device 10 manages the dynamic aspects of prediction. For instance, the decrementing of counter values for entries other than the matching one ensures that the prediction table remains adaptive, reflecting the most recent trends in command sequences. The replacement of entries with the lowest counter values ensures that the table remains relevant even when new commands are introduced. Moreover, the use of a maximum counter value prevents counters from growing indefinitely, allowing the system to remain responsive to changes in command patterns over time.

[0127] The prediction implemented in the device 10 is versatile and can be tailored for specific applications. For example, it can prioritize commands 30 used in security or authentication scenarios, as described in ISO 7816-compliant systems. In these cases, the prediction mechanism focuses on improving the performance of frequently used security commands, thereby enhancing the efficiency and reliability of the embedded system. Furthermore, the dynamic resizing of the prediction table and the ability to configure its parameters during runtime provide additional flexibility, making the device adaptable to a wide range of use cases.

[0128] The prediction table is also capable of supporting entries containing at least three instruction codes. The processing unit can replace an entry with the lowest counter value if a new instruction code is received that is not currently in the table. Additionally, the table 40178.AAB.P100PC S / Sp / kt

[0129] 18 can prioritize certain commands 30 based on their importance in specific scenarios, such as those used in authentication. The dynamic nature of the table allows it to adjust not only its size but also the value increments and decrements applied to the counter values, enabling a more nuanced response to variations in command sequences.

[0130] Further, the device 10 is designed to support runtime configurability. This includes adjusting the maximum counter value and the increment and decrement values dynamically, enabling the system to adapt to changing command patterns. The processing unit’s ability to dynamically update the table and prioritize commands ensures the prediction mechanism remains effective even as command usage evolves. The system’s adaptability to different use cases is further enhanced by its ability to optimize prediction for commands with higher security demands or those involving frequent transactions.

[0131] The device 10 integrates the capability to dynamically adjust key parameters, including the maximum counter value, increment value, and decrement value, during runtime. This dynamic configurability allows the device 10 to adapt to changing command patterns and optimize its prediction mechanism in real-time. By adjusting these parameters, the device 10 ensures that frequently used commands are prioritized in the prediction table, while infrequently used or outdated commands are gradually deprioritized.

[0132] To further enhance its performance, the device 10 can utilize artificial intelligence algorithms to refine these parameters based on historical command data. Through learning from past commands, the device 10 dynamically determines optimal values, improving its prediction accuracy and responsiveness. This flexibility enables the device 10 to efficiently handle varying workloads and diverse use cases, particularly in resource- constrained environments such as embedded systems.

[0133] By intelligently managing the prediction table and dynamically updating counter values, the device 10 remains efficient and relevant, even in scenarios where command patterns change frequently. This adaptability ensures the prediction mechanism remains effective in prioritizing commands, reducing processing time, and improving the overall performance of command dispatchers.

[0134] The device 10 is designed to execute the method 100, which is also described in detail below with reference to Figure 3. 40178.AAB.P100PC S / Sp / kt

[0135] 19

[0136] Figure 2 illustrates a device 20 for predicting a command sequence 40 in an embedded system. In particular, it is shown the command based prediction. The device 20 is specifically designed to handle multiple commands and to predict sequences 40 of these commands based on their historical occurrence. It comprises an input unit 21, a memory unit 22, and a processing unit 23, each working in conjunction to execute the prediction process.

[0137] The input unit 21 is responsible for receiving a plurality of commands. Each command includes an instruction code (INS), which is extracted and processed to identify command sequences. The received instruction codes form the basis of the prediction process by contributing to the creation and updating of a global prediction table stored in the memory unit 22)

[0138] The memory unit 22 stores a global prediction table that maintains at least three entries. Each entry in the table represents a sequence of instruction codes corresponding to a command sequence 40. An entry also includes a sequence counter that tracks the frequency of occurrence of the corresponding sequence and a command count parameter that records the total number of commands in the sequence. This table serves as a centralized repository for command sequence data, enabling the device 20 to predict subsequent sequences based on historical trends.

[0139] The processing unit 23 is the core computational component of the device 20 and executes various operations to enable command sequence prediction. When a sequence of commands is received, the processing unit 23 accesses the global prediction table and checks for a match with the stored sequences. If a match is found, the processing unit 23 increments the sequence counter of the corresponding entry, thereby increasing its priority. If the received sequence does not match any stored sequence and there is space available in the table, the new sequence is added to an available entry. If the table is full, the entry with the lowest sequence counter value is replaced with the new sequence. This dynamic updating ensures that the prediction table remains relevant and prioritizes frequently occurring sequences.

[0140] To maintain efficient operation, the processing unit sorts the entries in the global prediction table based on their sequence counter values, giving precedence to entries with higher counter values. The entry with the highest sequence counter value is used to provide the predicted command sequence. Additionally, if there are multiple entries in the 40178.AAB.P100PC S / Sp / kt

[0141] 20 table, the processing unit decrements the sequence counters of all other entries, ensuring that the table dynamically adapts to changes in command usage patterns.

[0142] Further, the global prediction table incorporates several advanced features to enhance its functionality. The command count parameter allows the table to handle sequences of varying lengths, while an end-of-transaction indicator is used to determine when a command sequence is complete. This ensures that the system can accurately identify and process sequences without ambiguity. Sequences that exceed a defined maximum length are truncated to conform to the table's size limitations, thereby optimizing memory usage. Additionally, the table is designed to include only those sequences that occur above a specified frequency threshold, ensuring that less relevant sequences do not occupy space in the table.

[0143] The processing unit 23 also enables the refinement of the global prediction table by evaluating historical command sequences. This evaluation dynamically adjusts the increment and decrement values of sequence counters, improving the accuracy and responsiveness of predictions. Static and dynamic command sequences are distinguished, with static sequences stored separately to optimize memory usage further. This separation ensures that frequently used static sequences do not interfere with the processing of more dynamic, variable sequences.

[0144] To improve the accuracy of predictions, the global prediction table only includes command sequences 40 that have been observed a minimum number of times. This prevents the table from being populated with rarely occurring sequences, focusing its resources on those with greater predictive value.

[0145] The device 20 for predicting a command sequence 40 extends the device’s ability to dynamically adjust parameters during runtime, including the maximum sequence counter value, increment value, and decrement value for entries in the global prediction table. This capability ensures the device 20 can adapt to changing patterns in command sequences and optimize the accuracy of its predictions. The dynamic adjustment mechanism prioritizes frequently occurring sequences while gradually deprioritizing outdated or rarely used ones.

[0146] Artificial intelligence algorithms further enhance the device’s adaptability by refining these parameter values based on historical command sequence data. By analyzing past patterns, the device can dynamically determine the most effective settings for sequence 40178.AAB.P100PC S / Sp / kt

[0147] 21 counters, enabling accurate and efficient prediction of command sequences. This Al- driven adjustment process ensures that the global prediction table evolves in a way that remains relevant to current command patterns.

[0148] Additionally, the device distinguishes between static and dynamic sequences, storing static sequences separately to optimize memory usage. This separation allows the global prediction table to handle highly dynamic sequences more effectively while maintaining static sequence data for consistent use cases. These capabilities make the system highly adaptable for diverse applications, such as those requiring high accuracy in security or authentication processes, where precise command sequence prediction is critical.

[0149] The device 20 is designed to execute the method 200, which is also described in detail below with reference to Figure 4.

[0150] Fig. 3 schematically shows a flow chart of the method 100 for predicting a subsequent command in an embedded system. The method 100 can comprise several method steps. The method steps can, if technically possible, be rearranged in their processing order.

[0151] In the first step 110, a command 30 is received. This command 30 includes an instruction code (INS) that serves as the primary identifier for the prediction process. The instruction code is extracted. By focusing on the instruction code, the device 10 ensures a streamlined and standardized approach to command processing, reducing the complexity of handling diverse commands.

[0152] The further step 120 involves accessing a prediction table associated with the received command 30. This table contains at least one entry, with each entry comprising an instruction code of a previously received command and an associated counter value (CNT). The prediction table serves as a dynamic repository that reflects the historical usage patterns of commands. This structure allows the system to access the most relevant data for making accurate predictions, minimizing the need for computationally expensive searches.

[0153] In the further step 130, the counter value of an entry in the prediction table is incremented. This occurs when the instruction code of the entry matches the instruction code of the received command 30. This dynamic adjustment ensures that frequently used commands are prioritized in future predictions. Additionally, the incremental update is computationally 40178.AAB.P100PC S / Sp / kt

[0154] 22 lightweight, enabling the system to maintain high performance even under resource constraints.

[0155] In step 140, the predicted subsequent command is determined and provided. This prediction is based on the entry in the prediction table with the highest counter value, which represents the command most likely to follow the received command. By selecting the entry with the highest counter value, the system effectively utilizes historical data to anticipate future commands, reducing the time required for command processing.

[0156] Figure 4 schematically shows a flow chart of the method 200 predicting a command sequence 40 in an embedded system. The method 200 can comprise several method steps. The method steps can, if technically possible, be rearranged in their processing order.

[0157] The method begins with the receiving step 210, where a plurality of commands is received. Each command includes an instruction code (INS), which serves as a unique identifier for the command. By receiving multiple commands, the system gathers the input necessary to identify and predict sequences. The focus on instruction codes ensures uniformity and compatibility across different command types, simplifying subsequent processing steps.

[0158] Next, in the accessing step 220, a global prediction table is accessed. This table is configured to store at least three entries, with each entry comprising a sequence of instruction codes representing a sequence of commands 40, a sequence counter tracking the frequency of that sequence, and a command count parameter indicating the total number of commands in the sequence. The global prediction table functions as a centralized data structure that organizes and retains sequence information. It enables efficient access and comparison, allowing the system to draw on historical data to inform predictions.

[0159] The incrementing step 230 involves updating the sequence counter of an entry in the global prediction table when the received sequence of instruction codes matches a stored sequence. The sequence counter is incremented, reflecting the increased frequency of the matched sequence. This real-time adjustment ensures that the prediction table remains dynamically updated to reflect the most current usage patterns, prioritizing frequently occurring sequences. 40178.AAB.P100PC S / Sp / kt

[0160] 23

[0161] Following this, in the sorting step 240, the entries in the global prediction table are sorted by their sequence counter values. Entries with higher sequence counter values are prioritized, as these represent the most frequently observed command sequences. Sorting the table in this manner ensures that the system can efficiently identify the most relevant entries during prediction, reducing processing overhead.

[0162] Further, the method 200 concludes with the providing step 250, where a predicted command sequence 40 is determined and output. This prediction is based on the entry in the global prediction table with the highest sequence counter value, representing the sequence most likely to occur next. By selecting the entry with the highest priority, the system ensures that its predictions are both accurate and relevant to the current context.

[0163] 40178.AAB.P100PC S / Sp / kt

[0164] 24

[0165] Reference Numerals

[0166] 100 Method for predicting a subsequent command

[0167] 110-140 Method steps 200 Method for predicting a command sequence

[0168] 210-270 Method steps

[0169] 10 Device for predicting a subsequent command

[0170] 11 Input unit

[0171] 12 Memory unit 13 Processing unit

[0172] 20 Device for predicting a command sequence

[0173] 21 Input unit

[0174] 22 Memory unit

[0175] 23 Processing unit

Claims

40178.AAB.P100PC S / Sp / kt25Claims1. Method (100) for predicting a subsequent command (30) in an embedded system, the method comprises the steps of:- Receiving (110) a command (30) including an instruction code, INS;- Accessing (120) a prediction table of the received command (30) containing at least one entry, wherein the entry includes an instruction code of a previous received command (30) and an associated counter value, CNT;- Incrementing (130) the counter value of the entry whose instruction code matches the instruction code of the received command (30), and- Providing (140) the predicted subsequent command (30) based on the entry with the highest counter value.

2. Method (100) according to the direct preceding claim, wherein the method (100) at least further comprises:- Decrementing the counter values of the remaining entries in the prediction table, provided that more than one entry exists in the prediction table, and / or- Replacing an entry with the lowest counter value when a new instruction code is received that is not present in the prediction table.

3. Method (100) according to any of the preceding claims, wherein the prediction table contains at least three entries, and wherein the prediction table is dynamically adjusted during runtime to adapt to different command processing sequences, and wherein the prediction table supports a fixed maximum number of entries, and entries exceeding this limit are managed by replacing the one with the lowest counter value, and wherein the prediction table dynamically resizes during runtime based on the complexity of the received commands (30).

4. Method (100) according to any of the preceding claims, wherein a maximum counter value, MaxCNT, of the counter value for the entry is configurable, enabling adjustment of the prediction’s response to changing command sequences.

5. Method (100) according to any of the preceding claims 2 to 6, wherein a value for incrementing and / or decrementing applied to the counter value is configurable during runtime to allow dynamically changing command patterns.40178.AAB.P100PC S / Sp / kt266. Method (100) according to any of the preceding claims, wherein the prediction table is configured to prioritize commands used in security and / or authentication scenarios, as described in ISO 7816-compliant systems.

7. Method (200) for predicting a command sequence (40) in an embedded system, the method (200) comprises the steps of:- Receiving (210) a plurality of commands (30), each command comprising an instruction code, INS;- Accessing (220) a global prediction table configured to store at least three entries, wherein each entry comprises:- A sequence of instruction codes representing a sequence of commands (40);- A sequence counter tracking the frequency of the corresponding sequence of instruction codes; and- A command count parameter indicating the total number of commands in the sequence (40);- Incrementing (230) the sequence counter of an entry in the global prediction table if the received sequence of instruction codes matches the stored sequence of instruction codes;- Sorting (240) the entries in the global prediction table by sequence counter values, prioritizing entries with higher sequence counter values; and- Providing (250) a predicted command sequence (40) using the entry with the highest sequence counter value.

8. Method (200) according to the directly preceding claim, wherein the method (200) further comprises:- Decrementing (260) the sequence counter of all other entries in the global prediction table, provided that more than one entry exists in the table; and / or- Adding (270) a new sequence of instruction codes to the global prediction table if the received sequence does not match any stored sequence, by:- Replacing the entry with the lowest sequence counter value when the table is full; or- Inserting the sequence into an available entry if one exists.40178.AAB.P100PC S / Sp / kt279. Method (200) according to the direct preceding claim, wherein the command count parameter indicates the total number of commands in a sequence and is used for handling sequences of varying lengths in the global prediction table.

10. Method (200) according to any of the preceding claims 7 to 9, wherein an end-of- transaction indicator is used to determine when a command sequence (40) is complete.

11. Method (200) according to any of the preceding claims 7 to 10, wherein the global prediction table is optimized to include only command sequences (40) that occur above a defined frequency threshold, and wherein the global prediction table supports predictions for sequences of commands by using a single table capable of storing multiple sequences, and wherein the global prediction table considers a fixed maximum number of commands per sequence, and sequences exceeding this limit are truncated.

12. Method (200) according to any of the preceding claims 7 to 9, wherein an end-of- transaction indicator is used to determine when a command sequence (40) is complete.

13. Device (10) for predicting a subsequent command (30) in an embedded system, the device (10) comprising:- an input unit (11) configured to receive a command (30) including an instruction code, INS;- a memory unit (12) configured to store a prediction table containing at least one entry, wherein each entry includes:- an instruction code of a previously received command (30), and- an associated counter value, CNT;- a processing unit (13) configured to:- Access the prediction table of the received command (30);- Increment the counter value of the entry whose instruction code matches the instruction code of the received command (30); and- Provide the predicted subsequent command (30) based on the entry with the highest counter value.

14. Device (20) for predicting a command sequence (40) in an embedded system, the device (20) comprising:40178.AAB.P100PC S / Sp / kt28- an input unit (21) configured to receive a plurality of commands (30), each command comprising an instruction code, INS;- a memory unit (22) configured to store a global prediction table with at least three entries, wherein each entry comprises:- a sequence of instruction codes representing a sequence of commands;- a sequence counter tracking the frequency of the corresponding sequence of instruction codes; and- a command count parameter indicating the total number of commands in the sequence;- a processing unit (23) configured to:- Access the global prediction table;- Increment the sequence counter of an entry in the global prediction table if the received sequence of instruction codes matches the stored sequence of instruction codes;- Sort the entries in the global prediction table by sequence counter values, prioritizing entries with higher sequence counter values; and- Provide a predicted command sequence (40) using the entry with the highest sequence counter value.

15. Computer program comprising instructions which, when executed by a computer, cause the computer to carry out the method according to the any of the preceding method claims.