Just-in-time generation of program code

The just-in-time generation of program code for communication devices addresses resource constraints by transforming user input into tokens, generating and verifying code on a server, ensuring compatibility and security.

WO2026238216A1PCT designated stage Publication Date: 2026-11-19TELEFONAKTIEBOLAGET LM ERICSSON (PUBL)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2025/062810
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

Existing communication devices with limited resources face challenges in generating and executing program code tailored to their specific execution environments, leading to incompatibility and failed execution when deploying identical code across heterogeneous devices.

Method used

A method and system for just-in-time generation of program code, where user input is transformed into tokens, metadata is sent to a server, and verified program code is generated and executed, adapting to the communication device's constraints.

Benefits of technology

Enables program code tailored to the execution environment, extending functionality on demand and ensuring secure execution by verifying code before execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2025062810_19112026_PF_FP_ABST
    Figure EP2025062810_19112026_PF_FP_ABST
Patent Text Reader

Abstract

There is provided techniques for just-in-time provision of program code. A method is performed by a communication device. The method comprises obtaining user input. The user input is descriptive of a task to be performed. The method comprises transforming, using a context determination algorithm, the user input into a set of tokens representative to describe the task. The method comprises sending a representation of the set of tokens and metadata of the communication device to a server device. The method comprises receiving program code for performing the task from the server device. The method comprises obtaining verification that the received program code corresponds to the task. The method comprises facilitating execution of the program code for the task to be performed.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] JUST-IN-TIME GENERATION OF PROGRAM CODE

[0002] TECHNICAL FIELD

[0003] Embodiments presented herein relate to a method, a communication device, a computer program, and a computer program product for provision of program code. Embodiments presented herein further relate to a method, a server device, a computer program, and a computer program product for just-in-time generation of program code for the communication device.

[0004] BACKGROUND

[0005] Compact, low-power communication devices, such as smart wearables (e.g., smart rings and wearable Al modules) are increasingly utilized as personal computing units. These communication devices typically incorporate limited sensor arrays for receiving input, including microphones, gyroscopes, accelerometers, ambient light sensors, and capacitive or resistive touch sensors. The range and fidelity of user input is directly constrained by the hardware resources available. In addition to restricted input modalities, these communication devices are further limited by minimal memory capacity, constrained processing power, and low energy availability.

[0006] Such communication devices may, however, maintain connectivity with more capable hub devices. This allows the transmission of sensor data and the reception of executable instructions, including the downloading of scripts or code modules.

[0007] Nevertheless, the onboard environments of these communication devices often lack general-purpose operating systems, and software execution is typically confined to interpreters with limited language support. Further, the communication devices typically operate with pre-installed applications that expose only fixed functionality. In this respect, in many cases, only low-level hardware interfaces are accessible, and support for high-level languages such as Python or JavaScript is absent. As a result, it is not feasible to store or preload program code for all conceivable tasks that may arise during operation of the communication device.

[0008] Contemporary techniques exist for dynamic source code generation. One approach is metaprogramming, wherein programs treat other programs as data, allowing for introspection and the runtime generation or alteration of executable code. Another class of techniques involves machine learning-based code generation, where pre-trained models translate structured or unstructured input, such as natural language, into source code. These techniques, employed in tools like GitHub Copilot and Codeium, can be used for generating functions or full program logic based on descriptive prompts.

[0009] WO2O24 / 078000 Ai describes the generation of code in response to task descriptions. AU2024 / 220200 Ai describes the generation of code based on multimedia prompts, including audio and video. These disclosures focus on generating source code from abstract user input but do not address constraints inherent to low-resource devices. In particular, these disclosures do not account for architecture-specific code generation, nor do they manage runtime memory constraints by selectively retrieving or discarding generated code.

[0010] Hence, there is a lack of infrastructure to generate, retrieve, and execute, program code tailored to the execution environment of a specific communication device. As a result, there is no capability to programmatically extend functionality in accordance with device-specific constraints such as processor type, memory footprint, or peripheral availability. Furthermore, indiscriminate code generation or transfer without hardware-specific adaptation can result in incompatibility or failed execution, especially when identical program code is deployed to heterogeneous communication devices with non-uniform architectures.

[0011] SUMMARY

[0012] An object of embodiments herein is to address the above issues.

[0013] A particular object is to enable program code tailored to the execution environment of a specific communication device to be provided to that communication device.

[0014] According to a first aspect there is presented a method for just-in-time provision of program code. The method is performed by a communication device. The method comprises obtaining user input. The user input is descriptive of a task to be performed. The method comprises transforming, using a context determination algorithm, the user input into a set of tokens representative to describe the task. The method comprises sending a representation of the set of tokens and metadata of the communication device to a server device. The method comprises receiving program code for performing the task from the server device. The method comprises obtainingverification that the received program code corresponds to the task. The method comprises facilitating execution of the program code for the task to be performed.

[0015] According to a second aspect there is presented a communication device for provision of program code. The communication device comprises processing circuitry. The processing circuitry is configured to cause the communication device to obtain user input. The user input is descriptive of a task to be performed. The processing circuitry is configured to cause the communication device to transform, using a context determination algorithm, the user input into a set of tokens representative to describe the task. The processing circuitry is configured to cause the communication device to send a representation of the set of tokens and metadata of the communication device to a server device. The processing circuitry is configured to cause the communication device to receive program code for performing the task from the server device. The processing circuitry is configured to cause the communication device to obtain verification that the received program code corresponds to the task. The processing circuitry is configured to cause the communication device to facilitate execution of the program code for the task to be performed.

