Resource transmission method and apparatus, electronic device, medium, and computer program product

By transmitting the target boot loading firmware in dual-core dual-system electronic devices, enabling an efficient second data transmission channel, the problem of low resource transmission rate is solved, and more efficient resource transmission and shorter upgrade time is achieved.

WO2025156458A1PCT designated stage Publication Date: 2025-07-31GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/087908
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-26
Filing Date
2024-04-16
Publication Date
2025-07-31

AI Technical Summary

Technical Problem

In dual-core and dual-system electronic equipment, the resource transmission rate in the prior art is low, resulting in low production efficiency of production lines and long waiting time during user upgrades.

Method used

By transmitting the target boot firmware in a system of a high-performance processor, an efficient second data transmission channel is enabled and the resources to be upgraded are transmitted using this channel to increase the data transmission rate.

Benefits of technology

It improves resource transmission efficiency, reduces production line production time and waiting time during user upgrades, and improves production efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024087908_31072025_PF_FP_ABST
    Figure CN2024087908_31072025_PF_FP_ABST
Patent Text Reader

Abstract

A resource transmission method and apparatus, an electronic device, a medium, and a computer program product, relating to the field of electronic devices. The method comprises: if a resource to be upgraded of a second system is present in a first storage space of a first system, the first system transmits target bootloader firmware to the second system by means of a first data transmission channel (301); the first system triggers the second system to run the target bootloader firmware (302); the second system enables a second data transmission channel with the first system by running the target bootloader firmware, wherein the data transmission rate of the second data transmission channel is greater than that of the first data transmission channel (303); and the first system transmits said resource to the second system by means of the second data transmission channel (304). The solution provided in the embodiments of the present application is conducive to improving the resource transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Resource transmission method, device, electronic device, medium and computer program product

[0001] This application claims priority to Chinese patent application number 202410119616.4, filed on January 26, 2024, entitled “Resource Transmission Method, Device, Electronic Device, Medium and Computer Program Product,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The embodiments of the present application relate to the field of electronic devices, and in particular to a resource transmission method, device, electronic device, medium, and computer program product. Background Art

[0003] With the continuous upgrade of electronic devices, dual-core, dual-system devices, featuring both high-performance and low-power processors, have emerged to improve battery life. These dual systems can work together while also being able to operate independently. Therefore, both high-performance and low-power processors require complete operational resources.

[0004] In the related art, in the production line production or OTA (Over-The-Air) scenario, the high-performance processor receives the resources to be upgraded transmitted from the outside, and transmits the resources to be upgraded to the low-power processor through the UART (Universal Asynchronous Receiver / Transmitter) channel or the SWD (Serial Wire Debug) channel, so that the low-power processor stores and runs the resources to be upgraded.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a resource transmission method, apparatus, electronic device, medium, and computer program product. The technical solution is as follows:

[0007] In one aspect, an embodiment of the present application provides a resource transmission method, which is applied to an electronic device that supports running a first system and a second system. The method includes:

[0008] When there are resources to be upgraded of the second system in the first storage space of the first system, the first system transmits target boot loading firmware to the second system through the first data transmission channel;

[0009] The first system triggers the second system to run the target boot loader firmware;

[0010] The second system enables a second data transmission channel with the first system by running the target boot loader firmware, wherein the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel;

[0011] The first system transmits the resource to be upgraded to the second system through the second data transmission channel.

[0012] On the other hand, an embodiment of the present application provides a resource transmission device, which is used in an electronic device that supports running a first system and a second system; the device includes:

[0013] A first system module is configured to transmit a target boot loader firmware to the second system through a first data transmission channel when resources to be upgraded of the second system exist in the first storage space of the first system;

[0014] The first system module is further configured to trigger the second system to run the target boot loader firmware;

[0015] a second system module, configured to enable a second data transmission channel with the first system by running the target boot loader firmware, wherein the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel;

[0016] The first system module is further configured to transmit the resource to be upgraded to the second system through the second data transmission channel.

[0017] On the other hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the resource transmission method described in the above aspect.

[0018] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the resource transmission method as described in the above aspects.

[0019] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the resource transmission method described in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] FIG1 is a diagram of a dual-core communication software framework of an Android operating system provided by an exemplary embodiment of the present application;

[0022] FIG2 is a diagram of a dual-core communication software framework of an RTOS provided by an exemplary embodiment of the present application;

[0023] FIG3 is a flow chart of a resource transmission method provided by an exemplary embodiment of the present application;

[0024] FIG4 is a schematic diagram of a dual-core dual system provided by an exemplary embodiment of the present application;

[0025] FIG5 is a schematic diagram of a dual-core dual system provided by another exemplary embodiment of the present application;

[0026] 6 is a timing diagram of a first system transmitting a target boot loader firmware to a second system via a first data transmission channel according to an exemplary embodiment of the present application;

[0027] 7 is a flowchart of a first system triggering a second system to run a boot-loaded firmware according to an exemplary embodiment of the present application;

[0028] FIG8 is a timing diagram of a first system transmitting resources to be upgraded to a second system via a second data transmission channel according to an exemplary embodiment of the present application;

[0029] FIG9 is a schematic diagram of a two-stage resource transmission method provided by an exemplary embodiment of the present application;

[0030] 10 is a schematic diagram of a second system providing a method for writing a resource data packet and receiving a resource data packet in parallel according to an exemplary embodiment of the present application;

[0031] FIG11 is a structural block diagram of a resource transmission device provided by an exemplary embodiment of the present application;

[0032] FIG12 is a structural block diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0034] In traditional electronic devices, only a single processor is often provided, and events are processed by an operating system running on the processor. However, as users' demand for electronic devices increases, electronic devices are also required to have stronger data processing capabilities. Therefore, electronic devices equipped with dual-core dual systems have emerged. In one possible embodiment, the electronic device is provided with at least a first processor and a second processor with different processing performance and power consumption, and the first system runs on the first processor and the second system runs on the second processor. In addition, the electronic device configured with dual-core dual systems is also provided with a system switching mechanism.

[0035] For example, in products such as smart watches or smart bracelets, a high-performance processor and a low-power processor may be included at the same time, running in the first system and the second system respectively (ie, dual-core dual system).

[0036] In order to reduce power consumption, a system running on a low-power processor often processes events with low performance requirements, and when there are events requiring high-performance processing, it switches to a system running on a high-power processor for high-performance event processing to meet the performance requirements of electronic equipment.

[0037] Optionally, the first system runs on a low-power processor and the second system runs on a high-performance processor; optionally, the first system runs on a high-performance processor; the second system runs on a low-power processor.

[0038] In the embodiment of the present application, since the first processor and the second processor operate asynchronously, and the first system and the second system need to implement system communication (or dual-core communication), in one possible application scenario, the first system is an Android operating system running on a central processing unit (CPU), and the second system is a real-time operating system (RTOS) running on a microcontroller unit (MCU).

[0039] Figure 1 is a diagram of the dual-core communication software framework for the Android operating system, provided by an exemplary embodiment of the present application. This dual-core communication software framework adheres to the design principles of "low coupling, high reliability, and high reuse," and includes the development of modules for the Kernel, HIDL (Hardware Abstraction Layer Interface Description Language), Native Services, Framework Services, Framework APIs, and Apps.

[0040] Among them, the APP module includes functional modules such as Launcher (desktop launcher), Setting (settings) and SystemUI (system user interface); the Framework API module includes management modules such as MCUManager (MCU management), SensorManager (sensor management), and LocationManager (location management); the Framework Service module includes service modules such as MCUManagerService (MCU management service), SystemSensorManager (system sensor management), and LocationManagerService (location management service); the Native Service module includes service modules such as dccservice (dcc service) and Sensorservice (sensor service); the HIDL module includes modules such as Sensor HAL (sensor hardware abstraction layer) and GPS HAL (global positioning system hardware abstraction layer). The Kernel module includes DCC Transfer Drivers such as dcc_data, Mcu_sensor, and Mcu_gps.

