Method for comparing two binary codes

By generating dissimilar binary code from the same source code and applying software quality metrics, the efficiency and security issues of binary code comparison in automated driving functions are solved, achieving efficient and secure code heterogeneity comparison.

CN123146931APending Publication Date: 2026-11-20ROBERT BOSCH GMBH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202580029710.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-04-22
Filing Date
2025-03-26
Publication Date
2026-11-20

Smart Images

  • Figure CN123146931A_ABST
    Figure CN123146931A_ABST
Patent Text Reader

Abstract

The invention relates to a method for comparing two binary codes of an automated driving function for a motor vehicle, comprising the following steps: generating two dissimilar binary codes from the same source code of an automated driving function for a motor vehicle, such that the generated binary codes each have a reference block pointing to the source code; forming, for each of the binary codes, a super block by fusing the reference blocks; based on the reference blocks, respectively assigning the super block formed for one of the two binary codes to a super block formed for the other of the two binary codes in order to obtain pairs formed of super blocks; applying at least one software quality metric to each pair of super blocks in order to obtain, as a result, a metric value which describes the similarity of the two super blocks of the pair, respectively; comparing the two binary codes based on the obtained metric values. The invention relates to an apparatus, a computer program and a machine-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method, an apparatus, a computer program, and a machine-readable storage medium for comparing two binary codes for driving functions of a motor vehicle. Background Technology

[0002] Public document WO 2023 / 004184 A1 discloses a method for monitoring roads.

[0003] Public document EP 3 674 920 A1 discloses a method for creating map data.

[0004] Public document WO 2022 / 081421 A1 discloses a method for data transmission within an infrastructure. Summary of the Invention

[0005] The objective of this invention is to provide a scheme for efficiently comparing two binary codes used for automated driving functions of motor vehicles.

[0006] This task is solved by means of the corresponding subject matter of the independent claim. The advantageous configurations of the invention are the subject matter of the various dependent claims.

[0007] According to a first aspect, a method is provided for comparing two binary codes for an automated driving function of a motor vehicle, the method comprising the following steps: Two dissimilar binary codes are generated from the same source code used for automated driving functions in motor vehicles, such that each generated binary code has a reference block pointing to the source code. For each binary code in the binary code, a superblock is formed by merging the reference blocks. Based on the reference block, a superblock formed for one of the two binary codes is assigned to a superblock formed for the other of the two binary codes, in order to obtain a pair formed by the superblocks. At least one software quality metric is applied to each pair of superblocks to obtain metric values ​​as results, wherein the metric values ​​describe the similarity between the two superblocks in the pair. The two binary codes are compared based on the obtained metric values.

[0008] According to a second aspect, an apparatus is provided, configured to perform all the steps of the method according to the first aspect.

[0009] According to a third aspect, a computer program is provided that includes instructions that, when implemented by a computer, for example by means according to a second aspect, cause the computer to implement the method according to a first aspect.

[0010] According to a fourth aspect, a machine-readable storage medium is provided, on which a computer program according to a third aspect is stored.

[0011] This invention is based on and incorporates the understanding that the aforementioned task is solved by forming superblocks through fusing reference blocks for each binary code and pairing these superblocks, thereby calculating a metric value for each pair by applying at least one software quality metric to each pair of superblocks. By using a software quality metric, the similarity of the superblocks in a pair can be efficiently quantified through the metric value, thus enabling efficient comparison of two binary codes based on the obtained metric value. In other words, by using at least one software quality metric, a quantitative comparison of the similarity between two binary codes becomes possible. Therefore, two binary codes can be compared efficiently.

[0012] By generating two dissimilar binary codes from the same source code used for automated driving functions in motor vehicles, a technical advantage is achieved, for example, by providing two different binary codes that can both fulfill the same function: automated driving.

[0013] Typically, identical binary code derived from the same source code is prone to systematic errors. In the context of automated driving of motor vehicles, this can be disadvantageous from a safety perspective.