[0016] According to a third aspect there is presented a computer program for provision of program code. The computer program comprises computer code which, when run on processing circuitry of a communication device, causes the communication device to perform actions. One action comprises the communication device to obtain user input. The user input is descriptive of a task to be performed. One action comprises the communication device to transform, using a context determination algorithm, the user input into a set of tokens representative to describe the task. One action comprises the communication device to send a representation of the set of tokens and metadata of the communication device to a server device. One action comprises the communication device to receive program code for performing the task from the server device. One action comprises the communication device to obtain verification that the received program code corresponds to the task. One action comprises the communication device to facilitate execution of the program code for the task to be performed.

[0017] According to a fourth aspect there is presented a method for just-in-time generation of program code for a communication device. The method is performed by a serverdevice. The method comprises receiving a representation of a set of tokens and metadata of the communication device from the communication device. The method comprises obtaining the program code for the set of tokens and the metadata. The method comprises sending the program code and verification information of the program code to the communication device.

[0018] According to a fifth aspect there is presented a server device for just-in-time generation of program code for a communication device. The server device comprises processing circuitry. The processing circuitry is configured to cause the server device to receive a representation of a set of tokens and metadata of the communication device from the communication device. The processing circuitry is configured to cause the server device to obtain the program code for the set of tokens and the metadata. The processing circuitry is configured to cause the server device to send the program code and verification information of the program code to the communication device.

[0019] According to a sixth aspect there is presented a computer program for just-in-time generation of program code for a communication device. The computer program comprises computer code which, when run on processing circuitry of a server device, causes the server device to perform actions. One action comprises the server device to receive a representation of a set of tokens and metadata of the communication device from the communication device. One action comprises the server device to obtain the program code for the set of tokens and the metadata. One action comprises the server device to send the program code and verification information of the program code to the communication device.

[0020] According to a seventh aspect there is presented a computer program product comprising a computer program according to at least one of the third aspect and the sixth aspect and a computer readable storage medium on which the computer program is stored. The computer readable storage medium could be a non-transitory computer readable storage medium.

[0021] Advantageously, these aspects enable program code tailored to the execution environment of the specific communication device to be provided to the communication device.Advantageously, since the program code ultimately is generated based on user input, these aspects make it possible to extend the functionality of the communication device on demand.

[0022] Advantageously, these aspects enable program code to be verified in different ways, either by the communication device or by the server device, before being executed, thereby addressing security concerns.

[0023] Other objectives, features and advantages of the enclosed embodiments will be apparent from the following detailed disclosure, from the attached dependent claims as well as from the drawings.

[0024] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / an / the element, apparatus, component, means, module, step, etc." are to be interpreted openly as referring to at least one instance of the element, apparatus, component, means, module, step, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.

[0025] BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The inventive concept is now described, by way of example, with reference to the accompanying drawings, in which:

[0027] Fig. 1 is a schematic diagram illustrating a communication system according to embodiments;

[0028] Figs. 2, 3, 4, and 5 are flowcharts of methods according to embodiments;

[0029] Fig. 6 is a schematic diagram showing structural units of a communication device according to an embodiment;

[0030] Fig. 7 is a schematic diagram showing structural units of a server device according to an embodiment; and

[0031] Fig. 8 shows one example of a computer program product comprising computer readable means according to an embodiment.DETAILED DESCRIPTION

[0032] The inventive concept will now be described more fully hereinafter with reference to the accompanying drawings, in which certain embodiments of the inventive concept are shown. This inventive concept may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided by way of example so that this disclosure will be thorough and complete, and will fully convey the scope of the inventive concept to those skilled in the art. Like numbers refer to like elements throughout the description. Any step or feature illustrated by dashed lines should be regarded as optional.

[0033] Fig. 1 is a schematic diagram illustrating a communication system 100 where embodiments presented herein can be applied. The communication system 100 comprises communication devices 110a: nod, a server device 120, and a data storage 130. The data storage 130 implements a database of tokens and corresponding program code. The data storage 130 is accessible by the server device 120.

[0034] Four non-limiting examples of communication devices 110a: nod are illustrated; a head-mounted display (HMD) device 110a, a generic Internet-of-Things (loT) device nob, a smartphone 110c, and a smart ring nod. These are just a few examples of communication devices 110a: nod. Each communication device 110a: nod comprises a set of hardware and software components configured to support code execution and communication with the server device 120. The communication device 110a: nod comprises a processor, such as a central processing unit (CPU), graphics processing unit (GPU), or microcontroller, which can be used to execute program code received from the server device 120. The processor may also execute additional software modules, such as a speech transcriber and a tokenization algorithm. A memory component is provided to store the tokenization algorithm, generated tokens, and the program code received from the server device 120, which may be stored temporarily during execution. The tokenization algorithm is a software component responsible for converting user input into a structured format, such as tokens. This algorithm maybe implemented using a language model capable of semantic analysis. In this respect, tokenization, in the context of Natural Language Processing (NLP) and machine learning, refers to the process of converting a sequence of text into smaller parts, known as tokens. These tokens can be as small as characters or as long as words. Onegoal of tokenization is to represent text in a manner that is meaningful for computers without losing its context. By converting text into tokens, algorithms can identify patterns. This pattern recognition makes it possible for machines to understand and respond to user input. The communication device 110a: nod may optionally comprise an interpreter or a compiler, which are software components used to execute received source code that has not yet been compiled into machine code. The communication device 110a: nod further comprises a user input interface, which may comprise different types of sensors, depending on the specific input modality supported.