[0041] The transport layer serves as the interface layer connecting the upper and lower layers in the dual-core communication software framework. It shields the transmission details of the lower layer (data link layer) of the system from the application layer and provides service channels for application scenarios. The application layer, as the main body of service provision, responds to human-computer interaction and transmits the data generated during the human-computer interaction process through the transport layer, as well as responds to external data requests.

[0042] RTOS is designed based on the principle of peer-to-peer. Taking a smartwatch as an example, FIG2 is a diagram of a dual-core communication software framework of an RTOS provided by an exemplary embodiment of the present application.

[0043] As shown in Figure 2, the dual-core communication software framework of RTOS is divided into the application layer (Application Layer), service layer (Service Layer), framework layer (Framework Layer), hardware abstraction layer (Hardware abstraction layer) and platform layer (Platform Layer).

[0044] Among them, the application layer includes watch face, Daily Tracker, Message center, Voice around Apps, Health Apps, Settings and other application modules; the service layer includes Sport&health task, System manager task, AMS, AudioService, Log Service, OFTP Service, BT Service, Delegate Service, RPC Service, sensor Service, storage Service and other service modules; the framework layer includes Message Pub, UI Framework, G2D Engine, Audio Middleware, Preference, File System (file system), Algorithms (algorithms), AsycEvent (in-process asynchronous events) and other framework modules; the hardware abstraction layer includes Screen / TP (screen / touch screen), sensors (sensors), Keypad (keyboard), Motor (motor) and other hardware abstraction modules; the platform layer includes board support package (BSP) and low-level driver (LOW level Driver), among which BSP includes Screen / TP, Codec (codec), sensors, Flash (flash memory), PSRAM (pseudo-static random access memory), etc., and low-level drivers include UART (universal asynchronous receiver and transmitter), ADC (analog-to-digital converter), GPIO (general input and output), SPI (serial peripheral interface), I2C (integrated circuit bus), IOS (input and output system), PCM (pulse code modulation), I2S (integrated sound bus), HWTimer (hardware timer).

[0045] It should be noted that the above dual-core communication software framework is only used for illustrative purposes. Those skilled in the art can also add, delete or modify the above framework according to actual needs. The embodiments of this application do not limit the specific structure of the dual-core communication software framework.

[0046] The two systems work in conjunction with each other, but each system also has the ability to operate independently. Therefore, high-performance processors and low-power processors need to have complete operating resources, and the amount of complete operating resources is usually large.

[0047] In related technologies, during the running of an application, data related to the application's operation can be transmitted between a high-performance processor and a low-power processor via an SPI (Serial Peripheral Interface) channel. In production line or OTA scenarios, the high-performance processor receives externally transmitted resources to be upgraded, and typically transmits the resources to be upgraded to the low-power processor via a UART channel or SWD channel, allowing the low-power processor to store and run the resources to be upgraded. The data transmission rate of the UART channel or SWD channel is lower than that of the SPI channel.

[0048] In production line scenarios, the resource download rate needs to be increased to improve production efficiency. After the product leaves the factory, the resource download rate needs to be increased to reduce the impact of the upgrade process on users. Therefore, when downloading or updating resources, the dual-core dual system requires a resource transmission method with a higher transmission rate.

[0049] 3 is a flow chart of a resource transmission method provided by an exemplary embodiment of the present application. The method is applied to an electronic device that supports running a first system and a second system.

[0050] The electronic device is a dual-core dual-system device. Optionally, the electronic device is a smart watch, smart bracelet, or other device that includes a high-performance processor and a low-power processor.

[0051] The high-performance processor and low-power processor in the electronic device run in a first system and a second system, respectively. Because the first processor and the second processor operate asynchronously, and the first system and the second system need to achieve system communication (also known as dual-core communication), in one possible application scenario, the first system is the Android operating system running on the central processing unit (CPU), and the second system is a real-time operating system (RTOS) running on the microcontroller unit (MCU).

[0052] In other embodiments, the low-power processor runs on a first system, which is a real-time operating system running on a microcontroller unit, and the high-performance processor runs on a second system, which is an Android operating system running on a central processing unit.

[0053] The method includes the following steps.

[0054] Step 301 : When resources to be upgraded of a second system exist in a first storage space of a first system, the first system transmits a target boot loader firmware to the second system through a first data transmission channel.

[0055] In some embodiments, the first system is a system running on a high-performance processor (such as the Android operating system), and the second system is a system running on a low-power processor (such as a real-time operating system). In other embodiments, the first system is a system running on a low-power processor, and the second system is a system running on a high-performance processor. The following describes the resource transfer method using the example of the first system being the Android operating system running on a central processing unit and the second system being a real-time operating system running on a microcontroller.

[0056] Refer to FIG4 , which is a schematic diagram of a dual-core dual system provided by an exemplary embodiment of the present application.

[0057] During production, the first system 410 receives resources from an external device via a USB (Universal Serial Bus) channel 401. During the OTA process, the first system 410 receives resources from an external device via a Wi-Fi (Wireless Fidelity) channel 402. The resources received by the first system 410 include resources to be upgraded in the second system 420, which may be used to download or upgrade applications in the second system.

[0058] Optionally, the resources to be upgraded include application firmware and a file image of the application.

[0059] Optionally, the resources to be upgraded also include system resources, which are resources for maintaining normal operation of the second system, such as a clock required for the second system to operate, a watchdog for preventing the second system from freezing, and the like.

[0060] Optionally, the resources to be upgraded also include peripheral resources, such as analog peripheral resources, timers, etc.

[0061] After receiving the resources to be upgraded from the second system 420 through the USB channel 401 or the WIFI channel 402, the first system 410 stores the resources to be upgraded in the first storage space 411 of the first system. The first storage space 411 of the first system and the second storage space 421 of the second system are non-volatile storage devices. Optionally, the first storage space or the second storage space is an eMMC (embedded Multi Media Card). Optionally, the first storage space or the second storage space can also be a Flash (flash memory), FeRAM (Ferroelectric Random Access Memory), MRAM (Magnetoresistive Random Access Memory), and other types. The embodiment of the present application does not limit the specific types of the first storage space and the second storage space.

[0062] Optionally, the first data transmission channel is a UART channel or a SWD channel.

[0063] The target bootloader firmware is used to enable the second data transmission channel between the first system and the second system to achieve high-speed transmission of resources to be upgraded between the first system and the second system. In the embodiment of the present application, the target bootloader firmware can also be called HS-bootloader (High Speed ​​bootloader).

[0064] In typical scenarios, the target bootloader firmware is much smaller than the resource to be upgraded. For example, the target bootloader firmware is approximately 200 kilobytes (KB), while the resource to be upgraded is approximately 300 MB. Therefore, the time required to transfer the target bootloader firmware from the first system to the second system via the first data transmission channel is typically very short.

[0065] In one possible implementation, the target boot loader firmware is included in the resources to be upgraded and is sent by an external device to the first system 410 via the USB channel 401 or the WIFI channel 402. In some embodiments, before transmitting the target boot loader firmware to the second system 420, the first system 410 may first transmit a program for assisting in downloading the target boot loader firmware, such as programmmer.bin, to the second system 420 via the first data transmission channel 431.

[0066] In another possible implementation, the target boot loading firmware may be pre-stored in the first storage space of the first system 410 .

[0067] In some embodiments, after the first system 410 receives the resource to be upgraded containing the target boot loading firmware sent by an external device, it can compare the target boot loading firmware with the historical boot loading firmware stored in the second storage space of the second system. If the target boot loading firmware is inconsistent with the historical boot loading firmware, the target boot loading firmware is transmitted to the second system 420 through the first data transmission channel 431.

[0068] It should be noted that the target boot loading firmware can also be pre-stored in the second storage space of the second system. When the target boot loading firmware is pre-stored in the second storage space, the first system does not need to transmit the target boot loading firmware to the second system again through the first data transmission channel.

[0069] Step 302: The first system triggers the second system to run the target boot loader firmware.