[0014] For example, this is typically the case: within the scope of automated driving functions, two computers perform calculations, with the same application software running on both computers or computing devices. A third computing device can, for example, be used to examine the results from the two computers or computing devices.

[0015] However, if the exact same binary code is run on these two computers, or computing devices, the results may be erroneous, even though the two computers will still produce the same results due to the identical binary code. Driving that is at least partially automated based on erroneous results could be detrimental, potentially leading to a collision, for example.

[0016] Therefore, the setup involves generating two dissimilar binary codes from the same source code, thereby creating greater heterogeneity in the application software of the two computing devices, or computers, performing calculations for at least partially automated driving of motor vehicles. This heterogeneity advantageously contributes to security against systemic errors.

[0017] However, the greater the difference between the binary codes derived from the same source code, the more likely the results will deviate from each other. In other words, it should be ensured that two binary codes still compute the same thing.

[0018] Therefore, in the context of automated driving of motor vehicles, it is meaningful to compare such dissimilar binary codes with each other in order to illustrate whether these differences are too large, too small, or sufficient for use of the binary codes within the scope of automated driving of motor vehicles.

[0019] The concept of "generating dissimilar binary code from the same source code" is known to those skilled in the art. Here, dissimilar binary code is generated from the same source code, which may also be referred to as source code within the scope of this specification. When generating the corresponding binary code, references to the original source code are included. In other words, this generation of dissimilar binary code results in each generated binary code having a reference block pointing to the source code.

[0020] These references, or reference blocks, are, for example, the names and line numbers of the original source code files.

[0021] The scheme described in this article specifically sets up a comparison not between complete binary code files, but between related reference blocks, i.e., pairs formed by superblocks. For example, references can be associated when they point to the same source file and the same line number.

[0022] In one embodiment of the method, the at least one software quality metric is selected from the following group of software quality metrics: Damerau-Levenshtein metric and longest-common metric.

[0023] This leads to the following technical advantages, for example: the ability to use particularly suitable software quality metrics.

[0024] In one implementation of the method, the metric values ​​of all pairs are accumulated, and the two binary codes are compared based on the accumulation.

[0025] This leads to the following technical advantages, for example: efficient comparison of binary codes.

[0026] In one embodiment of the method, the accumulation includes summing the metric values ​​to obtain a sum of the metric values, wherein the two binary codes are compared based on the sum of the metric values.

[0027] This leads to the following technical advantages, for example: accumulation can be performed efficiently, thus enabling efficient comparison of two binary codes.

[0028] In one embodiment of the method, the accumulation includes establishing a relationship between the metric value and a reference value to obtain a relative metric value, wherein the two binary codes are compared based on the sum of the relative metric values.

[0029] This leads to the following technical advantages, for example: accumulation can be performed efficiently, thus enabling efficient comparison of two binary codes.

[0030] In one embodiment of the method, establishing the relationship includes establishing a relationship between the metric value and the number of superblocks used as the reference quantity.

[0031] This leads to the following technological advantages, for example: relationships can be established efficiently.

[0032] In one embodiment of the method, the establishment of the relationship includes establishing a relationship between the metric value and the length of the corresponding superblock, wherein the length is used as the reference value.

[0033] This leads to the following technological advantages, for example: relationships can be established efficiently.

[0034] In one embodiment of the method, the accumulation includes performing a statistical analysis on the metric values, wherein the two binary codes are compared based on the results of the statistical analysis.

[0035] This leads to the following technical advantages, for example: accumulation can be performed efficiently, thus enabling efficient comparison of two binary codes.

[0036] In one embodiment of the method, the statistical analysis evaluation includes determining the dispersion of the metric values ​​and / or determining the average of the metric values.

[0037] This leads to the following technical advantages, for example: it enables efficient statistical analysis and evaluation.

[0038] In one implementation of this method, it is set that: the first reference block is a superblock.