[0035] Optionally, a speech transcriber may be included as a software module to analyze and interpret spoken user input. An input / output (I / O) interface is included to enable communication with the server device 120. This interface may use wireless communication technologies such as those defined by the 3rd Generation Partnership Project (3GPP) or wireless fidelity (Wi-Fi) standards.

[0036] The server device 120 comprises its own processor, such as a CPU, GPU, or microprocessor, configured to run a generative model and, optionally, to provide execution environments for testing generated program code. Memory in the server device 120 is used to store and operate the generative algorithm responsible for code generation. An I / O interface is provided in the server device 120 to facilitate communication with the communication devices 110a: nod. The server device 120 implements a generative model, such as a Generative Pre-training Transformer (GPT), which is used to generate program code and corresponding descriptions based on input tokens. In this context, some programming languages does not compile the source code beforehand but rather during execution of a program. This is called Just-in-time (JIT) compilation, as the source code is only compiled when needed.

[0037] Alternatively, some programming languages (such as Java) may transform the source code into an intermediary stage which is translated into machine code at execution. The JIT concept allows dynamic recompilation and adaptive optimization, as well as flexibility as the architecture of the communication device executing the code does not need to be known until execution. Hereinafter the terms program code will be used to represent both (original) source code and compiled source code unless a specific distinction needs to be made between source code and compiled source code. The generative model may also produce test program code intended to validate the correctness or performance of the generated program code. Optionally, the serverdevice 120 may include a compiler to convert generated source code into machine code optimized for execution on the target communication device 110a: nod.

[0038] Additionally, a virtual environment emulating the capabilities and constraints of the communication device 110a: nod may be provided for testing the generated program code under realistic operational conditions.

[0039] Reference is now made to Fig. 2 illustrating a method for provision of program code as performed by the communication device 110a: nod according to an embodiment.

[0040] S102: The communication device 110a: nod obtains user input. The user input is descriptive of a task to be performed. Different examples of user input will be provided below.

[0041] S104: The communication device noa:nod transforms, using a context determination algorithm, the user input into a set of tokens representative to describe the task. Different examples of context determination algorithm will be disclosed below.

[0042] S110: The communication device 110a: nod sends a representation of the set of tokens and metadata of the communication device 110a: nod to a server device 120. Different examples of metadata will be provided below.

[0043] S112: The communication device 110a: nod receives program code for performing the task from the server device 120. The program code may either be (original) source code or compiled source code, machine code, etc.

[0044] S114: The communication device 110a: nod obtains verification that the received program code corresponds to the task. As will be further disclosed below, the communication device 110a: nod may either itself verify that the received program code corresponds to the task or receive information from the server device 120 that the server device 120 has verified that the program code corresponds to the task.

[0045] S116: The communication device 110a: nod facilitates execution of the program code for the task to be performed. As will be further disclosed below, the program code may either be executed by the communication device 110a: nod or be sent to another communication device 110a: nod for execution. These are both examples of scenarioswhere the communication device 110a: nod facilitates execution of the program code for the task to be performed.

[0046] Embodiments relating to further details of provision of program code as performed by the communication device 110a: nod will now be disclosed with continued reference to Fig. 2.

[0047] There may be different examples of user input. In some examples, the user input is given as voice commands. In other examples, the user input is given as some sensor input. In some non-limiting examples, the user input is represented by any, or any combination of: an audio signal, a video signal, a text signal, motion-related sensor data, gesture-related sensor data, biosignal-related sensor input.

[0048] There may be different examples of metadata. In general terms, the metadata pertains to properties of the communication device 110a: nod. In some non-limiting examples, the metadata pertains to at least one of: type of processor implemented in the communication device 110a: nod, program language support in the communication device 110a: nod, type of input sensors and / or output units available in the communication device 110a: nod, random access memory size and / or nonvolatile memory size in the communication device 110a: nod. Further, in case the communication device 110a: nod comprises its own interpreter for a scripting language such as Javascript or Python, or Java Virtual Machine to interpret source program code, this type of information may be included in the metadata. In other examples, the communication device 110a: nod requires compiled source code to execute. The source program code must be compiled for the processor present in the device and may further have restrictions on available RAM, I / O capabilities, etc., and this type of information may be included in the metadata.

[0049] There may be different examples of context determination algorithms. In general terms, the context determination algorithm involves tokenization. Non-limiting examples of context determination algorithms are natural language understanding (NLU) models that analyze user input to extract intent and relevant entities. For instance, Bidirectional Encoder Representations from Transformers (BERT) can be used to derive contextual meaning from text by evaluating each word relative to its surrounding words. Rule-based systems may also be employed, where predefined patterns and conditional logic interpret context based on input structure andenvironmental variables. Recurrent neural networks (RNNs) or transformers can process sequential inputs, such as spoken commands, while incorporating temporal context. Additionally, multimodal algorithms may combine voice, location, and sensor data to infer user intent across diverse input types.

