CN-122018942-A - Method, apparatus, device, storage medium and program product for flushing
Abstract
The disclosure relates to a refreshing method, a device, equipment, a storage medium and a program product, wherein the method comprises the steps of obtaining a refreshing initial address indicated in a refreshing request to be processed, and calling a preset interface corresponding to a second controller according to the refreshing initial address to perform refreshing operation on the second controller if the refreshing initial address is located outside a memory range corresponding to the first controller, wherein the second controller is mounted under the first controller. The method and the device realize the dynamic identification of the controller needing to be refreshed through the memory address range, reduce the requirement on the computing resource of the first controller, enable the standard first controller to efficiently finish the refresh task of the second controller hung below, and improve the refresh flexibility and the refresh efficiency of the controller.
Inventors
- XU HANBO
- JIANG TAO
Assignees
- 小米汽车科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260213
Claims (20)
- 1. A method of brushing, comprising: acquiring a brushing initial address indicated in a brushing request to be processed; And if the initial address of the brushing is positioned outside the memory range corresponding to the first controller, calling a preset interface corresponding to the second controller according to the initial address of the brushing, and performing brushing operation on the second controller, wherein the second controller is mounted under the first controller.
- 2. The method of claim 1, further comprising, prior to the obtaining the swipe starting address indicated in the pending swipe request: determining a first memory space occupied by the first controller; and configuring a second memory space occupied by the second controller according to the first memory space, wherein the starting address of the second memory space is larger than the ending address of the first memory space.
- 3. The method of claim 2, wherein configuring the second memory space occupied by the second controller according to the first memory space comprises: determining the memory demand of the software data of the second controller; And configuring the capacity of the second memory space according to the first memory space and the memory demand, wherein the capacity of the second memory space is larger than or equal to the memory demand.
- 4. The method of claim 3, wherein the first controller is populated with a plurality of the second controllers, wherein configuring the capacity of the second memory space according to the first memory space and the memory demand comprises: Determining the capacity of the second memory space occupied by each second controller according to the memory demand of the software data of each second controller; configuring memory starting addresses of the second controllers according to the ending addresses of the first memory space and the capacity of the second memory space; the memory starting address of the first second controller located behind the first controller is larger than the memory ending address of the first controller, and the memory starting address of each subsequent second controller sequentially shifts based on the capacity of the second memory space occupied by the previous second controller.
- 5. The method of claim 1, further comprising, before the calling the preset interface corresponding to the second controller according to the refresh start address to perform a refresh operation on the memory space of the second controller: And configuring a preset interface applicable to the brushing process for at least one second controller mounted under the first controller.
- 6. The method of claim 5, wherein the configuring the predetermined interface for the at least one second controller mounted under the first controller includes: And taking the first controller as a master node, taking at least one second controller mounted under the first controller as a slave node, forming a device tree, and configuring a preset interface applicable to the brushing process for each slave node.
- 7. The method according to any one of claims 1-6, wherein the calling a preset interface corresponding to a second controller according to the refresh start address, performing a refresh operation on the second controller, includes: Determining a target second controller corresponding to the initial address of the brushing, and acquiring the preset interface corresponding to the target second controller; Determining an operation instruction appointed by the brushing request; And selecting a target interface corresponding to the operation instruction from the preset interfaces, and calling the target interface to execute the operation instruction on the memory space of the second controller.
- 8. The method as recited in claim 1, further comprising: And if the refreshing initial address is positioned in the memory range corresponding to the first controller, calling a refreshing interface corresponding to the first controller to carry out refreshing operation on the first controller.
- 9. A brushwriting apparatus of a controller, comprising: the acquisition module is used for acquiring a refreshing initial address indicated in the refreshing request to be processed; And the refreshing module is used for calling a preset interface corresponding to a second controller according to the refreshing initial address if the refreshing initial address is located outside the memory range corresponding to the first controller, so as to carry out refreshing operation on the second controller, and the second controller is mounted under the first controller.
- 10. The apparatus of claim 9, further comprising a first configuration module configured to determine a first memory space occupied by the first controller before the obtaining of the refresh start address indicated in the pending refresh request, and to configure a second memory space occupied by the second controller according to the first memory space, the start address of the second memory space being greater than the end address of the first memory space.
- 11. The apparatus of claim 10, wherein the first configuration module is further configured to determine a memory requirement for software data of the second controller, and wherein the second memory space is configured to have a capacity according to the first memory space and the memory requirement, the capacity of the second memory space being greater than or equal to the memory requirement.
- 12. The apparatus of claim 11, wherein the first controller is configured to carry a plurality of the second controllers, wherein the first configuration module is further configured to determine a capacity of the second memory space occupied by each of the second controllers according to a memory demand of each of the second controller software data; the memory starting address of the first second controller located behind the first controller is larger than the memory ending address of the first controller, and the memory starting address of each subsequent second controller sequentially shifts based on the capacity of the second memory space occupied by the previous second controller.
- 13. The apparatus as recited in claim 9, further comprising: The second configuration module is configured to configure a preset interface applicable to a brushing process for at least one second controller mounted under the first controller before the second controller is subjected to brushing operation on the memory space of the second controller according to the brushing start address.
- 14. The apparatus of claim 13, wherein the second configuration module is configured to take the first controller as a master node, take at least one of the second controllers mounted under the first controller as a slave node, form a device tree, and configure a preset interface applicable to a brushing process for each of the slave nodes.
- 15. The apparatus according to any one of claims 9 to 14, wherein the flushing module is configured to determine a target second controller corresponding to the flushing start address, obtain the preset interface corresponding to the target second controller, determine an operation instruction specified by the flushing request, select a target interface corresponding to the operation instruction from the preset interfaces, and call the target interface to execute the operation instruction on a memory space of the second controller.
- 16. The apparatus of claim 9, wherein the flush module is further configured to invoke a flush interface corresponding to a first controller to flush the first controller if the flush start address is within a memory range corresponding to the first controller.
- 17. A vehicle, characterized by comprising: at least one processor, and A memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor, the processor being configured to execute the instructions to implement the method of any one of claims 1-8.
- 18. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor, the processor being configured to execute the instructions to implement the method of any one of claims 1-8.
- 19. A computer readable storage medium storing a computer program or instructions which, when executed by a processor of an electronic device, enable the electronic device to perform a method of swiping, the method comprising: Acquiring a to-be-processed brushing request; Analyzing the refreshing request to obtain a refreshing initial address; And if the initial address of the brushing is positioned outside the memory range corresponding to the first controller, calling a preset interface corresponding to the second controller according to the initial address of the brushing, and performing brushing operation on the second controller, wherein the second controller is mounted under the first controller.
- 20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-8.
Description
Method, apparatus, device, storage medium and program product for flushing Technical Field The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for writing. Background In software upgrade applications for embedded controllers, standard controllers (e.g., electronic control units compliant with a standard protocol) typically require swiping of non-standard controllers (controllers that do not conform to a standard protocol, such as on-board chips or other accessory controllers) that are underhung. However, because of limited hardware and software resources (e.g., no file system support) of the standard controller, the non-standard controller currently requiring the flushing cannot be directly identified through the downloaded file content, resulting in limited flushing process of the non-standard controller. Disclosure of Invention In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, a device, a storage medium, and a program product for dynamically identifying a controller requiring to be refreshed through a memory address range, reducing the demand for computing resources of a first controller, enabling a standard first controller to efficiently complete a refresh task for an underhung second controller, and improving the flexibility and efficiency of controller refresh. In a first aspect, an embodiment of the present disclosure provides a method for flushing, including obtaining a flushing start address indicated in a to-be-processed flushing request, and if the flushing start address is located outside a memory range corresponding to a first controller, invoking a preset interface corresponding to a second controller according to the flushing start address, performing a flushing operation on the second controller, where the second controller is mounted under the first controller. In a second aspect, an embodiment of the present disclosure provides a brushing apparatus of a controller, including: the acquisition module is used for acquiring a refreshing initial address indicated in the refreshing request to be processed; And the refreshing module is used for calling a preset interface corresponding to a second controller according to the refreshing initial address if the refreshing initial address is located outside the memory range corresponding to the first controller, so as to carry out refreshing operation on the second controller, and the second controller is mounted under the first controller. In a third aspect, embodiments of the present disclosure provide a vehicle comprising: at least one processor, and A memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor, the processor being configured to execute the instructions to implement the method of any of the above aspects. In a fourth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor, and A memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor, the processor being configured to execute the instructions to implement the method of any of the above aspects. In a fifth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the method of any one of the above aspects. In a sixth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the above aspects. In a seventh aspect, an embodiment of the present disclosure provides a system for brushing a controller, including a server and a terminal, where the terminal interacts with the server through data to implement the method in any one of the foregoing aspects. According to the method, the device, the equipment, the storage medium and the program product for refreshing, the refreshing initial address in the refreshing request is obtained and is used as the basis for identifying the controller, if the refreshing initial address is not in the memory range of the first controller, it is indicated that the refreshing object of the refreshing request is not the first controller, but the second controller mounted under the first controller needs to be refreshed, the refreshing process of the second controller is automatically triggered, namely, the preset interface of the second controller corresponding to the refreshing initial address is called to execute the accurate refreshing operation on the second controller. Therefore, the problem of complex controller identity recognition is solved, the problem that a standard first controller cannot directly rec