[0039] This leads to the following technical advantages, for example: subsequent comparisons can be conducted in the best possible way.

[0040] Superblocks are not optional constructs, nor strictly speaking, optimizations. Superblocks arise from the fact that toolchains may generate successive reference blocks that all point to the same source code reference. These reference blocks are specifically merged into superblocks so that they can be compared in the best possible way. It cannot always be assumed that the toolchain prunes reference blocks to the same size for two optimization levels. Only by merging them into superblocks (always pointing to the same source code reference) can a reasonable comparison be made.

[0041] The toolchain used to generate assembly files consists, in particular, of a compiler and an assembler used subsequently.

[0042] In one implementation of this method, a check is set to check whether a reference block immediately following the superblock points to a library, wherein if so, the reference block is merged with the superblock.

[0043] This leads to the following technological advantages, for example: efficient integration.

[0044] In one implementation of the method, if not, it is checked whether the reference block points to the same reference as the superblock, and if so, the reference block is merged with the superblock.

[0045] This leads to the following technological advantages, for example: efficient integration.

[0046] In one implementation of this method, it is set such that if not, it is determined that the referenced block is a new superblock.

[0047] This leads to the following technological advantages, for example: efficient integration.

[0048] In one embodiment of the method, the fusion is performed independently of the arguments of the instructions included in the binary code.

[0049] This leads to the following technological advantages, for example: efficient integration.

[0050] In one implementation of this method, a check is set to check whether the superblock and the reference block immediately following the superblock point to the same source code file and the same line number, wherein if they do, the reference block is merged with the superblock.

[0051] This leads to the following technological advantages, for example: efficient integration.

[0052] In one implementation of the method, a check is set to check whether a superblock and a reference block pointing to the same source code file and the same line number are consecutively adjacent to each other. If so, the reference block is merged with the superblock. If not, the reference block is not merged with the superblock.

[0053] This leads to the following technological advantages, for example: efficient integration.

[0054] Merging in the sense of this specification includes, in particular, merging a reference block with another reference block and / or merging a reference block with a superblock.

[0055] Applying at least one software quality metric includes, for example, applying the at least one software quality metric to a pair of superblocks up to a first jump instruction in one of the two superblocks. This means, for example, applying the software quality metric to the portion of the superblock that includes the first jump instruction up to the first jump instruction and to the corresponding portion of the other superblock.

[0056] In other words, for example, software quality metrics can be applied only to the portion of the superblock up to the first jump instruction.

[0057] For example, if a jump instruction exists in one of two superblocks, a software quality metric is used to check whether the other superblock also contains a jump instruction and / or whether it includes a jump instruction at the same location as the first superblock. The metric, for example, gives the result of this check: whether the other superblock also contains a jump instruction and / or whether it includes a jump instruction at the same location as the first superblock.

[0058] The superblock is a list of machine instructions. These machine instructions are processed sequentially. Specifically, processing continues until a jump instruction is encountered. Analyzing and evaluating / comparing jump instructions can be very costly. Therefore, comparisons are performed only up to, for example, the jump instruction.

[0059] It should be noted that there are various types of jump instructions. For example, determining whether jump instructions exist on both sides, i.e., in both superblocks. For example, determining the relative length of a segment before a jump instruction. If no jump instruction exists, the relative length will be 100% of the total length of the superblock. For example, comparing jump instructions with each other. For example, not continuing the comparison after a jump instruction. For example, it may occur that one superblock in a pair does not contain a jump instruction, while the other superblock in the pair does. In this case, as described within the scope of this specification, the two superblocks are compared up to the jump instruction in the other superblock.

[0060] The scheme described herein is based in particular on the following: for example, not determining what a jump instruction does and / or where it leads from the content. The comparison is specifically terminated when a jump instruction is present. For example, it is configured such that, in this case, the comparison of whether jump instructions are the same is implicit rather than explicit. That is, for example, when the same jump instruction exists at the same location in two superblocks, the algorithm does not set up a special comparison.