[0050] In some aspects, the communication device 110a: nod, before sending the representation of the set of tokens to the server device 120, checks if the set of tokens, or at least some other similar set of tokens, is present in a stored task list. If so, the user is prompted to confirm if the last execution of the task aligned with the current task. Hence, in some embodiments, the communication device 110a: nod comprises a data storage implementing a database of tokens, and the communication device noamod is configured to perform (optional) step S106.

[0051] S106: The communication device noamod requests user confirmation of the task to be performed upon determining that the set of tokens is present in the database.

[0052] Assuming that user confirmation is received, it is then either the set of tokens as present in the database or an identifier of the set of tokens as present in the database that is sent in step S110 as the representation of the set of tokens to the server device 120.

[0053] In contrast, in case the set of tokens, or at least some other similar set of tokens, is not present in the stored task list, then the set of tokens is stored. Hence, in some embodiments, the communication device 110a: nod comprises a data storage implementing a database of tokens, and the communication device 110a: nod is configured to perform (optional) step S108.

[0054] S108: The communication device noamod stores the set of tokens in the database upon determining that the set of tokens is not present in the database.

[0055] It is the set of tokens itself that is sent in step S110 as the representation of the set of tokens to the server device 120.

[0056] As previously disclosed, the communication device noamod may itself verify that the received program code corresponds to the task. One way for the communication device noamod to perform this verification is to compare the set of tokens to another set of tokens, associated with the received program code. In particular, insome embodiments, set of tokens is a first set of tokens, and the communication device 110a: nod is configured to perform (optional) steps S114-2, S114-4, and S114-6 as part of obtaining the verification in step S114.

[0057] S114-2: The communication device noa:nod obtains a description of the program code. In one example, the description of the program code is obtained by being received from the server device 120. In another example, the description of the program code is the received program code itself.

[0058] S114-4: The communication device 110a: liod transforms, using the context determination algorithm, the description into a second set of tokens.

[0059] S114-6: The communication device 110a: nod verifies that the second set of tokens fulfils a similarity condition with respect to the first set of tokens.

[0060] The two sets of tokens can be compared using various methods depending on the desired granularity and application. Exact matching checks whether tokens in both sets are identical or if one set is a subset of the other. Edit distance metrics, such as Levenshtein distance, quantify the number of insertions, deletions, or substitutions needed to convert one set into the other. Token frequency analysis compares how often each token appears, often using vector-based similarity measures. Semantic comparison involves analyzing the meaning of tokens, typically using embeddings from language models. Structural comparison applies to syntactically organized tokens, such as source code, where syntax trees or graphs are used to detect equivalence. Lastly, hash-based comparison generates fingerprints for each set, allowing fast comparison based on hash similarity.

[0061] As further previously disclosed, the communication device 110a: nod may receive information from the server device 120 that the server device 120 has verified that the program code corresponds to the task. Hence, in some embodiments, the verification is in step S114 obtained by being received as verification information from the server device 120. The verification information then indicates that the server device 120 has verified the program code based on the set of tokens.

[0062] As previously disclosed, the program code may either be executed by the communication device 110a: liod or be sent to another communication devicenoa:iiod for execution. Hence, in some embodiments, facilitating execution program code comprises either executing the program code on the communication device 110a: nod or sending the program code to another communication device 110a: nod for execution of the program code on this another communication device 110a: nod. In case the program code is executed by the communication device 110a: nod itself, the program code maybe executed as soon as it is received in step S112 and after verification in step S114. Hence, the network interface on the communication device 110a: nod may send the program code directly to the processor which then executes the program code. In such an embodiment, the communication device 110a: nod may continuously send new tokens to the server device 120 to request new program code. For example, in case a task comprises two components, the tokens relating to the first component of the task may first be sent, then corresponding program code is received and executed whilst the communication device 110a: nod sends tokens corresponding to the second component of the task, etc.

[0063] Reference is now made to Fig. 3 illustrating a method for just-in-time generation of program code for a communication device 110a: nod as performed by the server device 120 according to an embodiment.

[0064] S202: The server device 120 receives a representation of a set of tokens and metadata of the communication device 110a: nod from the communication device 110a: nod. Different examples of the representation of the set of tokens have been disclosed above and apply here as well. Different examples of the metadata have been disclosed above and apply here as well.

[0065] S204: The server device 120 obtains the program code for the set of tokens and the metadata. Different ways in which the server device 120 may obtain the program code will be disclosed below.

[0066] S218: The server device 120 sends the program code and verification information of the program code to the communication device 110a: nod. Different examples of verification information will be disclosed below.Embodiments relating to further details of just-in-time generation of program code for a communication device 110a: nod as performed by the server device 120 will now be disclosed with continued reference to Fig. 3.

