Code update method, device, equipment and medium for vehicle controller software
The method of obtaining and generating handle codes to update vehicle controller software solves the problems of low code update efficiency and low quality in the existing technology, realizes fast, accurate and automatic code update, and ensures the quality of vehicle controller software.
Patent Information
- Application Number
- CN202210429764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-04-22
AI Technical Summary
In the prior art, the code update efficiency of vehicle controller software is low and the quality is not high, which makes it easy for modification omissions or errors to occur.
By acquiring the communication message information in the database file of the controller area network, a first handle code and a second handle code are generated, and the code of the vehicle controller software is updated based on these codes, thereby realizing automatic and accurate code update.
Improves the efficiency and accuracy of code updates and ensures the quality of updated vehicle controller software.
Smart Images

Figure CN114780126B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, equipment, and medium for updating code of vehicle-mounted controller software. Background Art
[0002] Currently, vehicle controller software code updates typically involve software developers manually writing the code to be modified. This results in low code modification efficiency. When the amount of code to be modified is large, omissions or errors in the code modification are likely to occur, resulting in low-quality updated vehicle controller software. Summary of the Invention
[0003] The embodiments of the present invention provide a method, apparatus, device and medium for updating the code of a vehicle-mounted controller software, so as to achieve faster, more effective and accurate updating of the code of the vehicle-mounted controller software, and further ensure the quality of the updated vehicle-mounted controller software.
[0004] In a first aspect, an embodiment of the present invention provides a method for updating code of a vehicle controller software, the method comprising:
[0005] Obtain at least one communication message information from a database file of a controller area network corresponding to the vehicle controller software;
[0006] If target message information exists in each communication message information, a first handle code is generated based on the target message information, and a second handle code is generated based on the communication message information other than the target message information;
[0007] The code of the vehicle controller software is updated based on the first handle code and the second handle code.
[0008] Optionally, the method further includes:
[0009] If the target message information does not exist in each communication message information, the second handle code is generated based on each communication message information.
[0010] Optionally, the method further includes:
[0011] Determining message signal data in each communication message information;
[0012] If target signal data exists in each message signal data, the communication message information containing the target signal data is used as the target message information.
[0013] Optionally, generating a first handle code based on target message information includes:
[0014] Determining a naming rule for a variable name to be updated corresponding to the target message information in the code of the vehicle controller software;
[0015] A first handle code is generated based on the naming rule and the target message information.
[0016] Optionally, generating a first handle code based on the naming rule and the target message information includes:
[0017] Based on the naming rule, each field in the target message information is combined and processed to obtain a combination result corresponding to the target message information, the combination result is used as the target variable name corresponding to the target message information, and a first handle code is generated based on the target variable name.
[0018] Optionally, obtaining at least one piece of communication message information from a database file of a controller area network corresponding to the vehicle controller software includes:
[0019] At least one communication message information in the database file of the controller area network corresponding to the vehicle controller software is obtained by calling a predefined file reading method for reading the database file of the controller area network.
[0020] Optionally, the code for updating the vehicle controller software based on the first handle code and the second handle code includes:
[0021] Determining a first code to be updated corresponding to the first handle code in the code of the vehicle controller software, and replacing the first code to be updated with the first handle code; and
[0022] Determine a second code to be updated corresponding to the second handle code in the code of the vehicle-mounted controller software, and replace the second code to be updated with the second handle code.
[0023] In a second aspect, an embodiment of the present invention further provides a device for updating the code of a vehicle controller software, the device comprising:
[0024] A message acquisition module, configured to acquire at least one communication message information from a database file of a controller area network corresponding to the vehicle controller software;
[0025] A first handle code generating module is configured to generate a first handle code based on the target message information if target message information exists in each communication message information, and to generate a second handle code based on the communication message information other than the target message information;
[0026] A software code update module is used to update the code of the vehicle controller software based on the first handle code and the second handle code.
[0027] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0028] one or more processors;
[0029] a storage device for storing one or more programs;
[0030] When the program is executed by the processor, the processor implements the code updating method for the vehicle controller software provided by any embodiment of the present invention.
[0031] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a code update method for vehicle-mounted controller software as provided in any embodiment of the present invention.
[0032] The technical solution of the embodiment of the present invention is achieved by obtaining at least one communication message information in the database file of the controller domain network corresponding to the vehicle-mounted controller software. After obtaining one or more communication message information, each communication message information can be analyzed. If target message information exists in each communication message information, a first handle code can be generated based on the target message information, and a second handle code can be generated based on the communication message information other than the target message information. After generating the first handle code and the second handle code, the code of the vehicle-mounted controller software can be updated based on the first handle code and the second handle code, which solves the technical problems of low code modification efficiency and low quality of the modified code in the prior art, and realizes a faster, more effective, accurate and automated update of the vehicle-mounted controller software code, further ensuring the quality of the updated vehicle-mounted controller software. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings introduced here only illustrate some of the embodiments to be described by the present invention, and are not exhaustive. A person skilled in the art can derive other drawings based on these drawings without inventive effort.
[0034] Figure 1 This is a flowchart of a method for updating the code of a vehicle controller software provided in the first embodiment of the present invention;
[0035] Figure 2 This is a flow chart of a method for updating the code of a vehicle controller software provided in the second embodiment of the present invention;
[0036] Figure 3This is a schematic structural diagram of a code updating device for vehicle-mounted controller software provided by a third embodiment of the present invention;
[0037] Figure 4 This is a structural diagram of an electronic device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all of the structures. Furthermore, the embodiments of the present invention and the features of the embodiments may be combined with one another unless otherwise specified.
[0039] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0040] Example 1
[0041] Figure 1 This is a flow chart of a code update method for vehicle-mounted controller software provided in Example 1 of the present invention. This embodiment is applicable to the situation where the code of the vehicle-mounted controller software is updated. The method can be executed by a code update device for the vehicle-mounted controller software. The code update device for the vehicle-mounted controller software can be implemented by software and / or hardware and can be integrated into electronic devices such as computers or servers.
[0042] like Figure 1 As shown, the method of this embodiment includes:
[0043] S110: Obtain at least one piece of communication message information from a database file of a controller area network corresponding to the vehicle controller software.
[0044] The contents of a Controller Area Network (CAN) database file describe CAN network communication information, enabling the coordinated operation of node controllers across the vehicle's CAN network. The contents of a CAN database file can include one or more communication message information. Each communication message includes, but is not limited to, the message name, message ID, message period, message signal data, and message status. The message status can be either received or sent.
[0045] Specifically, the database file for the controller network corresponding to the vehicle controller software is obtained, that is, the DBC file corresponding to the vehicle controller. This DBC file can then be parsed, for example, by using a polling method to parse each line in the DBC file. This allows the communication message information stored in the DBC file to be obtained. For example, lines beginning with "BO_" in the DBC file can be parsed to obtain information such as the message name, message ID, message period, message signal data, and message status.
[0046] S120: If target message information exists in each communication message information, generate a first handle code based on the target message information, and generate a second handle code based on the communication message information other than the target message information.
[0047] The target message information can be understood as communication message information including target signal data. The target signal data can be message information data set according to actual needs. The number of target signal data can be one, two, or more. For example, the target signal data can include message signal data including keywords such as Checksum or LiveCounter.
[0048] Among them, the first handle code can be a handle of a C language code, which can be used to update the code to be updated corresponding to the target message information in the vehicle controller software. The second handle code can be a handle of a C language code, which can be used to update the code to be updated corresponding to the communication message information other than the target message information in the vehicle controller software. It should be noted that the "first" and "second" in the first handle code and the second handle code are only for distinguishing different handle codes, and are not intended to limit the order or content of the handle codes.
[0049] Specifically, after obtaining one or more communication message information, if the target message information exists in each communication message information, the target message information can be stored in the first list created in advance for storing the target message information, and the communication message information other than the target message information can be stored in the second list created in advance for storing the communication message information other than the target message information. After all the communication message processing is completed, the first handle code can be generated based on the target message information stored in the first list, and the second handle code can be generated based on the communication message information other than the target message information stored in the second list, so that the handle code can be quickly generated. It should be noted that "first" and "second" in the first list and the second list are only used to distinguish different lists, and do not limit the order or content of the lists.
[0050] It can be understood that if the target message information does not exist in each communication message information, the second handle code can be generated based on each communication message information.
[0051] Optionally, the target message information can be determined by the following method:
[0052] The message signal data in each communication message information is determined. If the target signal data exists in each message signal data, the communication message information in which the target signal data exists is taken as the target message information.
[0053] Specifically, for each communication message information, the target signal data in the signal data in the communication message information is compared. If the comparison is consistent, it indicates that the target signal data exists in the message signal data in the communication message information, and then the communication message information in which the target signal data exists can be taken as the target message information.
[0054] Optionally, the following steps are used to introduce how to generate the first handle code based on the target message information:
[0055] Step 1, determine the naming rule of the to-be-updated variable name corresponding to the target message information in the code of the vehicle-mounted controller software.
[0056] The to-be-updated variable name can be understood as the variable name that needs to be updated in the code of the vehicle-mounted controller software. The naming rule of the to-be-updated variable name is the naming rule of the variable name that is set in advance in the early stage of developing the code of the vehicle-mounted controller software. Optionally, the naming rule of the to-be-updated variable can be named in the order of the message name, the message ID, the message period, the message state, and the message signal data.
[0057] Specifically, after all the target message information is determined, the to-be-updated variable name corresponding to the target message information in the code of the vehicle-mounted controller software can be determined. Then the naming rule of the to-be-updated variable name can be determined.
[0058] Step two, generating the first handle code based on the naming rule and the target message information.
[0059] Specifically, after determining the naming rule of the to-be-updated variable, each field in the target message information can be combined based on the naming rule. Then, a combination result corresponding to the target message information can be obtained. Further, the combination result can be taken as a target variable name corresponding to the target message information. Thus, the first handle code can be generated based on the target variable name. Wherein, generating the first handle code based on the target variable name can be understood as taking the target variable name as the first handle code.
[0060] It should be noted that the way of generating the second handle code based on the communication message information other than the target message information is the same as the way of generating the first handle code based on the target message information. It should also be noted that a single field in the target message information can be understood as a keyword in the target message information.
[0061] S130, updating the code of the vehicle-mounted controller software based on the first handle code and the second handle code.
[0062] Specifically, after generating the first handle code and the second handle code, a first to-be-updated code corresponding to the first handle code in the code of the vehicle-mounted controller software can be determined, and a second to-be-updated code corresponding to the second handle code in the code of the vehicle-mounted controller software can be determined. After determining the first to-be-updated code and the second to-be-updated code, the first to-be-updated code can be replaced by the first handle code, and the second to-be-updated code can be replaced by the second handle code, so as to update the code of the vehicle-mounted controller software.
[0063] Wherein, the first to-be-updated code can be understood as the code in the code of the vehicle-mounted controller software that needs to be replaced by the first handle code. The second to-be-updated code can be understood as the code in the code of the vehicle-mounted controller software that needs to be replaced by the second handle code. It should be noted that the "first" and "second" in the first to-be-updated code and the second to-be-updated code are only to distinguish the to-be-updated codes, and are not to limit the content or order of the to-be-updated codes.
[0064] The technical solution of the embodiment of the present invention is achieved by obtaining at least one communication message information in the database file of the controller domain network corresponding to the vehicle-mounted controller software. After obtaining one or more communication message information, each communication message information can be analyzed. If target message information exists in each communication message information, a first handle code can be generated based on the target message information, and a second handle code can be generated based on the communication message information other than the target message information. After generating the first handle code and the second handle code, the code of the vehicle-mounted controller software can be updated based on the first handle code and the second handle code, which solves the technical problems of low code modification efficiency and low quality of the modified code in the prior art, and realizes a faster, more effective, accurate and automated update of the vehicle-mounted controller software code, further ensuring the quality of the updated vehicle-mounted controller software.
[0065] Example 2
[0066] Figure 2 This is a flow chart illustrating a method for updating vehicle controller software code, provided in a second embodiment of the present invention. Optionally, obtaining at least one piece of communication message information from a database file of a controller area network corresponding to the vehicle controller software includes invoking a predefined file reading method for reading a database file of a controller area network to obtain at least one piece of communication message information from the database file of the controller area network corresponding to the vehicle controller software. Technical terms identical or corresponding to those in the above embodiments are not further described herein.
[0067] like Figure 2 As shown, the method of this embodiment may specifically include:
[0068] S210 : Acquire at least one piece of communication message information in the database file of the controller area network corresponding to the vehicle controller software by calling a predefined file reading method for reading the database file of the controller area network.
[0069] The file reading method can be one or more lines of computer code that can be used to parse a DBC file to read the communication message information in the DBC file. The file reading method can be pre-written in a preset computer language. The preset computer language can be set according to actual needs and is not specifically limited here, such as Python, JAVA, C++, etc.
[0070] It should be noted that the file reading method can be a file reading method without parameters, or a file reading method with parameters. When the file reading method is a file reading method with parameters, the parameters included in the file reading method with parameters are formal parameters. The formal parameters of the file reading method may include, but are not limited to, the file storage path of the DBC file. For example, the file name of the DBC file is File A, and the file storage path of the DBC file is C:\File A.
[0071] The following two methods describe how to obtain communication message information from a DBC file by calling a predefined file reading method. As an optional implementation of the present invention, communication message information from a DBC file is obtained by calling a parameterless file reading method. A path constant is predefined in the predefined parameterless file reading method and assigned to the file storage path of the DBC file.
[0072] As another optional implementation of an embodiment of the present invention, the file storage path of a DBC file can be determined. The file storage path can then be passed as an actual parameter to a predefined formal parameter of a file reading method for reading the DBC file. After the parameter is passed, a predefined file open statement for opening the DBC file in the file reading method can be executed to open the DBC file. After the DBC file is opened, the content stored in the DBC file can be parsed by executing a predefined file parsing statement for parsing the DBC file in the file reading method. Communication message information in the DBC file can then be obtained.
[0073] Furthermore, the following method is used to introduce how to obtain the communication message information in the DBC file by calling the predefined file reading method:
[0074] The contents of a DBC file are read by calling a predefined file reading method. After reading the contents of the DBC file, the communication message information in the DBC file is stored in a pre-created list. After the communication message information is stored in the list, the communication message information in the DBC file can be retrieved from the list of stored communication messages. The pre-created list can be a two-dimensional list that can be used to store the communication message information in the DBC file. It should be noted that the advantage of storing the communication message information in the DBC file in a pre-created list is that it facilitates timely access and use of the communication message information.
[0075] S220: If target message information exists in each communication message information, generate a first handle code based on the target message information, and generate a second handle code based on the communication message information other than the target message information.
[0076] S230, update the code of the vehicle-mounted controller software based on the first handle code and the second handle code.
[0077] The technical scheme of the embodiment of the application realizes more rapid, effective and accurate acquisition of the communication message information in the DBC file, thereby reducing the manual cost of acquiring the communication message information in the DBC file and further shortening the time consumption of code update of the vehicle-mounted controller software.
[0078] Embodiment three
[0079] Figure 3 is a structural schematic diagram of a code update device for vehicle-mounted controller software provided by the embodiment three of the application. The application provides a code update device for vehicle-mounted controller software, which comprises a message acquisition module 310, a first handle code generation module 320 and a software code update module 330.
[0080] The message acquisition module 310 is configured to acquire at least one piece of communication message information in a database file of a controller area network corresponding to vehicle-mounted controller software. The first handle code generation module 320 is configured to generate a first handle code based on target message information if the target message information exists in each piece of communication message information, and generate a second handle code based on the communication message information other than the target message information. The software code update module 330 is configured to update the code of the vehicle-mounted controller software based on the first handle code and the second handle code.
[0081] The technical scheme of the embodiment of the application acquires at least one piece of communication message information in a database file of a controller area network corresponding to vehicle-mounted controller software through the message acquisition module. After one or more pieces of communication message information are acquired, each piece of communication message information can be analyzed. If target message information exists in each piece of communication message information, the first handle code generation module can generate a first handle code based on the target message information and a second handle code based on the communication message information other than the target message information. After the first handle code and the second handle code are generated, the software code update module can update the code of the vehicle-mounted controller software based on the first handle code and the second handle code, thereby solving the technical problems of low code modification efficiency and low quality of modified code in the prior art, realizing more rapid, effective, accurate and automatic code update of the vehicle-mounted controller software and further guaranteeing the quality of the updated vehicle-mounted controller software.
[0082] Optionally, the apparatus further comprises a second handle code generation module configured to generate the second handle code based on the communication message information if the target message information does not exist in the communication message information.
[0083] Optionally, the apparatus further comprises a target message information determination module configured to determine message signal data in the communication message information, and if target signal data exists in the message signal data, take the communication message information in which the target signal data exists as the target message information.
[0084] Optionally, the first handle code generation module 320 is configured to determine a naming rule of a to-be-updated variable name corresponding to the target message information in the code of the vehicle-mounted controller software, and generate the first handle code based on the naming rule and the target message information.
[0085] Optionally, the first handle code generation module 320 is configured to perform combination processing on each field in the target message information based on the naming rule to obtain a combination result corresponding to the target message information, take the combination result as a target variable name corresponding to the target message information, and generate the first handle code based on the target variable name.
[0086] Optionally, the message acquisition module 310 is configured to acquire at least one piece of communication message information in a database file of a controller area network corresponding to the vehicle-mounted controller software by calling a file reading method defined in advance for reading the database file of the controller area network.
[0087] Optionally, the software code update module 330 is configured to determine a first to-be-updated code corresponding to the first handle code in the code of the vehicle-mounted controller software, replace the first to-be-updated code with the first handle code, and determine a second to-be-updated code corresponding to the second handle code in the code of the vehicle-mounted controller software, and replace the second to-be-updated code with the second handle code.
[0088] The apparatus described above can perform the vehicle-mounted controller software code update method provided by any embodiment of the present application, and has the corresponding function modules and beneficial effects of performing the vehicle-mounted controller software code update method.
[0089] It is worth noting that each unit and module included in the vehicle-mounted controller software code update apparatus described above is only divided according to the function logic, but is not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for the convenience of mutual differentiation, and do not limit the protection scope of the embodiments of the present application.
[0090] Embodiment Four
[0091] Figure 4 This is a structural diagram of an electronic device provided in Example 4 of the present invention. Figure 4 A block diagram of an exemplary electronic device 12 suitable for implementing any of the embodiments of the present invention is shown. Figure 4 The electronic device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention. The device 12 is typically an electronic device that processes configuration information.
[0092] like Figure 4 As shown, the electronic device 12 is implemented as a general-purpose computing device. Components of the electronic device 12 may include, but are not limited to, one or more processors or processing units 16, a memory 28, and a bus 18 connecting the various components (including the memory 28 and the processing unit 16).
[0093] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0094] The electronic device 12 typically includes a variety of computer-readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0095] Memory 28 may include computer-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer storage media. By way of example only, storage system 34 may be configured to read and write to non-removable, non-volatile magnetic media (not shown, commonly referred to as a "hard drive"). Although not shown, a magnetic disk drive may be provided for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media). In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product 40 having a set of program modules 42 configured to perform the functions of various embodiments of the present invention. Program product 40 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.
[0096] The electronic device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, mouse, camera, etc., and a display), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication can occur via an input / output (I / O) interface 22. Furthermore, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) devices, tape drives, and data backup storage devices.
[0097] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, for example, implementing the code update method of the vehicle controller software provided in the above embodiment of the present invention, which includes:
[0098] Obtain at least one communication message information from the database file of the controller area network corresponding to the vehicle-mounted controller software; if target message information exists in each communication message information, generate a first handle code based on the target message information, and generate a second handle code based on the communication message information other than the target message information; update the code of the vehicle-mounted controller software based on the first handle code and the second handle code.
[0099] Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the vehicle controller software code update method provided in any embodiment of the present invention.
[0100] Example 5
[0101] A fifth embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, for example, the method for updating the code of the vehicle controller software provided in the above embodiment of the present invention includes:
[0102] Obtain at least one communication message information from the database file of the controller area network corresponding to the vehicle-mounted controller software; if target message information exists in each communication message information, generate a first handle code based on the target message information, and generate a second handle code based on the communication message information other than the target message information; update the code of the vehicle-mounted controller software based on the first handle code and the second handle code.
[0103] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0104] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0105] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0106] The computer program code for performing the operations of the embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0107] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A code update method for vehicle controller software, characterized in that: include: Obtain at least one communication message information from a database file of a controller area network corresponding to the vehicle controller software; If target message information exists in each communication message information, a first handle code is generated based on the target message information, and a second handle code is generated based on the communication message information other than the target message information; wherein the second handle code is generated based on the communication message information other than the target message information in the same manner as the first handle code is generated based on the target message information; updating the code of the vehicle controller software based on the first handle code and the second handle code; The step of generating a first handle code based on target message information includes: Determining a naming rule for a variable name to be updated corresponding to the target message information in the code of the vehicle controller software; Generate a first handle code based on the naming rule and the target message information; The step of generating a first handle code based on the naming rule and the target message information includes: Based on the naming rule, each field in the target message information is combined and processed to obtain a combination result corresponding to the target message information, the combination result is used as the target variable name corresponding to the target message information, and a first handle code is generated based on the target variable name.
2. The method according to claim 1, characterized in that The method further comprises: If the target message information does not exist in each communication message information, the second handle code is generated based on each communication message information.
3. The method according to claim 1, characterized in that The method further comprises: Determining message signal data in each communication message information; If target signal data exists in each message signal data, the communication message information containing the target signal data is used as the target message information.
4. The method according to claim 1, wherein The obtaining of at least one communication message information in a database file of a controller area network corresponding to the vehicle-mounted controller software includes: At least one communication message information in the database file of the controller area network corresponding to the vehicle controller software is obtained by calling a predefined file reading method for reading the database file of the controller area network.
5. The method according to claim 1, wherein The code for updating the vehicle controller software based on the first handle code and the second handle code includes: Determining a first code to be updated corresponding to the first handle code in the code of the vehicle controller software, and replacing the first code to be updated with the first handle code; and Determine a second code to be updated corresponding to the second handle code in the code of the vehicle-mounted controller software, and replace the second code to be updated with the second handle code.
6. A code update device for vehicle controller software, characterized in that: include: A message acquisition module, configured to acquire at least one communication message information from a database file of a controller area network corresponding to the vehicle controller software; a first handle code generating module configured to generate a first handle code based on the target message information if target message information exists in each communication message information, and to generate a second handle code based on communication message information other than the target message information; wherein the second handle code is generated based on the communication message information other than the target message information in the same manner as the first handle code is generated based on the target message information; A software code updating module, configured to update the code of the vehicle controller software based on the first handle code and the second handle code; The first handle code generation module is specifically configured to determine a naming rule for a variable name to be updated corresponding to the target message information in the code of the vehicle controller software; and generate a first handle code based on the naming rule and the target message information; Among them, the first handle code generation module is also used to combine the various fields in the target message information based on the naming rules to obtain a combination result corresponding to the target message information, use the combination result as the target variable name corresponding to the target message information, and generate the first handle code based on the target variable name.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs; When the program is executed by the processor, the processor implements the code updating method for the vehicle controller software as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for updating the code of the vehicle controller software as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Code file generation method and device, equipment and storage medium
CN112379883A