[0061] For example, the default setting is to always compare instructions, without distinguishing whether there happen to be jump instructions in both superblocks.

[0062] The method is, for example, a computer-implemented method.

[0063] In the sense of this specification, a software quality metric is a function that maps software units, in this case, pairs formed by superblocks, to numerical values, in this case, metric values, which can be interpreted as the degree to which the quality attributes of the software unit, in this case, similarity, are satisfied.

[0064] Source code, for example, is written or composed in the programming language C++.

[0065] The features of the apparatus are similarly derived from the corresponding features of the method, and vice versa. Therefore, this means that the technical functionality of the apparatus is similar to the corresponding technical functionality of the method, and vice versa.

[0066] The method is performed, for example, by means of the device.

[0067] The device is, for example, a computer.

[0068] The device is configured, for example, in terms of programming techniques, to implement the computer program.

[0069] The expression "at least one" means "one or more".

[0070] An interpretation based on one software quality metric can similarly apply to multiple software quality metrics, and vice versa.

[0071] Driving functions, for example, are at least partially automated driving functions. The expression "at least partially automated" includes: partial automation, high automation, full automation, and autonomous.

[0072] The embodiments and implementation methods described herein can be combined with each other in any manner, even if not explicitly described. Attached Figure Description

[0073] The invention will now be explained in more detail with the aid of preferred embodiments. Herein lies: Figure 1A flowchart of a method for comparing two binary codes used for automated driving functions of motor vehicles; Figure 2 : device; Figure 3 Machine-readable storage media; Figure 4 Flowchart of the method steps; Figures 5 to 7 : Exemplary fusions of referenced blocks are shown respectively; and Figure 8 Superblock. Detailed Implementation

[0074] Figure 1 A flowchart is shown for a method of comparing two binary codes for an automated driving function in a motor vehicle, the method comprising the following steps: Generate 100 dissimilar binary codes from the same source code used for automated driving functions in motor vehicles, such that each generated binary code has a reference block pointing to the source code. For each binary code in the binary code, a 103 superblock is formed by merging the reference blocks. Based on the reference block, the superblock formed for one of the two binary codes is assigned 105 to the superblock formed for the other of the two binary codes, in order to obtain a pair formed by the superblock. For each pair of superblocks, at least 107 software quality metrics are applied to obtain metric values ​​as results, wherein the metric values ​​describe the similarity between the two superblocks in the pair. The two binary codes described in 109 are compared based on the obtained metric values.

[0075] Figure 2 An apparatus 201 is shown, which is configured to perform all the steps of the method according to the first aspect.

[0076] Figure 3 A machine-readable storage medium 301 is shown, on which a computer program 303 is stored. The computer program 303 includes instructions that, when executed by a computer, cause the computer to perform the method according to the first aspect.

[0077] Figure 4 A flowchart of the method steps is shown, which can be used, for example, in the method according to the first aspect.

[0078] According to step 401, it is determined that "the first reference block is the first superblock".

[0079] In step 403, check whether the "next reference block points to the library".

[0080] If so, then according to step 405, the next reference block is added to the current superblock, which is the first superblock in this case.

[0081] If not, proceed to step 407 to check whether the next reference block points to the same source code reference.

[0082] If so, proceed to step 405.

[0083] If not, then according to step 409, a new superblock begins with the next referenced block. In other words, according to step 409, it is determined that "the next referenced block is a new superblock".

[0084] The flowchart can then continue, for example, in step 403. The method can continue, for example, until no more referenced blocks can be merged into a superblock.

[0085] Figure 5 The first reference block 501, the second reference block 503, the third reference block 505, and the fourth reference block 507 are shown as examples.

[0086] The first reference block 501 points to the following reference: Source file 1: line 12.

[0087] The second reference block 503 points to the following reference: source file 1, line 12.

[0088] The third reference block 505 points to the following reference: source file 1, line 14.