[0067] There may be different ways for the server device 120 to obtain the program code in step S204. In some aspects, the server device 120 itself generates the program code. Hence, in some embodiments, obtaining the program code in step S204 comprises the server device 120 feeding the set of tokens and the metadata as input to a generative algorithm. In this respect, the generative algorithm transforms the set of input tokens into program code by interpreting the structure and meaning of the tokens. Using models such as a Generative Pre-trained Transformer (GPT), the generative algorithm predicts and constructs code sequences that fulfill the intent encoded in the tokens. It maps each token or token combination to corresponding syntax elements in a target programming language, considering context, dependencies, and known code patterns. In other aspects, the server device 120 in step S204 obtains the program code from a token hub, represented by the data storage 130. This could be the case where the received set of tokens match a set of tokens already present in the database. Hence, in some embodiments, the server device 120 has access to a data storage 130 implementing a database of tokens and corresponding program code, and in step S204 the program code is obtained by the server device 120 from the database upon the server device 120 having identified the set of tokens in the database. In this respect, the database may store sets of tokens having been received from different communication devices 110a: nod as well as program code having been generated for different communication devices 110a: nod. Each entry in the database may further comprise a description of what task each set of tokens, or each program code, corresponds to.

[0068] As disclosed above, the server device 120 in step S218 sends verification information of the program code to the communication device 110a: nod. As further disclosed above, the communication device 110a: nod may either itself verify that the received program code corresponds to the task or receive information from the server device 120 that the server device 120 has obtained verification that the program code corresponds to the task, either by the server device 120 itself having verified that the program code corresponds to the task or that the server device 120 having obtained such verification from a third party. The verification as performed by thecommunication device 110a: nod is based on the server device 120 sending description of the program code to the communication device 110a: nod. Hence, in some embodiments, the server device 120 is configured to perform (optional) step S206 before step S218.

[0069] S206: The server device 120 obtains a description of the program code.

[0070] This description can then be sent as the verification information to the communication device 110a: nod in step S218.

[0071] However, the description of the program code can also be used in the case where the verification is performed by the server device 120, i.e., in embodiments where the verification information that is sent in step S218 indicates that the server device 120 has verified the program code based on the set of tokens. In particular, in some embodiments, the server device 120, in addition to performing step S206, further performs (optional) steps S208 and S210 in order to verify the program code.

[0072] S208: The server device 120 transforms the description into a second set of tokens.

[0073] S210: The server device 120 verifies that the second set of tokens fulfils a similarity condition with respect to the first set of tokens. Examples of how the similarity condition can be evaluated have been disclosed above and apply here as well.

[0074] The verification information that is sent in step S218 may then indicate that the second set of tokens fulfils the similarity condition. In addition, as previously disclosed, the server device 120 may delegate the verification to a third party. It is then the third party that transforms the description into a second set of tokens and verifies that the second set of tokens fulfils the similarity condition with respect to the first set of tokens, etc.

[0075] Further, the server device 120 may verify that the description matches the task by creating test cases and then verify the program code against the thus created test cases. Hence, in some embodiments, the server device 120, is configured to perform (optional) steps S212 and S214 in order to verify the program code.

[0076] S212: The server device 120 generates at least one test case based on the set of tokens and the metadata. The at least one test case may be based on a virtual environmentrepresentative of the communication device 110a: nod. This virtual environment may be a digital twin of the communication device 110a: nod. In any case, the virtual environment should implement the same operating system and hardware / software restrictions as the communication device 110a: nod (as given by the metadata). The digital twin may further comprise other representations of other communication devices 110a: nod if the intent of the task is for the communication device 110a: nod to communicate with such other communication devices 110a: nod. Testing in the virtual environment may for example be performed for security purposes, e.g., to verify that potentially dangerous, or malicious, instructions or code segments have not been inserted in the program code (for example, either by mistake or due to training data poisoning, etc.).

[0077] S214: The server device 120 validates the program code against the at least one test case. For example, the program code can in step S214 be validated by executing it against one or more predefined test cases and comparing the outputs to expected results. If the actual outputs match the expected outcomes under all tested conditions, the program code is considered functionally correct at least for those scenarios. The test cases may be generated by the same generative algorithm as the program code, with the additional instruction to test that the requested task is actually performed when the program code is executed.

[0078] The verification information that is sent in step S218 may then indicate that the program code has been validated. In this respect, verification information is not sent in case the program code failed the validation.

[0079] As disclosed above, the program code sent to the communication device 110a: nod may either be source code or compiled source code. In some embodiments, the program code is source code and the server device 120 is configured to perform (optional) step S216.

[0080] S216: The server device 120 compiles, in accordance with the metadata, the source code into complied source code. It is then the compiled source code that is sent to the communication device 110a: nod. The compiled source code could be byte code or machine code, depending on the program language and program code support in the communication device 110a: nod.One particular embodiment for provision of program code as performed by the communication device 110a: nod based on at least some of the above disclosed embodiments will now be disclosed in detail with reference to the flowchart of Fig. 4.

[0081] S301: The communication device 110a: nod obtains user input. The user input is descriptive of a task to be performed. The task may be described by the user using natural language, such as “Calculate the number of words I am saying during the next minute” or “Inform me when you receive a network packet of type X”, or some other type of input means as previously disclosed.

[0082] S302: The communication device 110a: nod transforms, using a context determination algorithm, the user input into a set of tokens representative to describe the task. Here, the communication device 110a: nod may for example use a tokenization algorithm, e.g., a speech synthesizing algorithm which divides the user input into chunks, containing words or sub-words, to translate the user input to tokens. The tokens are processed by a context determination algorithm which generates the first set of tokens which represents the task. In some examples, the context algorithm only selects tokens from the user input. In other examples, the tokens are translated into other tokens which better represent the task. E.g., in the example from step S301, the user input “Inform me ...” can be translated to “Play a sound ...”. In some examples, the speech synthesizing algorithm and the context determination algorithm are implemented as a single algorithm.