[0070] In one possible implementation, the first system can trigger a reset signal by pulling a reset pin. Upon detecting the reset signal, the second system executes the target bootloader firmware. The first system can also trigger the second system to execute the target bootloader firmware by other means, for example, the first system can send an instruction to the second system via the first data transmission channel, etc., which is not limited in this embodiment of the present application.

[0071] Step 303: The second system enables a second data transmission channel with the first system by running the target bootloader firmware, where the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel.

[0072] Optionally, the second data transmission channel is an SPI channel.

[0073] The data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel. For example, the second data transmission channel is a 24M SPI transmission channel and the first data transmission channel is a UART channel. Experiments have shown that the data transmission rate of the second data transmission channel is more than five times that of the first data transmission channel.

[0074] In some embodiments, upon detecting a reset signal, the second system 420 enables the second data transmission channel 432 with the first system 410 by running the target bootloader firmware.

[0075] Step 304: The first system transmits the resources to be upgraded to the second system through the second data transmission channel.

[0076] In some embodiments, after the second system receives the resource to be upgraded, it can write the resource to be upgraded into the second storage space. The second storage space can include different storage subspaces. Optionally, different storage subspaces are used to store different types of resources to be upgraded.

[0077] Optionally, the resources to be upgraded are transmitted in the form of resource data packets, and the second system writes the resource data packets and receives the resource data packets in parallel, that is, the second system writes and receives the resource data packets in a pipeline manner.

[0078] To sum up, when the first storage space of the first system contains the resources to be upgraded of the second system, the first system transmits the target boot loading firmware to the second system through the first data transmission channel, and triggers the second system to run the target boot loading firmware. Since the size of the target boot loading firmware is very small, the transmission time taken by the first system to transmit the target boot loading firmware to the second system through the first data transmission channel is very short; the target boot loading firmware can enable the second data transmission channel between the first system and the second system. Since the data transmission rate of the second data transmission channel is greater than the transmission rate of the first data transmission channel, the transmission time taken by the first system to transmit the resources to be upgraded to the second system through the second data transmission channel is shorter than the time taken to transmit the resources to be upgraded to the second system through the first data transmission channel. The first system transmits the target boot loading firmware to the second system through the first data transmission channel, and the second system runs the target boot loading firmware to enable the second data transmission channel. The total time taken by the first system to transmit the resources to be upgraded to the second system through the second data transmission channel is shorter than the time taken by the first system to transmit the resources to be upgraded to the second system through the first data transmission channel. Therefore, the resource transmission method proposed in this application can shorten the transmission time of the resources to be upgraded and improve the transmission efficiency of the resources to be upgraded, thereby improving the production efficiency of the production line, reducing the waiting time of users during the upgrade process, and improving the user experience.

[0079] Optionally, the first system transmits the target boot loader firmware to the second system through the first data transmission channel, including:

[0080] The first system sends a firmware erasing instruction to the second system;

[0081] The second system erases the historical boot-loaded firmware based on the firmware erase instruction;

[0082] When the historical boot loading firmware is completely erased, the first system transmits the target boot loading firmware to the second system through the first data transmission channel.

[0083] Optionally, the method further includes:

[0084] The first system sends a storage space configuration acquisition request to the second system;

[0085] The second system sends storage space configuration information to the first system, where the storage space configuration information is used to indicate the configuration of the storage space for storing the boot loading firmware;

[0086] When the historical boot loader firmware is completely erased, the first system transmits the target boot loader firmware to the second system through the first data transmission channel, including:

[0087] When the historical boot loading firmware is completely erased, the first system transmits the target boot loading firmware to the second system through the first data transmission channel based on the storage space configuration information.

[0088] Optionally, the first system sends a firmware erasing instruction to the second system, including:

[0089] In a case where the target boot-loaded firmware is different from the historical boot-loaded firmware, the first system sends a firmware erasing instruction to the second system;

[0090] The method further includes:

[0091] When the resources to be upgraded of the second system exist in the first storage space of the first system and the boot-loaded firmware is the same as the historical boot-loaded firmware, the first system triggers the second system to run the historical boot-loaded firmware.

[0092] Optionally, when the resources to be upgraded of the second system exist in the first storage space of the first system, the first system transmitting the boot loader firmware to the second system through the first data transmission channel includes:

[0093] When there are resources to be upgraded of the second system in the first storage space of the first system, the first system triggers a reset signal;

[0094] When the reset signal is detected, the second system sends a first handshake request to the first system;

[0095] The first system sends a first handshake response corresponding to the first handshake request to the second system;

[0096] The second system sends a confirmation response to the first handshake response to the first system;

[0097] When the confirmation response is received, the first system transmits the target boot loader firmware to the second system through the first data transmission channel.

[0098] Optionally, after the first system transmits the target boot loader firmware to the second system through the first data transmission channel, the method further includes:

[0099] When the target bootloader firmware is transferred, the second system sends a firmware transfer completion response to the first system;

[0100] The first system triggers the second system to run the target bootloader firmware, including:

[0101] Upon receiving the firmware transfer completion response, the first system triggers a reset signal;

[0102] When a reset signal is detected, the second system sends a first handshake request to the first system;

[0103] In the case of not receiving the first handshake response corresponding to the first handshake request, the second system runs the target bootloader firmware.

[0104] Optionally, the second system enables a second data transmission channel with the first system by running the target bootloader firmware, including:

[0105] The first system triggers an upgrade signal;

[0106] When the upgrade signal is detected, the second system initializes the second data transmission channel by running the target bootloader firmware;

[0107] The first system sends a second handshake request to the second system through the second data transmission channel;

[0108] The second system sends a second handshake response corresponding to the second handshake request to the first system through the second data transmission channel to enable the second data transmission channel;

[0109] The method further includes:

[0110] When the resource to be upgraded has completed transmission, the first system stops triggering the upgrade signal.

[0111] Optionally, the first system transmits the resources to be upgraded to the second system through the second data transmission channel, including:

[0112] The first system sends a version information acquisition request to the second system;

[0113] The second system returns the current resource version information to the first system;

[0114] When the current resource version information is inconsistent with the version information of the resource to be upgraded, the first system sends a resource transfer request to the second system through the second data transmission channel;

[0115] The second system sends a request response to the resource transfer request to the first system;

[0116] When the request response is received, the first system transmits the resource to be upgraded to the second system via the second data transmission channel.

[0117] Optionally, the resource transfer request includes storage partition information, where the storage partition information is used to indicate a partition storing resources to be upgraded.

[0118] The second system sends a request response to the resource transfer request to the first system, including:

[0119] The second system performs validity verification on the storage partition information included in the resource transfer request;

[0120] When the storage partition information passes the validity check, the second system sends a request response to the resource transfer request to the first system.

[0121] Optionally, the resource transfer request includes a target check value, which is generated by the first system based on the resource to be upgraded;

[0122] The method further includes:

[0123] In the process of receiving the resources to be upgraded transmitted by the first system, the second system performs a readback check on the written resources to obtain a readback check value;

[0124] When the resource to be upgraded is completely written, the second system performs write verification on the resource to be upgraded based on the readback verification value and the target verification value;

[0125] Based on the write verification result, an upgrade result response is sent to the first system through the second data transmission channel.

[0126] Optionally, the second storage space of the second system includes at least two storage subspaces, and the resource transfer request includes at least two resource transfer sub-requests for different types of resources;

[0127] The method further includes:

[0128] The second system loads the firmware by running the target bootloader, and determines the target storage subspace corresponding to the sub-resource to be upgraded based on the resource transfer sub-request;

[0129] The second system writes the sub-resource to be upgraded into the target storage sub-space.

[0130] Optionally, the second storage space of the second system includes Nor Flash and eMMC, Nor Flash is used to write firmware resources in the resources to be upgraded, and eMMC is used to write file resources in the resources to be upgraded.

[0131] Optionally, the resources to be upgraded are transmitted in the form of resource data packets, and the second system writes the resource data packets and receives the resource data packets in parallel.

[0132] Optionally, the first data transmission channel is a UART channel or a SWD channel, and the second data transmission channel is an SPI channel.

