Method and device for processing data
The method automates data structure transformation using a specification language and AI models to resolve ambiguities, ensuring efficient and accurate conversion of complex data structures like C/C++ classes, supporting scalable conversion across multiple versions.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ROBERT BOSCH GMBH
- Filing Date
- 2025-10-16
- Publication Date
- 2026-04-30
AI Technical Summary
Existing data structure transformation methods are inefficient and often require human intervention, especially when dealing with complex data structures such as classes in programming languages like C or C++, leading to challenges in automated and accurate conversion processes.
A method and device for processing data structures that involves determining initial information to transform a first data structure into a second data structure automatically, using a specification language in a human-readable format, and employing entities like expert systems or AI models to resolve ambiguities, with the option for human interaction when necessary, and generating executable representations for transformation.
Enables efficient, automated, and accurate transformation of data structures, preserving information content while handling complex data structures like classes with hundreds of elements, and supports scalable conversion across multiple versions with minimal human intervention.
Smart Images

Figure EP2025079842_30042026_PF_FP_ABST
Abstract
Description
[0001] Description
[0002] title
[0003] Method and apparatus for processing data
[0004] State of the art
[0005] The disclosure relates to a method for processing data associated with a data structure for a computer program, for example for a product such as a vehicle.
[0006] The disclosure further relates to a device for processing data associated with a data structure for a computer program, for example for a product such as a vehicle.
[0007] Disclosure of the invention
[0008] Some examples relate to a procedure, such as a computer-implemented procedure, for processing data associated with a data structure for a computer program, for example, for a product such as a vehicle, comprising: determining initial information that characterizes a transformation of a first data structure of a first definition into a second data structure of a second definition, where the second definition is different from the first definition, and, optionally, transforming the first data structure into the second data structure based at least on the initial information. In some examples, this enables efficient preparation and / or efficient, for example, automatic, execution of the data structure transformation. For instance, the principle according to the disclosure can be used for automated data structure conversion, such as for data migration.In some examples, at least one of the aspects a) determining or b) transforming is carried out automatically, for example without interaction with a person, for example showing an automatic determination of the first information and / or an automatic transformation into the second data structure.
[0009] In some examples, the procedure is designed to include at least one of the following elements: a) providing the initial information in a human-readable format, or b) providing the initial information using a specification language, for example, to describe the transformation, where the specification language is in a human-readable format. In some examples, this allows a person to monitor or influence the initial information.
[0010] In some examples, the first data structure and / or the second data structure is a class, e.g., according to the C or C++ programming language. In other examples, the first data structure and / or the second data structure may also have a different type than the class mentioned above as an example. For instance, the principle, as disclosed without loss of generality, is also applicable to other data structures in other programming languages.
[0011] For example, the procedure involves comparing all elements of the first data structure, for example in the case of a class as the first data structure of all members of the class, with the respective elements of the second data structure.
[0012] In some examples, the procedure includes at least one of the following elements: determining whether a transformation of at least one element of the first data structure into an element of the second data structure is not unique (e.g., ambiguous), and, if the determination reveals that the transformation of at least one element of the first data structure into an element of the second data structure is not unique (e.g., ambiguous), performing an interaction with at least one entity with the aim of resolving the non-uniqueness (e.g., ambiguity). In some examples, the entity includes at least one of the following elements: a) person, or b) expert system, or c) model based on artificial intelligence, for example, machine learning. While, for example, the aforementioned variants b), c), e.g.While fully automated processing of the data structure may still be possible according to some examples, according to the aforementioned variant a), at least in some examples, interaction with a person, e.g. a user, may also be provided.
[0013] In some examples, the procedure involves: determining, for example predicting, a specific transformation, for example from several possible transformations, for an element of the first data structure into an element of the second data structure, where, for example, the specific transformation is the transformation that best fits the several possible transformations according to at least one predefinable criterion, where, for example, the determination is carried out based on at least one of the following elements: a) type of the element, or b) name of the element, or c) at least one previous transformation, optionally executing an interaction with at least one entity, for example to confirm the specific transformation, optionally specifying (and / or executing) the specific transformation, for example based on the interaction.
[0014] In some examples, the procedure includes at least one of the following elements: a) requesting an entity (e.g., person, expert system, or model) to verify at least some part of the initial information and / or the transformation, for example, by confirming at least some part of the initial information and / or the transformation; b) signaling to at least one entity, for example, informing at least one entity about at least one transformation with a potentially inaccurate result; e) determining initial values and / or default values, for example, for at least one new element, for example, by interacting with at least one entity; or d) specifying at least one semantic transformation.
[0015] In some examples, the procedure includes at least one of the following elements: a) creating an executable representation, for example, a bytecode that can be executed, e.g., by a virtual machine, based on the specification of the transformation; or b) executing the bytecode, for example, by a virtual machine; or c) providing a virtual machine for executing the bytecode, for example, for an application, for example, in the form of a library.
[0016] In some examples, the creation of an executable representation may include at least one of the following elements: a) generation of machine-executable code that performs the transformation, e.g., bytecode, e.g., executable by a virtual machine; or b) generation of a program (e.g., using a programming language such as C++); or c) generation, for example, direct generation, of assembly code or binary code, e.g., for a computing device, e.g., a CPU.
[0017] In some examples, the procedure includes at least one of the following elements: a) determining second pieces of information that characterize an aggregation of transformations of the first data structure to a target data structure of a target definition, for example by aggregating several individual transformations, or b) performing a transformation, for example a direct one, of the first data structure to the target data structure based on the second pieces of information.
[0018] Further examples relate to a device for carrying out the method according to the disclosure, wherein, for example, the device is configured to carry out the method according to the disclosure.
[0019] Further examples relate to a product, for example a control unit or vehicle computer or vehicle or measuring system, comprising at least one device according to the disclosure.
[0020] Further examples relate to a computer-readable storage medium comprising instructions that, when executed by a computer, cause it to perform the method according to the disclosure. Further examples relate to a computer program comprising instructions that, when executed by a computer, cause it to perform the method according to the disclosure.
[0021] Further examples relate to a data carrier signal that transmits and / or characterizes the computer program according to the disclosure.
[0022] Further examples relate to the use of the method according to the disclosure and / or the device according to the disclosure and / or the product according to the disclosure and / or the computer-readable storage medium according to the disclosure and / or the computer program according to the disclosure and / or the data carrier signal according to the disclosure for at least one of the following elements: a) simulating, for example, re-simulating, e.g., re-calculating, or b) evaluating, for example, re-evaluating, e.g., calculating, recorded data, for example, measurement data, or c) exchanging data between different programs and / or program versions, or d) data communication between at least one of the following elements: d1) one or more processes, or d2) one or more processors, or d3) elements of distributed systems, or e) automatic conversion, for example, for data migration.
[0023] Further features, applications, and advantages of the invention will become apparent from the following description of examples of the invention, which are illustrated in the figures of the drawing. All described or illustrated features, individually or in any combination, constitute the subject matter of the invention, irrespective of their compilation in the claims or their cross-references, and irrespective of their formulation or representation in the description or in the drawing.
[0024] The drawing shows:
[0025] Fig. 1 schematically shows a simplified flowchart,
[0026] Fig. 2 schematically shows a simplified block diagram, Fig. 3 schematically shows a simplified flowchart,
[0027] Fig. 4 schematically shows a simplified flowchart,
[0028] Fig. 5 schematically shows a simplified flowchart,
[0029] Fig. 6 schematically shows a simplified flowchart,
[0030] Fig. 7 schematically shows a simplified flowchart,
[0031] Fig. 8 schematically shows a simplified flowchart,
[0032] Fig. 9 schematically shows a simplified block diagram,
[0033] Fig. 10 schematically shows a simplified block diagram,
[0034] Fig. 11 schematically shows a simplified diagram,
[0035] Fig. 12 schematically shows a simplified diagram,
[0036] Fig. 13 schematically shows a simplified diagram,
[0037] Fig. 14 schematically shows a simplified diagram,
[0038] Fig. 15 schematically shows aspects of uses.
[0039] Some examples, e.g., Figs. 1, 2, 10, refer to a method, for example, a computer-implemented method, for processing data associated with a data structure DS (Fig. 10) for a computer program CP, for example, for a product such as a vehicle 10, comprising: determining 100 (Fig. 1) of first information 1-1 that characterizes a transformation of a first data structure DS-1 (Fig. 2) of a first definition DEF-1 into a second data structure DS-2 of a second definition DEF-2, where the second definition DEF-2 is different from the first definition DEF-1, and, optionally, transforming 102 (Fig. 1) the first data structure DS-1 into the second data structure DS-2 based at least on the first information 1-1. In some examples, this enables efficient preparation and / or efficient, for example, automatic, execution of the transformation 102 of the data structure DS, DS-1.For example, the principle can be used according to the disclosure for automated conversion of data structures, such as for data migration.
[0040] In some examples, Fig. 2, at least some aspects of the method according to the disclosure can be carried out by means of a device 200 (see also below for details to Fig. 9).
[0041] In some examples, Fig. 1, the determination of the first information can be carried out, for example, based on a) information that characterizes the first definition DEF-1 of the first data structure DS-1, for example in the form of at least one reflection, for example a source reflection, e.g. a version "N" of the first data structure DS-1, and / or based on b) information that characterizes the second definition DEF-2 of the second data structure DS-2, for example in the form of at least one reflection, for example a target reflection, e.g. a version "N+1" (e.g. subsequent version) for the second data structure DS-2.
[0042] By using reflections to determine 100, it can be advantageous in some examples to enable conversion, for example, performing the transformation, without affecting the data or...
[0043] Data structures DS-1, DS-2 original definitions must be used, for example, they must be present.
[0044] In some examples, Fig. 1, at least one of the aspects a) retrieval 100 or b) transformation 102 is performed automatically, for example without human interaction, thus including, for example, an automatic retrieval 100a of the first information 1-1 and / or an automatic transformation 102a into the second data structure DS-2. In some examples, the transformation 102, 102a can therefore also be described as "automatic conversion," for example, "auto-conversion." In some examples, Fig. 3, the procedure is provided to include at least one of the following elements: a) providing 110 of the first information in a human-readable format HRF, or b) providing 112 of the first information 1-1 using a specification language ACSL, for example, to describe the transformation 102, 102a, where, for example, the specification language ACSL has a human-readable format HRF.In some examples, this allows a person to monitor or influence the initial information (1-1). In some examples, the specification language can be described as an "Auto-Conversion Specification Language".
[0045] In some examples, Fig. 2, the first data structure DS-1 and / or the second data structure DS-2 is a class, e.g. according to the programming language C or C++.
[0046] In further examples, the first data structure DS-1 and / or the second data structure DS-2 can also have a different type than the class mentioned above as an example. For instance, the principle, according to the disclosure without loss of generality, is also applicable to other data structures in programming languages other than, for example, C or C++.
[0047] In some examples, the principle according to the revelation can be used for migration, e.g., data migration, e.g., in relation to data structures of programming languages.
[0048] For example, the principle can be used according to the revelation for at least one type of transformation or migration of data structures: a) pivotal conversion, or b) inaccurate data conversion, or c) information is lost or added.
[0049] In some examples, the aforementioned types of transformations can be applied, for example, to convert serialized objects.
[0050] For example, a pivotal conversion can describe a process where the information content of the data in a data structure DS-1 is 100% preserved during the transformation to data structure DS-2, although the data may be represented differently. In some examples, pivotal conversions (e.g., regarding a definition of data (objects) via classes) include at least one of the following elements:
[0051] - Changes to the data type of a member ("member") where the value range is increased, e.g.: float to double, uint8_t to uint32_t, or - Renaming of member variables, or
[0052] - Reordering of member variables or restructuring of the class, or - attribute changes (e.g. from private to public, required alignment), or
[0053] - Changes to the enumeration values in an enumeration type, or
[0054] - Deleting or adding redundant information, or
[0055] - Image conversion from one color representation to another equivalent one (e.g. RGB <-> HSL).
[0056] In some examples, the information content decreases with inaccurate data conversion, e.g., within an acceptable accuracy range.
[0057] Examples include:
[0058] - Changes to the data type of a member where the value range is reduced (e.g., double -> float), or
[0059] - Converting an image to a lower resolution, or
[0060] - Conversion of one member to another unit (e.g. nanoseconds -> milliseconds).
[0061] In some examples, information can be deleted or added during conversion, such as transformation 102 (Fig. 1). Examples include adding or deleting member variables that do not contain redundant information. Deleting or adding non-redundant information does not necessarily cause problems in some examples. For instance, a vehicle registration number might be added during a measurement. This information is not relevant, for example, for analyzing a lane detection algorithm. The extent to which conversions involving the deletion and / or addition of information are acceptable depends on the context in some examples. Therefore, in some examples, unacceptable conversions can be managed in a list or added to a list, for example, if the conversion is no longer useful.The list can be checked, for example, before executing a transformation 102, thereby avoiding conversions that are undesirable in themselves and that could lead to an intolerable loss of information.
[0062] Below is an example of a first data structure DS-1 (Fig. 2) with a first definition DEF-1, which is transformed into a second data structure DS-2 with a second definition DEF-2 that differs from the first definition DEF-1, using the principle according to the disclosure.
[0063] The first data structure DS-1 is, for example, the structure of the first definition DEF-1 shown below:
[0064] struct Foo_v0 {
[0065] float m_a;
[0066] uint32_t m_b;
[0067] };
[0068] The second data structure DS-2 is, for example, the structure of the second definition DEF-2 shown below:
[0069] struct Foo_vl {
[0070] double m_a;
[0071] uint32_t m_b;
[0072] };
[0073] It can be seen that the data type of member m_a of the structure changes from "float" (single-precision floating-point number) according to the first definition DEF-1 to "double" (double-precision floating-point number) according to the second definition DEF-2. The other member m_b does not change its data type with respect to the definitions DEF-1 and DEF-2.
[0074] In some examples, the first information 1-1 according to the disclosure can describe the change described above between the definitions DEF-1, DEF-2, for example from the first definition DEF-1 to the second definition DEF-2, and the transformation 102 of the structure, i.e. e.g. from Foo_v0 to Foo_vl e.g. can be carried out automatically.
[0075] It should be noted that the structure mentioned above as an example has a comparatively low level of complexity, but the principle according to the disclosure is applicable without limitation of generality to far more complex data structures, the transformation of which would not be possible at all or only with considerable effort by a person, e.g. to data structures, for example classes, which have several hundred or more elements.
[0076] For example, as shown in Fig. 4, the procedure involves comparing 120 of all elements ELEM-1 of the first data structure DS-1 (Fig. 2), for example, in the case of a class as the first data structure of all members of the class, with the respective elements ELEM-2 of the second data structure DS-2. In some examples, at least some of the first information can be determined based on the comparison 120.
[0077] In some examples, Fig. 4, the procedure includes at least one of the following elements: Determining 122 whether a transformation of at least one element of the first data structure DS-1 into an element of the second data structure DS-2 is not unique, for example, ambiguous, and, if the determination 122 shows that the transformation of at least one element of the first data structure DS-1 into an element of the second data structure DS-2 is not unique, for example, ambiguous, performing 124 an interaction IA with at least one entity E (see also Fig. 2), e.g., with the aim of clarifying the non-uniqueness, for example, ambiguity.
[0078] In some examples, Fig. 2, the entity E has at least one of the following elements: a) person E1, or b) expert system E2, or c) model E3, e.g., based on artificial intelligence (e.g., "AI model"), for example, machine learning. While, for example, the aforementioned variants b), c), e.g., still allow for fully automated processing of the data structure DS-1 according to some examples, according to the aforementioned variant a), at least in some examples, interaction IA with a person E1, e.g., a user, can also be provided. In some examples, Fig. 5, the procedure includes: Determining 130, for example, Predicting 130a, a specific transformation T, for example, from several possible transformations, for an element ELEM' of the first data structure DS-1 (Fig.2) into an element of the second data structure DS-2, wherein, for example, the specified transformation is a transformation that best matches the several possible transformations according to at least one predefinable criterion, wherein, for example, determining 130 is performed based on at least one of the following elements, see block 130b: a) type of element ELEM', or b) name of element ELEM', or c) at least one previous transformation.
[0079] Optionally, an interaction IA' with at least one entity E, for example to confirm the specific transformation T, may be performed.
[0080] Furthermore, optionally, an execution of the specific transformation T may be provided, for example based on a specification (e.g., characterizable by at least a part of the first information 1-1) resulting from the interaction IA', thus e.g., based on the interaction IA'.
[0081] In some examples, Fig. 6, the procedure includes at least one of the following elements: a) requesting 140 an entity E (e.g., person E1, expert system E2, or model E3) to verify at least some part of the first information 1-1 and / or the transformation T, for example, by confirming at least some part of the first information 1-1 and / or the transformation T; or b) signaling 142 to at least one entity E, for example, informing 142a about at least one potentially inaccurate transformation; or d) determining 144 initial values and / or default values, for example, for at least one new element, for example, by interaction 144a with at least one entity E; or e) specifying 146 at least one semantic transformation.
[0082] In some examples, Fig. 7, the method includes at least one of the following elements: a) forming 150 an executable representation, for example a bytecode BC, based on the first information 1-1, or b) executing 152 the bytecode, for example using a virtual machine VM, or c) providing 154 a virtual machine VM for executing the bytecode, for example for an application, for example providing 154a the virtual machine VM in the form of a library.
[0083] In some examples, Fig. 8, the procedure includes at least one of the following elements: a) Determining 160 of second information I-2 that characterizes an aggregation of transformations of the first data structure DS-1 to a target data structure DS-Z (Fig. 2) of a target definition DEF-Z, for example by aggregating 160a several individual transformations, or b) Executing 162 a transformation TD, for example a direct transformation, of the first data structure DS-1 to the target data structure DS-Z based on the second information I-2. In some examples, by aggregating 160a, at least some, for example all, for example necessary, transformations are combined, for example into a new transformation, for example the direct transformation TD.
[0084] Further examples, Fig. 9, relate to a device 200 for carrying out the method according to the disclosure, wherein, for example, the device 200 is configured to carry out the method according to the disclosure.
[0085] For example, the device 200 comprises: a computing device (“computer”) 202 having at least one computing core 202a, a storage device 204 associated with the computing device 202 for at least temporary storage of at least one of the following elements: a) data DAT, b) computer program PRG, for example for carrying out the method according to the disclosure.
[0086] In some examples, the DAT characterizes at least one of the following elements, or the data DAT is associated with at least one of the following elements: a) first information 1-1, or b) second information 1-2, or e) data structure DS, DS-1, DS-2, DS-Z, or d) executable representation, for example, bytecode BC. In further examples, Fig. 9, the memory device 204 includes volatile memory (e.g., main memory (RAM)) 204a, and / or non-volatile (NVM) memory (e.g., flash EEPROM) 204b, or a combination thereof or with other memory types not explicitly mentioned.
[0087] Further examples, Fig. 9, relate to a computer-readable storage medium SM, comprising instructions PRG which, when executed by a computer 202, cause it to execute the method according to the disclosure.
[0088] Further examples, Fig. 9, relate to a computer program PRG, comprising instructions which, when the program PRG is executed by a computer 202, cause it to execute the method according to the disclosure.
[0089] Further examples, Fig. 9, relate to a data carrier signal DCS, which characterizes and / or transmits the computer program PRG according to the embodiments. The data carrier signal DCS can be transmitted (sent and / or received) via an optional data interface 206 of the device 200.
[0090] In some examples, Fig. 9, at least some, for example all, aspects of the functionality of the device 200 can be realized by a, for example pure, hardware circuit.
[0091] Further examples, Fig. 10, relate to a product, for example control unit (not shown) or vehicle computer (not shown) or vehicle 10 or measuring system 20, for example for a vehicle 10 or for a component (e.g. control unit or vehicle computer) of a vehicle 10, comprising at least one device 200 according to the disclosure.
[0092] For example, using the principle according to the disclosure, at least one data structure DS, DS-1 of a computer program CP for vehicle 10 can be transformed, for example automatically, into at least one predefinable target data structure, e.g., with a definition that differs from an original definition. Fig. 11 schematically shows a simplified diagram according to further examples. Element E1 symbolizes information that characterizes one or more first definitions (e.g., at least similar to element DEF-1 according to Fig. 2) of first data structures (e.g., at least similar to element DS-1 according to Fig. 2), for example, in the form of at least one reflection. For example, element E1 symbolizes one or more source reflections, e.g., of a version "N" of the first data structures.
[0093] Element E2 symbolizes information that characterizes one or more second definitions (e.g., at least similar to element DEF-2 according to Fig. 2) of second data structures (e.g., at least similar to element DS-2 according to Fig. 2), for example, in the form of at least one reflection. For example, element E2 symbolizes one or more target reflections, e.g., of a version "N+1" for the second data structures. In other words, the target reflections E2 describe properties of the second data structures into which the first data structures can be transformed, e.g., using the principle according to the disclosure, for example, automatically, e.g., without human interaction.
[0094] Element E3 symbolizes the determination 100 (Fig. 1) of the first information 1-1, for example by means of a so-called ACSL generator. For example, at least some aspects of the ACSL generator E3 can be realized by means of the device 200 according to the disclosure.
[0095] In some examples, Fig. 11, block E3 can also be configured to determine the input data E1 and / or E2. In other examples, block E3 can be configured to receive the input data E1 and / or E2, e.g., from another device (not shown), for example, a device configured to generate the corresponding reflections based on the data structures DS-1, DS-2 or their definitions DEF-1, DEF-2.
[0096] Element E4 symbolizes an output of block E3, e.g., the initial information 1-1, for example, in a human-readable format. Fig. 12 schematically shows a simplified diagram according to further examples, illustrating (further) processing of the initial information 1-1, see element E4. Element E5 is configured to generate a bytecode E6 based on the initial information 1-1 and can therefore also be referred to as an ACSL compiler in some examples.
[0097] Fig. 13 schematically shows a simplified diagram according to further examples, where the elements E4, E5, E6 in Fig. 13 correspond to the elements E4, E5, E6 in Fig. 12. Element E6a symbolizes an archive, for example comprising at least one database, for storing at least the bytecode E6.
[0098] Element E10 symbolizes a first data structure or object of class "A(V1)" with a first definition. Element E11 symbolizes an application. Element E12 symbolizes a second data structure or object of class "A(V2)" with a second definition, which differs from the first definition and into which the object of class A(V1) is to be transformed. For this purpose, a virtual machine E14 (e.g., "Auto-VM"), for example, provided in the form of a library, can be used. For example, the virtual machine E14 can receive the bytecode E6 from the database E6a, which was generated based on initial information E4 for a transformation from class "A(V1)" with the first definition to class "A(V2)" with the second definition.Optionally, the ACSL bytecode E6 can be serialized, for example using a corresponding library E13, and the virtual machine E14 can optionally use the serialized bytecode of element E13 to transform element E10 "A(V1)" to element E12 "A(V2)".
[0099] In other words, the Auto-VM E14 is available as a library and can be used in various applications E11 or other frameworks (not shown). As illustrated in the example in Fig. 13, the Auto-VM E14 is linked to the application E11 as a library. For example, if an object E10 of class A(V1) is to be converted, or transformed, into an object E12 of class A(V2), some examples can first check whether the corresponding ACSL bytecode for this transformation has already been loaded. If not, some examples can search for the corresponding bytecode for this transformation in the archive E6a, for example, in a database containing serialized ACSL bytecode, and load it dynamically at runtime (e.g., of the application E11). If the bytecode E6 required for the transformation is not found, the corresponding ACSL specification can optionally be generated using the ACSL compiler E5.compiled on-the-fly (i.e., dynamically, e.g., directly as needed), so that the conversion or transformation 102 (Fig. 1) can then be performed, e.g., by the Auto-VM E14.
[0100] Figure 14 schematically shows a simplified diagram according to further examples that symbolize aspects of the aggregation of transformations. For example, the aggregation of transformations can enable a unified or aggregated transformation, thereby potentially eliminating several individual transformations, such as "intermediate transformations," that would otherwise be required between a target definition and a source definition.
[0101] Element E20 symbolizes initial information for a transformation from one or more data structures of first definition V1 to one or more data structures of second definition V2, for example, in the form of the ACSL specification language. Element E21 symbolizes initial information for a transformation from one or more data structures of second definition V2 to one or more data structures of third definition V3, for example, in the form of the ACSL specification language. Element E22 symbolizes initial information for a transformation from one or more data structures of third definition V3 to one or more data structures of fourth definition V4, for example, in the form of the ACSL specification language.
[0102] Element E23 symbolizes the aggregation of elements E20 and E21, resulting in a first aggregated, for example, combined and optimized, ACSL description E24, which contains initial information for a transformation from one or more data structures of the first definitions V1 to one or more data structures of the third definitions V3. Element E25 symbolizes the aggregation of elements E22 and E24, resulting in a second aggregated, for example, combined and optimized, ACSL description E26, which contains initial information for a transformation from one or more data structures of the first definitions V1 to one or more data structures of the fourth definitions V4.
[0103] In some examples, these can also be called "chainers" or...
[0104] The elements E23 and E25, which can be designated as "aggregation devices", are realized by means of the device 200.
[0105] In other words, the principle according to the revelation allows, in some examples, Fig. 14, an aggregation of (e.g., automatic) transformations according to the revelation, for example, automatically (without interaction with any entity).
[0106] For example, chaining, as described in the revelation, is applicable to relatively large software projects where data structures such as classes consist of subclasses, some of which are developed by different teams or employees. In some cases, this can lead to significantly more class versions than the four examples V1, V2, V3, and V4 mentioned above, because many developers directly or indirectly influence the definition of classes at the top or lower levels. For instance, "Team A" develops a library, and "Team B" uses data types from this library in its class definitions. New class versions are then created whenever both Team A and Team B make changes, which in some cases leads to an exponential number of combinations of necessary transformations between all data type versions.
[0107] In further examples, the required conversion, such as a transformation (e.g., from all versions to a higher version), grows almost quadratically. For n class versions, the number of converters from "old" to "new" is determined by the formula (n*n - n) / 2. Thus, there are, for example, a total of n*n combinations, from which the n self-referencing conversions must be subtracted. The remaining number of converters covers both conversion directions, old->new and new->old, so the number of converters for only one direction (e.g., "old" -> "new") can be obtained by dividing by two. For example, (12*12 - 12) / 2 = 138 converters are required so that 12 class versions can convert each version to a newer version. In some examples, this can be efficiently implemented using the principle according to the disclosure by means of chaining, e.g., analogous to Fig. 14.
[0108] For example, it is possible to convert data structures from "Version 1" to "Version 12" by performing all partial conversions sequentially (V1->V2->V3-> ... ->V11->V12). At runtime, this approach may require all intermediate converters to be available, loaded, and executed, which is not practical, for example, with many class versions, e.g., for performance reasons.
[0109] The principle according to the disclosure and an implementation of automatic chaining, e.g., as shown in Fig. 14, advantageously offers a solution that automatically creates all converters that can be executed from any version to any other version, e.g., without performing the conversion in subsequent substeps. However, it should be noted that chaining conversions is generally not commutative.
[0110] For example, a chain of V1 -> V2 -> V3 -> V4 is not necessarily identical to a chain of V1 -> V3 -> V2 -> V4. This is because, for instance, partial conversions can result in inaccurate transformations, and / or members might be deleted or added. Therefore, differently ordered partial conversions can lead to different results. Consequently, in some examples, it may be useful to use the overall order of all available class versions for a chaining function.
[0111] In some examples, one way to identify class versions is to add a version number as a suffix to the class name. However, this convention may not always be sufficient to generate a complete version order for data structures such as classes based on their names. This is because, for example, a new class version might not necessarily have a different name, such as when a substructure defined in a library changes or when a class is modified concurrently by multiple developers. In other words, the naming convention mentioned above as an example is useful for developers to determine a rough version order, but it is not essential for determining the actual order in some examples. Therefore, in other examples, it is suggested that a versioning mechanism based on the Khans algorithm be used.
[0112] In some examples, the initial information can be 1-1, e.g., representable in the form of an ACSL specification, a data field (e.g.,
[0113] The `%direction` attribute indicates whether the source class of the conversion is older ("UP") or newer ("DOWN"), or whether it originates from concurrent development branches ("EQUAL"). To determine the order of these class versions, some examples use the Khans algorithm for topological sorting; see also [reference] for details.
[0114] https: / / en. wikipedia. org / wiki / Topological_sorting#Kahn's_algorithm. This algorithm also recognizes ring dependencies, for example.
[0115] In some examples, Fig. 14, the generation of chained converters is provided, whereby, for example, two partial conversions specified in the ACSL specification language are combined, see elements E23, E25, to form a new ACSL specification E24, E26, which behaves as if the two partial conversions were applied sequentially.
[0116] If several sub-converters are involved, the final converter, for example, is shown in Fig.
[0117] Figure 14, for example, is symbolized by element E26 and is generated inductively. In some examples, the process begins with a chaining of the first two conversions, E20 and E21, followed by the addition of the next chaining, E22, as described above for Figure 14, until the final converter, represented by element E26, is reached. Advantageously, transformations performed via chained converters yield the same result in at least some, and in some, examples, all cases as if all partial conversions were performed sequentially. This allows, for example, the provision of an integrated and automatic component testing framework that can be applied immediately after the creation of the chained converter.Further examples, aspects and advantages are described below according to the disclosure, some of which can be combined individually or in any combination with at least one of the aspects described above.
[0118] In some examples, the principle according to the disclosure can be used to provide an automated process (e.g., denoted as "Auto-Conversion") in which data structures or objects, e.g., from C / C++ classes (i.e., associated with initial definitions DEF-1, see Fig. 2) (and / or data structures of other programming languages), can be safely transformed (e.g., migrated or converted) into objects of other class definitions (e.g., DEF-2 according to Fig. 2).
[0119] In some examples, the principle according to the disclosure allows the provision of self-contained converters that enable a transformation of data structures, e.g. without having external dependencies.
[0120] In some examples, the principle according to the disclosure allows the generation of efficient converters that combine several subclass conversions (e.g., Fig. 14), instead of performing all the necessary subconversions sequentially. In some examples, this can also be referred to as "auto-conversion chaining".
[0121] In some examples, the principle, as disclosed, allows the processing of a comparatively large number of class versions (e.g., more than 100 class versions), thus exhibiting high scalability. In some examples, at least some, for example, all, class definitions DEF-1, DEF-2, DEF-Z, ... are available, for example, via source code management systems. However, in other examples, it is not necessary for all original definitions (e.g., in a current branch) to be available for a transformation, such as conversion, e.g., to the latest version. This allows, in some examples, conversion between class versions that cannot coexist in the same source code (e.g., one version uses an older and another version uses a newer version of the same library, where only one library version can be present at a time).
[0122] In some examples, the principle, as disclosed, allows for traceability and / or validation, where, for instance, one or more converters describing transformation 102 (e.g., using the initial information 1-1) are defined in a specification language such as ACSL, which is human-readable and / or comparable (e.g., "diffable") and mergeable (e.g., "mergable") and can be versioned / created based on a framework. Therefore, in some examples, it is always possible to establish a connection between the class definitions DEF-1, DEF-2, and DEF-Z used in converters.
[0123] In further examples, data associated with the data structures DS-1, DS-2, DS-Z can be uniquely identified, for example, via at least one hash value, such as a class hash (e.g., "Classhash"), which can be determined, for example, by a function for serializing and / or deserializing data. This allows data corruption, e.g., during reinterpretation and / or transformation (e.g., conversion), to be detected or prevented in some examples.
[0124] In other examples, converters that characterize the initial information 1-1, for example using the ACSL specification language, can be platform-independent, for example by using a specific format, such as a "Serlib Reflection Format," which abstracts differences between compiler and / or processor architecture and / or operating system. In further examples, the converters can also be designed to be independent of a programming language.
[0125] In some examples, the principle according to the disclosure allows for the provision of a self-contained converter, e.g., a "self-contained converter." A particular challenge when converting objects from one class to another can be the detection of so-called self-contained conversions. Members of a class are, for example, either basic data types or classes. Classes are often restructured, for example, by moving members from one class to another. In the following example, the member Bar::m_a is moved to the class Foo::m_foo_a. It follows that the conversion of Foo_vO to Foo_v1 is not possible without the conversion of Bar_vO to Bar_v1. This is therefore not a self-contained conversion. In contrast, the conversion of Bar_vO to Bar_v1 is independent and therefore self-contained. This is also called a sub-conversion. This conversion can then, for example,can be reused in any class that uses this structure as a subclass.
[0126] struct Foo_v0 {
[0127] uint32_t m_a;
[0128] uint32_t m_b;
[0129] };
[0130] struct Bar_v0 {
[0131] Foo_v0 m_foo;
[0132] uint32_t m_a;
[0133] };
[0134] struct Foo_vl {
[0135] uint32_t m_a;
[0136] uint32_t m_b;
[0137] uint32_t m_foo_a;
[0138] };
[0139] struct Bar_vl {
[0140] Foo_vl m_foo;
[0141] };
[0142] In some examples, restructuring can be performed by using a combination of several classes, e.g., at any depth in the class hierarchy. An analysis to detect non-autonomous conversions can therefore become comparatively complex, but is made possible, for example, by the principle according to the disclosure. In some examples, the principle according to the disclosure is applicable to at least some of the following use cases: a) re-simulation / calculation of recorded measurements, or b) data exchange between programs and program versions, or c) inter-process / interprocessor / distributed communication.
[0143] In some examples, the principle according to the disclosure can be used for the development, verification, and debugging of software (e.g., the computer program CP according to Fig. 10), where, for example, real data (e.g., from vehicle 10 or a system for vehicle 10) are used, since otherwise it cannot be guaranteed that vehicle 10 or the system will function as expected. Therefore, for example, real data is recorded and used as input in re-simulation / computing environments. For example, data is recorded with a specific software version, and the resulting measurement is compatible with this version. Since data structures such as classes evolve during the development of, for example, the computer program CP, the conversion, for example, transformation 102, of recorded data and / or the associated data structures DS-1 into later versions DS-2, DS-Z is important in some examples.This allows for re-simulation / calculation, for example, without requiring continuous re-recording of the data itself. In some cases, this also saves costs, as recording real-world data is comparatively expensive. For instance, online conversion according to the principle of disclosure requires comparatively little, even minimal, computational effort, while offline conversion incurs comparatively high storage costs.
[0144] In some examples, the principle, as revealed, can be used for data exchange between programs and program versions.
[0145] Software components are often shared by different projects. For example, a software component is used in both radar and video projects for vehicle 10 (Fig. 10). However, the different projects use different middleware versions, each specifically adapted to its respective project. Differences can also exist in the libraries used. Therefore, data structures such as classes and subclasses may differ, defined by the different libraries and / or the middleware. To analyze recorded data from video projects, for example, in a radar simulation environment, the data, along with its respective data structures, can be converted in some cases using the principle described in the disclosure.
[0146] In some examples, the principle as disclosed can be used for interprocess / interprocessor or distributed communication. Complex software, which, for example, executes multiple processes on multiple processors and different operating systems, sometimes requires data conversion, which can also be performed using the principle as disclosed. This is especially true for distributed systems and architectures such as IoT devices or, for example, vehicle-to-vehicle communication, where each participating system runs an individual program version that can be updated independently of other participants. For example, class changes in one part of the software system can lead to data exchange incompatibilities in conventional systems, rendering the product unusable. This can be avoided by applying the principle as disclosed, for example, by...Automated transformations 102 are performed to enable data exchange. In some examples, the principle according to the disclosure can be used for an automatic transformation 102, 102a or conversion of data structures or associated data, where the initial information 1-1 for the transformation can be described using the ACSL specification language. In some examples, an ACSL generator E3 (Fig. 11) can be provided, which determines the required transformations and provides the initial information 1-1, e.g., using the ACSL specification language. Furthermore, in some examples, the initial information 1-1 can be transformed into an executable representation, for example, a bytecode BC, e.g., ACSL bytecode, e.g., using a compiler E5 (Fig. 12). In some examples, Fig. 13, a virtual machine E14 can be provided, which executes the ACSL bytecode and thus, e.g.,The automatic transformations 102 and 102a are performed. In some examples, the ACSL specification language specifies all transformations, such as conversions, in a human-readable form, independent of a processor architecture, compiler, or the language in which the respective data structure, e.g., a class, is defined. Therefore, in some examples, the conversion is always traceable, e.g., by a person, and can be managed, e.g., in a source code management system such as Git (see https: / / git-scm.com / ).
[0147] In some examples, the ACSL generator E3 automates the creation of initial information. For instance, the ACSL generator E3 receives source and target reflections (e.g., generated by a serialization and reflection library) of a class definition as input. The ACSL generator E3 compares all members, (bit) fields, base classes, enumeration types, and aggregated classes and detects all changes between the source and target data structures. Member variables of classes that are identical (data type, attributes, etc.) and have the same name are recognized as pivotal conversions. Furthermore, standalone conversions are identified that can be reused in other converters. For example, if a conversion is ambiguous or non-unique (e.g., if a name changes), a person E1, e.g., a user, can be assigned a different name.Interactive feedback can be requested, for example, by presenting a list of possible, such as probable, transformations, perhaps via a user interface (not shown). Alternatively or additionally to this interaction with person E1, in some examples an expert system E2 and / or an (AI) model E3 can be consulted, for example, to resolve ambiguity. In practice, in some examples, a comparatively large number of transformations, such as conversions, can be performed automatically, for example, by the ACSL generator E3, i.e., without any interaction with entity E.
[0148] In some examples, such as when a data structure, like a class, undergoes many changes, it can be difficult for a user to find the most likely transformation T in a displayed list of possible transformations. This is the case, for example, when members are moved to subclasses or transformations are not unique. To improve the user experience, the ACSL generator E3 includes a predictor in some examples that calculates the best-fitting and most likely transformations T and displays them to the user E1, for example, as the first option. In some examples, an algorithm for the predictor is based on the similarity of matches based on, for example, type, name, and previous transformations.
[0149] In some examples, a verification process may be provided, e.g., by entity E. For instance, once the ACSL generator E3 has assigned all members of a source class to a target class, entity E, e.g., user E1, may be asked to perform a verification, e.g., to confirm the determined transformations, e.g., characterized by the initial information 1-1, e.g., represented by the ACSL specification language. In particular, entity E, e.g., user E1, may be informed of inaccurate transformations in some examples, e.g., if members have been deleted, and may be asked for initial / default values, e.g., for added members.
[0150] Furthermore, in some examples it is possible to provide semantic transformations, e.g., when source members of a data structure DS-1 are assigned to target members of a data structure DS-2. For example, the source value can be multiplied by 100, or the values of two members can be combined and the result assigned to a third member.
[0151] Further aspects of the ACSL bytecode E4 (Fig. 11) and the ACSL compiler E3 are described below, using some examples. For instance, the ACSL specification E4 of the first information 1-1 is compiled by the ACSL compiler E5 (Fig. 12) into, for example, a platform-dependent ACSL bytecode E6. The ACSL bytecode E6 is interpreted, for example, by a virtual machine (e.g., "Auto-VM") E14 (Fig. 13) and performs the transformation 102, such as the conversion of class objects. The ACSL bytecode E6 is, for example, serializable and can be dynamically loaded at runtime of the application E11. If new converters are available that implement, for example, new transformations, recompilation of the virtual machine E14 or other components is not required in some examples, which can increase efficiency. The ACSL bytecode E6 consists, for example, of powerful and easily understandable instructions that, for example,The complexity of the transformations involved may be concealed. The ACSL compiler E5 may, in some examples, include an optimizer that generates relatively efficient transformations, such as conversions, using conventional, e.g., current, optimization techniques (e.g., strength reduction and / or elimination of common subexpressions and / or unrolling of loops, etc.). In some examples, for example, to select the correct ACSL bytecode for a transformation, only a source and target class hash are required. In some examples, reflection information is no longer needed, which keeps the size of the ACSL bytecode E6 relatively small (e.g., on average, 128–512 bytes per converter). An example of disassembled ACSL bytecode is shown below.
[0152] Autoconverter V3 version [0.15.0]
[0153] abi : le6
[0154] time: Sat May 15 13 : 18 :48 2021
[0155] flags :
[0156] srcSize : 552
[0157] dstSize: 688
[0158] srchash : [a603e6df600f6f85891cl5946d6aele6]
[0159] dsthash : [9cff9dcccd77338b8d6b8327f 5289b7a]
[0160] 0 MOV .4 [ 0, 01[ 0, 0]
[0161] 1 MOV .4 [ 48, 48] [ 4, 4]
[0162] 2 WCT [ 4, 52] [ 36, 40] count
[0001] code
[0006] sizeof( T) src / dst [4->8]
[0163] 3 MOV .4 [ 4, 56] [ -4, 36]
[0164] 4 MOV .8 [ 4, 601 [ -123 24]
[0165] 5 LPS [ 8, 68] [ 24, 48] repeat" ' 40
[0166] 6 , 10v 0, 681[ 0, 48] size
[0012]
[0167] 7 CLR .4 , - ] [ 12, 60]
[0168] 8 LPE 12, 80] [ 4, 64 3 jmp [ -2] count
[0040]
[0169] 9 MOV .4 [ 0, 548 ] [ -656, 32]
[0170] 10 CLR [ , - ] [ -24, 8] size
[0016] 11 HLT [ 4j 552] [ 680, 688]
[0171] In some examples, the ACSL specification language specifies self-contained conversions using unique hash values for the data structures, e.g., class hashes in the case of classes, which can be determined using a serialization and reflection library, and, for example, the class names of the source and target classes. In some examples, enumeration types (e.g., "enum") are treated the same as classes, but, for example, "@enum" can be used instead of "@class" in the ACSL specification language.
[0172] In some examples, the ACSL specification language specifies all assignments (e.g., including new or deleted members).
[0173] For example, reflection can be used to check whether all members of a data structure to be transformed have been correctly assigned.
[0174] The principle according to the disclosure, which, for example, enables the provision of a concept for the automatic transformation of data structures DS-1, DS-2, DS-Z with different definitions DEF-1, DEF-2, DEF-Z, is comparatively efficient in some examples and can be performed online or "on-the-fly." Furthermore, in some examples, it can be easily scaled and / or is testable, traceable, and validatable, and covers more use cases and requirements than some conventional approaches.
[0175] Further examples, Fig. 15, relate to a use 300 of the method according to the disclosure and / or the device 200 according to the disclosure and / or the product 10, 20 according to the disclosure and / or the computer-readable storage medium SM according to the disclosure and / or the computer program PRG according to the disclosure and / or the data carrier signal DCS according to the disclosure for at least one of the following elements: a) simulating 301, for example, re-simulating, e.g., re-calculating, or b) evaluating 302, for example, re-evaluating, for example, calculating, recorded, for example, "old", data, for example, measurement data (e.g., from at least one control unit of the vehicle 10), wherein, for example,the evaluation 302 can be carried out using software that has been adapted to the latest definitions for at least one data structure DS, or c) exchange 303 of data between different programs and / or program versions, or d) data communication 304 between at least one of the following elements: d1) one or more processes, or d2) one or more processors, or d3) elements of distributed systems, or e) automatic conversion 305, for example for a data migration.
Claims
Claims 1. Method, for example a computer-implemented method, for processing data associated with a data structure (DS) for a computer program (CP), for example for a product such as a vehicle (10), comprising: determining (100) first information (I-1) that characterizes a transformation (T) of a first data structure (DS-1) of a first definition (DEF-1) into a second data structure (DS-2) of a second definition (DEF-2), wherein the second definition (DEF-2) is different from the first definition (DEF-1), and, optionally, transforming (102) the first data structure (DS-1) into the second data structure (DS-2) based at least on the first information (1-1).
2. Method according to claim 1, wherein at least one of the aspects a) determining (100) or b) transforming (102) is performed automatically, for example without interaction with a person, for example comprising an automatic determination (100a) of the first information (1-1) and / or an automatic transformation (102a) into the second data structure (DS-2).
3. Method according to at least one of the preceding claims, comprising at least one of the following elements: a) providing (110) the first information (1-1) in a human-readable format (HRF), or b) providing (112) the first information (1-1) by means of a specification language (ACSL), for example to describe the transformation (T), wherein, for example, the specification language (ACSL) has a human-readable format.
4. Method according to at least one of the preceding claims, wherein the first data structure (DS-1) and / or the second data structure (DS-2) is a class.
5. Method according to at least one of the preceding claims, comprising: comparing (120) all elements (ELEM-1) of the first data structure (DS-1), for example in the case of a class as the first data structure (DS-1) of all members of the class, with the respective elements (ELEM-2) of the second data structure (DS-2).
6. Method according to claim 5, comprising at least one of the following elements: Determining (122) whether a transformation of at least one element of the first data structure (DS-1) into an element of the second data structure (DS-2) is not unique, for example ambiguous, and, if the determination (122) reveals that the transformation of at least one element of the first data structure (DS-1) into an element of the second data structure (DS-2) is not unique, for example ambiguous, performing (124) an interaction (IA) with at least one entity (E), for example with the aim of clarifying the non-uniqueness, for example ambiguity.
7. Method according to claim 6, wherein the entity (E) comprises at least one of the following elements: a) person (E1), or b) expert system (E2), or (E3) model based on artificial intelligence, for example machine learning.
8. A method according to at least one of the preceding claims, comprising: determining (130), for example predicting (130a), a specific transformation (T), for example of several possible transformations, for an element (ELEM) 1 ) of the first data structure (DS-1) into an element of the second data structure (DS-2), wherein, for example, the specified transformation (T) is a transformation that best fits among the several possible transformations according to at least one predefinable criterion, wherein, for example, the determination (130) is performed (130b) based on at least one of the following elements: a) type of element, or b) name of element, or c) at least one previous transformation, optionally performing (132) an interaction (IA). 1) with at least one entity (E), for example to confirm the specific transformation (T), optionally execute (134) the specific transformation (T), for example based on the interaction (IA) 1 ).
9. A method according to at least one of the preceding claims, comprising at least one of the following elements: a) requesting (140) an entity (E) to verify at least a part of the first information (1-1) and / or the transformation (T; T), for example by confirming the at least a part of the first information (1-1) and / or the transformation (T; T), or b) signaling (142) to at least one entity (E), for example by informing (142a) at least one entity (E) about at least one, for example potentially, inaccurate transformation, or c) determining (144) initial values and / or default values, for example for at least one new element, for example by interaction (144a) with at least one entity (E), or d) specifying (146) at least one semantic transformation by at least one entity (E).
10. Method according to at least one of the preceding claims, comprising at least one of the following elements: a) forming (150) an executable representation, for example a bytecode (BC; E6), based on the first information (1-1), or b) executing (152) the bytecode (BC; E6), for example by means of a virtual machine (VM; E14), or c) providing (154) a virtual machine (VM; E14) for executing (152) the bytecode (BC; E6), for example for an application (E11), for example in the form of a library.
11. Method according to at least one of the preceding claims, comprising at least one of the following elements: a) Determining (160) second information (I-2) that characterizes a chaining of transformations of the first data structure (DS-1) to a target data structure (DS-Z) of a target definition (DEF-Z), for example by chaining (160a) several individual transformations, or b) Performing (162) a, for example direct, transformation (TD) of the first data structure (DS-1) to the target data structure (DS-Z) based on the second information (I-2).
12. Device (200) for carrying out the method according to at least one of the preceding claims, wherein, for example, the device (200) is configured to carry out the method according to at least one of the preceding claims.
13. Product, for example control unit or vehicle computer or vehicle (10) or measuring system (20), comprising at least one device (200) according to claim 12.
14. Computer-readable storage medium (SM) comprising instructions (PRG) which, when executed by a computer (102), cause it to execute the method according to at least one of claims 1 to 11.
15. Computer program (PRG) comprising instructions which, when the program (PRG) is executed by a computer (102), cause it to execute the method according to at least one of claims 1 to 11.
16. Data carrier signal (DCS) that transmits and / or characterizes the computer program (PRG) according to claim 15.
17. Use (300) of the method according to at least one of claims 1 to 11 and / or the device (100) according to claim 12 and / or the product (10, 20) according to claim 13 and / or the computer-readable storage medium (SM) according to claim 14 and / or the computer program (PRG) according to claim 15 and / or the data carrier signal (DCS) according to claim 16 for at least one of the following elements: a) Simulation, for example, re-simulation, e.g.Resimulation, (301), or b) evaluation, for example re-evaluation, for example calculation, (302) of recorded data, for example measurement data, or c) exchange (303) of data between different programs and / or program versions, or d) data communication (304) between at least one of the following elements: d1) one or more processes, or d2) one or more processors, or d3) elements of distributed systems, or e) automatic conversion (305), for example for data migration.
Citation Information
Patent Citations
Learning ETL rules by example
US20190318272A1
System and method for using a graphical user interface to develop a virtual programmable logic controller
US20230289149A1