[0089] The fourth reference block 507 points to the following reference: source file 1, line 18.

[0090] The first reference block 501 and the second reference block 503 are merged into a first superblock 509, which is illustrated schematically by curly braces. The first superblock 509 has the following reference: Source file: line 12.

[0091] In addition, it is determined that "the third reference block 505 is the second superblock 511 with the following reference": Source file 1: line 14.

[0092] The third reference block 505 is not merged with the first superblock 509 because the third reference block does not point to the same reference. The third reference block 505 points to line 14 of the first source file, while the two reference blocks 501 and 503 point to the same line 12 of source file 1.

[0093] Corresponding to the scheme described in this paper, then, for example, determining that "the fourth reference block 507 is the third superblock", which is in Figure 5The details were not further elaborated in the drawing.

[0094] Figure 6 The first reference block 601, the first library 603, the second reference block 605, and the third reference block 607 are shown.

[0095] Library 603 is located between the first reference block 601 and the second reference block 605.

[0096] The first reference block 601 points to the following reference: Source file 1: line 12.

[0097] The library, or library block 603, points to line 99.

[0098] The second reference block 605 points to the following reference: Source file 1: line 12.

[0099] The third reference block 607 points to the following reference: Source file 1: line 14.

[0100] The first reference block 601, library 603, and second reference block 605 are merged into the first superblock 609.

[0101] The third reference block 607 forms the second superblock 611, and therefore does not merge with the first superblock 609 because the third reference block references a different line number.

[0102] Figure 7 The first reference block 701, the first library block 703, the second reference block 705, the third reference block 707, and the fourth reference block 709 are shown.

[0103] The first reference block 701 points to the following reference: Source file 1: line 12.

[0104] The first block 703 points to line 99.

[0105] The second reference block 705 points to the following reference: Source file 1: line 12.

[0106] The third reference block 707 points to the following reference: Source file 1: line 14.

[0107] The fourth reference block 709 points to the following reference: Source file 1: line 12.

[0108] According to the scheme described in this paper, the first reference block 701, the first library block 703, and the second reference block 705 are merged into the first super block 711.

[0109] The third reference block 707 forms the second superblock 713 and does not merge with the first superblock 711 because the third reference block 707 points to a different reference, which is line 14 in this case.

[0110] Although the fourth reference block 709 points to the same reference as the first reference block 701 and the second reference block 705, the third reference block 707 is located between the fourth reference block 709 and the first superblock 711, or the second reference block 705, so the fourth reference block 709 is not merged with the first superblock 711.

[0111] The scheme described in this paper for comparing two dissimilar binary codes generated from the same source code is particularly advantageous in the field of automated driving. One example of such automated driving is automated driving within the scope of the AVP process. Here, AVP stands for "Automated Valet Parking," which can be translated into German as "automatischer Parkvorgang."

[0112] Especially in the context of AVP, for example, the so-called "Safety PLC" is used. "PCL" stands for "Programmable Logic Controller". This safety PLC is a hardware component that is used to put the AVP infrastructure into a safe state when, for example, unreasonable conditions are detected by safety monitoring.

[0113] The use of this hardware is technically complex and expensive, and its maintenance is costly. Therefore, it is advantageous to no longer use this hardware.

[0114] This can be achieved, for example, by replacing the safety PLC with three computers. Application software runs on two of these computers, or computing devices. The third computing device, or computer, is used, for example, only to check the results, which are calculated independently by the other two computing devices. Up to this point, the same application software has always run on the two computing devices. However, this introduces security risks that should be mitigated or minimized, which can be efficiently addressed through the scheme described herein.

[0115] In principle, the higher the heterogeneity of a system, the more secure it is. However, this heterogeneity also comes at a cost. Thus, there exists a tension between vastly different binary code and completely identical binary code, both generated from the same source code.