[0133] In some embodiments, when there are resources to be upgraded of the second system in the first storage space of the first system, the first system triggers a reset signal.

[0134] Optionally, the first system pulls the reset pin to trigger a reset signal.

[0135] When the reset signal is detected, the second system sends a first handshake request to the first system.

[0136] The first handshake request is used to request the first system to instruct the transmission of the target boot loader firmware (HS-bootloader.bin) or to instruct the second system to run the target boot loader firmware.

[0137] In some embodiments, when the to-be-upgraded resources of the second system are upgraded, the first system does not respond to the first handshake request to instruct the second system to run the target boot loader firmware.

[0138] In some embodiments, when the resources to be upgraded in the second system have not been upgraded, the first system sends a first handshake response corresponding to the first handshake request to the second system.

[0139] The second system sends an acknowledgment response to the first handshake response to the first system.

[0140] When the confirmation response is received, the first system transmits the target boot loader firmware to the second system through the first data transmission channel.

[0141] 5 , which is a timing diagram of a first system transmitting a target boot loader firmware to a second system through a first data transmission channel according to an exemplary embodiment of the present application.

[0142] Among them, steps 5.1 to 5.2.3 are the process of the first handshake between the first system and the second system.

[0143] Step 5.1: When there are resources to be upgraded of the second system in the first storage space of the first system, the first system pulls the reset pin to trigger a reset signal.

[0144] Step 5.2.1: When a reset signal is detected, the second system sends a first handshake request to the first system.

[0145] Step 5.2.2: When the target boot loader firmware is not transmitted to the second system, the first system sends a first handshake response corresponding to the first handshake request to the second system.

[0146] In a case where the target bootloader firmware is transferred to the second system, the first system does not send a first handshake response to the second system.

[0147] In the case of not receiving the first handshake response corresponding to the first handshake request, the second system runs the target bootloader firmware.

[0148] Step 5.2.3: The second system sends a confirmation response to the first handshake response to the first system.

[0149] In some embodiments, before transmitting the target bootloader firmware to the second system, the first system may first transmit a program for assisting in downloading the target bootloader firmware, such as progarmmer.bin, to the second system through the first data transmission channel for subsequent assisting in downloading HS-bootloader.bin.

[0150] Among them, steps 5.3.1 to 5.3.3 are the process of transferring progarmmer.bin.

[0151] Step 5.3.1: The first system transmits programmmer.bin to the second system through the first data channel.

[0152] Optionally, after receiving progarmmer.bin, the second system writes progarmmer.bin into a RAM (Random Access Memory) of the second system.

[0153] In step 5.3.2, the second system returns a transmission success response of progarmmer.bin to the first system through the first data channel.

[0154] Step 5.3.3: The first system sends an instruction requesting execution of programmer.bin to the second system through the first data channel.

[0155] The second system jumps to and executes programmer.bin based on the received instruction.

[0156] After the second system executes progarmmer.bin for assisting in downloading the target boot loading firmware, the first system may notify the second system to erase the historical boot loading firmware to write the current new target boot loading firmware.

[0157] Among them, steps 5.4.1 to 5.4.4 are the process of erasing the historical boot loading firmware.

[0158] Step 5.4.1: The first system sends a storage space configuration acquisition request to the second system through the first data transmission channel.

[0159] The storage space configuration information is used to indicate the configuration of the storage space for storing the boot loading firmware.

[0160] Optionally, the storage space configuration information may include storage partition information for storing the boot-loading firmware of the second system. For example, the storage space configuration information includes the Nor Flash ID being 2, indicating that the second system stores the boot-loading firmware in the second storage partition in the Nor Flash.

[0161] Optionally, the storage space configuration information may further include a data alignment mode for the bootloader firmware. The data alignment mode indicates that the bootloader firmware performs data alignment according to a target number of bits during transmission and storage, for example, 4 bits or 8 bits.

[0162] Step 5.4.2: The second system returns the storage space configuration information to the first system through the first data transmission channel.

[0163] For example, the second system returns the storage partition information Nor Flash ID of 2 for booting and loading firmware to the first system.

[0164] In step 5.4.3, the first system sends a firmware erasing instruction to the second system through the first data transmission channel to notify the second system to erase the historical boot-loaded firmware in the storage partition.

[0165] In one possible scenario, during the last transmission of the resource to be upgraded, historical boot loading firmware has been stored in the storage partition of the second system. Therefore, the second system needs to erase the historical boot loading firmware so that the target boot loading firmware corresponding to the resource to be upgraded can be written into the storage partition later.

[0166] The second system erases the historical boot loading firmware based on the firmware erase instruction.

[0167] For example, the second system performs a firmware erasing operation on the storage partition corresponding to the storage partition information Nor Flash ID being 2, so as to erase the historical boot loading firmware.

[0168] Step 5.4.4: When the historical boot loader firmware is completely erased, the second system returns an erase completion response to the first system via the first data transmission channel.

[0169] When the historical boot loading firmware is completely erased, the first system transmits the target boot loading firmware to the second system through the first data transmission channel.

[0170] Steps 5.5.1 to 5.5.2 are the process of bootloading the firmware on the transfer target.

[0171] Step 5.5.1: The first system transmits the target bootloader firmware (HS-bootloader.bin) to the second system through the first data transmission channel.

[0172] When the historical boot loading firmware is completely erased, the first system transmits the target boot loading firmware to the second system through the first data transmission channel based on the storage space configuration information.

[0173] Optionally, when the storage space configuration information includes a data alignment mode of the target boot loading firmware, the first system transmits the target boot loading firmware according to the data alignment mode, and the second system writes the target boot loading firmware according to the data alignment mode.

[0174] The second system writes the target boot loading firmware into the storage partition corresponding to the storage partition information, for example, writing the target boot loading firmware into the storage partition corresponding to the Nor Flash ID 2.

[0175] Step 5.5.2: When the target bootloader firmware is transferred successfully, the second system sends a firmware transfer completion response to the first system.

[0176] The firmware transfer completion response indicates that the transfer of HS-bootloader.bin is complete.

[0177] Step 5.6: Upon receiving the firmware transfer completion response, the first system triggers a reset signal.

[0178] Optionally, the first system pulls the reset pin again to trigger the reset signal.

[0179] When the second system detects the reset signal again, it sends the first handshake request to the first system again. If the second system does not receive the first handshake response corresponding to the first handshake request, it runs the target boot loading firmware.

[0180] In this embodiment, when the target boot loading firmware is not transmitted from the first system to the second system, the first system transmits programmer.bin to the second system to assist in downloading the target boot loading firmware; the first system sends a firmware erase instruction to the second system to erase the historical boot loading firmware and write the new target boot loading firmware; when the target boot loading firmware is transmitted from the first system to the second system, the second system executes the target boot loading firmware and enables the second data transmission channel for subsequent high-speed transmission of resources to be upgraded.

[0181] In some embodiments, the first system may determine whether the historical boot loading firmware and the target boot loading firmware are identical. If they are identical, the step of transmitting the target boot loading firmware is omitted, thereby further improving resource transmission efficiency.

[0182] 6, which is a flowchart of an exemplary embodiment of the present application, wherein the first system triggers the second system to run the boot-loading firmware. The first system triggers the second system to run the boot-loading firmware, including the following steps.

[0183] Step 610 : When there are resources to be updated of the second system in the first storage space of the first system, the first system determines whether the target boot loading firmware corresponding to the resources to be upgraded is the same as the historical boot loading firmware.

[0184] In some embodiments, the first system may first determine whether the file sizes of the target boot loading firmware and the historical boot loading firmware are the same; if the file sizes are the same, then determine whether the file contents are the same to improve determination efficiency.

[0185] Regarding the specific method for the first system to determine whether the file contents of the target boot loading firmware and the historical boot loading firmware are the same, in one possible implementation method, the update probabilities corresponding to different file areas in the boot loading firmware can be set in advance in the first system. The first system compares the file contents of the target boot loading firmware and the historical boot loading firmware one by one in order of update probability from high to low to determine whether the target boot loading firmware and the historical boot loading firmware are the same, thereby further improving the efficiency of the judgment.

