Software updating method, equipment and device based on automatic addressing and storage medium
By allocating regional addresses to vehicle software modules and using automatic addressing technology to write and verify updated data, the problem of long vehicle software update time is solved and an efficient software update process is achieved.
Patent Information
- Application Number
- CN202510608108.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-10-03
AI Technical Summary
The flashing time for vehicle software updates is long, which increases the probability of errors and labor time costs during the flashing process.
Through the method based on automatic addressing, the address link file of the software is obtained and the regional address is assigned to each module. The regional address and update data of the module to be updated are obtained, the update data is written into the corresponding regional address, and the CRC check value is used to ensure the accuracy and consistency of the updated data.
It reduces the flashing time of vehicle software updates, improves flashing efficiency, and reduces the error probability and labor costs.
Smart Images

Figure CN120743301A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle software technology, and in particular to a software update method, device, apparatus, and storage medium based on automatic addressing. Background Art
[0002] With the rapid development of new energy vehicles, ECU (Electronic Control Unit) software has become increasingly complex, leading to a rapid increase in the size of in-vehicle apps. The integration of battery management algorithms, EKF (Extended Kalman Filter), functional safety, and information security features has significantly increased the amount of software code and configuration files. Apps have also added more data logging and diagnostic features, which require extensive data processing and storage, leading to an increase in program file size. To ensure vehicle system security, modern ECU apps have incorporated more encryption, security verification, and fault tolerance mechanisms, all of which increase file size. Vehicle software requires constant updates to accommodate new features, fix vulnerabilities, and improve performance. Each update often introduces a large amount of new content and data, further increasing the size of each flash file. Flash programming, in particular, is generating ever-larger flash files. The increasing demand for updating electronic control system applications is leading to longer CAN (Controller Area Network) flashing times. This lengthy flashing process increases the likelihood of errors and increases labor costs.
[0003] There is currently no effective solution to the problem of long flashing time when updating vehicle software in related technologies. Summary of the Invention
[0004] According to various embodiments of the present application, a software update method, device, apparatus, and storage medium based on automatic addressing are provided.
[0005] In a first aspect, the present application provides a software update method based on automatic addressing, comprising:
[0006] Obtaining an address link file of the software, wherein the address link file includes a plurality of regional addresses, and allocating the regional addresses to respective modules of the software, wherein each module corresponds to each regional address on a one-to-one basis;
[0007] Obtaining the regional address of the module to be updated of the software;
[0008] Obtaining update data of the module to be updated;
[0009] The update data is written into the area address of the module to be updated.
[0010] In some embodiments, obtaining the regional address of the module to be updated of the software includes:
[0011] The regional address of each module of the software is obtained, and the regional address of the module to be updated is selected.
[0012] In some embodiments, obtaining update data of the module to be updated further includes:
[0013] Obtaining an update file of the software, compiling the update file to generate an update data file, wherein the update data file includes a plurality of one-to-one corresponding update data and update addresses, and the plurality of update addresses correspond to the plurality of regional addresses;
[0014] An update address of the data to be updated corresponding to the area address of the module to be updated is found from the multiple update addresses; and the update data of the module to be updated is read from the update data file according to the update address of the data to be updated.
[0015] In some embodiments, the update file includes a plurality of update data, each of the update data includes a variable file and a function code file, and each of the update addresses includes a first fixed area and a second fixed area; and compiling the update file to generate the update data file includes:
[0016] A first preprocessing instruction is added before and after the variable file of each updated data, for writing the variable file in the corresponding first fixed area; a second preprocessing instruction is added before and after the function code file of each updated data, for writing the function code file in the second fixed area, thereby writing each updated data into the corresponding update address to generate an updated data file.
[0017] In some embodiments, after generating the update data file, the method further includes:
[0018] Obtaining a first CRC check value of the update data file;
[0019] After writing the update data into the area address of the module to be updated, the method further includes:
[0020] Obtain a second CRC check value of the update data of the module to be updated and the data of the module not updated. If the first CRC check value is consistent with the second CRC check value, erase the backup data of the module to be updated, and perform a software update according to the update data of the module to be updated.
[0021] In some embodiments, the method further comprises:
[0022] If the first CRC check value is inconsistent with the second CRC check value, the backup data of the module to be updated is written into the area address of the module to be updated to cover the update data of the module to be updated.
[0023] In some embodiments, before obtaining the update data of the module to be updated, the method further includes:
[0024] Determine the driver required by the module to be updated, and download and install the driver.
[0025] In the second aspect, the present application provides a software update device based on automatic addressing, including: a host computer, the host computer is used to obtain the address link file of the software, the address link file includes multiple regional addresses, and the regional addresses are assigned to each module of the software, wherein each module corresponds one-to-one to each regional address; obtaining the regional address of the module to be updated of the software; obtaining the update data of the module to be updated; sending the regional address of the module to be updated and the update data to perform software update, wherein, when the software is updated, the update data of the module to be updated is written into the regional address of the module to be updated.
[0026] In some embodiments, the host computer is further configured to obtain the regional address of each module of the software, select the regional address of the module to be updated, and generate a regional address.
[0027] In some embodiments, the host computer is also used to obtain an update file of the software, and compile the update file to generate an update data file, wherein the update data file includes multiple one-to-one corresponding update data and update addresses, and the multiple update addresses correspond to the multiple regional addresses; the update address of the data to be updated corresponding to the regional address of the module to be updated is found from the multiple update addresses, and the update data of the module to be updated is read from the update data file according to the update address of the data to be updated.
[0028] In some embodiments, the update file includes several update data, each of the update data includes a variable file and a function code file, and each of the update addresses includes a first fixed area and a second fixed area; the host computer is also used to add a first preprocessing instruction before and after the variable file of each of the update data, for writing the variable file in the corresponding first fixed area; and add a second preprocessing instruction before and after the function code file of each of the update data, for writing the function code file in the second fixed area, thereby writing each update data into the corresponding update address to generate the update data file.
[0029] In some embodiments, the host computer is further configured to determine a driver required by the module to be updated, and download and install the driver.
[0030] In some embodiments, the host computer is further configured to obtain a first CRC check value of the update data file, and the first CRC check value is used to perform a CRC check on the update data.
[0031] In some embodiments, the device further includes a lower computer, which is configured to receive the area address and update data of the module to be updated of the software sent by the upper computer, and write the update data of the module to be updated into the area address of the module to be updated.
[0032] In some embodiments, the lower computer is further used to determine whether the starting address and space size of the regional address of the module to be updated are correct after receiving the regional address of the module to be updated. If so, erase the data corresponding to the regional address of the module to be updated, receive the update data of the module to be updated, and write the update data of the module to be updated into the regional address of the module to be updated.
[0033] In some embodiments, the lower computer is further used to obtain a second CRC check value based on the update data of the module to be updated and the data of the module that has not been updated, receive a first CRC check value, and if the first CRC check value is consistent with the second check value, erase the backup data of the module to be updated, and perform a software update based on the update data of the module to be updated.
[0034] In some embodiments, the lower computer is further configured to write the backup data of the module to be updated into the area address of the module to be updated to overwrite the update data of the module to be updated when the first CRC check value is inconsistent with the second CRC check value.
[0035] In some embodiments, the lower computer is further configured to download and install a driver required by the module to be updated.
[0036] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the software update method based on automatic addressing as described in the first aspect above.
[0037] In a fourth aspect, the present application provides a storage medium storing a computer program, wherein the computer program is configured to execute the software update method based on automatic addressing described in the first aspect when running.
[0038] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0040] Figure 1 This is a flowchart of a software update method based on automatic addressing according to an embodiment of the present application.
[0041] Figure 2 This is a specific flow chart of a software update method based on automatic addressing according to an embodiment of the present application.
[0042] Figure 3 This is a schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0044] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by a person of ordinary skill in the technical field to which this application belongs. In this application, words such as "one", "a", "the", "these" and the like do not indicate a limit on quantity and may be singular or plural. The terms "include", "comprise", "have" and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include unlisted steps or modules (units) or may include other steps or modules (units) inherent to these processes, methods, products or devices. Words such as "connect", "connected", "coupled" and the like used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. "A plurality" used in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, or B exists alone. Generally, the character " / " indicates that the objects in the preceding and following relationship are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0045] The embodiment of the present application provides a software update method based on automatic addressing, Figure 1 is a flow chart of the software update method based on automatic addressing of this embodiment, as shown in FIG. Figure 1 As shown, the process includes the following steps:
[0046] Step S110 , obtaining an address link file of the software, wherein the address link file includes a plurality of regional addresses, and allocating the regional addresses to the respective modules of the software, wherein each module corresponds to each regional address on a one-to-one basis.
[0047] In this step, the software can be the vehicle's ECU software or an in-vehicle app. The software is stored in modules, specifically divided by function. Different modules can be assigned different regional addresses, and the corresponding modules can be stored within the assigned regional addresses. All regional addresses allocated to the software are stored in an address link file, which can be stored on the software's corresponding server. The software's address link file can be obtained by accessing the server.
[0048] Furthermore, during the software update process, each module of the software may be compiled, and the area address for module storage may be obtained during compilation. An address link file may be generated based on the area address for module storage, and the address link file may be stored in the server for future use.
[0049] Step S120: obtaining the area address of the module to be updated of the software.
[0050] In this step, when the software is updated, some modules in the software will be updated, while other modules do not need to be updated. The modules that need to be updated are the modules to be updated. Since each module has a corresponding regional address, after determining the modules to be updated, the regional address of the modules to be updated can be obtained. Software modules include SOC (system on chip) modules, etc.
[0051] Step S130: Acquire update data of the module to be updated.
[0052] In this step, the update data corresponds to the module to be updated, rather than the entire software.
[0053] Step S140: writing the update data into the area address of the module to be updated.
[0054] In this step, the regional address is applied to the vehicle electronic system, and the update data is written into the regional address of the module to be updated, thereby completing the update of the vehicle's software.
[0055] In this embodiment, the software is divided into different modules and assigned different regional addresses. During a software update, the regional address of the module to be updated and the update data for the module to be updated are obtained, and the update data for the module to be updated is written to the regional address of the module to be updated, thereby completing the software update. Because updates are downloaded and updated on a module-by-module basis, there is no need to download the entire update file, effectively reducing the flashing time during vehicle software updates and improving flashing efficiency.
[0056] In some embodiments, obtaining the regional address of the module to be updated of the software includes:
[0057] The regional address of each module of the software is obtained, and the regional address of the module to be updated is selected.
[0058] In this embodiment, since each module has a corresponding regional address, after the module to be updated is determined, the regional address of the module to be updated can be directly determined through the module to be updated, and the process is simple and convenient.
[0059] Furthermore, a regional address table can be obtained from the address link file of the software. The regional address table includes the regional address of each module of the software. The regional address of the module to be updated can be quickly selected from the regional address table.
[0060] Specifically, the name of the module to be updated and the regional address of the module storage are obtained from the regional address table to generate a regional configuration file for the module to be updated. The regional configuration file includes the regional address of the module to be updated. When the update is subsequently performed, the regional configuration file can be directly called to obtain the regional address of the module to be updated.
[0061] In some embodiments, obtaining update data of the module to be updated further includes:
[0062] Obtaining an update file of the software, compiling the update file to generate an update data file, wherein the update data file includes a plurality of one-to-one corresponding update data and update addresses, and the plurality of update addresses correspond to the plurality of regional addresses;
[0063] An update address of the data to be updated corresponding to the area address of the module to be updated is found from the multiple update addresses; and the update data of the module to be updated is read from the update data file according to the update address of the data to be updated.
[0064] In this embodiment, when the software is updated, a corresponding update file is received and compiled to generate an update data file. The update data file includes multiple one-to-one corresponding update data and update addresses, and the multiple update addresses correspond to the multiple area addresses. By utilizing the correspondence between the area address and the update address, the update address of the data to be updated can be found from the multiple update addresses, and the corresponding update data can be read according to the update address of the data to be updated to ensure that the update data corresponds to the area address.
[0065] It should be noted that the update data of the update address corresponds to the module to be updated.
[0066] In some embodiments, the update file includes a plurality of update data, each update data includes a variable file and a function code file, and each update address includes a first fixed area and a second fixed area; compiling the update file to generate the update data file includes:
[0067] A first preprocessing instruction is added before and after the variable file of each updated data to write the variable file in the corresponding first fixed area; a second preprocessing instruction is added before and after the function code file of each updated data to write the function code file in the second fixed area, thereby writing each updated data into the corresponding update address to generate an updated data file.
[0068] In this embodiment, the update file includes several update data, each update data includes a variable file and a function code file, each update address includes a first fixed area and a second fixed area, the variable file is written in the first fixed area using a first preprocessing instruction, and the function code instruction is written in the second fixed area using a second preprocessing instruction to generate an update data file, the first fixed area and the second fixed area of an update address together correspond to an area address, and the corresponding update address is found through the area address to obtain the corresponding update data.
[0069] Furthermore, when the software is updated, each module file of the software can be compiled by the compiler to generate corresponding script files with suffixes of .c and .h. The compiler calls the script file, adds a first pre-compilation instruction before and after the variable file of the script file, and adds a second pre-compilation instruction before and after the function code file of the script file, and writes the variable file and function code file in the corresponding fixed area of the area address.
[0070] Specifically, in actual applications, you can obtain the regional configuration file, get the regional address corresponding to the software module from it, compile the software module through Matlab, generate .c and .h script files, call the script file through Matlab, add the first pre-compilation instruction before and after the variable file of the script file, add the second pre-compilation instruction before and after the function code file of the script file, enable the software module change in the regional configuration file, and generate the update data file, that is, the hex file, through HighTec compilation.
[0071] In some embodiments, after generating the update data file, the method further includes:
[0072] Obtaining a first CRC check value of the update data file;
[0073] After writing the update data into the area address of the module to be updated, the method further includes:
[0074] Obtain a second CRC check value of the update data of the module to be updated and the data of the module not updated. If the first CRC check value is consistent with the second CRC check value, erase the backup data of the module to be updated, and perform a software update according to the update data of the module to be updated.
[0075] In this embodiment, the consistency and accuracy of the update data are verified using the first CEC check value of the update data file and the second CRC check value of the update data of the module to be updated and the data of the module not updated, to ensure that the update is accurate.
[0076] It should be noted that the non-updated modules are modules that do not participate in the update, that is, other modules in the software except the module to be updated.
[0077] In some embodiments, the method further comprises:
[0078] If the first CRC check value is inconsistent with the second CRC check value, the backup data of the module to be updated is written into the area address of the module to be updated to cover the update data of the module to be updated.
[0079] In this embodiment, when the first CRC check value is inconsistent with the second CRC check value, it indicates that the updated data at this time is incorrect. The backup data of the module to be updated can be written into the area address of the module to be updated to overwrite the update data of the module to be updated, ensuring that the original data of the module to be updated is not changed, that is, the update operation is not performed.
[0080] In some embodiments, before obtaining the update data of the module to be updated, the method further includes:
[0081] Determine the driver required by the module to be updated, and download and install the driver.
[0082] In this embodiment, before obtaining the update data of the module to be updated, the driver required by the module to be updated is first determined, and the driver is downloaded and installed, so that the update operation can be performed smoothly.
[0083] Specifically, the driver includes Flash Driver and the like.
[0084] The present application also provides a software update device based on automatic addressing, including: a host computer, the host computer is used to obtain the address link file of the software, the address link file includes multiple regional addresses, and the regional addresses are assigned to each module of the software, wherein each module corresponds one-to-one to each regional address; obtaining the regional address of the module to be updated of the software; obtaining the update data of the module to be updated; sending the regional address of the module to be updated and the update data to perform software update, wherein, when the software is updated, the update data of the module to be updated is written into the regional address of the module to be updated.
[0085] In this embodiment, the automatic addressing-based software update device includes a host computer that divides the software into modules and assigns them different local addresses. During a software update, the host computer obtains and transmits the local addresses of the modules to be updated, along with the update data for the modules to be updated, to the data recipient for software update processing. Because updates are downloaded and updated on a module-by-module basis, there's no need to download the entire update file, effectively reducing vehicle software update time and improving update efficiency.
[0086] In some embodiments, the host computer is further configured to obtain the regional address of each module of the software, select the regional address of the module to be updated, and generate a regional address.
[0087] In some embodiments, the host computer is also used to obtain an update file of the software, and compile the update file to generate an update data file, wherein the update data file includes multiple one-to-one corresponding update data and update addresses, and the multiple update addresses correspond to the multiple regional addresses; the update address of the data to be updated corresponding to the regional address of the module to be updated is found from the multiple update addresses, and the update data of the module to be updated is read from the update data file according to the update address of the data to be updated.
[0088] In some embodiments, the update file includes several update data, each of the update data includes a variable file and a function code file, and each of the update addresses includes a first fixed area and a second fixed area; the host computer is also used to add a first preprocessing instruction before and after the variable file of each of the update data, for writing the variable file in the corresponding first fixed area; and add a second preprocessing instruction before and after the function code file of each of the update data, for writing the function code file in the second fixed area, thereby writing each update data into the corresponding update address to generate the update data file.
[0089] In some embodiments, the host computer is further configured to determine a driver required by the module to be updated, and download and install the driver.
[0090] In some embodiments, the host computer is further configured to obtain a first CRC check value of the update data file, and the first CRC check value is used to perform a CRC check on the update data.
[0091] In some embodiments, the device further includes a lower computer, which is configured to receive the area address and update data of the module to be updated of the software sent by the upper computer, and write the update data of the module to be updated into the area address of the module to be updated.
[0092] In some embodiments, the lower computer is further used to determine whether the starting address and space size of the regional address of the module to be updated are correct after receiving the regional address of the module to be updated. If so, erase the data corresponding to the regional address of the module to be updated, receive the update data of the module to be updated, and write the update data of the module to be updated into the regional address of the module to be updated.
[0093] In some embodiments, the lower computer is further used to obtain a second CRC check value based on the update data of the module to be updated and the data of the module that has not been updated, receive a first CRC check value, and if the first CRC check value is consistent with the second check value, erase the backup data of the module to be updated, and perform a software update based on the update data of the module to be updated.
[0094] In some embodiments, the lower computer is further configured to write the backup data of the module to be updated into the area address of the module to be updated to overwrite the update data of the module to be updated when the first CRC check value is inconsistent with the second CRC check value.
[0095] In some embodiments, the lower computer is further configured to download and install a driver required by the module to be updated.
[0096] In some embodiments, as Figure 2 As shown, the automatic addressing-based software update can be applied to a host computer 210 and a slave computer 220 located in a vehicle. The host computer 210 is configured to obtain the software's address link file, assign the local addresses to the various modules of the software, obtain the local addresses of the modules to be updated, obtain the update data for the modules to be updated, and send the local addresses and update data of the modules to be updated to the slave computer 220. The slave computer 220 is configured to receive the local addresses and update data of the modules to be updated and write the update data of the modules to be updated to the local addresses of the modules to be updated.
[0097] In some embodiments, such as Figure 2 As shown, before the upper computer 210 sends the area address of the module to be updated and the update data to the lower computer 220, the upper computer 210 sends a diagnostic service request to the lower computer 220, and the lower computer 220 determines whether the diagnostic service request is correct. If the diagnostic service request is correct, the lower computer 220 replies with diagnostic information, and the upper computer 210 determines whether the diagnostic information is correct. If the diagnostic information is correct, the upper computer 210 sends the area address of the module to be updated to the lower computer 220.
[0098] If the diagnosis service request is an error, the lower computer 220 copies the backup data of the module to be updated to the area address of the module to be updated, and the program is rolled back to wait for flashing again.
[0099] If the diagnosis information is wrong, the host computer 210 re-acquires the area address and update data of the module to be updated of the software.
[0100] In some embodiments, such as Figure 2As shown, after the lower computer 220 receives the area address of the module to be updated, the lower computer 220 determines whether the starting address and space size of the area address of the module to be updated are correct. If so, the data corresponding to the area address of the module to be updated is erased, and the erasure result is replied to the upper computer 210; the upper computer 210 determines whether the erasure is successful based on the erasure result. If the erasure is successful, the update data of the module to be updated is sent to the lower computer 220.
[0101] If the starting address and space size of the area address of the module to be updated are incorrect, the lower computer 220 copies the backup data of the module to be updated to the area address of the module to be updated, and the program is rolled back to wait for flashing again.
[0102] If the erasure fails, the host computer 210 re-acquires the area address and update data of the module to be updated of the software.
[0103] It should be noted that, before the lower computer 220 erases the data corresponding to the area address of the module to be updated, the lower computer 220 backs up the original data of the module to be updated to obtain the backup data.
[0104] In some embodiments, such as Figure 2 As shown, when the lower computer 220 receives the update data of the module to be updated of the software, it determines whether the data sending has timed out. If not, the lower computer 220 replies with a message of successful data reception to the upper computer 210, and writes the update data of the module to be updated into the area address of the module to be updated, and obtains a second CRC check value based on the update data of the module to be updated and the data of the module that has not been updated; the upper computer 210 determines whether a message of successful data reception is received, and if so, obtains a first CRC check value of the update data file, and sends the first CRC check value to the lower computer 220; the lower computer 220 receives the first CRC check value, and if the first CRC check value is consistent with the second check value, deletes the backup data of the module to be updated, performs software update according to the update data of the module to be updated, uses the update data of the module to be updated as backup data, and also sends a check success flag to the upper computer 210.
[0105] If the data transmission times out or the first CRC check value is inconsistent with the second check value, the lower computer 220 copies the backup data of the module to be updated to the area address of the module to be updated, and the program rolls back to wait for flashing again.
[0106] If the host computer 210 does not receive the message indicating successful data reception or the mark indicating successful verification, the host computer 210 re-acquires the area address and update data of the module to be updated of the software.
[0107] In some embodiments, before the host computer 210 sends the regional address of the module to be updated to the slave computer 220, the host computer 210 determines the driver required by the module to be updated, downloads and installs the driver, and notifies the slave computer 220 to download and install the driver.
[0108] It should be understood that, although the various steps in the above flow chart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above flow chart may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0109] like Figure 3 As shown, the present application further provides an electronic device 300, comprising a memory 31 and a processor 32, wherein the memory 31 stores a computer program, and the processor 32 is configured to run the computer program to execute the above-mentioned software update method based on automatic addressing.
[0110] The present application also provides a storage medium, in which a computer program is stored. The computer program is configured to execute the above-mentioned software update method based on automatic addressing when running.
[0111] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0112] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A software update method based on automatic addressing, characterized in that: The method comprises: Obtaining an address link file of the software, wherein the address link file includes a plurality of regional addresses, and allocating the regional addresses to respective modules of the software, wherein each module corresponds to each regional address on a one-to-one basis; Obtaining the regional address of the module to be updated of the software; Obtaining update data of the module to be updated; The update data is written into the area address of the module to be updated.
2. The method according to claim 1, characterized in that Obtaining the regional address of the module to be updated of the software includes: The regional address of each module of the software is obtained, and the regional address of the module to be updated is selected.
3. The method according to claim 2, characterized in that Acquiring the update data of the module to be updated further includes: Obtaining an update file of the software, compiling the update file to generate an update data file, wherein the update data file includes a plurality of one-to-one corresponding update data and update addresses, and the plurality of update addresses correspond to the plurality of regional addresses; An update address of the data to be updated corresponding to the area address of the module to be updated is found from the multiple update addresses; and the update data of the module to be updated is read from the update data file according to the update address of the data to be updated.
4. The method according to claim 3, characterized in that The update file includes a variable file and a function code file, and the area address includes a first fixed area and a second fixed area; and compiling the update file to generate an update data file includes: A first preprocessing instruction is added before and after the variable file to write the variable file in the corresponding first fixed area; a second preprocessing instruction is added before and after the function code file to write the function code file in the second fixed area to generate the update data file.
5. The method according to claim 3, characterized in that After the update data file is generated, the method further includes: Obtaining a first CRC check value of the update data file; After writing the update data into the area address of the module to be updated, the method further includes: Obtain a second CRC check value of the update data of the module to be updated and the data of the module not updated. If the first CRC check value is consistent with the second CRC check value, erase the backup data of the module to be updated, and perform a software update according to the update data of the module to be updated.
6. The method according to claim 5, characterized in that The method further comprises: If the first CRC check value is inconsistent with the second CRC check value, the backup data of the module to be updated is written into the area address of the module to be updated to cover the update data of the module to be updated.
7. The method according to claim 1, characterized in that Before obtaining the update data of the module to be updated, the method further includes: Determine the driver required by the module to be updated, and download and install the driver.
8. A software update device based on automatic addressing, characterized in that: The device includes a host computer, which is used to obtain an address link file of the software, wherein the address link file includes multiple regional addresses, and the regional addresses are assigned to each module of the software, wherein each module corresponds one-to-one to each regional address; obtain the regional address of the module to be updated of the software; obtain update data of the module to be updated; send the regional address of the module to be updated and the update data to perform a software update, wherein when the software is updated, the update data of the module to be updated is written into the regional address of the module to be updated.
9. The device according to claim 8, characterized in that The host computer is further configured to obtain the regional address of each module of the software, select the regional address of the module to be updated, and generate a regional address.
10. The device according to claim 9, characterized in that The host computer is also used to obtain the update file of the software and compile the update file to generate an update data file, wherein the update data file includes multiple one-to-one corresponding update data and update addresses, and the multiple update addresses correspond to the multiple regional addresses; find the update address of the data to be updated corresponding to the regional address of the module to be updated from the multiple update addresses, and read the update data of the module to be updated from the update data file according to the update address of the data to be updated.
11. The device according to claim 10, characterized in that The update file includes several update data, each of the update data includes a variable file and a function code file, and each of the update addresses includes a first fixed area and a second fixed area; the host computer is also used to add a first preprocessing instruction before and after the variable file of each of the update data, for writing the variable file in the corresponding first fixed area; and add a second preprocessing instruction before and after the function code file of each of the update data, for writing the function code file in the second fixed area, thereby writing each update data into the corresponding update address to generate the update data file.
12. The device according to claim 8, characterized in that The host computer is further configured to determine a driver required by the module to be updated, and download and install the driver.
13. The device according to claim 10, characterized in that The host computer is further configured to obtain a first CRC check value of the update data file, where the first CRC check value is used to perform a CRC check on the update data.
14. The device according to claim 8, characterized in that The device includes a lower computer, which is used to receive the area address and update data of the module to be updated of the software, and write the update data of the module to be updated into the area address of the module to be updated.
15. The device according to claim 14, characterized in that The lower computer is also used to determine whether the starting address and space size of the regional address of the module to be updated are correct after receiving the regional address of the module to be updated. If so, erase the data corresponding to the regional address of the module to be updated, receive the update data of the module to be updated, and write the update data of the module to be updated into the regional address of the module to be updated.
16. The device according to claim 14, characterized in that The lower computer is also used to obtain a second CRC check value based on the update data of the module to be updated and the data of the module that has not been updated, receive a first CRC check value, and if the first CRC check value is consistent with the second check value, erase the backup data of the module to be updated, and perform software update according to the update data of the module to be updated.
17. The device according to claim 16, characterized in that The lower computer is further configured to write the backup data of the module to be updated into the area address of the module to be updated to overwrite the update data of the module to be updated when the first CRC check value is inconsistent with the second CRC check value.
18. The device according to claim 14, characterized in that The lower computer is further used to download and install the driver required by the module to be updated.
19. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the software update method based on automatic addressing according to any one of claims 1 to 7.
20. A storage medium, characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the software update method based on automatic addressing according to any one of claims 1 to 7 when running.