[0116] On the one hand, while highly heterogeneous binary code offers significant advantages in terms of security against systemic errors, it can also mean substantial additional overhead in terms of generation and maintenance. Furthermore, proving that "the software still does the same thing" can be extremely resource-intensive.

[0117] On the other hand, identical binary code is highly susceptible to systematic errors. However, the additional cost of generating it is zero, and proving that "identical binary code performs the same function" is straightforward because it is identical binary code.

[0118] From a security perspective, according to the scheme described in this paper, dissimilar binary code is still created from the same source code, and the two binary codes are compared in order to evaluate their similarity.

[0119] For example, based on the comparison results, it can be determined whether the binary code can be used for automated driving functions.

[0120] Therefore, within the scope of the scheme described herein, a method for measuring the differences in binary code thus generated is disclosed.

[0121] The scheme described in this article involves generating dissimilar binary code. Generating dissimilar binary code is itself prior art. The following conditions must be met when generating dissimilar binary code: Binary code is generated from the same source code. When generating binary code, references to the original source code must be included. These references are the names and line numbers of the original source code files.

[0122] For example, instead of directly comparing complete code files, compare related reference blocks. For instance, associate references when they point to the same source code file and line number.

[0123] For example, only the actual instruction, such as "push", is considered, without considering the instruction's arguments, such as the memory address.

[0124] For example, merging referenced blocks into a superblock. During merging, the superblock acquires a reference to the merged referenced block.

[0125] If a reference to a library is located between reference blocks and does not, for example, point to one of the source code files, then the library, or the library block, is merged with the preceding superblock.

[0126] exist Figure 7 In the exemplary illustration shown, the fourth reference block 709 has the same references as the first reference block 701 and the second reference block 705. However, merging is not performed because a different superblock, namely the second superblock 713, is located between them. In this case, the fourth reference block 709 is ignored, for example.

[0127] The comparison of binary code is based on the differences in superblocks. In other words, the differences in superblocks are calculated.

[0128] According to the scheme described in this article, there are, for example, the possibility of multiple computational discrepancies.

[0129] For example, use the Damerau-Levenshtein metric and / or the longest-common metric.

[0130] By applying the Damerau-Levenshtein metric, one can answer questions such as: how many line swaps are required to convert a sequence of binary instructions in one binary code into another sequence of binary instructions in another binary code.

[0131] The following example illustrates this: For example, the Damerau-Levenshtein algorithm, or Damerau-Levenshtein metric, can be adjusted as follows: Instead of calculating the distance between two words, we calculate the distance between two lists of words (or lists of assembly instructions). Here, one letter corresponds to one word.

[0132] For example: "Schon" -> "Schau" 1. Replace o with a 2. Replace n with u Adjustment: Schon Schau Tennis -> Schau Schon Tennis 1. Swap "Schau" and "Schon" The operations performed above on the letters in the two words “Schon” -> “Schau” will be performed below on the words in the two lists “Schon, Schau and Tennis” and “Schau, Schhon and Tennis”.

[0133] Replacement is specifically treated as one deletion plus one insertion, and therefore has a cost of 2. This differs from the cost of 1 in the original, i.e., unadjusted Damerau-Levenshtein algorithm.

[0134] The following section will illustrate the application of the longest-common metric.

[0135] The “longest-common metric” specifically answers the following question: "How long is the longest identical sequence of assembly instructions?" Therefore, the metric here is specifically the longest identical sequence of assembly instructions.

[0136] The "longest-common metric" specifically finds the longest substring that is contained in both strings.

[0137] For the “longest-common metric”, the following extension can be set in particular: operate on a list of words (e.g., instead of operating on a sequence of letters).

[0138] Considerations for jump instructions Jump instructions may appear in a superblock. If this occurs, the comparison ends immediately after the jump instruction, for example. The knowledge of whether an instruction is a jump instruction is itself known to those skilled in the art.

[0139] For example: Instructions in the superblock: 1: pop 2: add 3: jne 4: pop Line 3 is a jump instruction. For example, for comparisons, only lines 1-3 are considered.

