Method and System for Converting Text Code and Graphic Code for Automobile Development
The method converts graphic code to text code with annotation-based configuration information, ensuring precise conversion and maintaining graphic code integrity, addressing the limitations of existing version management systems in automobile development.
Patent Information
- Application Number
- JP2023203440
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-06-01
- Filing Date
- 2023-11-30
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2043-11-30
AI Technical Summary
The challenge in automobile development is the inability of graphic code to serve as a carrier for logic execution, requiring conversion to text code for execution on the automobile controller, and the difficulty in managing and comparing differences between versions of graphic code using version management software like Git, which only supports text-based code.
A method and system for converting graphic code into text code by inserting configuration information into annotation regions, allowing for precise conversion and restoration of graphic code, maintaining a one-to-one correspondence through encoding and decoding processes.
Ensures accurate and efficient conversion between graphic and text code, maintaining the original graphic code integrity during multiple conversions, enhancing investigation and testing efficiency in automobile development.
Smart Images

Figure 0007697708000017 
Figure 0007697708000018 
Figure 0007697708000019
Abstract
Description
Technical Field
[0001] This application claims priority based on Chinese Patent Application No. 202310640840.3 filed on June 1, 2023, the entire content of which is incorporated herein by reference. The present invention belongs to the technical field of vehicle software development, and specifically relates to a method and a system for converting text code and graphic code for automobile development.
Background Art
[0002] In the automobile development process, there is first a model constructed based on graphic code. However, when graphic code is executed on the computer side, it cannot serve as a carrier for logic execution. For automobile development, since the logic of the automobile controller must be executed based on text code, after generating the graphic code into text code, it can be executed by the automobile controller.
Summary of the Invention
[0003] The present invention relates to a method and a system for converting text code and graphic code for automobile development. The conversion method includes: converting graphic code into text code to generate target text code, and inserting configuration information of each execution unit in the current graphic code into the annotation region of the target text code; and when converting the target text code back into graphic code, extracting the configuration information in the annotation region of the target text code by a graphic program, loading the configuration information, and restoring the graphic code.
[0004] In addition, the present invention further provides an apparatus for converting text code and graphic code. This apparatus includes the following. A processor that executes a program for the method of converting the foregoing text code and graphic code, A storage module that stores a program for executing the method of converting the foregoing text code and graphic code, And a display module used to display the conversion result between the text code and the graphic code.
[0005] In a third aspect, the present invention further provides a computer-readable (readable) storage medium. This storage medium stores computer-readable instructions (commands), and when it is executed by at least one processor, it causes the method of converting text code and graphic code to be executed.
[0006] In a fourth aspect, the present invention further provides a method for converting text code and graphic code applied to automobile development. This conversion method includes the following. Converting the vehicle graphic code into a text code to generate a target text code, and inserting the configuration information of each execution unit in the current vehicle graphic code into the annotation area of the target text code, and When converting the target text code back into the vehicle graphic code, extracting the configuration information in the annotation area of the target text code by the vehicle graphic program, loading the configuration information, and restoring the vehicle graphic code.
[0007] In a fifth aspect, the present invention further provides an electronic device. This electronic device includes a processor, a readable storage medium, a communication bus, and a communication interface. The above-mentioned processor, the above-mentioned readable storage medium, and the above-mentioned communication interface realize communication with each other via the above-mentioned communication bus. The above-mentioned readable storage medium stores a program for executing the method of converting the text code and the graphic code described above. The above-mentioned program causes the processor to execute operations corresponding to the method of converting the text code and the graphic code.
[0008] In a sixth aspect, the present invention further provides a vehicle development debugging system. This system includes a computer device, a bus adapter, or a writing device. The computer device includes a processor, a readable storage medium, a communication bus, and a communication interface. The readable storage medium stores a program for executing the above-described conversion method between the text code and the graphic code. The program causes the processor to execute an operation corresponding to the conversion method between the text code and the graphic code to generate a text code. The processor, the readable storage medium, and the communication interface realize communication with a bus adapter via the communication bus. The processor is configured to compile at least one execution code of the text code. The bus adapter is configured to write the compiled execution code to a debugging device. Or, The writing device is configured to write the compiled execution code to a debugging device.
[0009] The present invention further provides a vehicle development debugging method. This debugging method includes the following. Causing a computer device to execute an operation corresponding to a conversion method between a text code and a graphic code to generate a text code, Causing a bus adapter to write the compiled execution code to a debugging device, or, Causing a writing device to write the compiled execution code to a debugging device.
[0010] In a seventh aspect, the present invention further provides a vehicle development debugging method. This debugging method includes the following. Causing a computer device to execute an operation corresponding to the conversion method between the text code and the graphic code to generate a text code, Writing the compiled executable code to the debugging device by a bus adapter, or writing the compiled executable code to the debugging device by a writing device.
[0011] In an eighth aspect, the present invention further provides a computer program product. This computer program product includes a computer-readable storage medium, in which computer-readable program code is stored. The computer-readable program code includes instructions, and these instructions cause at least one processor or at least one computer device to execute the conversion method between the above text code and graphic code.
[0012] The present invention is intended to provide some brief summaries of the subject matter described in this specification. Therefore, it should be understood that the above features are merely examples and should not be construed as narrowing the scope or essence of the subject matter described in this specification in any way.
[0013] Other features, aspects, and advantages of the subject matter described in this specification will become apparent from the following specific embodiments, the accompanying drawings, and the claims. Other features and advantages of the present invention are described in the following specification, some of which will be apparent from the specification, or understood by practicing the present invention. The objects and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the specification and the drawings. To make the above objects, features, and advantages of the present invention more understandable, the following will give preferred embodiments and explain them in detail in conjunction with the accompanying drawings.
[0014] To more clearly explain the specific embodiments of the present invention or the technical solutions of the prior art, the following briefly describes the drawings that need to be used in the description of the specific embodiments or the prior art. The drawings described in the following description are some embodiments of the present invention, and it is obvious that those skilled in the art can obtain other drawings from these drawings without creative effort.
Brief Description of the Drawings
[0015]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
DETAILED DESCRIPTION OF THE INVENTION
[0016] In order to make the objectives, technical aspects, and advantages of the embodiments of the present invention clearer, the technical aspects of the present invention will be clearly and completely described below in connection with the accompanying drawings. It is obvious that the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the invention, all other embodiments obtained on the premise that those skilled in the art do not perform creative labor belong to the scope of protection of the invention.
[0017] In the process of developing an automobile, for example, when managing text-based C code, it is necessary to rely on version management software such as Git (an open-source distributed version control system). However, with such management software, it is difficult to manage graphic code and compare differences between versions. Therefore, the files for comparing differences in the version management system are generally text code. When users view the difference items between different versions of text code, it is also difficult to inversely deduce the implementation details of graphic code from specific difference codes. Also, when a problem occurs in the logic of the text code, it is necessary to perform a difference comparison from the text code corresponding to the problematic program version and inversely deduce and correct it in the graphic code. After modifying the graphic code, the text code needs to be regenerated. The process of generating text code from this graphic code, executing it on an automotive controller, further converting and modifying it from text code to graphic code, and then continuously generating and executing text code from the graphic code is repeated until the program is accurate.
[0018] Furthermore, since similar or analogous software programs in the process of developing an automobile can only be generated unidirectionally between graphic code and C code, a precise one-to-one correspondence of each execution operation between graphic code and C code cannot be achieved. That is, after generating C code from graphic code and then generating graphic code from the C code again, a difference occurs between the original graphic code and the regenerated graphic code.
[0019] The reasons for the difference between the original graphic code and the regenerated graphic code will be explained by examples below: Generally, when attempting to repeatedly execute one operation in a graphic code, it is only necessary to set the number of repetitions of the operation. For example, when the operation k=k+1 needs to loop 3 times, the number of repetitions of the operation k=k+1 is set to 3. However, the C code generated based on the graphic code has various results depending on the usage scenario. (1) In general loop logic, that is, in a general-purpose scenario, the generated C code is as follows: for (i=0; i<3; i++){ k = k + 1; } (2) In a high-performance requirement scenario, the generated C code is as follows. k = k + 1; k = k + 1; k = k + 1; The different C codes generated in the above two scenarios will result in completely different results when converted back to the graphic code again. That is, the graphic code obtained by converting back may have three operations occurring, not just one, or the graphic code realizes the for grammar using a diamond branch and does not simply use the repetition attribute.
[0020] Therefore, at least one embodiment provides a method for converting between a text code and a graphic code for automotive development, which includes converting the graphic code into a text code to generate a target text code, and inserting the configuration information of each execution unit in the current graphic code into the annotation area of the target text code, and when converting the target text code back into a graphic code, extracting the configuration information in the annotation area of the target text code by a graphic program, loading the configuration information to obtain the configuration information of each execution unit in the graphic code, and restoring the graphic code based on the configuration information.
[0021] In some embodiments, the configuration information is the graphic code itself. That is, the information after the graphic code is persisted is called configuration information. The graphic code is represented in the form of a block diagram and includes programs with contents such as sequential execution, branch jump execution, loop execution, etc.
[0022] Each time the graphic code is converted into text code, and in any case, the configuration information of the graphic code is inserted into the annotation area of the target text code as an annotation. Therefore, when converting back from the text code to the graphic code again, it is guaranteed that the graphic code is exactly the same as the original graphic code. That is, it realizes maintaining a one-to-one correspondence between the graphic code and the text code and performing multiple round-trip conversions.
[0023] Hereinafter, various non-limiting embodiments of the examples of the present disclosure will be described in detail in connection with the accompanying drawings.
[0024] As shown in FIG. 1, some embodiments provide a method for converting between text code and graphic code, including the following. In step S101, the graphic code is converted into text code to generate a target text code, and the configuration information of each execution unit in the current graphic code is inserted into the annotation area of the target text code. In step S102, when converting the target text code back into graphic code, the configuration information in the annotation area of the target text code is extracted by the graphic program, the configuration information is loaded to obtain the configuration information of each execution unit in the graphic code, and the graphic code is restored based on the configuration information.
[0025] In some embodiments, after the above configuration information is serialized and encoded, it is inserted into the annotation area of the target text code in text form. Also, when converting the target text code back to a graphic code, the text of the configuration information in the annotation area is extracted by a graphic program for deserialization and decoding, and the configuration information is loaded, thereby restoring the graphic code.
[0026] Specifically, the graphic programs according to some embodiments refer to programs that operate on a PC (Personal Computer) and present structures such as sequential execution, branch jump execution, and loop execution in computer graphics.
[0027] In some embodiments, the serialized encoding method is, for example, the base64 encoding method, but is not limited thereto. If the base64 encoding method is adopted, the corresponding deserialization and decoding method adopts the base64 decoding method.
[0028] It should be noted that in the following case content, the base64 encoding method and the base64 decoding method are taken as examples for explanation.
[0029] In some embodiments, the above text code is not limited to, for example, C code, Java code, Python code, Pascal code, C++ code, Visual Basic code, C# code, etc.
[0030] It should be noted that in the following cases, in all of them, the conversion between the graphic code and the C code is described as an example. However, the parentheses in each function call statement in the C code may be empty or not empty. If there are parameters, they do not have to be non-empty. For convenience of description, some embodiments collectively adopt function call statements without parameters.
[0031] In some embodiments, the type of each execution unit in the graphic code can be preset in advance. For example, the execution units in the graphic code can be preset as sequential execution units, branch jump units, nested execution units, and loop units. By reading the attribute of the type of each execution unit through the graphic code, the type of each execution unit can be recognized, and the methods for converting different types of execution units into C code are as follows respectively. Convert the sequence execution units in the graphic code directly into the C code of the corresponding unit actions. Convert the branch jump units in the graphic code into the C code with the structure of "if" or "else if" or "else". Convert the nested execution units in the graphic code into a function for executing nested C code and function call C code. And, Convert the cyclic units in the graphic code into one tag, one goto statement, and the C code operated by the loop unit.
[0032] As an embodiment of converting the graphic code into C code, take the graphic code including the sequence execution units as shown in FIG. 2 as an example. Specifically, when converting the graphic code into C code, the execution units can be sequentially converted according to the execution order, and the corresponding C code is as follows: A(); B(); C();
[0033] As another embodiment of converting the graphic code into C code, take the graphic code including the branch jump execution units as shown in FIG. 3 as an example. When converting the graphic code into C code, it is necessary to set two branches for the return value of A. When A returns logical true, the first branch is executed, that is, B. After the execution of B is completed, the logic continues to execute the next one. Otherwise, the second branch is executed, that is, C. After the execution of C is completed, the logic continues to jump to the next instruction of B and execute. The corresponding C code is as follows. if (A()){ B(); } else { C(); }
[0034] As the third implementation method for converting the graphic code into C code, take the graphic code including the nested execution unit as shown in FIG. 4 as an example. As shown in FIG. 5, the execution unit B on the graphic code is a nested execution unit, and its internal is a sub-graphic code. When converting the graphic code into C code, it is necessary to first convert the content of the execution unit B into a C code function, and the inner-layer nested C code is as follows. int B(void){ D(); E(); F(); } The code generation of the execution unit B will call the function B, and the outer-layer nested C code is as follows. A(); B(); C();
[0035] As the fourth implementation method for converting the graphic code into C code, take the graphic code including the loop execution unit as shown in FIG. 6 as an example. After execution unit A is completed, execution unit B starts execution. This is a judgment. If the return result is logically true, execution unit C is continuously executed downward. Otherwise, it jumps rightward, and the jump label is "Loop", which means the program jumps above execution unit A and continues to execute downward. Execution units A and B form a loop. When converting the graphic code to C code, it is necessary to set the label Loop above execution unit A. When execution unit B returns logically false, the goto statement in the C code language jumps to this label. The generated C code is as follows. Loop: A(); if (B()){ goto Loop; } C();
[0036] In some embodiments, inserting configuration information into the annotation area of the target code includes Persistent configuration information (which may be referred to as "persisted configuration information" hereinafter) generating the graphic code of, and after serializing and encoding the persistent configuration information, inserting it into the annotation area of the target code in text form.
[0037] Specifically, the one-to-one correspondence between the graphic code and the text code can be realized by encoding and decoding in the form of a string or a file. For example, the persistent configuration information of the generated graphic code is as follows: conf=5704664608865866268;1;-1;4143886487092279683;-1;0;0;0;0;yOu / 2rXj;;-1;0 When this persistent configuration information is encoded by base64, the following string s is obtained: Y29uZj01NzA0NjY0NjA4ODY1ODY2MjY4OzE7LTE7NDE0Mzg4NjQ4NzA5MjI3OTY4MzstMTswOzA7MDswO3lPdS8yclhqOzstMTsw。
[0038] By simply inserting the character string s in text format into the comment area of the target C code, all the information of the graphic code can be stored in the C code. When it is necessary to convert back from the C code to the graphic code, by extracting the character string s from the C code and performing a base64 decoding operation on the character string s, the persistent configuration information of the graphic code can be obtained, and by loading the persistent configuration information, the complete graphic code can be obtained.
[0039] In some embodiments, when converting the graphic code to C code, in addition to displaying the configuration information of each execution unit in the current graphic code in the target C code, the positioning information of each execution unit in the current graphic code is also displayed in the target C code.
[0040] Specifically, the above positioning information includes a globally unique identifier (GUID) that corresponds one-to-one with each execution unit in the graphic code, and each globally unique identifier is generated by calling the system API function coCreateGuid. Using the globally unique identifier, the execution unit can be directly positioned, thereby realizing the conversion from the graphic code to the text code. With the globally unique identifier, each text code line corresponding to the graphic code can be directly positioned. Also, the graphic code is realized from the text code. With the globally unique identifier, the execution unit corresponding to the text code line can be directly positioned.
[0041] As an arbitrary method of displaying positioning information within the target C code, convert the graphic code into C code, and along with the generation of the target C code, insert the positioning information of each execution unit of the current graphic code into the corresponding target C code lines respectively.
[0042] With the positioning information, in the graphic code corresponding to a certain code line in the C code, the position of the execution unit can be positioned, and in the application scenarios where it is necessary to investigate the C code logic, the convenience and efficiency of the investigation can be greatly improved. Furthermore, in the C code corresponding to a certain execution unit in the graphic code, the position of the corresponding code line can be positioned, and in the application scenarios where it is necessary to further test functions, etc. in the C code, the test efficiency can be greatly improved. Next, the method of inserting positioning information into the corresponding target C code lines will be described in detail with examples. Take the graphic code as shown in Figure 7 as an example. In step S201, when converting from the graphic code to the C code, for each execution unit of A, B, and C, a corresponding globally unique identifier is generated, and the correspondence table between the execution unit and the id is as follows.
Table 1
Table 2
[0043] As another method of displaying positioning information in the target code, when converting a graphic code into a text code, a temporary file is created to temporarily hold the positioning information of each execution unit in the current graphic code. Also, after serializing and encoding the above positioning information, it is inserted into the annotation area of the target code in text form. Here, the above positioning information is an association file between each execution unit and the corresponding target code line.
[0044] Hereinafter, a method of presenting positioning information as a temporary file in the annotation area of the target C code will be described in detail with examples. Taking a graphic code as shown in FIG. 7 as an example. In step S301, when converting from a graphic code to a C code, for each execution unit of A, B, and C, a corresponding globally unique identifier is generated, and the correspondence table between the execution unit and the id is as follows.
Table 3
Table 4
Table 5
[0045] Hereinafter, the conversion method between the C code and the graphic code in the embodiments of the present disclosure will be described in detail by combining the complete steps of converting from the graphic code to the C code and further from the C code to the graphic code with a complete case.
[0046] Case 1 (Insert positioning information on the right side of the corresponding target C code line) In this example, it is assumed that the graphic code is as shown in FIG. 7. According to the description methods of some embodiments, the steps of performing the mutual conversion between the graphic code and the C code are as follows. In step S401, for each execution unit of A, B, and C, a corresponding globally unique identifier is generated, and the correspondence table between the execution unit and the id is as follows.
Table 6
Table 7
Table 8
Table 9
[0047] Case Two (Insert the positioning information in text form into the annotation area of the target C code) Suppose the graphic code of this example is as shown in FIG. 8. This graphic code has five execution units: A, B, C, D, and E. When the program is executed, first A is executed, then B is executed, and the next step is executed according to the result of B. If the return value of B is logically true, then C is executed; otherwise, D is executed. After the execution of C is completed, E is executed next. When the execution of D is completed, E is executed next, and NOP is not executed. When the execution of E is completed, the program ends and the execution of NOP is no longer necessary. According to the description methods of some embodiments, the steps of performing mutual conversion between the graphic code and the C code are as follows. In step S501, generate a globally unique identifier for each execution unit of A, B, C, D, and E. The id is a 64-bit integer (Integer), and the ids corresponding to different execution units are different. The correspondence table between the execution unit and the id is as follows.
Table 10
Table 11
Table 12
Table 13
[0048] As described above, it is a method for converting the code and the graphic code in several embodiments. Each time the graphic code is converted to the C code, and the configuration information of the graphic code is inserted as an annotation into the annotation area of the target code. Therefore, when converting back from the C code to the graphic code again, it is guaranteed that the graphic code is exactly the same as the original graphic code, that is, a one-to-one correspondence relationship between the graphic code and the C code is maintained to realize multiple round-trip conversions. Furthermore, in some embodiments, in the graphic code corresponding to a certain code line in the C code according to the positioning information, the position of the execution unit can be positioned, which can greatly improve the convenience and efficiency of investigation in the application scenario where it is necessary to investigate the C code logic. Furthermore, in the C code corresponding to a certain execution unit in the graphic code, the position of the corresponding code line can be positioned, which can greatly improve the test efficiency in the application scenario where it is necessary to further test functions and the like in the C code. Furthermore, the graphic code according to some embodiments may be directly executed, and the generated C code program may also be directly executed, and both execution processes and execution results are completely corresponding.
[0049] As shown in FIG. 9, some embodiments further provide a conversion device for text code and graphic code, a processor for executing a program of the foregoing conversion method for text code and graphic code, a storage module for storing a program for executing the foregoing conversion method for text code and graphic code, and a display module used for displaying the conversion result of the text code and the graphic code.
[0050] In some embodiments, the conversion device for text code and graphic code may be one of an electronic device or a computer, and the electronic device will be described in detail in the following description.
[0051] At least one embodiment further provides a conversion method for text code and graphic code applied to automobile development, including the following. Convert the vehicle graphic code into a text code to generate a target text code, and insert the configuration information of each execution unit in the current vehicle graphic code into the annotation area of the target text code. Also, when converting the target text code back into a vehicle graphic code, extract the configuration information in the annotation area of the target text code by the vehicle graphic program, and load the configuration information to restore the vehicle graphic code.
[0052] In the scenario used for automobile development, the specific conversion steps for the text code and the vehicle graphic code are the same as those of the foregoing conversion method for text code and graphic code, and the description thereof will be omitted here.
[0053] The following combines cases and details the conversion method for text code and graphic code applied to the automobile development scenario. In the process of developing the ABS algorithm for automobile chassis electric control, take the logic of controlling the opening of a relief valve as an example. Refer to the graphic code segment shown in FIG. 10.
[0054] This logic determines whether the slip rate slip of the current wheel is less than 0.2. If the return result is logically false, it means that the slip rate of the current wheel is 0.2 or more, indicating that the wheel has a tendency to lock, and it is necessary to open the relief valve to depressurize this wheel. The flow for generating the graphic code into C code is as follows. Step S601, generate a globally unique identifier corresponding to each execution unit in the graphic code. The correspondence table between the execution unit and the id is as follows.
Table 14
Table 15
Table 16
[0055] In the following, in relation to the development process of the ABS algorithm for vehicle chassis electric control, taking the logic of controlling the opening of a single relief valve as an example, the application of positioning information in the vehicle development scenario will be described in detail.
[0056] As shown in FIG. 11, when it is determined that the function for the user to open the AV valve does not work and it is necessary to examine the corresponding logic, first load this C code file with the graphic code, read the annotation information in the C code file, decrypt it with base64 to obtain the configuration information and positioning information of the graphic code, and restore the graphic code according to the decrypted configuration information. Next, the user clicks on the line code "AV_On();" in the C code file window where the graphic code is loaded. Based on the line number information described in the positioning information, the graphic code is located at the execution unit id "3428365350600537763" corresponding to the line number. The window jumps to the graphic code, highlights the execution unit in the graphic code display window, making it easier for the user to modify the execution unit, and greatly improving the convenience and efficiency of the investigation.
[0057] In the following, in relation to the development process of the ABS algorithm for automotive chassis electric control, taking the logic for controlling the opening of a relief valve as an example, the application of positioning information in the automotive test scenario will be described in detail.
[0058] In actual automotive test applications, it is necessary to perform software-in-the-loop tests using the C code logic generated after the graphic code. Still taking the logic for controlling the opening of the above relief valve as the object to be tested, as shown in FIG. 10, after generating the graphic code segment into C code, it is necessary to further test the function "AV_On" in the C code, obtain information such as execution time and resource occupancy, and this needs to be positioned to the corresponding code line of the C code by the graphic code.
[0059] The positioning method is as follows. First, the user clicks on the execution unit "AV_On" in the graphic code, attempts to jump to the corresponding C code line, the graphic code obtains the execution unit id "3428365350600537763", reads the annotation information in the C code file, obtains the positioning information of the graphic code after base64 decoding, that is, obtains the correspondence file between the code line and the id. Then the graphic code collects the code lines where this id appears in the file, presents them to the user in the form of a list, the user selects the corresponding option in the list, and the corresponding C code line is positioned and displayed, thereby greatly improving the test efficiency.
[0060] The following describes electronic devices in some embodiments from the perspective of hardware processing, but does not limit the specific implementation of the electronic devices.
[0061] As shown in FIG. 12, the electronic device includes a processor, a readable storage medium, a communication bus, and a communication interface. Here, the above-mentioned processor, the above-mentioned readable storage medium, and the above-mentioned communication interface realize communication with each other via the above-mentioned communication bus. The above-mentioned readable storage medium is used to store a program for executing the conversion method between the above-mentioned text code and the above-mentioned graphic code. The above-mentioned program causes the above-mentioned processor to execute operations corresponding to the conversion method between the above-mentioned text code and the above-mentioned graphic code.
[0062] In other embodiments, a computer device or an industrial computer can also be regarded as a kind of electronic device. It should be noted that the configuration shown in FIG. 12 does not limit the electronic device, and it can include fewer or more components than shown in the figure, some components can be combined, or different components can be arranged.
[0063] In some embodiments, the communication interface may be a communication interface connectable to an external bus adapter, such as RS232, RS485, a USB port, and a TYPE port. A wired or wireless network interface may also be included, and the network interface may optionally include wired and / or wireless interfaces (e.g., a WI-FI interface, a Bluetooth® interface, etc.) typically used to establish a communication connection between the computer device and other electronic devices.
[0064] Among them, the memory module, the readable storage medium, or the computer-readable storage medium includes at least one type of memory. The memory includes flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, it may be an internal storage unit of a computer device, such as a hard disk of the computer device. In other embodiments, the memory may be an external storage device of the computer device, such as a plug-in hard disk equipped in the computer device, a Smart Media® Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory may include both an internal storage unit and an external storage device of the computer device. The memory stores various data such as application software installed in the computer device and the code of a computer program, and is also used to temporarily store output data and data to be output.
[0065] In some embodiments, the processor may execute program code stored in the memory or process data, and may be, for example, a Central Processing Unit (CPU) for executing a computer program, a controller, a microcontroller, a microprocessor, or other data processing chips.
[0066] In some embodiments, the communication bus may be an input / output bus that can be, for example, a Peripheral Component Interconnect (PCI) bus or an Enhanced Industry Standard Architecture (EISA) bus. This bus can be divided into an address bus, a data bus, a control bus, and the like.
[0067] Optionally, the computer device may further include a user interface. The user interface can include input units such as a display and a keyboard, and optionally, the user interface can also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display or display module may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. In this case, the display or display module is also referred to as a display screen or a display unit for displaying the information processed in the computer device and for displaying the visualized user interface.
[0068] When the above processor executes the above program, it realizes the steps in the embodiment of the method for converting the text code and the graphic code shown in FIG. 1 above, for example, from step S101 to step S102 shown in FIG. 1. Alternatively, when the processor executes a computer program, it realizes the functions of each module or unit in the embodiments of the above respective devices.
[0069] In some embodiments, the processor is specifically used to realize the following steps. Convert the graphic code into a text code to generate a target text code, and insert the configuration information of each execution unit in the current graphic code into the annotation area of the target text code. And, When converting the target text code back into a graphic code, extract the configuration information from the annotation area of the target text code, load the configuration information, and restore the graphic code.
[0070] Optionally, as a possible embodiment, the processor can be further used to implement the following steps. The above configuration information is serialized, encoded, and then inserted into the annotation area of the target text code in text form. And, When converting the target text code back into a graphic code, extract the text of the configuration information in the annotation area, perform reverse serialization and decoding, obtain the configuration information of each execution unit in the graphic code, load the configuration information, and restore the graphic code.
[0071] Optionally, as a possible embodiment, the processor can be further used to implement the following steps. Convert the sequential execution units in the graphic code into text codes for the corresponding unit operations. Convert the branch jump units in the graphic code into text codes with an "if" or "else if" or "else" structure. Convert the nested execution units in the graphic code into functions that execute nested text codes and the function call text codes. And, Convert the loop units in the graphic code into one tag, one goto statement, and the text code operated by the corresponding loop unit.
[0072] Optionally, as a possible embodiment, the processor can be further used to implement the following steps. Generating persistent configuration information of a graphic code, and After serializing and encoding the persistent configuration information, inserting it into the annotation area of the target code in text form.
[0073] Optionally, as a possible embodiment, the processor can further be used to implement the following steps. Along with generating the target text code, inserting the positioning information of each execution unit in the current graphic code into the corresponding target text code line respectively.
[0074] Optionally, as a possible embodiment, the processor can further be used to implement the following steps. When converting the graphic code into text code, establish a temporary file, and the temporary file is used to temporarily store the positioning information of each execution unit in the current graphic code. The above positioning information is an associated file between each execution unit and the corresponding target text code line. And After serializing and encoding the above associated file, insert it into the above annotation area of the target text code in text form.
[0075] At least one embodiment also provides a computer-readable storage medium. The computer-readable storage medium stores a program for the conversion method between text code and graphic code. When the program is executed by a processor, for the specific steps of the method that can realize the conversion between text code and graphic code, refer to the specific description of the conversion method between text code and graphic code in several embodiments, and the description here is omitted.
[0076] As shown in FIGS. 13 and 14, several embodiments further provide a vehicle development debugging system, including a computer device, a bus adapter or a writing device. Among them, The computer device includes a processor, a readable storage medium, a communication bus, and a communication interface. And, The readable storage medium stores a program for executing the conversion method between the above-described text code and graphic code. The program causes the processor to execute an operation corresponding to the conversion method between the text code and the graphic code to generate a text code. The processor, the readable storage medium, and the communication interface realize communication with a bus adapter via the communication bus. The processor is configured to compile at least one execution code of the text code. The bus adapter is configured to write the compiled execution code to a debugging device. Or, The writing device is configured to write the compiled execution code to a debugging device.
[0077] Some embodiments further provide a vehicle development debugging method, including the following. The computer device causes an operation corresponding to the conversion method between the text code and the graphic code to be executed to generate a text code. The bus adapter writes the compiled execution code to a debugging device. Or, the writing device writes the compiled execution code to a debugging device.
[0078] In some embodiments, the computer device corresponds to the above-described electronic device, and the description thereof is omitted here.
[0079] The processor is configured to compile at least one execution code of the text code. In some embodiments, the compilation of the text code can be achieved by executing a cross-compiler.
[0080] In some embodiments, after the above configuration information is serialized and encoded, it is inserted into the annotation area of the target text code in text form. Also, when converting the target text code back to a graphic code, the text of the configuration information in the annotation area is extracted by a graphic program and deserialized and decoded to obtain the configuration information of each execution unit in the graphic code, and the graphic code is restored by loading the configuration information.
[0081] In some embodiments, converting the graphic code to a text code includes the following. Converting the sequential execution units in the graphic code to text codes of corresponding unit operations. Converting the branch jump units in the graphic code to text codes in the "if" or "else if" or "else" configuration. Converting the nested execution units in the graphic code to functions that execute nested text codes and the function call text codes. Also, converting the loop units in the graphic code to one tag, one goto statement, and the text code operated by the corresponding loop unit.
[0082] In some embodiments, the method of inserting configuration information into the annotation area of the target text code includes the following. Generating persistent configuration information of the graphic code. Also, after serializing and encoding the persistent configuration information, it is inserted into the annotation area of the target text code in text form.
[0083] In some embodiments, together with the generation of the target text code, the positioning information of each execution unit in the current graphic code is inserted into the corresponding target text code line.
[0084] In some embodiments, when converting a graphic code into a text code, one temporary file is established, and the temporary file is used to temporarily store the positioning information of each execution unit in the current graphic code. Among them, the above positioning information is an associated file between each execution unit and the corresponding target text code line. After serializing and encoding the above associated file, it is inserted into the annotation area of the target text code in text form.
[0085] In some embodiments, the bus adapter may be a CAN bus adapter, a CANFD bus adapter, a FastLIN bus adapter, a LIN bus adapter, an Ethernet bus adapter, or a FlexRay bus adapter. It may be one-to-one, or one-to-many. Some embodiments do not limit the specific implementation of the bus adapter. In some embodiments, the compiled execution code may be written by communicating with a debug device via the UDS or XCP or CCP protocol.
[0086] In some embodiments, the writing device may refer to a programmer.
[0087] In some embodiments, the debug device in the automotive field can specifically refer to an in-vehicle ECU and its related systems. For example, but not limited to, an electric power steering system EPS, an anti-lock braking system ABS, an electronic stability control system ESC, an automotive engine management system, and a battery management system BMS. These devices can be connected to a computer device in a bus manner, thereby realizing the reception and execution of the compiled execution code.
[0088] Some embodiments further provide a computer program product, including a computer-readable storage medium having stored therein computer-readable program code, the computer-readable program code including instructions for causing at least one processor or at least one computer device to execute the method for converting any of the above possible text codes and graphic codes.
[0089] Some embodiments provide a computer-readable storage medium storing computer-readable instructions that, when executed by at least one processor, cause the method for converting text codes and graphic codes in the above embodiments to be executed.
[0090] In some embodiments provided by the present invention, it is natural that the disclosed apparatus and method can also be realized in other ways. The embodiments of the apparatus described above are merely illustrative. For example, the flowcharts and block diagrams in the drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program product according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code. The above module, the above program segment, or the above part of the code includes executable instructions for realizing one or more predetermined logical functions. It should be noted that in some alternative implementation manners, the functions represented by the blocks may occur in an order different from the order shown in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and depending on the related functions, they can sometimes be executed in the reverse order. Also, each block of the block diagram and / or flowchart, as well as combinations of the blocks of the block diagram and / or flowchart, may be realized by a dedicated hardware-based system for performing a predetermined function or operation, or may be realized by a combination of dedicated hardware and computer instructions.
[0091] In addition, each functional module in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
[0092] When the above functions are realized in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art or the part of the technical solution, can be represented in the form of a software product. The computer software product is stored in the storage medium and includes a plurality of instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0093] Inspired by the preferred embodiments of the present invention described above, those skilled in the art can make various changes and modifications without departing from the technical idea of the present invention from the above description. The technical scope of the present invention is not limited to the content of the specification, and its technical scope must be determined based on the scope of the claims.
Claims
1. A method for converting a text code and a graphic code, comprising: converting the graphic code into a text code to generate a target text code, inserting an identifier of each execution unit in the graphic code into a corresponding line of each execution unit of the target text code, and inserting configuration information related to one or more execution units in the graphic code into an annotation area of the target text code; and when converting the target text code back into a graphic code, extracting the identifier and the configuration information of the annotation area inserted into the target text code by a graphic program, loading the identifier and the configuration information, and restoring the graphic code; when inserting configuration information related to one or more execution units into an annotation area of the target text code, generating persistent configuration information related to one or more execution units in the graphic code as information including an identifier of each execution unit, serializing and encoding the persistent configuration information, and then inserting it into the annotation area of the target text code in text form. A method for converting a text code and a graphic code, characterized by the above.
2. When converting the target text code back into a graphic code, extracting the text of the configuration information of the annotation area by a graphic program, performing reverse serialization and decoding to obtain configuration information related to one or more execution units in the graphic code, loading the configuration information, and thereby restoring the graphic code. The conversion method according to claim 1, characterized by the above.
3. When converting the graphic code into a text code, converting sequential execution units in the graphic code into text codes of corresponding unit operations, converting branch jump units in the graphic code into text codes with an "if" or "else if" or "else" structure, converting nested execution units in the graphic code into a function for executing nested text codes and a function call text code, and converting loop units in the graphic code into one tag, one goto statement, and a text code operated by a corresponding loop unit. The conversion method according to claim 1, characterized by the above.
4. A method for converting text code and graphic code, converting the graphic code into text code to generate target text code, and inserting positioning information of each execution unit in the graphic code and configuration information related to one or more execution units in the graphic code into the annotation area of the target text code, and when converting the target text code back into graphic code, extracting the positioning information and configuration information inserted into the annotation area of the target text code by a graphic program, loading the positioning information and configuration information, and restoring the graphic code, including when inserting the positioning information of each execution unit in the graphic code into the annotation area of the target text code, establishing a temporary file for temporarily storing identifiers of each execution unit in the graphic code, generating a related file including positioning information associating the line numbers corresponding to each execution unit of the target text code with the identifiers of each execution unit from the temporary file, after serializing and encoding the related file, inserting it into the annotation area of the target text code in text format, when inserting configuration information related to one or more execution units into the annotation area of the target text code, generating permanent configuration information related to one or more execution units in the graphic code as information including the identifiers of each execution unit, characterized by serializing and encoding the permanent configuration information and then inserting it into the annotation area of the target text code in text format. A method for converting text code and graphic code.
5. When converting the target text code back into graphic code, extracting the text of the configuration information in the annotation area by a graphic program, performing inverse serialization and decoding to obtain configuration information related to one or more execution units in the graphic code, loading the configuration information, and thereby restoring the graphic code. The conversion method according to claim 4, characterized by obtaining it.
6. When converting the graphic code into text code, converting the sequential execution units in the graphic code into text code of corresponding unit operations. Converting the branch jump unit in the graphic code into text code in the "if" or "else if" or "else" configuration, Converting the nested execution unit in the graphic code into a function for executing nested text code and the function call text code, and The conversion method according to claim 4, characterized by converting the loop unit in the graphic code into one tag, one goto statement, and text code operated by the corresponding loop unit.
7. A conversion device between text code and graphic code, A processor that executes a program of the conversion method between text code and graphic code according to any one of claims 1 to 6, A storage module that stores a program for executing the conversion method between the text code and the graphic code, and A conversion device between text code and graphic code, comprising a display module used for displaying the conversion result between text code and graphic code.
8. A computer-readable storage medium, Storing computer-readable instructions, A computer-readable storage medium, characterized in that when it is executed by at least one processor, it causes the conversion method between text code and graphic code according to any one of claims 1 to 6 to be executed.
9. Applied to automobile development, The conversion method between text code and graphic code according to any one of claims 1 to 6, characterized in that the graphic code is for vehicles.
10. An electronic device, Including a processor, a readable storage medium, a communication bus, and a communication interface, The processor, the readable storage medium, and the communication interface realize communication with each other via the communication bus, The readable storage medium stores a program for executing the conversion method between text code and graphic code according to any one of claims 1 to 6, The program causes the processor to execute an operation corresponding to the conversion method between the text code and the graphic code. An electronic device characterized by this.
11. A vehicle development debugging system, Including a computer device, a bus adapter or a writing device, The computer device includes a processor, a readable storage medium, a communication bus, and a communication interface, The readable storage medium stores a program for executing the method for converting the text code and the graphic code according to any one of claims 1 to 6, The program causes the processor to execute an operation corresponding to the method for converting the text code and the graphic code to generate a text code, The processor and the readable storage medium realize communication with a bus adapter via the communication interface and the communication bus, The processor is configured to compile at least one execution code of the text code, The bus adapter is configured to write the compiled execution code to a debug device, or The writing device is configured to write the compiled execution code to a debug device, A vehicle development debug system characterized by the above.
12. The vehicle development debug system according to claim 11, wherein the bus adapter is a CAN bus adapter, a CAN FD bus adapter, a FastLIN bus adapter, a LIN bus adapter, an Ethernet bus adapter, or a FlexRay bus adapter.
13. The bus adapter communicates with a debug device via a UDS or XCP or CCP protocol to write the compiled execution code, The vehicle development debug system according to claim 11, wherein the debug device includes an electric power steering system, an anti-lock brake system, an electronic stability control system, an automotive engine management system, and a battery management system.
14. A vehicle development debug method, comprising: causing a computer device to execute an operation corresponding to the method for converting the text code and the graphic code according to any one of claims 1 to 6 to generate a text code; writing, by a bus adapter, the compiled execution code to a debug device, or writing, by a writing device, the compiled execution code to a debug device. A vehicle development debug method characterized by the above. A computer program, characterized in that at least one processor or at least one computer device is caused to execute the method for converting text code and graphic code according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for managing program of numerical controller
JP1992021005A
Program analysis display device
JP1995261990A
Program generating device and block diagram generating apparatus
JP2009181446A
Controller for vehicle
JP2011150739A