[0083] S303: The communication device 110a: nod check whether the first set of tokens or a set of tokens close to the first set of tokens is present in its stored task list or not. In other words, the communication device 110a: nod determines whether the task has been performed and thereby that corresponding program code has previously been requested from the server device 120 or not. If yes, the user may be prompted to confirm that the last execution of the task aligned with the current task.

[0084] If confirmed, then the first set of tokens may not be stored.

[0085] S304: The communication device 110a: nod sends a representation of the set of tokens and metadata of the communication device 110a: nod to the server device 120. As per above, it is either the set of tokens itself, the set of tokens as present in the database, or an identifier of the set of tokens as present in the database, that is sent in step S304 as the representation of the set of tokens to the server device 120.S305: The communication device 110a: nod receives program code for performing the task, along with a description of the program code, from the server device 120.

[0086] Step S306 is performed in case the verification of the program code is performed by the communication device 110a: nod itself. Step S306 is otherwise skipped.

[0087] S306: The communication device 110a: nod feeds the description to the context determination algorithm which creates a second set of tokens. The communication device 110a: nod compares the second set of tokens to the first set of tokens. Step S307 is then entered only in case the second set of tokens fulfils a similarity condition with respect to the first set of tokens. Otherwise, either the user is requested to provide more user input, or the communication devices 110a: nod sends the difference between the different sets of tokens to the server device 120.

[0088] S307: The communication device 110a: nod facilitates execution of the program code for the task to be performed. Here, the program code is either executed by the communication device 110a: nod or sent to another communication device 110a: nod for execution.

[0089] S308: The first set of tokens is stored in a task database in case the check in step S303 reveals that the first set of tokens or a set of tokens close to the first set of tokens is not present in its stored task list.

[0090] One particular embodiment for just-in-time generation of program code for the communication device 110a: nod as performed by the server device 120 based on at least some of the above disclosed embodiments will now be disclosed in detail with reference to the flowchart of Fig. 5.

[0091] S401: The server device 120 receives a representation of a set of tokens and metadata of the communication device 110a: nod from the communication device 110a: nod.

[0092] S402: The server device 120 obtains the program code for the set of tokens and the metadata, as has been previously disclosed.

[0093] S403: The server device 120 optionally compiles the program code according to the metadata into compiled source code.S404: The server device 120 optionally verifies the program code, as has been previously disclosed.

[0094] S405: The server device 120 send the program code (either the (original) source code or the compiled source code) to the communication device 110a: nod. In case the server device 120 has verified the program code, then the server device 120 sends verification information that indicates that the second set of tokens fulfils the similarity condition. In case the server device 120 has not verified the program code, then the server device 120 sends other type of verification information, such as a description of the program code, to the communication device 110a: nod.

[0095] Fig. 6 schematically illustrates, in terms of a number of structural units, the components of a communication device 600 according to an embodiment. As in Fig.

[0096] 1, the communication device 600 may be any of a HMD device 110a, an loT device nob, a smartphone 110c, a smart ring nod, or some other type of communication device. Processing circuitry 610 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), etc., capable of executing software instructions stored in a computer program product 810a (as in Fig. 8), e.g. in the form of a storage medium 630. The processing circuitry 610 may further be provided as at least one application specific integrated circuit (ASIC), or field programmable gate array (FPGA).

[0097] Particularly, the processing circuitry 610 is configured to cause the communication device 600 to perform a set of operations, or steps, as disclosed above. For example, the storage medium 630 may store the set of operations, and the processing circuitry 610 may be configured to retrieve the set of operations from the storage medium 630 to cause the communication device 600 to perform the set of operations. The set of operations may be provided as a set of executable instructions. Thus the processing circuitry 610 is thereby arranged to execute methods as herein disclosed.

[0098] The storage medium 630 may also comprise persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory.

[0099] The communication device 600 may further comprise a communications (comm.) interface 620 for communications with the server device, as in Fig. 1. As such thecommunications interface 620 may comprise one or more transmitters and receivers, comprising analogue and digital components.

[0100] The processing circuitry 610 controls the general operation of the communication device 600 e.g. by sending data and control signals to the communications interface 620 and the storage medium 630, by receiving data and reports from the communications interface 620, and by retrieving data and instructions from the storage medium 630. Other components, as well as the related functionality, of the communication device 600 are omitted in order not to obscure the concepts presented herein.

[0101] Fig. 7 schematically illustrates, in terms of a number of structural units, the components of a server device 700 according to an embodiment. Processing circuitry 710 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), etc., capable of executing software instructions stored in a computer program product 810b (as in Fig. 8), e.g. in the form of a storage medium 730. The processing circuitry 710 may further be provided as at least one application specific integrated circuit (ASIC), or field programmable gate array (FPGA).

[0102] Particularly, the processing circuitry 710 is configured to cause the server device 700 to perform a set of operations, or steps, as disclosed above. For example, the storage medium 730 may store the set of operations, and the processing circuitry 710 may be configured to retrieve the set of operations from the storage medium 730 to cause the server device 700 to perform the set of operations. The set of operations may be provided as a set of executable instructions. Thus the processing circuitry 710 is thereby arranged to execute methods as herein disclosed.