[0140] Accumulation of metrics used for binary code Typically, two binary codes will have multiple superblocks that can be compared. For efficient comparison, accumulating the corresponding metric values ​​is particularly advantageous. In particular, one or more of the following three statistical methods are especially advantageous, or can be used, for example: 1. Simple addition 2. Perform a simple summation of the following relative values: 2.1 A metric based on the number of superblocks being compared 2.2 Or a metric that takes the length of each superblock being compared as a reference. 2.3 or a combination of 2.1 and 2.2 3. Evaluation based on extended statistical analysis 3.1 For example: How do the measures of dispersion and average work for all the superblocks being compared? In principle, the following relationships are particularly relevant: The higher the calculated Damerau-Levenshtein value (a metric for the results of applying Damerau-Levenshtein), the greater the difference in binary code.

[0141] The smaller the longest-common value (a metric used to measure the results of applying Damerau-Levenshtein), the greater the difference in binary code.

[0142] Figure 8 A superblock 801 including the first jump instruction 803 is schematically shown. The portion of superblock 801 up to and including the first jump instruction 803 is indicated by curly braces with reference numeral 805. The portion of superblock 801 after the first jump instruction 803 up to the end of superblock 801 is indicated by curly braces with reference numeral 807.

[0143] In other words, superblock 801 is a superblock that includes jump instructions, thus enabling superblock 801 to be divided into: a portion 805 up to and including the jump instructions, and another portion 807 following the jump instructions up to the end of superblock 801. For example, software quality metrics can be applied only to this portion 805, that is, not to the entire superblock, but only to a part or section of the superblock, which also includes jump instructions.

[0144] For example, it can be configured such that part 801 extends only to the first jump instruction 803, and part 807 after the first jump instruction 803 up to the end of the superblock 801 includes or excludes the first jump instruction.

[0145] This means, for example, that the portion of superblock 801 up to but not including the first jump instruction 803 is indicated by curly braces with reference numeral 805. The portion of superblock 801 after the first jump instruction 803, including or excluding the first jump instruction, up to the end of superblock 801, is indicated by curly braces with reference numeral 807.

[0146] In other words, superblock 801 is a superblock that includes jump instructions, thus enabling superblock 801 to be divided into: a portion 805 that includes or excludes the jump instructions, and another portion 807 that follows the jump instructions and extends to the end of superblock 801. For example, software quality metrics may be applied only to this portion 805, that is, not to the entire superblock, but only to a part or section of the superblock, which may or may not include jump instructions.

[0147] For example, it can be configured such that part 805 does not include the first jump instruction, but software quality metrics are still applied to this part 805 and the first jump instruction.

[0148] For example, a portion of a superblock can be called a partial superblock, and software quality metrics can be applied based on this partial superblock.

[0149] In summary, the scheme described in this paper includes one or more of the following steps: 1. Generate two executable files that are different at the binary level from the source code.

[0150] 2. Superblocks are formed by merging and then paired up via source code references.

[0151] 3. For each pair, generate the following two metrics: Damerau-Levenshtein* and Longest-Common*. 3.1 The larger the Damerau-Levenshtein, the better. 3.2 The smallest possible length of common is good.

[0152] 4. Accumulate the values ​​of all pairs.

[0153] 5. In the next step, thresholds are also set for measurement, indicating that the differences in binary code are large enough from a security perspective.

Claims