[0186] Step 621: When the target boot-loaded firmware is different from the historical boot-loaded firmware, the first system sends a firmware erasing instruction to the second system.

[0187] Step 622: The second system erases the historical boot-loaded firmware based on the firmware erase instruction.

[0188] Step 623: When the historical boot loader firmware is completely erased, the first system transmits the target boot loader firmware to the second system through the first data transmission channel.

[0189] Step 624: The first system triggers the second system to run the target boot loader firmware.

[0190] Step 631 : When the boot-loaded firmware is the same as the historical boot-loaded firmware, the first system triggers the second system to run the historical boot-loaded firmware.

[0191] Step 640: The second system enables a second data transmission channel with the first system by running the bootloader firmware, where the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel.

[0192] Wherein, when step 624 is executed, the boot loading firmware is the target boot loading firmware; when step 631 is executed, the boot loading firmware is the historical boot loading firmware.

[0193] Step 650: The first system transmits the resources to be upgraded to the second system through the second data transmission channel.

[0194] In this embodiment, the first system compares the target boot loading firmware and the historical boot loading firmware. When the target boot loading firmware and the historical boot loading firmware are the same, the second system directly runs the historical boot loading firmware, thereby eliminating the steps of the first system transmitting the target boot loading firmware through the first data transmission channel, the second system erasing the historical boot loading firmware, and then writing the boot loading firmware into the storage space, thereby improving the efficiency of the resource transmission process.

[0195] 7 , which is a timing diagram of a first system transmitting resources to be upgraded to a second system through a second data transmission channel, provided by an exemplary embodiment of the present application.

[0196] Among them, steps 7.1.1 to 7.1.4 are the process of the first system and the second system performing the second handshake.

[0197] Step 7.1.1: The first system triggers an upgrade signal, wherein the upgrade signal is used to indicate a transmission demand for resources to be upgraded.

[0198] Exemplarily, the first system triggers the upgrade signal by pulling the reset pin and pulling the upgrade request pin high.

[0199] Step 7.1.2: When the upgrade signal is detected, the second system initializes the second data transmission channel by running the target bootloader firmware.

[0200] Exemplarily, when the second system detects that the upgrade request pin is at a high level, the second data transmission channel is initialized.

[0201] Step 7.1.3: The first system sends a second handshake request to the second system through the second data transmission channel.

[0202] The second handshake request is used to request transmission of the resource to be upgraded through the second data transmission channel.

[0203] Step 7.1.4: The second system sends a second handshake response corresponding to the second handshake request to the first system through the second data transmission channel to enable the second data transmission channel.

[0204] In some embodiments, the first system may read version information corresponding to each resource to be upgraded from the second system, and determine whether to transmit each resource to be upgraded to the second system based on the version information.

[0205] Step 7.2.1: The first system sends a version information acquisition request to the second system.

[0206] The version information acquisition request is used to obtain version information corresponding to the resource to be upgraded, such as the version number.

[0207] Optionally, the first system sends a version information acquisition request to the second system through the first data transmission channel or the second data transmission channel.

[0208] Step 7.2.2: The second system returns the current resource version information to the first system.

[0209] The current resource version information refers to the version information of the resource corresponding to the resource to be upgraded stored in the second storage space of the second system. For example, the version number corresponding to the resource to be upgraded is version 2.0, and the current resource version information is version 1.0.

[0210] Optionally, the second system returns version information to the first system through the first data transmission channel or the second data transmission channel.

[0211] When the current resource version information is consistent with the version information of the resource to be upgraded, the first system stops transmitting the resource to be upgraded to the second system and stops triggering the upgrade signal, to indicate that the resource upgrade is completed.

[0212] When the current resource version information is inconsistent with the version information of the resource to be upgraded, the first system sends a resource transmission request to the second system through the second data transmission channel.

[0213] The second system sends a request response to the resource transfer request to the first system.

[0214] When the request response is received, the first system transmits the resource to be upgraded to the second system via the second data transmission channel.

[0215] Different types of resources to be upgraded correspond to different types of resource transfer requests. In some embodiments, the resource transfer request includes at least two resource transfer sub-requests for different types of resources.

[0216] For example, if the resource to be upgraded is a file image, the corresponding resource transfer sub-request is a file image transfer sub-request; if the resource to be upgraded is application firmware, the corresponding resource transfer request is an application firmware transfer sub-request.

[0217] To store different types of resources to be upgraded, in some embodiments, the second storage space of the second system includes at least two storage subspaces. The second system, through the running target bootloader firmware, determines the target storage subspace corresponding to the sub-resource to be upgraded based on the resource transfer sub-request, and writes the sub-resource to be upgraded into the target storage subspace.

[0218] For example only, when the resource transfer sub-request is a file resource transfer sub-request, the second system determines that the target storage subspace is eMMC by running the target boot loading firmware; when the resource transfer sub-request is a firmware resource transfer sub-request, the second system determines that the target storage subspace is Nor Flash by running the target boot loading firmware.

[0219] Steps 7.3.1 to 7.3.8 are the process of transmitting file resources from the first system to the second system through the second data transmission channel.

[0220] In step 7.3.1, the first system sends a file resource transfer sub-request to the second system via the second data transmission channel, wherein the file resource transfer sub-request is used to request the transfer of file resources to the second system.

[0221] In some embodiments, the resource transfer request includes storage partition information, where the storage partition information is used to indicate a partition storing the resource to be upgraded.

[0222] For example only, the file resource transfer sub-request includes the storage partition information Nor Flash ID of 3, indicating that the partition where the second system stores the file resource is the third storage partition in Nor Flash.

[0223] In some embodiments, the resource transfer request further includes a target check value.

[0224] The target check value is generated by the first system based on the resource to be upgraded, and is used to compare with the readback check value during the resource writing process to ensure the accuracy of the resource writing.

[0225] Optionally, the target check value is a parity check value, or other types of check values.

[0226] In step 7.3.2, the second system performs a validity check on the storage partition information included in the resource transfer request and records a target check value.

[0227] In a possible implementation, the second system compares the storage partition information with information corresponding to each storage partition in the second storage space one by one to determine the validity of the storage partition.

[0228] For example only, if the storage partition information eMMC ID is 3, and the eMMC of the second storage space has a storage partition numbered 3, then the storage partition information is valid; if the storage partition information eMMC ID is 999, and the eMMC of the second storage space does not have a storage partition numbered 999, then the storage partition information is not valid.

[0229] Exemplarily, the resource transfer request further includes a target check value of 0, and the second system records the target check value of 0.

[0230] Step 7.3.3: When the storage partition information passes the validity check, the second system sends a request response to the resource transfer request to the first system.

[0231] Step 7.3.4: Upon receiving the request response, the first system transmits the file resource to the second system through the second data transmission channel.

[0232] Step 7.3.5: During the process of receiving the resources to be upgraded transmitted by the first system, the second system performs a readback check on the written resources to obtain a readback check value.

[0233] In some embodiments, when receiving the first file resource package corresponding to the file resource transmitted by the first system, the second system writes the first file resource package to the storage partition numbered 3 in the eMMC, and immediately performs a readback check on the first file resource package to obtain a readback check value corresponding to the first file resource package (assumed to be 1).

[0234] In some embodiments, the readback check value corresponding to the first file resource package is generated by the second system based on the first file resource package.

[0235] When receiving the second file resource package corresponding to the file resource transmitted by the first system, the second system writes the second file resource package to the storage partition numbered 3 in the eMMC, and immediately performs a readback check on the second file resource package to obtain the readback check value corresponding to the second file resource package (assuming it is 2).

[0236] In some embodiments, the readback check value corresponding to the second file resource package is generated by the second system based on the second file resource package and the readback check value corresponding to the first file resource package.

[0237] …

[0238] When receiving the last file resource package corresponding to the file resource transmitted by the first system, the second system writes the last file resource package to the storage partition numbered 3 in the eMMC, and immediately performs a readback check on the last file resource package to obtain the readback check value corresponding to the last file resource package (assuming it is 0).