[0103] The storage medium 730 may also comprise persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory.

[0104] The server device 700 may further comprise a communications interface 720 for communications with the communication devices and the data storage, as in Fig. 1. As such the communications interface 720 may comprise one or more transmitters and receivers, comprising analogue and digital components.The processing circuitry 710 controls the general operation of the server device 700 e.g. by sending data and control signals to the communications interface 720 and the storage medium 730, by receiving data and reports from the communications interface 720, and by retrieving data and instructions from the storage medium 730. Other components, as well as the related functionality, of the server device 700 are omitted in order not to obscure the concepts presented herein.

[0105] The server device 700 may be provided as a standalone device or as a part of at least one further device. For example, the server device 700 may be provided in a node of the radio access network or in a node of the core network. Alternatively, functionality of the server device 700 may be distributed between at least two devices, or nodes. These at least two nodes, or devices, may either be part of the same network part (such as the radio access network, the core network, or the service network) or may be spread between at least two such network parts. In general terms, instructions that are required to be performed in real time may be performed in a device, or node, operatively closer to the communication device 110a: nod, 600 than instructions that are not required to be performed in real time. A first portion of the instructions performed by the server device 700 may be executed in a first device, and a second portion of the instructions performed by the server device 700 maybe executed in a second device; the herein disclosed embodiments are not limited to any particular number of devices on which the instructions performed by the server device 700 may be executed. Hence, the methods according to the herein disclosed embodiments are suitable to be performed by a server device 700 residing in a cloud computational environment. Therefore, although a single processing circuitry 710 is illustrated in Fig. 7 the processing circuitry 710 may be distributed among a plurality of devices, or nodes. The same applies to the computer program 820b of Fig. 8.

[0106] Fig. 8 shows one example of a computer program product 810a, 810b comprising computer readable means 830. On this computer readable means 830, a computer program 820a can be stored, which computer program 820a can cause the processing circuitry 610 and thereto operatively coupled entities and devices, such as the communications interface 620 and the storage medium 630, to execute methods according to embodiments described herein. The computer program 820a and / or computer program product 810a may thus provide means for performing any steps of the communication device 600 as herein disclosed. On this computer readable means830, a computer program 820b can be stored, which computer program 820b can cause the processing circuitry 710 and thereto operatively coupled entities and devices, such as the communications interface 720 and the storage medium 730, to execute methods according to embodiments described herein. The computer program 820b and / or computer program product 810b may thus provide means for performing any steps of the server device 700 as herein disclosed.

[0107] In the example of Fig. 8, the computer program product 810a, 810b is illustrated as an optical disc, such as a CD (compact disc) or a DVD (digital versatile disc) or a Blu-Ray disc. The computer program product 810a, 810b could also be embodied as a memory, such as a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or an electrically erasable programmable read-only memory (EEPROM) and more particularly as a non-volatile storage medium of a device in an external memory such as a USB (Universal Serial Bus) memory or a Flash memory, such as a compact Flash memory. Thus, while the computer program 820a, 820b is here schematically shown as a track on the depicted optical disk, the computer program 820a, 820b can be stored in any way which is suitable for the computer program product 810a, 810b.

[0108] The inventive concept has mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the inventive concept, as defined by the appended patent claims.

Claims

CLAIMS1. A method for just-in-time provision of program code, the method being performed by a communication device (110a: nod, 600), the method comprising:obtaining (S102) user input, wherein the user input is descriptive of a task to be performed;transforming (S104), using a context determination algorithm, the user input into a set of tokens representative to describe the task;sending (S110) a representation of the set of tokens and metadata of the communication device (110a: nod, 600) to a server device (120, 700);receiving (S112) program code for performing the task from the server device (120, 700);obtaining (S114) verification that the received program code corresponds to the task; andfacilitating (S116) execution of the program code for the task to be performed.

2. The method according to claim 1, wherein the user input is represented by any, or any combination of: an audio signal, a video signal, a text signal, motion-related sensor data, gesture-related sensor data, biosignal-related sensor data.

3. The method according to claim 1 or 2, wherein the metadata pertains to at least one of: type of processor implemented in the communication device (110a: nod, 600), program language support in the communication device (110a: nod, 600), type of input sensors and / or output units available in the communication device (110a: nod, 600), random access memory size and / or non-volatile memory size in the communication device (110a: nod, 600).

4. The method according to any of preceding claim, wherein the communication device (110a: nod, 600) comprises a data storage implementing a database of tokens, and wherein the method further comprises:storing (S108) the set of tokens in the database upon determining that the set of tokens is not present in the database.

5. The method according to any preceding claim, wherein it is the set of tokens itself that is sent as the representation of the set of tokens to the server device (120, 700).

6. The method according to any of claims 1 to 3, wherein the communication device (110a: nod, 600) comprises a data storage implementing a database of tokens, and wherein the method further comprises:requesting (S106) user confirmation of the task to be performed upon determining that the set of tokens is present in the database; andwherein it is either the set of tokens as present in the database or an identifier of the set of tokens as present in the database that is sent as the representation of the set of tokens to the server device (120, 700).