1. A method for comparing two binary codes for an automated driving function of a motor vehicle, the method comprising the steps of: Two dissimilar binary codes are generated from the same source code used for automated driving functions of motor vehicles, such that the generated binary codes each have a reference block (501, 503, 505, 507) pointing to the source code. For each binary code in the binary code, a (103) superblock (509, 511, 609, 611, 711, 713) is formed by merging the reference blocks (501, 503, 505, 507). Based on the reference blocks (501, 503, 505, 507), the superblocks (509, 511, 609, 611, 711, 713) formed for one of the two binary codes are respectively assigned (105) to the superblocks (509, 511, 609, 611, 711, 713) formed for the other of the two binary codes, so as to obtain the pairs formed by the superblocks (509, 511, 609, 611, 711, 713). For each pair of superblocks (509, 511, 609, 611, 711, 713), at least one software quality metric (107) is applied to obtain metric values ​​as results, where, The metric describes the similarity between the two superblocks (509, 511, 609, 611, 711, 713) in the pair. The two binary codes are compared based on the obtained metric values ​​(109).

2. The method according to claim 1, wherein, The at least one software quality metric is selected from the following group of software quality metrics: Damerau-Levenshtein metric and longest-common metric.

3. The method according to claim 1 or 2, wherein, The metric values ​​of all pairs are accumulated, and the two binary codes are compared based on the accumulation.

4. The method according to claim 3, wherein, The accumulation includes summing the metric values ​​to obtain a sum of the metric values, wherein the two binary codes are compared based on the sum of the metric values.

5. The method according to claim 3 or 4, wherein, The accumulation includes establishing a relationship between the metric value and a reference value to obtain a relative metric value, wherein the two binary codes are compared based on the sum of the relative metric values.

6. The method according to claim 5, wherein, The establishment of the relationship includes establishing the relationship between the metric value and the number of superblocks (509, 511, 609, 611, 711, 713) that serve as the reference quantity.

7. The method according to claim 5 or 6, wherein, The establishment of the relationship includes establishing the relationship between the metric value and the length of the corresponding superblock (509, 511, 609, 611, 711, 713), with the length serving as the reference value.

8. The method according to any one of claims 3 to 7, wherein, The accumulation includes statistical analysis and evaluation of the metric values, wherein the two binary codes are compared based on the results of the statistical analysis and evaluation.

9. The method according to claim 8, wherein, The statistical analysis evaluation includes determining the dispersion of the metric values ​​and / or determining the average of the metric values.

10. The method according to any one of the preceding claims, wherein, Confirmed: The first reference block (501, 503, 505, 507) is a superblock.

11. The method according to any one of the preceding claims, wherein, Check: Does the reference block (501, 503, 505, 507) immediately following the superblock point to the library? If so, merge the reference block (501, 503, 505, 507) with the superblock.

12. The method according to claim 11, wherein, If not, check if the reference block (501, 503, 505, 507) points to the same reference as the superblock. If so, merge the reference block (501, 503, 505, 507) with the superblock.

13. The method according to claim 12, wherein, If not, then determine that the referenced block (501, 503, 505, 507) is the new superblock.

14. The method according to any one of the preceding claims, wherein, The fusion is performed independently of the arguments of the instructions included in the binary code.

15. The method according to any one of the preceding claims, wherein, Check: whether the superblock and the reference block (501, 503, 505, 507) immediately following the superblock point to the same source code file and the same line number. If so, merge the reference block (501, 503, 505, 507) with the superblock.

16. The method according to any one of the preceding claims, wherein, Check: Are the superblock and reference block (501, 503, 505, 507) pointing to the same source code file and the same line number consecutively adjacent to each other? If yes, then merge the reference block (501, 503, 505, 507) with the superblock. If no, then do not merge the reference block (501, 503, 505, 507) with the superblock.

17. An apparatus (201) configured to perform all the steps of the method according to any one of the preceding claims.

18. A computer program (303) comprising instructions that, when implemented by a computer, cause the computer to perform the method according to any one of claims 1 to 16.

19. A machine-readable storage medium (301) having a computer program (303) as claimed in claim 18 stored thereon.

Citation Information

Patent Citations

  • Method and device for constructing map data

    EP3674920A1

  • Systems and methods for improved smart infrastructure data transfer

    WO2022081421A1

  • System, method and machine-readable media to monitore a dedicated roadway that runs in parallel to a railroad

    WO2023004184A1