[0239] When the resource to be upgraded is completely written, the second system performs a write verification on the resource to be upgraded based on the readback verification value and the target verification value to obtain a write verification result.

[0240] In some embodiments, when the readback verification value is consistent with the target verification value, the second system determines that the write verification result is a correct write.

[0241] Step 7.3.6: Upon receiving the file resource sent by the first system through the second data transmission channel, the second system sends a transmission result response to the first system through the second data transmission channel.

[0242] Optionally, for each file resource package, the second system sends a transmission result response corresponding to the file resource package to the first system.

[0243] Optionally, the second system only replies with the transmission result response corresponding to some file resource packages to reduce the amount of data transmission. For example, the second system may only reply with the transmission result response corresponding to the last file resource package.

[0244] Step 7.3.7: When the file resource transfer is completed, the first system sends a file resource upgrade result reading request to the second system.

[0245] In step 7.3.8, the second system sends the file resource upgrade result to the first system through the second data transmission channel based on the write verification result of the file resource.

[0246] In some embodiments, when the write verification result indicates that the writing is correct, the second system sends a file resource upgrade result indicating that the upgrade is successful to the first system through the second data transmission channel.

[0247] In some embodiments, if the write verification result is not correct, the second system sends a file resource upgrade result indicating an upgrade failure to the first system via the second data transmission channel to instruct the first system to retransmit the resource to be upgraded via the second data transmission channel.

[0248] In this embodiment, in the process of receiving the resources to be upgraded transmitted by the first system, the second system performs a readback check on the written resources to obtain a readback check value. When the resources to be upgraded are completely written, the second system determines the write check result based on the readback check value and the target check value. On the one hand, it can ensure the correctness of the writing and improve the upgrade quality of the resources to be upgraded; on the other hand, checking while writing can save the readback check time. When the transmission is completed, the readback check can be completed as soon as possible, thereby improving the efficiency of resource transmission.

[0249] Steps 7.4.1 to 7.4.8 are the process of the first system transmitting firmware resources to the second system through the second data transmission channel.

[0250] In step 7.4.1, the first system sends a firmware resource transmission sub-request to the second system via the second data transmission channel, wherein the firmware resource transmission sub-request is used to request the transmission of firmware resources to the second system.

[0251] It should be noted that the firmware resource refers to the application firmware to be upgraded, not the HS-bootloader firmware that enables the second data transmission channel.

[0252] Exemplarily, the firmware resources include m55.bin, SensorHub.bin, etc. Among them, SensorHub.bin is the application firmware corresponding to the sensor management component.

[0253] In some embodiments, the resource transfer request includes storage partition information, where the storage partition information is used to indicate a partition storing the resource to be upgraded.

[0254] For example only, the firmware resource transfer sub-request includes the storage partition information Nor Flash ID of 5, indicating that the partition where the second system stores the file resource is the 5th storage partition in Nor Flash.

[0255] In some embodiments, the firmware resource transfer sub-request also includes a target check value corresponding to the storage partition.

[0256] In step 7.4.2, the second system erases the old firmware according to the storage partition information included in the firmware resource transfer sub-request.

[0257] For example only, the second system erases the old firmware from the fifth storage partition in the Nor Flash.

[0258] Step 7.4.3: The second system sends a request response to the firmware resource transfer sub-request to the first system.

[0259] Step 7.4.4: Upon receiving the request response, the first system transmits the firmware resource to the second system through the second data transmission channel.

[0260] Step 7.4.5: During the process of receiving the resource to be upgraded, the second system performs a readback check to obtain a readback check value; and determines a write check result based on the target check value and the readback check value.

[0261] The process of reading back and verifying firmware resources is similar to that of reading back and verifying file resources. For more information about read back and verifying, please refer to step 5.3.5 and will not be repeated here.

[0262] Step 7.4.6: Upon receiving the firmware resource sent by the first system through the second data transmission channel, the second system sends a transmission result response to the first system through the second data transmission channel.

[0263] Optionally, for each firmware resource package, the second system sends a transmission result response corresponding to the firmware resource package to the first system.

[0264] Optionally, the second system only replies with the transmission result response corresponding to some firmware resource packages to reduce the amount of data transmission. For example, the second system may only reply with the transmission result response corresponding to the last firmware resource package.

[0265] Step 7.4.7: When the firmware resource transmission is completed, the first system sends a firmware resource upgrade result reading request to the second system.

[0266] Step 7.4.8: The second system sends the firmware resource upgrade result to the first system through the second data transmission channel based on the write verification result of the firmware resource.

[0267] Step 7.5: When the resources to be upgraded have completed transmission, the first system stops triggering the upgrade signal.

[0268] Optionally, when the resource upgrade results of all resources to be upgraded are successful, the first system pulls the reset pin again and pulls down the upgrade request pin to stop triggering the upgrade signal.

[0269] Refer to FIG8 , which is a schematic diagram of a dual-core dual system provided by another exemplary embodiment of the present application.

[0270] As shown in FIG8 , the target boot loader firmware can be transmitted between the first system 810 and the second system 820 via a first data transmission channel 831. When the transmission of the target boot loader firmware is complete, the target boot loader firmware enables a second data transmission channel 832, and the first system 810 transmits the resources to be upgraded to the second system 820 via the second data transmission channel 832.

[0271] In addition, the first processor corresponding to the first system 810 and the second processor corresponding to the second system 820 are connected via a reset pin 841 and an upgrade request pin 842. The first storage space of the first system 810 includes eMMC-1 (811); the second storage space of the second system 820 includes eMMC-2 (821) and Nor Flash (822).

[0272] Refer to FIG9 , which is a two-stage schematic diagram of a resource transmission method provided by an exemplary embodiment of the present application.

[0273] As shown in Figure 9, the resource transmission method proposed in this application includes two data transmission phases, wherein the first phase 901 is the MCU-Boot phase. In the first phase, the first system and the second system transmit the HS-bootloader through the first data transmission channel.

[0274] The first stage 901 includes a first sub-stage 911 , in which the second system downloads the HS-bootloader to the second storage space via the first data transmission channel.

[0275] In some embodiments, the first data transmission channel is a UART channel or a SWD channel.

[0276] In some embodiments, the second storage space of the second system includes Nor Flash and eMMC-2, and the second system stores the HS-bootloader in Nor Flash.

[0277] Among them, HS-bootloader is the target boot loader firmware. The second system enables a second data transmission channel with the first system by running the target boot loader firmware, and the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel.

[0278] The second stage 902 is the HS-bootloader stage. In the second stage, the first system and the second system transmit the resources to be upgraded via the second data transmission channel.

[0279] In some embodiments, the second data transmission channel is an SPI channel.

[0280] In some embodiments, the second system determines the target storage subspace corresponding to the sub-resource to be upgraded based on the resource transfer sub-request by running the target bootloader firmware, and writes the sub-resource to be upgraded into the target storage subspace.

[0281] The target storage subspace includes Nor Flash and eMMC, wherein Nor Flash is used to write firmware resources in the resources to be upgraded, and eMMC (referring to eMMC-2) is used to write file resources in the resources to be upgraded.

[0282] The second stage 902 includes a second sub-stage 921 and a third sub-stage 922 .

[0283] In the second sub-phase 921 , the second system downloads the firmware resource to the Nor Flash through the second data transmission channel.

[0284] In the third sub-stage 922 , the second system downloads the file resource to the eMMC through the second data transmission channel.

[0285] Among them, the second sub-stage 921 and the third sub-stage 922 do not have a sequential execution order. The first system can choose to download the firmware resources first or download the file resources first as needed. The embodiment of the present application does not limit this.

[0286] In one possible implementation, the first system may obtain the priorities corresponding to different resource types of resources to be upgraded, and give priority to transmitting data corresponding to resource types with higher priorities. The priority may be determined based on historical resource transmission records. For example, the first system may obtain historical resource transmission records in which the transmission time is less than a duration threshold, and calculate the first average duration for completing all resource transmissions in the historical resource transmission records for priority transmission of file resources, and the second average duration for completing all resource transmissions in the historical resource transmission records for priority transmission of firmware resources; when the first average duration is greater than the second average duration, it is determined that the priority of the firmware resource is higher than the priority of the file resource; and when the first average duration is less than the second average duration, it is determined that the priority of the file resource is higher than the priority of the firmware resource.