7. The method according to any preceding claim, wherein the set of tokens is a first set of tokens, and wherein obtaining the verification comprises:obtaining (S114-2) description of the program code;transforming (S114-4), using the context determination algorithm, the description into a second set of tokens; andverifying (S 114-6) that the second set of tokens fulfils a similarity condition with respect to the first set of tokens.

8. The method according to any of claims 1 to 6, wherein the verification is obtained by being received as verification information from the server device (120, 700), wherein the verification information indicates that the server device (120, 700) has verified the program code based on the set of tokens.

9. The method according to any preceding claim, wherein facilitating execution program code comprises either executing the program code on the communication device (110a: nod, 600) or sending the program code to another communicationdevice (110a: nod, 600) for execution of the program code on said another communication device (110a: nod, 600).

10. A method for just-in-time generation of program code for a communication device (110a: nod, 600), the method being performed by a server device (120, 700), the method comprising:receiving (S202) a representation of a set of tokens and metadata of the communication device (110a: nod, 600) from the communication device (110a: nod, 600);obtaining (S204) the program code for the set of tokens and the metadata; andsending (S218) the program code and verification information of the program code to the communication device (110a: nod, 600).

11. The method according to claim 10, wherein obtaining the program code comprises feeding the set of tokens and the metadata as input to a generative algorithm.

12. The method according to claim 10, wherein the server device (120, 700) has access to a data storage (130) implementing a database of tokens and corresponding program code, and wherein the program code is obtained from the database upon the server device (120, 700) having identified the set of tokens in the database.

13. The method according to any of claims 10 to 12, wherein the method further comprises:obtaining (S206) a description of the program code; andwherein the description is sent as the verification information to the communication device (110a: nod, 600).

14. The method according to any of claims 10 to 12, wherein the verification information indicates that the server device (120, 700) has verified the program code based on the set of tokens.15- The method according to claim 14, wherein the method further comprises verifying the program code by:obtaining (S206) a description of the program code;transforming (S208) the description into a second set of tokens; andverifying (S210) that the second set of tokens fulfils a similarity condition with respect to the first set of tokens, andwherein the verification information indicates that the second set of tokens fulfils the similarity condition.

16. The method according to claim 14, wherein the method further comprises verifying the program code by:generating (S212) at least one test case based on the set of tokens and the metadata; andvalidating (S214) the program code against the at least one test case, andwherein the verification information indicates that the program code has been validated.

17. The method according to claim 16, wherein the at least one test case is based on a virtual environment representative of the communication device (110a: nod, 600).

18. The method according to any of claims 10 to 17, wherein the program code is source code, and wherein the method further comprises:compiling (S216), in accordance with the metadata, the source code into complied source code, wherein it is the complied source code that is sent to the communication device (110a: nod, 600).

19. A communication device (110a: nod, 600) for provision of program code, the communication device (110a: nod, 600) comprising processing circuitry (610), the processing circuitry being configured to cause the communication device (110a: nod, 600) to:obtain user input, wherein the user input is descriptive of a task to be performed;transform, using a context determination algorithm, the user input into a set of tokens representative to describe the task;send a representation of the set of tokens and metadata of the communication device (110a: nod, 600) to a server device (120, 700);receive program code for performing the task from the server device (120, 700);obtain verification that the received program code corresponds to the task; andfacilitate execution of the program code for the task to be performed.

20. The communication device (110a: nod, 600) according to claim 19, further being configured to perform the method according to any of claims 2 to 9.

21. A server device (120, 700) for just-in-time generation of program code for a communication device (110a: nod), the server device (120, 700) comprising processing circuitry (710), the processing circuitry being configured to cause the server device (120, 700) to:receive a representation of a set of tokens and metadata of the communication device (110a: nod, 600) from the communication device (110a: nod, 600);obtain the program code for the set of tokens and the metadata; andsend the program code and verification information of the program code to the communication device (110a: nod, 600).

22. The server device (120, 700) according to claim 21, further being configured to perform the method according to any of claims 11 to 18.

23. A computer program (820a) for provision of program code, the computer program comprising computer code which, when run on processing circuitry (610) of a communication device (110a: nod, 600), causes the communication device (noa:nod, 600) to:obtain (S102) user input, wherein the user input is descriptive of a task to be performed;transform (S104), using a context determination algorithm, the user input into a set of tokens representative to describe the task;send (S110) a representation of the set of tokens and metadata of the communication device (110a: nod, 600) to a server device (120, 700);receive (S112) program code for performing the task from the server device (120, 700);obtain (S114) verification that the received program code corresponds to the task; andfacilitate (S116) execution of the program code for the task to be performed.

24. A computer program (820b) for just-in-time generation of program code for a communication device (110a: liod), the computer program comprising computer code which, when run on processing circuitry (710) of a server device (120, 700), causes the server device (120, 700) to:receive (S202) a representation of a set of tokens and metadata of the communication device (110a: nod, 600) from the communication device (110a: nod, 600);obtain (S204) the program code for the set of tokens and the metadata; andsend (S218) the program code and verification information of the program code to the communication device (110a: nod, 600).

25. A computer program product (810a, 810b) comprising a computer program (820a, 820b) according to at least one of claims 23 and 24, and a computer readable storage medium (830) on which the computer program is stored.