[0287] Referring to FIG. 10 , FIG. 10 is a schematic diagram showing that writing a resource data packet and receiving a resource data packet are executed in parallel by a second system according to an exemplary embodiment of the present application.

[0288] The resources to be upgraded are transmitted in the form of resource data packets. The first system transmits resource data packet X-1, resource data packet X, resource data packet X+1, etc. to the second system in sequence through the second data transmission channel.

[0289] The second system writes the resource data packet and receives the resource data packet in parallel.

[0290] As shown in Figure 10, the second system writes resource data packet X-1 in parallel with receiving resource data packet X, writes resource data packet X in parallel with receiving resource data packet X+1, and writes resource data packet X+1 in parallel with receiving resource data packet X+2. That is, the second system writes the previous resource data packet while receiving the current resource data packet.

[0291] Since writing resource data packets and receiving resource data packets are the two most time-consuming steps in the upgrade process of the resources to be upgraded, the resource upgrade time can be shortened and the resource upgrade efficiency can be improved by executing the writing resource data packets and receiving resource data packets in parallel.

[0292] See Figure 11, which is a block diagram of a resource transmission device provided by an exemplary embodiment of the present application. The device includes:

[0293] The first system module 1101 is configured to transmit a target boot loader firmware to the second system through a first data transmission channel when resources to be upgraded of the second system exist in the first storage space of the first system;

[0294] The first system module 1101 is further configured to trigger the second system to run the target boot loader firmware;

[0295] The second system module 1102 is configured to enable a second data transmission channel with the first system by running the target boot loader firmware, wherein the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel;

[0296] The first system module 1101 is further configured to transmit the resources to be upgraded to the second system through the second data transmission channel.

[0297] Optionally, the first system module 1101 is configured to:

[0298] sending a firmware erasing instruction to the second system;

[0299] The second system module 1102 is further configured to erase the historical boot loading firmware based on the firmware erase instruction;

[0300] When the historical boot loader firmware is completely erased, the first system module 1101 is further configured to transmit the target boot loader firmware to the second system through the first data transmission channel.

[0301] Optionally, the first system module 1101 is configured to:

[0302] Sending a storage space configuration acquisition request to the second system;

[0303] The second system module 1102 is further configured to send storage space configuration information to the first system, where the storage space configuration information is used to indicate a configuration of a storage space for storing boot loading firmware;

[0304] The first system module 1101 is further configured to transmit the target boot loader firmware to the second system through the first data transmission channel based on the storage space configuration information when the historical boot loader firmware is completely erased.

[0305] Optionally, the first system module 1101 is configured to:

[0306] In a case where the target boot loading firmware is different from the historical boot loading firmware, sending the firmware erasing instruction to the second system;

[0307] If the resources to be upgraded of the second system exist in the first storage space of the first system and the boot loading firmware is the same as the historical boot loading firmware, the second system is triggered to run the historical boot loading firmware.

[0308] Optionally, the first system module 1101 is configured to:

[0309] triggering a reset signal when there are resources to be upgraded of the second system in the first storage space of the first system;

[0310] The second system module 1102 is further configured to send a first handshake request to the first system when the reset signal is detected;

[0311] The first system module 1101 is further configured to send a first handshake response corresponding to the first handshake request to the second system;

[0312] The second system module 1102 is further configured to send a confirmation response to the first handshake response to the first system;

[0313] The first system module 1101 is further configured to transmit the target boot loading firmware to the second system through the first data transmission channel when the confirmation response is received.

[0314] Optionally, the second system module 1102 is configured to:

[0315] When the target bootloader firmware is transferred successfully, sending a firmware transfer completion response to the first system;

[0316] The first system module 1101 is further configured to trigger the reset signal upon receiving the firmware transmission completion response;

[0317] The second system module 1102 is further configured to send a first handshake request to the first system when the reset signal is detected;

[0318] In a case where the first handshake response corresponding to the first handshake request is not received, the target bootloader firmware is executed.

[0319] Optionally, the first system module 1101 is configured to:

[0320] Trigger upgrade signal;

[0321] The second system module 1102 is further configured to initialize the second data transmission channel by running the target boot loader firmware when the upgrade signal is detected;

[0322] The first system module 1101 is further configured to send a second handshake request to the second system through the second data transmission channel;

[0323] The second system module 1102 is further configured to send a second handshake response corresponding to the second handshake request to the first system through the second data transmission channel, so as to enable the second data transmission channel;

[0324] The first system module 1101 is further configured to stop triggering the upgrade signal when the transmission of the resource to be upgraded is completed.

[0325] Optionally, the first system module 1101 is configured to:

[0326] Sending a version information acquisition request to the second system;

[0327] The second system module 1102 is further configured to return current resource version information to the first system;

[0328] The first system module 1101 is further configured to send a resource transfer request to the second system through the second data transmission channel when the current resource version information is inconsistent with the version information of the resource to be upgraded;

[0329] The second system module 1102 is further configured to send a request response to the resource transfer request to the first system;

[0330] The first system module 1101 is further configured to transmit the resource to be upgraded to the second system through the second data transmission channel upon receiving the request response.

[0331] Optionally, the resource transfer request includes storage partition information, where the storage partition information is used to indicate a partition storing the resource to be upgraded. The second system module 1102 is configured to:

[0332] Performing validity verification on the storage partition information included in the resource transfer request;

[0333] In a case where the storage partition information passes the validity check, the request response to the resource transfer request is sent to the first system.

[0334] Optionally, the resource transfer request includes a target check value, where the target check value is generated by the first system based on the resource to be upgraded. The second system module 1102 is configured to:

[0335] In the process of receiving the resource to be upgraded transmitted by the first system, performing a readback check on the written resource to obtain a readback check value;

[0336] When the resource to be upgraded is completely written, performing a write check on the resource to be upgraded based on the readback check value and the target check value;

[0337] Based on the write verification result, an upgrade result response is sent to the first system through the second data transmission channel.

[0338] Optionally, the second storage space of the second system includes at least two storage subspaces, and the resource transfer request includes at least two resource transfer sub-requests for different types of resources; the second system module 1102 is configured to:

[0339] Determining, by running the target bootloader firmware, a target storage subspace corresponding to the sub-resource to be upgraded based on the resource transfer sub-request;

[0340] The sub-resource to be upgraded is written into the target storage sub-space.

[0341] Optionally, the second storage space of the second system includes Nor Flash and eMMC, the Nor Flash is used to write firmware resources in the resources to be upgraded, and the eMMC is used to write file resources in the resources to be upgraded.

[0342] Optionally, the resource to be upgraded is transmitted in the form of a resource data packet, and the second system writes the resource data packet and receives the resource data packet in parallel.

[0343] Optionally, the first data transmission channel is a UART channel or a SWD channel, and the second data transmission channel is an SPI channel.

[0344] Please refer to Figure 12, which is a block diagram of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the present application may include one or more of the following components: a processor 1210 and a memory 1220.

[0345] Optionally, the processor 1210 includes at least a first processor 1211 and a second processor 1212, wherein the first processor 1211 is configured to run the first system and the second processor 1212 is configured to run the second system. In some embodiments, the power consumption of the first processor 1211 is lower than that of the second processor 1212, and the performance of the first processor 1211 is lower than that of the second processor 1212. In other embodiments, the power consumption of the first processor 1211 is higher than that of the second processor 1212, and the performance of the first processor 1211 is higher than that of the second processor 1212. The processor 1210 utilizes various interfaces and circuits to connect various components within the entire electronic device. It executes instructions, programs, code sets, or instruction sets stored in the memory 1220 and accesses data stored in the memory 1220 to perform various functions of the electronic device and process data. Optionally, the processor 1210 may be implemented in hardware using at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1210 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processing unit (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 1210, but may be implemented separately through a chip.

[0346] The memory 1220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 1220 includes a non-transitory computer-readable storage medium. The memory 1220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book), etc.

[0347] The electronic device in the embodiment of the present application further includes a communication component 1230 and a display component 1240. The communication component 1230 may be a Bluetooth component, a WiFi (Wireless Fidelity) component, an NFC (Near Field Communication) component, or the like, and is configured to communicate with an external device (server or other terminal device) via a wired or wireless network; the display component 1240 is configured to display a graphical user interface and / or receive user interaction operations.

[0348] In addition, those skilled in the art will understand that the structures of the electronic devices shown in the above figures do not limit the electronic devices. The electronic devices may include more or fewer components than shown, or may combine certain components or arrange the components differently. For example, the electronic devices may also include radio frequency circuits, input units, sensors, audio circuits, speakers, microphones, power supplies, and other components, which will not be described in detail here.

[0349] An embodiment of the present application further provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the resource transmission method described in any of the above embodiments.

[0350] Optionally, the computer-readable storage medium may include: ROM, RAM, solid state drives (SSDs) or optical disks, etc. Among them, RAM may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM).

[0351] An embodiment of the present application also provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes to implement the resource transmission method described in any of the above embodiments.

[0352] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A resource transmission method, which is applied to an electronic device that supports running a first system and a second system; The method includes: When there is an upgrade resource of the second system in the first storage space of the first system, the first system transmits a target bootloader firmware to the second system through a first data transmission channel; The first system triggers the second system to run the target bootloader firmware; By running the target bootloader firmware, the second system enables a second data transmission channel with the first system, and the data transmission rate of the second data transmission channel is greater than that of the first data transmission channel; The first system transmits the upgrade resource to the second system through the second data transmission channel.

2. The method according to claim 1, wherein, The first system transmits the target bootloader firmware to the second system through the first data transmission channel, including: The first system sends a firmware erase instruction to the second system; Based on the firmware erase instruction, the second system erases the historical bootloader firmware; When the historical bootloader firmware is erased, the first system transmits the target bootloader firmware to the second system through the first data transmission channel.

3. The method according to claim 2, wherein The method further includes: The first system sends a storage space configuration acquisition request to the second system; The second system sends storage space configuration information to the first system, and the storage space configuration information is used to indicate the configuration of the storage space for storing the bootloader firmware; When the historical bootloader firmware is erased, the first system transmits the target bootloader firmware to the second system through the first data transmission channel, including: When the historical bootloader firmware is erased, the first system transmits the target bootloader firmware to the second system through the first data transmission channel based on the storage space configuration information.

4. The method according to claim 2, wherein The first system sends a firmware erase instruction to the second system, including: When the target bootloader firmware is different from the historical bootloader firmware, the first system sends the firmware erase instruction to the second system; The method further includes: When there is an upgrade resource of the second system in the first storage space of the first system and the bootloader firmware is the same as the historical bootloader firmware, the first system triggers the second system to run the historical bootloader firmware.

5. The method according to claim 1, wherein When there is an upgrade resource of the second system in the first storage space of the first system, the first system transmits the bootloader firmware to the second system through the first data transmission channel, including: When there is an upgrade resource of the second system in the first storage space of the first system, the first system triggers a reset signal; When the reset signal is detected, the second system sends a first handshake request to the first system; The first system sends a first handshake response corresponding to the first handshake request to the second system. The second system sends an acknowledgment response to the first system for the first handshake response; Upon receiving the acknowledgment response, the first system transmits the target bootloader firmware to the second system through the first data transmission channel.

6. The method according to claim 5, wherein After the first system transmits the target bootloader firmware to the second system through the first data transmission channel, the method further includes: Upon completion of the transmission of the target bootloader firmware, the second system sends a firmware transmission completion response to the first system; The first system triggers the second system to run the target bootloader firmware, including: Upon receiving the firmware transmission completion response, the first system triggers the reset signal; Upon detecting the reset signal, the second system sends a first handshake request to the first system; In the case where the first handshake response corresponding to the first handshake request is not received, the second system runs the target bootloader firmware.

7. The method according to claim 1, wherein, The second system enables the second data transmission channel with the first system by running the target bootloader firmware, including: The first system triggers an upgrade signal; Upon detecting the upgrade signal, the second system initializes the second data transmission channel by running the target bootloader firmware; The first system sends a second handshake request to the second system through the second data transmission channel; The second system sends the second handshake response corresponding to the second handshake request to the first system through the second data transmission channel to enable the second data transmission channel; The method further includes: Upon completion of the transmission of the resource to be upgraded, the first system stops triggering the upgrade signal.

8. The method according to claim 1, wherein The first system transmits the resource to be upgraded to the second system through the second data transmission channel, including: The first system sends a version information acquisition request to the second system; The second system returns the current resource version information to the first system; In the case where the current resource version information is inconsistent with the version information of the resource to be upgraded, the first system sends a resource transmission request to the second system through the second data transmission channel; The second system sends a request response to the resource transmission request to the first system; Upon receiving the request response, the first system transmits the resource to be upgraded to the second system through the second data transmission channel.

9. The method according to claim 8, wherein The resource transmission request contains storage partition information, and the storage partition information is used to indicate the partition for storing the resource to be upgraded; The second system sends a request response to the resource transmission request to the first system, including: The second system performs a validity check on the storage partition information included in the resource transmission request; In the case where the storage partition information passes the validity check, the second system sends the request response to the resource transmission request to the first system.

10. The method according to claim 8, wherein, The resource transfer request includes a target verification value, which is generated by the first system based on the resource to be upgraded; The method further includes: During the process of receiving the resource to be upgraded transmitted by the first system, the second system performs a read-back verification on the written resource to obtain a read-back verification value; When the resource to be upgraded is completely written, the second system performs a write verification on the written resource to be upgraded based on the read-back verification value and the target verification value; Based on the write verification result, an upgrade result response is sent to the first system through the second data transmission channel.

11. The method according to claim 8, wherein, The second storage space of the second system includes at least two storage sub-spaces, and the resource transfer request includes at least two resource transfer sub-requests for different types of resources; The method further includes: The second system determines the target storage sub-space corresponding to the sub-resource to be upgraded based on the resource transfer sub-request through the running target bootloader firmware; The second system writes the sub-resource to be upgraded into the target storage sub-space.

12. The method according to claim 11, wherein The second storage space of the second system includes Nor Flash and eMMC. The Nor Flash is used to write the firmware resources in the resource to be upgraded, and the eMMC is used to write the file resources in the resource to be upgraded.

13. The method according to claim 1, wherein, The resource to be upgraded is transmitted in the form of a resource data packet, and the second system writes the resource data packet and receives the resource data packet in parallel.

14. The method according to claim 1, wherein The first data transmission channel is a UART channel or an SWD channel, and the second data transmission channel is an SPI channel.

15. A resource transfer device, which is used for an electronic device that supports running a first system and a second system; The device includes: A first system module, which is used to transmit a target bootloader firmware to the second system through a first data transmission channel when there is a resource to be upgraded of the second system in the first storage space of the first system; The first system module is further used to trigger the second system to run the target bootloader firmware; A second system module, which is used to enable a second data transmission channel with the first system by running the target bootloader firmware, and the data transmission rate of the second data transmission channel is greater than that of the first data transmission channel; The first system module is further used to transmit the resource to be upgraded to the second system through the second data transmission channel.

16. An electronic device, which includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the resource transfer method according to any one of claims 1 to 14.

17. A computer-readable storage medium, which stores at least one program code, and the program code is loaded and executed by a processor to implement the resource transfer method according to any one of claims 1 to 14.

18. A computer program product, the computer program product comprising computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the electronic device to execute the resource transmission method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Firmware remote upgrading method and device, terminal, mobile equipment and storage medium

    CN110704077A

  • Multiprocessors systems and processes scheduling methods thereof

    US20150301858A1

  • Data transmission method and apparatus, device, and storage medium

    WO2022218107A1