WO2025156458A1 - 资源传输方法、装置、电子设备、介质及计算机程序产品 - Google Patents

资源传输方法、装置、电子设备、介质及计算机程序产品

Info

Publication number
WO2025156458A1
WO2025156458A1 PCT/CN2024/087908 CN2024087908W WO2025156458A1 WO 2025156458 A1 WO2025156458 A1 WO 2025156458A1 CN 2024087908 W CN2024087908 W CN 2024087908W WO 2025156458 A1 WO2025156458 A1 WO 2025156458A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
firmware
data transmission
transmission channel
upgraded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/087908
Other languages
English (en)
French (fr)
Inventor
郭凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of WO2025156458A1 publication Critical patent/WO2025156458A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • G06F13/126Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine and has means for transferring I/O instructions and statuses between control unit and main processor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • G06F13/128Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine for dedicated transfers to a network
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Definitions

  • 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.
  • a high-performance processor receives externally transmitted resources to be upgraded, and transmits the resources to be upgraded to a low-power processor through a UART (Universal Asynchronous Receiver/Transmitter) channel or an SWD (Serial Wire Debug) channel, so that the low-power processor stores and runs the resources to be upgraded.
  • UART Universal Asynchronous Receiver/Transmitter
  • SWD Serial Wire Debug
  • 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:
  • 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:
  • the first system transmits target boot loading firmware to the second system through the first data transmission channel;
  • the first system triggers the second system to run 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, wherein the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel;
  • the first system transmits the resource to be upgraded to the second system through the second data transmission channel.
  • 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:
  • 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;
  • the first system module is further configured to trigger the second system to run the target boot loader firmware
  • 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;
  • the first system module is further configured to transmit the resource to be upgraded to the second system through the second data transmission channel.
  • 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.
  • 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.
  • 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.
  • 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
  • FIG2 is a diagram of a dual-core communication software framework of an RTOS provided by an exemplary embodiment of the present application
  • FIG3 is a flow chart of a resource transmission method provided by an exemplary embodiment of the present application.
  • FIG4 is a schematic diagram of a dual-core dual system provided by an exemplary embodiment of the present application.
  • FIG5 is a schematic diagram of a dual-core dual system provided by another exemplary embodiment of the present application.
  • FIG. 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
  • FIG. 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
  • 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
  • FIG9 is a schematic diagram of a two-stage resource transmission method provided by an exemplary embodiment of the present application.
  • FIG. 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;
  • FIG11 is a structural block diagram of a resource transmission device provided by an exemplary embodiment of the present application.
  • FIG12 is a structural block diagram of an electronic device provided by an exemplary embodiment of the present application.
  • 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.
  • the electronic device configured with dual-core dual systems is also provided with a system switching mechanism.
  • 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).
  • a system running on a low-power processor 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.
  • 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.
  • 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)
  • the first system is an Android operating system running on a central processing unit (CPU)
  • the second system is a real-time operating system (RTOS) running on a microcontroller unit (MCU).
  • RTOS real-time operating system
  • FIG. 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 modules for the kernel, HIDL (Hardware Abstraction Layer Interface Description Language), native services, framework services, framework APIs, and apps.
  • HIDL Hardware Abstraction Layer Interface Description Language
  • the App module includes functional modules such as Launcher, Settings, and SystemUI.
  • the Framework API module includes management modules such as MCUManager, SensorManager, and LocationManager.
  • the Framework Service module includes service modules such as MCUManagerService, SystemSensorManager, and LocationManagerService.
  • the Native Service module includes service modules such as dccservice and Sensorservice.
  • the HIDL module includes modules such as SensorHAL and GPSHAL.
  • the Kernel module includes DCC Transfer Drivers such as dcc_data, Mcu_sensor, and Mcu_gps.
  • 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.
  • FIG2 is a diagram of a dual-core communication software framework of an RTOS provided by an exemplary embodiment of the present application.
  • 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).
  • 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 (activity management service), 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, etc.
  • 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 (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 audio bus), HWTimer (hardware
  • 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.
  • SPI Serial Peripheral Interface
  • the high-performance processor receives externally transmitted upgrade resources and typically transmits them to the low-power processor via a UART or SWD channel, allowing the low-power processor to store and execute the upgraded resources.
  • the data transmission rate of a UART or SWD channel is lower than that of an SPI channel.
  • 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.
  • FIG. 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.
  • the electronic device is a dual-core dual-system device.
  • the electronic device is a smart watch, smart bracelet, or other device that includes a high-performance processor and a low-power processor.
  • a high-performance processor and a low-power processor in an electronic device run on a first system and a second system, respectively. Because the first and second processors operate asynchronously and require system communication (also known as dual-core communication) between the first and second systems, in one possible application scenario, the first system is the 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).
  • system communication also known as dual-core communication
  • the low-power processor runs on a first system, which is a real-time operating system running on a microcontroller unit
  • the high-performance processor runs on a second system, which is an Android operating system running on a central processing unit.
  • the method includes the following steps.
  • 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.
  • 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).
  • the first system is a system running on a low-power processor
  • 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.
  • FIG4 is a schematic diagram of a dual-core dual system provided by an exemplary embodiment of the present application.
  • first system 410 receives resources from an external device via USB (Universal Serial Bus) channel 401.
  • USB Universal Serial Bus
  • first system 410 receives resources from an external device via WIFI (Wireless Fidelity) channel 402.
  • the resources received by first system 410 include resources to be upgraded in second system 420, which may be used to download or upgrade applications in the second system.
  • the resources to be upgraded include application firmware and a file image of the application.
  • the resources to be upgraded also include system resources.
  • System resources are resources required to maintain the normal operation of the second system, such as the resources required for the operation of the second system. The required clock, watchdog to prevent the second system from crashing, etc.
  • the resources to be upgraded also include peripheral resources, such as analog peripheral resources, timers, etc.
  • the first system 410 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 memory devices.
  • the first storage space or the second storage space is an eMMC (embedded Multi Media Card).
  • 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), etc.
  • Flash flash memory
  • FeRAM Feroelectric Random Access Memory
  • MRAM Magneticoresistive Random Access Memory
  • the first data transmission channel is a UART channel or a SWD channel.
  • the target bootloader firmware is used to enable a second data transmission channel between the first system and the second system, thereby achieving high-speed transmission of resources to be upgraded between the first system and the second system.
  • the target bootloader firmware may also be referred to as an HS-bootloader (High Speed bootloader).
  • the target bootloader firmware is much smaller than the resource to be upgraded.
  • 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.
  • 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.
  • 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.
  • the target boot loading firmware may be pre-stored in the first storage space of the first system 410 .
  • the first system 410 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.
  • the target boot loading firmware can also be pre-stored in the second storage space of the second system.
  • the first system does not need to transmit the target boot loading firmware to the second system again through the first data transmission channel.
  • Step 302 The first system triggers the second system to run the target boot loader firmware.
  • the first system can trigger a reset signal by pulling a reset pin.
  • 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.
  • 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.
  • the second data transmission channel is an SPI channel.
  • the data transmission rate of the second data transmission channel is greater than the data transmission rate of the first data transmission channel.
  • 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.
  • the second system 420 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.
  • Step 304 The first system transmits the resources to be upgraded to the second system through the second data transmission channel.
  • the second system 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.
  • different storage subspaces are used to store different types of resources to be upgraded.
  • 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.
  • 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 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.
  • the 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.
  • the time taken to transmit the resources to be upgraded to the second system through the transmission channel is shorter. 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.
  • the first system transmits the target boot loader firmware to the second system through the first data transmission channel, including:
  • the first system sends a firmware erasing instruction to the second system
  • the second system erases the historical boot-loaded firmware based on the firmware erase instruction
  • the first system transmits the target boot loading firmware to the second system through the first data transmission channel.
  • 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, where the storage space configuration information is used to indicate the configuration of the storage space for storing the boot loading firmware;
  • the first system transmits the target boot loader firmware to the second system through the first data transmission channel, including:
  • 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.
  • the first system sends a firmware erasing instruction to the second system, including:
  • the first system sends a firmware erasing instruction to the second system;
  • the method further includes:
  • the first system triggers the second system to run the historical boot-loaded firmware.
  • the first system transmitting the boot loader firmware to the second system through the first data transmission channel includes:
  • the first system 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
  • the second system 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 a confirmation response to the first handshake response to the first system
  • the first system transmits the target boot loader firmware to the second system through the first data transmission channel.
  • the method further includes:
  • the second system sends a firmware transfer completion response to the first system
  • the first system triggers the second system to run the target bootloader firmware, including:
  • the first system Upon receiving the firmware transfer completion response, the first system triggers a reset signal
  • the second system When a reset signal is detected, the second system sends a first handshake request to the first system;
  • the second system runs the target bootloader firmware.
  • the second system enables a second data transmission channel with the first system by running the target bootloader firmware, including:
  • the first system triggers an upgrade signal
  • the second system When the upgrade signal is detected, 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 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;
  • the method further includes:
  • the first system stops triggering the upgrade signal.
  • the first system transmits the resources 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
  • the first system sends a resource transfer request to the second system through the second data transmission channel;
  • the second system sends a request response to the resource transfer request to the first system
  • the first system transmits the resource to be upgraded to the second system via the second data transmission channel.
  • the resource transfer request includes storage partition information, where the storage partition information is used to indicate a partition storing resources to be upgraded.
  • the second system sends a request response to the resource transfer request to the first system, including:
  • the second system performs validity verification on the storage partition information included in the resource transfer request
  • the second system sends a request response to the resource transfer request to the first system.
  • the resource transfer request includes a target check value, which is generated by the first system based on the resource to be upgraded;
  • the method further includes:
  • the second system performs a readback check on the written resources to obtain a readback check value
  • the second system 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;
  • an upgrade result response is sent to the first system through the second data transmission channel.
  • 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 method further includes:
  • 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;
  • the second system writes the sub-resource to be upgraded into the target storage sub-space.
  • 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.
  • 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.
  • the first data transmission channel is a UART channel or a SWD channel
  • the second data transmission channel is an SPI channel
  • the first system 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.
  • the first system pulls the reset pin to trigger a reset signal.
  • the second system When the reset signal is detected, the second system sends a first handshake request to the first system.
  • 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.
  • HS-bootloader.bin target boot loader firmware
  • the first system 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.
  • the first system 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.
  • the second system sends an acknowledgment response to the first handshake response to the first system.
  • the first system transmits the target boot loader firmware to the second system through the first data transmission channel.
  • FIG. 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.
  • steps 5.1 to 5.2.3 are the process of the first handshake between the first system and the second system.
  • 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.
  • Step 5.2.1 When a reset signal is detected, the second system sends a first handshake request to the first system.
  • 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.
  • the first system does not send a first handshake response to the second system.
  • the second system runs the target bootloader firmware.
  • Step 5.2.3 The second system sends a confirmation response to the first handshake response to the first 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.
  • a program for assisting in downloading the target bootloader firmware such as progarmmer.bin
  • steps 5.3.1 to 5.3.3 are the process of transferring progarmmer.bin.
  • Step 5.3.1 The first system transmits programmmer.bin to the second system through the first data channel.
  • the second system writes progarmmer.bin into the RAM (Random Access Memory) of the second system.
  • step 5.3.2 the second system returns a transmission success response of progarmmer.bin to the first system through the first data channel.
  • Step 5.3.3 The first system sends an instruction requesting execution of programmer.bin to the second system through the first data channel.
  • the second system jumps to and executes programmer.bin based on the received instruction.
  • the first system may notify the second system to erase the historical boot loading firmware to write the current new target boot loading firmware.
  • steps 5.4.1 to 5.4.4 are the process of erasing the historical boot loading firmware.
  • Step 5.4.1 The first system sends a storage space configuration acquisition request to the second system through the first data transmission channel.
  • the storage space configuration information is used to indicate the configuration of the storage space for storing the boot loading firmware.
  • the storage space configuration information may include storage partition information for storing the boot loader firmware of the second system.
  • the storage space configuration information includes a Nor Flash ID of 2, indicating that the second system stores the boot loader firmware in the second storage partition in the Nor Flash.
  • 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.
  • Step 5.4.2 The second system returns the storage space configuration information to the first system through the first data transmission channel.
  • the second system returns the storage partition information Nor Flash ID of the boot loading firmware to the first system as 2.
  • 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.
  • the second system erases the historical boot loading firmware based on the firmware erase instruction.
  • the second system performs a firmware erase operation on the storage partition corresponding to the storage partition information Nor Flash ID 2 to erase the historical boot loading firmware.
  • 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.
  • the first system transmits the target boot loading firmware to the second system through the first data transmission channel.
  • Steps 5.5.1 to 5.5.2 are the process of bootloading the firmware on the transfer target.
  • 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.
  • HS-bootloader.bin target bootloader firmware
  • 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.
  • 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.
  • the second system writes the target boot loader firmware into the storage partition corresponding to the storage partition information.
  • the target boot loader firmware is written into the storage partition corresponding to the Nor Flash ID 2.
  • 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.
  • the firmware transfer completion response indicates that the transfer of HS-bootloader.bin is complete.
  • Step 5.6 Upon receiving the firmware transfer completion response, the first system triggers a reset signal.
  • the first system pulls the reset pin again to trigger the reset signal.
  • the second system 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.
  • the first system 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.
  • 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.
  • FIG. 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.
  • 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.
  • 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.
  • 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 judgment.
  • 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.
  • Step 622 The second system erases the historical boot-loaded firmware based on the firmware erase instruction.
  • 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.
  • Step 624 The first system triggers the second system to run the target boot loader firmware.
  • 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.
  • 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.
  • step 624 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.
  • Step 650 The first system transmits the resources to be upgraded to the second system through the second data transmission channel.
  • the first system compares the target boot loading firmware and the historical boot loading firmware.
  • 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.
  • FIG. 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.
  • steps 7.1.1 to 7.1.4 are the process of the first system and the second system performing the second handshake.
  • 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.
  • the first system triggers the upgrade signal by pulling the reset pin and pulling the upgrade request pin high.
  • 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.
  • the second data transmission channel is initialized.
  • Step 7.1.3 The first system sends a second handshake request to the second system through the second data transmission channel.
  • the second handshake request is used to request transmission of the resource to be upgraded through the second data transmission channel.
  • 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.
  • 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.
  • Step 7.2.1 The first system sends a version information acquisition request to the second system.
  • the version information acquisition request is used to obtain version information corresponding to the resource to be upgraded, such as the version number.
  • 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.
  • Step 7.2.2 The second system returns the current resource version information to the first system.
  • 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.
  • the version number corresponding to the resource to be upgraded is version 2.0
  • the current resource version information is version 1.0.
  • the second system returns version information to the first system through the first data transmission channel or the second data transmission channel.
  • 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.
  • 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 transfer request to the first system.
  • the first system transmits the resource to be upgraded to the second system via the second data transmission channel.
  • the resource transfer request includes at least two resource transfer sub-requests for different types of resources.
  • the corresponding resource transfer sub-request is a file image transfer sub-request
  • the resource to be upgraded is application firmware
  • the corresponding resource transfer request is an application firmware transfer sub-request
  • 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.
  • 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.
  • 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.
  • 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.
  • 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 file resource transfer sub-request contains storage partition information Nor Flash ID 3, indicating that the partition where the second system stores the file resource is the third storage partition in Nor Flash.
  • the resource transfer request further includes a target check value.
  • 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.
  • the target check value is a parity check value, or other types of check values.
  • 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.
  • 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.
  • 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.
  • the resource transfer request further includes a target check value of 0, and the second system records the target check value of 0.
  • 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.
  • 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.
  • 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.
  • the second system 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).
  • the readback check value corresponding to the first file resource package is generated by the second system based on the first file resource package.
  • the second system 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).
  • 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.
  • the second system 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).
  • the second system 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.
  • the second system determines that the write verification result is a correct write.
  • 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.
  • the second system sends a transmission result response corresponding to the file resource package to the first system.
  • the second system only replies with the transmission result response corresponding to some file resource packages to reduce the amount of data transmission.
  • the second system may only reply with the transmission result response corresponding to the last file resource package.
  • 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.
  • Step 7.3.8 The second system sends the file resource to the first system through the second data transmission channel based on the write verification result of the file resource. Upgrade results.
  • the second system 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.
  • 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.
  • the second system performs a readback check on the written resources to obtain a readback check value.
  • 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.
  • the readback check can be completed as soon as possible, thereby improving the efficiency of resource transmission.
  • 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.
  • 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.
  • firmware resource refers to the application firmware to be upgraded, not the HS-bootloader firmware that enables the second data transmission channel.
  • the firmware resources include m55.bin, SensorHub.bin, etc.
  • SensorHub.bin is the application firmware corresponding to the sensor management component.
  • 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 firmware resource transfer sub-request contains storage partition information Nor Flash ID 5, indicating that the partition where the second system stores file resources is the 5th storage partition in Nor Flash.
  • the firmware resource transfer sub-request also includes a target check value corresponding to the storage partition.
  • 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.
  • the second system erases the old firmware from the 5th storage partition in Nor Flash.
  • Step 7.4.3 The second system sends a request response to the firmware resource transfer sub-request to the first system.
  • 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.
  • 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.
  • step 5.3.5 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.
  • 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.
  • the second system sends a transmission result response corresponding to the firmware resource package to the first system.
  • the second system only replies with the transmission result response corresponding to some firmware resource packages to reduce the amount of data transmission.
  • the second system may only reply with the transmission result response corresponding to the last firmware resource package.
  • 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.
  • 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.
  • Step 7.5 When the resources to be upgraded have completed transmission, the first system stops triggering the upgrade signal.
  • the first system pulls the reset pin again and pulls down the upgrade request pin to stop triggering the upgrade signal.
  • FIG8 is a schematic diagram of a dual-core dual system provided by another exemplary embodiment of the present application.
  • 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.
  • 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.
  • 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).
  • FIG9 is a two-stage schematic diagram of a resource transmission method provided by an exemplary embodiment of the present application.
  • the resource transmission method proposed in this application includes two data transmission phases, wherein the first phase 901 is the MCU-Boot phase.
  • the first system and the second system transmit the HS-bootloader through the first data transmission channel.
  • 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.
  • the first data transmission channel is a UART channel or a SWD channel.
  • 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.
  • 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.
  • the second stage 902 is the HS-bootloader stage.
  • the first system and the second system transmit the resources to be upgraded via the second data transmission channel.
  • the second data transmission channel is an SPI channel.
  • 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.
  • the target storage subspace includes Nor Flash and eMMC.
  • 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.
  • the second stage 902 includes a second sub-stage 921 and a third sub-stage 922 .
  • the second system downloads the firmware resources to Nor Flash through the second data transmission channel.
  • the second system downloads the file resource to the eMMC through the second data transmission channel.
  • 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.
  • 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.
  • FIG. 10 is a schematic diagram illustrating that a second system writes a resource data packet and receives a resource data packet in parallel according to an exemplary embodiment of the present application.
  • 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.
  • the second system writes the resource data packet and receives the resource data packet in parallel.
  • 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.
  • 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.
  • FIG. 11 is a block diagram of a resource transmission device provided by an exemplary embodiment of the present application.
  • the device includes:
  • 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;
  • the first system module 1101 is further configured to trigger the second system to run the target boot loader firmware
  • 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;
  • 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.
  • the first system module 1101 is configured to:
  • the second system module 1102 is further configured to erase the historical boot loading firmware based on the firmware erase instruction;
  • 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.
  • the first system module 1101 is configured to:
  • the second system module 1102 is further configured to send storage space configuration information to the first system.
  • the storage space configuration information is used to Indicates the configuration of the storage space for storing bootloader firmware;
  • 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.
  • the first system module 1101 is configured to:
  • the second system is triggered to run the historical boot loading firmware.
  • the first system module 1101 is configured to:
  • the second system module 1102 is further configured to send a first handshake request to the first system when the reset signal is detected;
  • the first system module 1101 is further configured to send a first handshake response corresponding to the first handshake request to the second system;
  • the second system module 1102 is further configured to send a confirmation response to the first handshake response to the first system
  • 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.
  • the second system module 1102 is configured to:
  • the first system module 1101 is further configured to trigger the reset signal upon receiving the firmware transmission completion response;
  • the second system module 1102 is further configured to send a first handshake request to the first system when the reset signal is detected;
  • the target bootloader firmware is executed.
  • the first system module 1101 is configured to:
  • 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;
  • the first system module 1101 is further configured to send a second handshake request to the second system through the second data transmission channel;
  • 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;
  • 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.
  • the first system module 1101 is configured to:
  • the second system module 1102 is further configured to return current resource version information to the first system
  • 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;
  • the second system module 1102 is further configured to send a request response to the resource transfer request to the first system
  • 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.
  • 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:
  • the request response to the resource transfer request is sent to the first system.
  • the resource transfer request includes a target check value, and 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:
  • an upgrade result response is sent to the first system through the second data transmission channel.
  • 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:
  • the sub-resource to be upgraded is written into the target storage sub-space.
  • 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
  • the eMMC is used to write file resources in the resources to be upgraded.
  • 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.
  • the first data transmission channel is a UART channel or a SWD channel
  • the second data transmission channel is an SPI channel
  • FIG 12 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.
  • 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.
  • 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.
  • 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 to various components within the entire electronic device.
  • the processor 1210 By running or executing instructions, programs, code sets, or instruction sets stored in the memory 1220 and accessing data stored in the memory 1220, the processor 1210 performs various functions of the electronic device and processes data.
  • the processor 1210 can be implemented using at least one of the following hardware forms: digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA).
  • DSP digital signal processing
  • FPGA field-programmable gate array
  • PDA programmable logic array
  • the processor 1210 can 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.
  • CPU central processing unit
  • GPU graphics processing unit
  • NPU neural network processing unit
  • modem modem
  • the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content required to be displayed on the touch screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to handle wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 1210 and may be implemented separately through a chip.
  • the memory 1220 may include random access memory (RAM) or 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.
  • 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 various method embodiments described below, etc.
  • the data storage area may store data created based on the use of the electronic device (such as audio data, a phone book, etc.).
  • 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 (a 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.
  • 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.
  • 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.
  • 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.
  • the computer-readable storage medium may include: ROM, RAM, solid-state drives (SSDs), or optical disks.
  • RAM may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM).
  • ReRAM resistance random access memory
  • DRAM dynamic random access memory
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Stored Programmes (AREA)

Abstract

一种资源传输方法、装置、电子设备、介质及计算机程序产品,涉及电子设备领域。包括:在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件(301);第一系统触发第二系统运行目标引导加载固件(302);第二系统通过运行目标引导加载固件,使能与第一系统之间的第二数据传输通道,第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率(303);第一系统通过第二数据传输通道,向第二系统传输待升级资源(304)。本申请实施例提供的方案有助于提升资源传输效率。

Description

资源传输方法、装置、电子设备、介质及计算机程序产品
本申请要求于2024年01月26日提交的申请号为202410119616.4、发明名称为“资源传输方法、装置、电子设备、介质及计算机程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及电子设备领域,特别涉及一种资源传输方法、装置、电子设备、介质及计算机程序产品。
背景技术
随着电子设备的不断升级,为提升续航能力,同时包含高性能处理器和低功耗处理器的双核双系统设备应运而生。双系统可以相互配合工作,同时各系统也具有独立运行的能力,因此,高性能处理器和低功耗处理器需要具备完整的运行资源。
相关技术中,在产线生产或OTA(Over-The-Air,空中下载)的场景下,高性能处理器接收外部传输的待升级资源,并通过UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)通道或SWD(Serial Wire Debug,串行线调试)通道将待升级资源传输给低功耗处理器,以使得低功耗处理器存储并运行待升级资源。
发明内容
本申请实施例提供了一种资源传输方法、装置、电子设备、介质及计算机程序产品。所述技术方案如下:
一方面,本申请实施例提供了一种资源传输方法,所述方法应用于电子设备,所述电子设备支持运行第一系统和第二系统;所述方法包括:
在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,所述第一系统通过第一数据传输通道向所述第二系统传输目标引导加载固件;
所述第一系统触发所述第二系统运行所述目标引导加载固件;
所述第二系统通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,所述第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率;
所述第一系统通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
另一方面,本申请实施例提供了一种资源传输装置,所述装置用于电子设备,所述电子设备中支持运行第一系统和第二系统;所述装置包括:
第一系统模块,用于在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,通过第一数据传输通道向所述第二系统传输目标引导加载固件;
所述第一系统模块,还用于触发所述第二系统运行所述目标引导加载固件;
第二系统模块,用于通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,所述第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率;
所述第一系统模块,还用于通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
另一方面,本申请实施例提供了一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现上述方面所述的资源传输方法。
另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如上述方面所述的资源传输方法。
另一方面,本申请实施例提供了一种计算机程序产品,述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;计算机设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述计算机设备执行如上述方面所述的资源传输方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个示例性实施例提供的安卓操作系统的双核通信软件框架图;
图2是本申请一个示例性实施例提供的RTOS的双核通信软件框架图;
图3是本申请一个示例性实施例提供的资源传输方法的流程图;
图4是本申请一个示例性实施例提供的双核双系统的示意图;
图5是本申请另一个示例性实施例提供的双核双系统的示意图;
图6是本申请一个示例性实施例提供的第一系统通过第一数据传输通道向第二系统传输目标引导加载固件的时序图;
图7是本申请一个示例性实施例提供的第一系统触发第二系统运行引导加载固件的流程图;
图8是本申请一个示例性实施例提供的第一系统通过第二数据传输通道向第二系统传输待升级资源的时序图;
图9是本申请一个示例性实施例提供的资源传输方法的二阶段示意图;
图10是本申请一个示例性实施例提供的第二系统写入资源数据包与接收资源数据包并行执行的示意图;
图11是本申请一个示例性实施例提供的资源传输装置的结构框图;
图12是本申请一个示例性实施例提供的电子设备的结构方框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在传统的电子设备中,往往仅设置有单一的处理器,并通过运行在处理器上的操作系统进行事件的处理。然而,随着用户对于电子设备使用需求的增加,也要求电子设备具有较强的数据处理能力,因此,配备双核双系统的电子设备随之产生。在一种可能的实施方式中,电子设备至少设置具有不同处理性能以及功耗的第一处理器以及第二处理器,并且具有第一系统运行于第一处理器,第二系统运行于第二处理器,此外配置双核双系统的电子设备中同样设置有系统切换的机制。
例如,在智能手表或智能手环等产品中,可以同时包含高性能处理器和低功耗处理器,分别运行于第一系统和第二系统(即双核双系统)。
为达到降低功耗的目的,往往由运行于低功耗处理器的系统对低性能需求的事件进行处理,并在存在高性能处理需求的事件时切换至运行于高能耗处理器的系统进行高性能事件处理,以满足电子设备的性能需求。
可选的,第一系统运行于低功耗处理器,第二系统运行于高性能处理器;可选的,第一系统运行于高性能处理器;第二系统运行于低功耗处理器。
本申请实施例中,由于第一处理器和第二处理器异步工作,且第一系统和第二系统需要实现系统通信(或称为双核通信)。在一种可能的应用场景下,第一系统为运行在中央处理器(Central Processing Unit,CPU)上的安卓(Android)操作系统,且第二系统为运行在微控制单元(Micro Controller Unit,MCU)上的实时操作系统(Real Time Operating System,RTOS)。
图1是本申请一个示例性实施例提供的安卓操作系统的双核通信软件框架图。该双核通信软件框架遵循“低耦合,高可靠,高复用”的设计原则,包括Kernel(内核)、HIDL(硬件抽象层接口描述语言)、Native Service(本地服务)、Framework Service(框架服务)、Framework API(框架接口)和APP(应用)部分的模块开发。
其中,APP模块包括Launcher(桌面启动器)、Setting(设置)和SystemUI(系统用户界面)等功能模块,Framework API模块中包括MCUManager(MCU管理)、SensorManager(传感器管理)、LocationManager(位置管理)等管理模块,Framework Service模块中包括MCUManagerService(MCU管理服务)、SystemSensorManager(系统传感器管理)、LocationManagerService(位置管理服务)等服务模块,Native Service模块包括dccservice(dcc服务)、Sensorservice(传感器服务)等服务模块,HIDL模块包括Sensor HAL(传感器硬件抽象层)、GPS HAL(全球定位系统硬件抽象层)等模块。Kernel模块包括dcc_data、Mcu_sensor、Mcu_gps等DCC Transfer Driver(DCC传输驱动)。
传输层作为双核通信软件框架中衔接上下层的接口层,向应用层屏蔽系统下层(数据链路层)通信的传输细节,为应用场景提供服务通道;应用层作为服务提供的主体,响应于人机交互并通过传输层对人机交互过程中产生的数据进行传输,以及对外部数据请求进行响应。
RTOS采用对等原则进行设计。以电子设备为智能手表为例,图2是本申请一个示例性实施例提供的RTOS的双核通信软件框架图。
如图2所示,RTOS的双核通信软件框架分为应用层(Application Layer)、服务层(Service Layer)、框架层(Framework Layer)、硬件抽象层(Hardware abstraction layer)和平台层(Platform Layer)。
其中,应用层包括watch face(表盘)、Daily Tracker(日常追踪)、Message center(消息中心)、Voice around Apps(声音应用)、Health Apps(健康应用)、Settings(设置)等应用模块;服务层包括Sport&health task(运动健康任务)、System manager task(系统管理任务)、AMS(活动管理服务)、AudioService(音频服务)、Log Service(日志服务)、OFTP Service(Odette文件传输协议服务)、BT Service(蓝牙服务)、Delegate Service(转交服务)、RPC Service(远程调用服务)、sensor Service(传感器服务)、storage Service(存储服务)等服务模块;框架层包括Message Pub(消息中心)、UI Framework(用户界面框架)、G2D Engine(G2D引擎)、Audio Middleware(音频中间件)、Preference(偏好)、File system(文件系统)、Algorithms(算法)、AsycEvent(进程内异步事件)等框架模块;硬件抽象层包括Screen/TP(屏幕/触控屏)、sensors(传感器)、Keypad(键盘)、Motor(马达)等硬件抽象模块;平台层包括板级支持包(Board Support Package,BSP)以及低等级驱动(LOW level Driver),其中,BSP包括Screen/TP、Codec(编码译码器)、sensors、Flash(闪存)、PSRAM(伪静态随机存储器)等等,低等级驱动包括UART(通用异步收发传输器)、ADC(模数转换器)、GPIO(通用输入输出)、SPI(串行外设接口)、I2C(集成电路总线)、IOS(输入输出系统)、PCM(脉冲编码调制)、I2S(集成音频总线)、HWTimer(硬件定时器)。
需要说明的是,上述双核通信软件框架仅用于示意性说明,本领域技术人员还可以根据实际需求,对上述框架进行增加、删除或修改,本申请实施例并不对双核通信软件框架的具体结构构成限定。
两个系统工作时相互配合,同时各系统也具有独立运行的能力。因此,高性能处理器和低功耗处理器需要具备完整的运行资源,且完整运行资源的资源量通常较大。
相关技术中,在应用程序的运行过程中,高性能处理器和低功耗处理器之间可以通过SPI(Serial Peripheral Interface,串行外设接口)通道传输与应用程序运行相关的数据;而在产线生产或OTA的场景下,高性能处理器接收外部传输的待升级资源,通常通过UART通道或SWD通道将待升级资源传输给低功耗处理器,以使得低功耗处理器存储并运行待升级资源。其中,UART通道或SWD通道的数据传输速率相较于SPI通道较小。
在产线生产的场景下,需要提升资源下载速率以提高生产效率;产品出厂以后,需要提升资源下载速率以减少升级过程对用户的影响,因此,在资源下载或资源更新时,双核双系统需要一种具有更高传输速率的资源传输方法。
参见图3,图3是本申请一个示例性实施例提供的资源传输方法的流程图。该方法应用于电子设备,该电子设备支持运行第一系统和第二系统。
其中,电子设备为双核双系统设备。可选的,电子设备为包含高性能处理器和低功耗处理器的智能手表、智能手环等设备。
电子设备中的高性能处理器和低功耗处理器分别运行于第一系统和第二系统。由于第一处理器和第二处理器异步工作,且第一系统和第二系统需要实现系统通信(或称为双核通信)。在一种可能的应用场景下,第一系统为运行在中央处理器(Central Processing Unit,CPU)上的安卓(Android)操作系统,且第二系统为运行在微控制单元(Micro Controller Unit,MCU)上的实时操作系统(Real Time Operating System,RTOS)。
在另一些实施例中,低功耗处理器运行于第一系统,第一系统为运行在微控制单元上的实时操作系统,高性能处理器运行于第二系统,第二系统为运行在中央处理器上的安卓操作系统。
该方法包括以下步骤。
步骤301,在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件。
在一些实施例中,第一系统为高性能处理器运行的系统(如安卓操作系统),第二系统为低功耗处理器运行的系统(如实时操作系统)。在另一些实施例中,第一系统为低功耗处理器运行的系统,第二系统为高性能处理器运行的系统。下文以第一系统为运行在中央处理器上的安卓操作系统、第二系统为运行在微控制单元上的实时操作系统为例,对资源传输方法进行说明。
参见图4,图4是本申请一个示例性实施例提供的双核双系统的示意图。
在产线生产的过程中,第一系统410通过USB(Universal Serial Bus,通用串行总线)通道401接收外部设备传输的资源;在OTA过程中,第一系统410通过WIFI(Wireless Fidelity,无线保真技术)通道402接收外部设备传输的资源。其中,第一系统410接收的资源包括第二系统420的待升级资源,其中,待升级资源可以为用于对第二系统的应用程序进行下载或升级的资源。
可选的,待升级资源包括应用程序固件,以及应用程序的文件镜像。
可选的,待升级资源还包括系统资源,系统资源是维持第二系统正常工作的资源,如第二系统运行所 需的时钟、防止第二系统死机的看门狗等。
可选的,待升级资源还包括外设资源,如模拟外设资源、定时器等。
在通过USB通道401或WIFI通道402接收到第二系统420的待升级资源后,第一系统410将待升级资源存储在第一系统的第一存储空间411中。第一系统的第一存储空间411以及第二系统的第二存储空间421为非易失性存储器件。可选的,第一存储空间或第二存储空间为eMMC(embedded Multi Media Card,嵌入式多媒体卡)。可选的,第一存储空间或第二存储空间还可以为Flash(闪存)、FeRAM(Ferroelectric Random Access Memory,铁电存储器)、MRAM(Magnetoresistive Random Access Memory,磁性随机存储器)等类型。本申请实施例对第一存储空间和第二存储空间的具体类型不作限制。
可选的,第一数据传输通道为UART通道或SWD通道。
目标引导加载固件用于使能第一系统与第二系统之间的第二数据传输通道,以实现第一系统与第二系统进行待升级资源的高速率传输。在本申请实施例中,目标引导加载固件也可称为HS-bootloader(High Speed bootloader)。
在通常的场景下,目标引导加载固件的体积远小于待升级资源的体积。仅作示例的,目标引导加载固件的体积大小约200kb,待升级资源的体积约为300M。因此,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件的传输用时通常很短。
在一种可能的实现方式中,目标引导加载固件包含于待升级资源中,由外部设备通过USB通道401或WIFI通道402发送给第一系统410。在一些实施例中,在向第二系统420传输标引导加载固件之前,第一系统410可以先通过第一数据传输通道431向第二系统420传输用于辅助下载目标引导加载固件的程序,如progarmmer.bin。
在另一种可能的实现方式中,目标引导加载固件可以预先存储于第一系统410的第一存储空间中。
在一些实施例中,第一系统410接收到外部设备发送的包含目标引导加载固件的待升级资源后,可以对目标引导加载固件和第二系统的第二存储空间中存储的历史引导加载固件进行比较,在目标引导加载固件与历史引导加载固件不一致的情况下,通过第一数据传输通道431向第二系统420传输目标引导加载固件。
需要说明的是,目标引导加载固件也可以预先存储在第二系统的第二存储空间,在目标引导加载固件预先存储在第二存储空间的情况下,第一系统无需再次通过第一数据传输通道向第二系统传输目标引导加载固件。
步骤302,第一系统触发第二系统运行目标引导加载固件。
在一种可能的实现方式中,第一系统可以通过拉动复位管脚以触发复位信号,在检测到复位信号的情况下,第二系统运行目标引导加载固件。第一系统还可以通过其他方式触发第二系统运行目标引导加载固件,例如,第一系统可以通过第一数据传输通道向第二系统发送指令等,本申请实施例对此不作限制。
步骤303,第二系统通过运行目标引导加载固件,使能与第一系统之间的第二数据传输通道,第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率。
可选的,第二数据传输通道为SPI通道。
第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率。仅作示例的,第二数据传输通道为24M SPI传输通道,第一数据传输通道为UART通道,经实验证明,第二数据传输通道的数据传输速率为第一数据传输通道的5倍以上。
在一些实施例中,第二系统420在检测到复位信号的情况下,通过运行目标引导加载固件,使能与第一系统410之间的第二数据传输通道432。
步骤304,第一系统通过第二数据传输通道,向第二系统传输待升级资源。
在一些实施例中,在第二系统接收到待升级资源后,可以将待升级资源写入第二存储空间。其中,第二存储空间可以包括不同的存储子空间。可选的,不同存储子空间用于存储不同类型的待升级资源。
可选的,待升级资源以资源数据包的形式传输,且第二系统写入资源数据包与接收资源数据包并行执行。即,第二系统采用流水线的方式写入和接收资源数据包。
综上所述,在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件,并触发第二系统运行目标引导加载固件,由于目标引导加载固件的体积很小,因此第一系统通过第一数据传输通道向第二系统传输目标引导加载固件的传输用时很短;目标引导加载固件可以使能第一系统与第二系统之间的第二数据传输通道,由于第二数据传输通道的数据传输速率大于第一数据传输通道的传输速率,因此,第一系统通过第二数据传输通道向第二系统传输待升级资源的传输用时相较于通过第一数据传输通道向第二系统传输待升级资源的用时更短。第一系统通过第一数据传输通道向第二系统传输目标引导加载固件,第二系统运行目标引导加载固件以使能第二数据传输通道,第一系统通过第二数据传输通道向第二系统传输待升级资源的总用时,比第一系统通过第一数 据传输通道向第二系统传输待升级资源的用时更短,因此,采用本申请提出的资源传输方法,可以缩短待升级资源的传输用时,提升待升级资源的传输效率,从而提升产线生产效率、减少用户在升级过程中的等待时间、提升用户体验。
可选的,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件,包括:
第一系统向第二系统发送固件擦除指令;
第二系统基于固件擦除指令,擦除历史引导加载固件;
在历史引导加载固件擦除完毕的情况下,第一系统通过第一数据传输通道,向第二系统传输目标引导加载固件。
可选的,该方法还包括:
第一系统向第二系统发送存储空间配置获取请求;
第二系统向第一系统发送存储空间配置信息,存储空间配置信息用于指示存储引导加载固件的存储空间的配置情况;
在历史引导加载固件擦除完毕的情况下,第一系统通过第一数据传输通道,向第二系统传输目标引导加载固件,包括:
在历史引导加载固件擦除完毕的情况下,第一系统基于存储空间配置信息,通过第一数据传输通道,向第二系统传输目标引导加载固件。
可选的,第一系统向第二系统发送固件擦除指令,包括:
在目标引导加载固件不同于历史引导加载固件的情况下,第一系统向第二系统发送固件擦除指令;
该方法还包括:
在第一系统的第一存储空间中存在第二系统的待升级资源,且引导加载固件与历史引导加载固件相同的情况下,第一系统触发第二系统运行历史引导加载固件。
可选的,在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统通过第一数据传输通道向第二系统传输引导加载固件,包括:
在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统触发复位信号;
在检测到复位信号的情况下,第二系统向第一系统发送第一握手请求;
第一系统向第二系统发送第一握手请求对应的第一握手响应;
第二系统向第一系统发送对第一握手响应的确认响应;
在接收到确认响应的情况下,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件。
可选的,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件之后,该方法还包括:
在目标引导加载固件传输完成的情况下,第二系统向第一系统发送固件传输完成响应;
第一系统触发第二系统运行目标引导加载固件,包括:
在接收到固件传输完成响应的情况下,第一系统触发复位信号;
在检测到复位信号情况下,第二系统向第一系统发送第一握手请求;
在未接收到第一握手请求对应的第一握手响应的情况下,第二系统运行目标引导加载固件。
可选的,第二系统通过运行目标引导加载固件,使能与第一系统之间的第二数据传输通道,包括:
第一系统触发升级信号;
在检测到升级信号的情况下,第二系统通过运行目标引导加载固件,初始化第二数据传输通道;
第一系统通过第二数据传输通道向第二系统发送第二握手请求;
第二系统通过第二数据传输通道向第一系统发送第二握手请求对应的第二握手响应,以使能第二数据传输通道;
该方法还包括:
在待升级资源完成传输的情况下,第一系统停止触发升级信号。
可选的,第一系统通过第二数据传输通道,向第二系统传输待升级资源,包括:
第一系统向第二系统发送版本信息获取请求;
第二系统向第一系统返回当前资源版本信息;
在当前资源版本信息与待升级资源的版本信息不一致的情况下,第一系统通过第二数据传输通道,向第二系统发送资源传输请求;
第二系统向第一系统发送对资源传输请求的请求响应;
在接收到请求响应的情况下,第一系统通过第二数据传输通道,向第二系统传输待升级资源。
可选的,资源传输请求中包含存储分区信息,存储分区信息用于指示存储待升级资源的分区;
第二系统向第一系统发送对资源传输请求的请求响应,包括:
第二系统对资源传输请求中包含的存储分区信息进行有效性校验;
在存储分区信息通过有效性校验的情况下,第二系统向第一系统发送对资源传输请求的请求响应。
可选的,资源传输请求中包含目标校验值,目标校验值由第一系统基于待升级资源生成;
该方法还包括:
在接收第一系统传输的待升级资源的过程中,第二系统对已写入资源进行回读校验,得到回读校验值;
在待升级资源完全写入的情况下,第二系统基于回读校验值以及目标校验值,对写入的待升级资源进行写入校验;
基于写入校验结果,通过第二数据传输通道向第一系统发送升级结果响应。
可选的,第二系统的第二存储空间包括至少两个存储子空间,资源传输请求包括至少两种针对不同类型资源的资源传输子请求;
该方法还包括:
第二系统通过运行的目标引导加载固件,基于资源传输子请求确定待升级子资源对应的目标存储子空间;
第二系统将待升级子资源写入目标存储子空间。
可选的,第二系统的第二存储空间包括Nor Flash和eMMC,Nor Flash用于写入待升级资源中的固件资源,eMMC用于写入待升级资源中的文件资源。
可选的,待升级资源以资源数据包的形式传输,且第二系统写入资源数据包与接收资源数据包并行执行。
可选的,第一数据传输通道为UART通道或SWD通道,第二数据传输通道为SPI通道。
在一些实施例中,在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统触发复位信号。
可选的,第一系统拉动复位管脚,以触发复位信号。
在检测到复位信号的情况下,第二系统向第一系统发送第一握手请求。
其中,第一握手请求用于请求第一系统指示传输目标引导加载固件(HS-bootloader.bin)或指示第二系统运行目标引导加载固件。
在一些实施例中,在第二系统的待升级资源完成升级的情况下,第一系统不响应第一握手请求,以指示第二系统运行目标引导加载固件。
在一些实施例中,在第二系统的待升级资源未完成升级的情况下,第一系统向第二系统发送第一握手请求对应的第一握手响应。
第二系统向第一系统发送对第一握手响应的确认响应。
在接收到确认响应的情况下,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件。
参见图5,图5是本申请一个示例性实施例提供的第一系统通过第一数据传输通道向第二系统传输目标引导加载固件的时序图。
其中,步骤5.1~5.2.3为第一系统与第二系统进行第一握手的过程。
步骤5.1,在第一系统的第一存储空间中存在第二系统的待升级资源的情况下,第一系统拉动复位管脚,以触发复位信号。
步骤5.2.1,在检测到复位信号的情况下,第二系统向第一系统发送第一握手请求。
步骤5.2.2,在未完成向第二系统传输目标引导加载固件的情况下,第一系统向第二系统发送第一握手请求对应的第一握手响应。
在完成向第二系统传输目标引导加载固件的情况下,第一系统不向第二系统发送第一握手响应。
在未接收到第一握手请求对应的第一握手响应的情况下,第二系统运行目标引导加载固件。
步骤5.2.3,第二系统向第一系统发送对第一握手响应的确认响应。
在一些实施例中,在向第二系统传输标引导加载固件之前,第一系统可以先通过第一数据传输通道向第二系统传输用于辅助下载目标引导加载固件的程序,如progarmmer.bin,以用于后续辅助执行下载HS-bootloader.bin。
其中,步骤5.3.1~5.3.3为传输progarmmer.bin的过程。
步骤5.3.1,第一系统通过第一数据通道向第二系统传输progarmmer.bin。
可选的,第二系统接收progarmmer.bin后,将progarmmer.bin写入第二系统的RAM(Random Access Memory,随机存取存储器)。
步骤5.3.2,第二系统通过第一数据通道向第一系统返回progarmmer.bin的传输成功响应。
步骤5.3.3,第一系统通过第一数据通道向第二系统发送请求执行programmer.bin的指令。
第二系统基于接收到的指令,跳转并执行programmer.bin。
在第二系统执行用于辅助下载目标引导加载固件的progarmmer.bin后,第一系统可以通知第二系统擦除历史引导加载固件,以写入当前新的目标引导加载固件。
其中,步骤5.4.1~5.4.4为擦除历史引导加载固件的过程。
步骤5.4.1,第一系统通过第一数据传输通道向第二系统发送存储空间配置获取请求。
其中,存储空间配置信息用于指示存储引导加载固件的存储空间的配置情况。
可选的,存储空间配置信息可以包括第二系统存储引导加载固件的存储分区信息。例如,存储空间配置信息包括Nor Flash ID为2,指示第二系统将引导加载固件存储在Nor Flash中的第2个存储分区中。
可选的,存储空间配置信息还可以包括引导加载固件的数据对齐方式。其中,数据对齐方式指示引导加载固件在传输和存储过程中按照目标比特位数进行数据对齐。例如,按照4比特或8比特进行数据对齐。
步骤5.4.2,第二系统通过第一数据传输通道向第一系统返回存储空间配置信息。
例如,第二系统向第一系统返回引导加载固件的存储分区信息Nor Flash ID为2。
步骤5.4.3,第一系统通过第一数据传输通道向第二系统发送固件擦除指令,以通知第二系统对存储分区内的历史引导加载固件进行擦除。
在一种可能的场景中,上一次进行待升级资源的传输过程中,第二系统的存储分区内已存储有历史引导加载固件,因此第二系统需要对历史引导加载固件进行擦除,以便后续该存储分区内写入本次待升级资源对应的目标引导加载固件。
第二系统基于固件擦除指令,擦除历史引导加载固件。
例如,第二系统对存储分区信息Nor Flash ID为2对应的存储分区进行固件擦除操作,以擦除历史引导加载固件。
步骤5.4.4,在历史引导加载固件擦除完毕的情况下,第二系统通过第一数据传输通道向第一系统返回擦除完成响应。
在历史引导加载固件擦除完毕的情况下,第一系统通过第一数据传输通道,向第二系统传输目标引导加载固件。
步骤5.5.1~5.5.2为传输目标引导加载固件的过程。
步骤5.5.1,第一系统通过第一数据传输通道向第二系统传输目标引导加载固件(HS-bootloader.bin)。
在历史引导加载固件擦除完毕的情况下,第一系统基于存储空间配置信息,通过第一数据传输通道,向第二系统传输目标引导加载固件。
可选的,在存储空间配置信息中包含目标引导加载固件的数据对齐方式的情况下,第一系统按照该数据对齐方式对目标引导加载固件进行传输,第二系统按照该数据对齐方式对目标引导加载固件进行写入。
第二系统将目标引导加载固件写入存储分区信息对应的存储分区。例如,将目标引导加载固件写入Nor Flash ID为2对应的存储分区。
步骤5.5.2,在目标引导加载固件传输完成的情况下,第二系统向第一系统发送固件传输完成响应。
其中,固件传输完成响应表征HS-bootloader.bin传输完成。
步骤5.6,在接收到固件传输完成响应的情况下,第一系统触发复位信号。
可选的,第一系统再次拉动复位管脚,以触发复位信号。
第二系统再次检测到复位信号时,再次向第一系统发送第一握手请求,在未接收到第一握手请求对应的第一握手响应的情况下,第二系统运行目标引导加载固件。
本实施例中,在未完成第一系统向第二系统传输目标引导加载固件的情况下,第一系统向第二系统传输programmer.bin,以辅助下载目标引导加载固件;第一系统向第二系统发送固件擦除指令,可以实现对历史引导加载固件的擦除,以写入新的目标引导加载固件;在完成第一系统向第二系统传输目标引导加载固件的情况下,第二系统执行目标引导加载固件,使能第二数据传输通道,以用于后续能够高速率地进行待升级资源的传输。
在一些实施例中,第一系统可以判断历史引导加载固件与目标引导加载固件是否相同,在相同的情况下,免去传输目标引导加载固件的步骤,从而进一步提升资源传输效率。
参见图6,图6是本申请一个示例性实施例提供的第一系统触发第二系统运行引导加载固件的流程图。第一系统触发第二系统运行引导加载固件包括以下步骤。
步骤610,在第一系统的第一存储空间中存在第二系统的待更新资源的情况下,第一系统判断待升级资源对应的目标引导加载固件与历史引导加载固件是否相同。
在一些实施例中,第一系统可以先判断目标引导加载固件与历史引导加载固件的文件大小是否相同;在文件大小相同的情况下,再判断文件内容是否相同,以提升判断效率。
关于第一系统判断目标引导加载固件与历史引导加载固件的文件内容是否相同的具体方法,在一种可 能的实现方式中,可以预先在第一系统中设置引导加载固件中不同文件区域对应的更新概率,第一系统按照更新概率由高到低的顺序对目标引导加载固件与历史引导加载固件的文件内容进行逐一比较,以确定目标引导加载固件与历史引导加载固件是否相同,进一步提升判断的效率。
步骤621,在目标引导加载固件不同于历史引导加载固件的情况下,第一系统向第二系统发送固件擦除指令。
步骤622,第二系统基于固件擦除指令,擦除历史引导加载固件。
步骤623,在历史引导加载固件擦除完毕的情况下,第一系统通过第一数据传输通道,向第二系统传输目标引导加载固件。
步骤624,第一系统触发第二系统运行目标引导加载固件。
步骤631,在引导加载固件与历史引导加载固件相同的情况下,第一系统触发第二系统运行历史引导加载固件。
步骤640,第二系统通过运行引导加载固件,使能与第一系统之间的第二数据传输通道,第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率。
其中,在执行步骤624的情况下,引导加载固件为目标引导加载固件;在执行步骤631的情况下,引导加载固件为历史引导加载固件。
步骤650,第一系统通过第二数据传输通道,向第二系统传输待升级资源。
本实施例中,第一系统对目标引导加载固件和历史引导加载固件进行比较,在目标引导加载固件和历史引导加载固件相同的情况下,第二系统直接运行历史引导加载固件,从而免去了第一系统通过第一数据传输通道传输目标引导加载固件、第二系统擦除历史引导加载固件再将引导加载固件写入存储空间的步骤,从而提升了资源传输过程的效率。
参见图7,图7是本申请一个示例性实施例提供的第一系统通过第二数据传输通道向第二系统传输待升级资源的时序图。
其中,步骤7.1.1~7.1.4为第一系统与第二系统进行第二握手的过程。
步骤7.1.1,第一系统触发升级信号。其中,升级信号用于指示当前具有待升级资源的传输需求。
示例性的,第一系统通过拉动复位管脚,并拉高升级请求管脚,以触发升级信号。
步骤7.1.2,在检测到升级信号的情况下,第二系统通过运行目标引导加载固件,初始化第二数据传输通道。
示例性的,当第二系统检测到升级请求管脚为高电平时,初始化第二数据传输通道。
步骤7.1.3,第一系统通过第二数据传输通道向第二系统发送第二握手请求。
其中,第二握手请求用于请求通过第二数据传输通道传输待升级资源。
步骤7.1.4,第二系统通过第二数据传输通道向第一系统发送第二握手请求对应的第二握手响应,以使能第二数据传输通道。
在一些实施例中,第一系统可以向第二系统读取各个待升级资源对应的版本信息,并基于版本信息确定是否向第二系统传输各个待升级资源。
步骤7.2.1,第一系统向第二系统发送版本信息获取请求。
其中,版本信息获取请求用于获取待升级资源对应的版本信息,例如,版本编号。
可选的,第一系统通过第一数据传输通道或第二数据传输通道向第二系统发送版本信息获取请求。
步骤7.2.2,第二系统向第一系统返回当前资源版本信息。
其中,当前资源版本信息是指第二系统的第二存储空间中存储的与待升级资源对应的资源的版本信息。例如,待升级资源对应的版本编号为2.0版本,当前资源版本信息为1.0版本。
可选的,第二系统通过第一数据传输通道或第二数据传输通道向第一系统返回版本信息。
在当前资源版本信息与待升级资源的版本信息一致的情况下,第一系统停止向第二系统传输待升级资源,并停止触发升级信号,以表征资源升级已完成。
在当前资源版本信息与待升级资源的版本信息不一致的情况下,第一系统通过第二数据传输通道,向第二系统发送资源传输请求。
第二系统向第一系统发送对资源传输请求的请求响应。
在接收到请求响应的情况下,第一系统通过第二数据传输通道,向第二系统传输待升级资源。
其中,不同类型的待升级资源对应于不同类型的资源传输请求。在一些实施例中,资源传输请求包括至少两种针对不同类型资源的资源传输子请求。
例如,待升级资源为文件镜像,则对应的资源传输子请求为文件镜像传输子请求;待升级资源为应用程序固件,则对应的资源传输请求为应用程序固件传输子请求。
为存储不同类型的待升级资源,在一些实施例中,第二系统的第二存储空间包括至少两个存储子空间。第二系统通过运行的目标引导加载固件,基于资源传输子请求确定待升级子资源对应的目标存储子空间;并第二系统将待升级子资源写入目标存储子空间。
仅作示例的,在资源传输子请求为文件资源传输子请求的情况下,第二系统通过运行的目标引导加载固件,确定目标存储子空间为eMMC;在资源传输子请求为固件资源传输子请求的情况下,第二系统通过运行的目标引导加载固件,确定目标存储子空间为Nor Flash。
步骤7.3.1~7.3.8为第一系统通过第二数据传输通道向第二系统传输文件资源的过程。
步骤7.3.1,第一系统通过第二数据传输通道,向第二系统发送文件资源传输子请求。其中,文件资源传输子请求用于请求向第二系统传输文件资源。
在一些实施例中,资源传输请求中包含存储分区信息,存储分区信息用于指示存储待升级资源的分区。
仅作示例的,文件资源传输子请求中包含存储分区信息Nor Flash ID为3,指示第二系统存储文件资源的分区为Nor Flash中的第3个存储分区。
在一些实施例中,资源传输请求中还包含目标校验值。
目标校验值由第一系统基于待升级资源生成,用于在资源写入的过程中与回读校验值进行比对,以保证资源写入的准确性。
可选的,目标校验值为奇偶校验值,或者其他类型的校验值。
步骤7.3.2,第二系统对资源传输请求中包含的存储分区信息进行有效性校验,并记录目标校验值。
在一种可能的实现方式中,第二系统将存储分区信息与第二存储空间中每个存储分区对应的信息进行逐一比对,以确定出该存储分区的有效性。
仅作示例的,存储分区信息eMMC ID为3,且第二存储空间的eMMC中具有编号为3的存储分区,则该存储分区信息具备有效性;存储分区信息eMMC ID为999,且第二存储空间的eMMC中不具有编号为999的存储分区,则该存储分区信息不具备有效性。
示例性的,资源传输请求中还包含目标校验值为0,则第二系统记录目标校验值0。
步骤7.3.3,在存储分区信息通过有效性校验的情况下,第二系统向第一系统发送对资源传输请求的请求响应。
步骤7.3.4,在接收到请求响应的情况下,第一系统通过第二数据传输通道,向第二系统传输文件资源。
步骤7.3.5,在接收第一系统传输的待升级资源的过程中,第二系统对已写入资源进行回读校验,得到回读校验值。
在一些实施例中,在接收第一系统传输的文件资源对应的第一个文件资源包时,第二系统将第一个文件资源包写入eMMC中编号为3的存储分区,并立即对第一个文件资源包进行回读校验,得到第一个文件资源包对应的回读校验值(假设为1)。
在一些实施例中,第一个文件资源包对应的回读校验值由第二系统基于第一个文件资源包生成。
在接收第一系统传输的文件资源对应的第二个文件资源包时,第二系统将第二个文件资源包写入eMMC中编号为3的存储分区,并立即对第二个文件资源包进行回读校验,得到第二个文件资源包对应的回读校验值(假设为2)。
在一些实施例中,第二个文件资源包对应的回读校验值由第二系统基于第二个文件资源包以及第一个文件资源包对应的回读校验值生成。
……
在接收第一系统传输的文件资源对应的最后一个文件资源包时,第二系统将最后一个文件资源包写入eMMC中编号为3的存储分区,并立即对最后一个文件资源包进行回读校验,得到最后一个文件资源包对应的回读校验值(假设为0)。
在待升级资源完全写入的情况下,第二系统基于回读校验值以及目标校验值,对写入的待升级资源进行写入校验,得到写入校验结果。
在一些实施例中,在回读校验值与目标校验值一致的情况下,第二系统确定写入校验结果为正确写入。
步骤7.3.6,在接收到第一系统通过第二数据传输通道发送的文件资源的情况下,第二系统通过第二数据传输通道向第一系统发送传输结果响应。
可选的,对于每一个文件资源包,第二系统均会向第一系统发送该文件资源包对应的传输结果响应。
可选的,第二系统仅回复部分文件资源包对应的传输结果响应,以减少数据传输量,例如,第二系统可以仅回复最后一个文件资源包对应的传输结果响应。
步骤7.3.7,在文件资源传输完成的情况下,第一系统向第二系统发送文件资源升级结果读取请求。
步骤7.3.8,第二系统基于文件资源的写入校验结果,通过第二数据传输通道向第一系统发送文件资源 升级结果。
在一些实施例中,在写入校验结果为正确写入的情况下,第二系统通过第二数据传输通道向第一系统发送表征升级成功的文件资源升级结果。
在一些实施例中,在写入校验结果不为正确写入的情况下,第二系统通过第二数据传输通道向第一系统发送表征升级失败的文件资源升级结果,以指示第一系统通过第二数据传输通道重传待升级资源。
本实施例中,在接收第一系统传输的待升级资源的过程中,第二系统对已写入资源进行回读校验,得到回读校验值,并在待升级资源完全写入的情况下,第二系统基于回读校验值以及目标校验值确定写入校验结果,一方面可以保证写入的正确性,提升待升级资源的升级质量;另一方面,边写入边校验可以节省回读校验时间,当传输完成后即可尽快完成回读校验,提升了资源传输的效率。
步骤7.4.1~7.4.8为第一系统通过第二数据传输通道向第二系统传输固件资源的过程。
步骤7.4.1,第一系统通过第二数据传输通道,向第二系统发送固件资源传输子请求。其中,固件资源传输子请求用于请求向第二系统传输固件资源。
需要说明的是,固件资源是指待升级的应用程序固件,并非使能第二数据传输通道的HS-bootloader固件。
示例性的,固件资源包括m55.bin、SensorHub.bin等。其中,SensorHub.bin是传感器管理组件对应的应用程序固件。
在一些实施例中,资源传输请求中包含存储分区信息,存储分区信息用于指示存储待升级资源的分区。
仅作示例的,固件资源传输子请求中包含存储分区信息Nor Flash ID为5,指示第二系统存储文件资源的分区为Nor Flash中的第5个存储分区。
在一些实施例中,固件资源传输子请求中还包含该存储分区对应的目标校验值。
步骤7.4.2,第二系统根据固件资源传输子请求中包含的存储分区信息,擦除旧固件。
仅作示例的,第二系统对Nor Flash中的第5个存储分区进行旧固件擦除。
步骤7.4.3,第二系统向第一系统发送对固件资源传输子请求的请求响应。
步骤7.4.4,在接收到请求响应的情况下,第一系统通过第二数据传输通道,向第二系统传输固件资源。
步骤7.4.5,在接收待升级资源的过程中,第二系统进行回读校验,得到回读校验值;并基于目标校验值和回读校验值,确定写入校验结果。
对固件资源进行回读校验的过程与对文件资源进行回读校验的过程类似,关于回读校验的更多内容参见步骤5.3.5,在此不再赘述。
步骤7.4.6,在接收到第一系统通过第二数据传输通道发送的固件资源的情况下,第二系统通过第二数据传输通道向第一系统发送传输结果响应。
可选的,对于每一个固件资源包,第二系统均会向第一系统发送该固件资源包对应的传输结果响应。
可选的,第二系统仅回复部分固件资源包对应的传输结果响应,以减少数据传输量,例如,第二系统可以仅回复最后一个固件资源包对应的传输结果响应。
步骤7.4.7,在固件资源传输完成的情况下,第一系统向第二系统发送固件资源升级结果读取请求。
步骤7.4.8,第二系统基于固件资源的写入校验结果,通过第二数据传输通道向第一系统发送固件资源升级结果。
步骤7.5,在待升级资源完成传输的情况下,第一系统停止触发升级信号。
可选的,在全部待升级资源的资源升级结果均为升级成功的情况下,第一系统再次拉动复位管脚,并拉低升级请求管脚,以停止触发升级信号。
参见图8,图8是本申请另一个示例性实施例提供的双核双系统的示意图。
如图8所示,在第一系统810与第二系统820之间可以通过第一数据传输通道831传输目标引导加载固件。在目标引导加载固件传输完成的情况下,目标引导加载固件使能第二数据传输通道832,第一系统810通过第二数据传输通道832向第二系统820传输待升级资源。
此外,第一系统810对应的第一处理器和第二系统820对应的第二处理器之间通过复位管脚841和升级请求管脚842相连。第一系统810的第一存储空间包括eMMC-1(811);第二系统820的第二存储空间包括eMMC-2(821)以及Nor Flash(822)。
参见图9,图9是本申请一个示例性实施例提供的资源传输方法的二阶段示意图。
如图9所示,在本申请提出的资源传输方法中,包含两个数据传输阶段,其中第一阶段901为MCU-Boot阶段。第一阶段中,第一系统和第二系统通过第一数据传输通道传输HS-bootloader。
第一阶段901中包含第一子阶段911,第二系统通过第一数据传输通道下载HS-bootloader至第二存储空间中。
在一些实施例中,第一数据传输通道为UART通道或SWD通道。
在一些实施例中,第二系统的第二存储空间包括Nor Flash和eMMC-2,第二系统将HS-bootloader存储至Nor Flash中。
其中,HS-bootloader为目标引导加载固件,第二系统通过运行目标引导加载固件,使能与第一系统之间的第二数据传输通道,且第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率。
第二阶段902为HS-bootloader阶段。第二阶段中,第一系统和第二系统通过第二数据传输通道传输待升级资源。
在一些实施例中,第二数据传输通道为SPI通道。
在一些实施例中,第二系统通过运行的目标引导加载固件,基于资源传输子请求确定待升级子资源对应的目标存储子空间,并将第二系统将待升级子资源写入目标存储子空间。
目标存储子空间包括Nor Flash和eMMC,其中,Nor Flash用于写入待升级资源中的固件资源,eMMC(指eMMC-2)用于写入待升级资源中的文件资源。
第二阶段902中包含第二子阶段921和第三子阶段922。
在第二子阶段921中,第二系统通过第二数据传输通道将固件资源下载到Nor Flash。
在第三子阶段922中,第二系统通过第二数据传输通道将文件资源下载到eMMC。
其中,第二子阶段921和第三子阶段922不具有先后执行顺序,第一系统可以根据需要选择先下载固件资源或者先下载文件资源,本申请实施例对此不作限制。
在一种可能的实现方式中,第一系统可以获取待升级资源的不同资源类型对应的优先级,并优先传输优先级较高的资源类型对应的数据。其中,优先级可以基于历史资源传输记录确定。例如,第一系统可以获取传输用时小于时长阈值的历史资源传输记录,并统计优先传输文件资源的历史资源传输记录中完成全部资源传输的第一平均时长,以及优先传输固件资源的历史资源传输记录中完成全部资源传输的第二平均时长;在第一平均时长大于第二平均时长的情况下,确定固件资源的优先级高于文件资源的优先级,在第一平均时长小于第二平均时长的情况下,确定文件资源的优先级高于固件资源的优先级。
参见图10,图10是本申请一个示例性实施例提供的第二系统写入资源数据包与接收资源数据包并行执行的示意图。
待升级资源以资源数据包的形式传输,第一系统通过第二数据传输通道,依次向第二系统传输资源数据包X-1、资源数据包X、资源数据包X+1……
第二系统写入资源数据包与接收资源数据包并行执行。
如图10所示,第二系统写入资源数据包X-1与接收资源数据包X并行执行、写入资源数据包X与接收资源数据包X+1并行执行、写入资源数据包X+1与接收资源数据包X+2并行执行,即,第二系统在接收当前资源数据包的同时,同时写入前一个资源数据包。
由于写入资源数据包和接收资源数据包为待升级资源的升级过程中耗时最长的两个步骤,因此通过上述写入资源数据包与接收资源数据包并行执行的方式,可以提升减少资源升级时长,提升资源升级效率。
参见图11,图11是本申请一个示例性实施例提供的资源传输装置的结构框图。该装置包括:
第一系统模块1101,用于在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,通过第一数据传输通道向所述第二系统传输目标引导加载固件;
所述第一系统模块1101,还用于触发所述第二系统运行所述目标引导加载固件;
第二系统模块1102,用于通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,所述第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率;
所述第一系统模块1101,还用于通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
可选的,所述第一系统模块1101,用于:
向所述第二系统发送固件擦除指令;
所述第二系统模块1102,还用于基于所述固件擦除指令,擦除历史引导加载固件;
在所述历史引导加载固件擦除完毕的情况下,所述第一系统模块1101,还用于通过所述第一数据传输通道,向所述第二系统传输所述目标引导加载固件。
可选的,所述第一系统模块1101,用于:
向所述第二系统发送存储空间配置获取请求;
所述第二系统模块1102,还用于向所述第一系统发送存储空间配置信息,所述存储空间配置信息用于 指示存储引导加载固件的存储空间的配置情况;
所述第一系统模块1101,还用于在所述历史引导加载固件擦除完毕的情况下,基于所述存储空间配置信息,通过所述第一数据传输通道,向所述第二系统传输所述目标引导加载固件。
可选的,所述第一系统模块1101,用于:
在所述目标引导加载固件不同于所述历史引导加载固件的情况下,向所述第二系统发送所述固件擦除指令;
在所述第一系统的第一存储空间中存在所述第二系统的待升级资源,且所述引导加载固件与所述历史引导加载固件相同的情况下,触发所述第二系统运行所述历史引导加载固件。
可选的,所述第一系统模块1101,用于:
在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,触发复位信号;
所述第二系统模块1102,还用于在检测到所述复位信号的情况下,向所述第一系统发送第一握手请求;
所述第一系统模块1101,还用于向所述第二系统发送所述第一握手请求对应的第一握手响应;
所述第二系统模块1102,还用于向所述第一系统发送对所述第一握手响应的确认响应;
所述第一系统模块1101,还用于在接收到所述确认响应的情况下,通过所述第一数据传输通道向所述第二系统传输所述目标引导加载固件。
可选的,第二系统模块1102,用于:
在所述目标引导加载固件传输完成的情况下,向所述第一系统发送固件传输完成响应;
所述第一系统模块1101,还用于在接收到所述固件传输完成响应的情况下,触发所述复位信号;
所述第二系统模块1102,还用于在检测到所述复位信号情况下,向所述第一系统发送第一握手请求;
在未接收到所述第一握手请求对应的所述第一握手响应的情况下,运行所述目标引导加载固件。
可选的,第一系统模块1101,用于:
触发升级信号;
所述第二系统模块1102,还用于在检测到所述升级信号的情况下,通过运行所述目标引导加载固件,初始化所述第二数据传输通道;
所述第一系统模块1101,还用于通过所述第二数据传输通道向所述第二系统发送第二握手请求;
所述第二系统模块1102,还用于通过所述第二数据传输通道向所述第一系统发送所述第二握手请求对应的第二握手响应,以使能所述第二数据传输通道;
所述第一系统模块1101,还用于在所述待升级资源完成传输的情况下,停止触发所述升级信号。
可选的,第一系统模块1101,用于:
向所述第二系统发送版本信息获取请求;
所述第二系统模块1102,还用于向所述第一系统返回当前资源版本信息;
所述第一系统模块1101,还用于在所述当前资源版本信息与所述待升级资源的版本信息不一致的情况下,通过所述第二数据传输通道,向所述第二系统发送资源传输请求;
所述第二系统模块1102,还用于向所述第一系统发送对所述资源传输请求的请求响应;
所述第一系统模块1101,还用于在接收到所述请求响应的情况下,通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
可选的,所述资源传输请求中包含存储分区信息,所述存储分区信息用于指示存储所述待升级资源的分区;第二系统模块1102,用于:
对所述资源传输请求中包含的所述存储分区信息进行有效性校验;
在所述存储分区信息通过有效性校验的情况下,向所述第一系统发送对所述资源传输请求的所述请求响应。
可选的,所述资源传输请求中包含目标校验值,所述目标校验值由所述第一系统基于所述待升级资源生成;第二系统模块1102,用于:
在接收所述第一系统传输的所述待升级资源的过程中,对已写入资源进行回读校验,得到回读校验值;
在所述待升级资源完全写入的情况下,基于所述回读校验值以及所述目标校验值,对写入的所述待升级资源进行写入校验;
基于写入校验结果,通过所述第二数据传输通道向所述第一系统发送升级结果响应。
可选的,所述第二系统的第二存储空间包括至少两个存储子空间,所述资源传输请求包括至少两种针对不同类型资源的资源传输子请求;第二系统模块1102,用于:
通过运行的所述目标引导加载固件,基于所述资源传输子请求确定待升级子资源对应的目标存储子空间;
将所述待升级子资源写入所述目标存储子空间。
可选的,所述第二系统的所述第二存储空间包括Nor Flash和eMMC,所述Nor Flash用于写入所述待升级资源中的固件资源,所述eMMC用于写入所述待升级资源中的文件资源。
可选的,所述待升级资源以资源数据包的形式传输,且所述第二系统写入资源数据包与接收所述资源数据包并行执行。
可选的,所述第一数据传输通道为UART通道或SWD通道,所述第二数据传输通道为SPI通道。
请参考图12,图12是本申请一个示例性实施例提供的电子设备的结构方框图。本申请中的电子设备可以包括一个或多个如下部件:处理器1210和存储器1220。
可选的,处理器1210至少包括第一处理器1211和第二处理器1212,其中,第一处理器1211用于运行第一系统,第二处理器1212用于运行第二系统。在一些实施例中,第一处理器1211的功耗低于第二处理器1212的功耗,第一处理器1211的性能低于第二处理器1212的性能。在另一些实施例中,第一处理器1211的功耗高于第二处理器1212的功耗,第一处理器1211的性能高于第二处理器1212的性能。处理器1210利用各种接口和线路连接整个电子设备内的各个部分,通过运行或执行存储在存储器1220内的指令、程序、代码集或指令集,以及调用存储在存储器1220内的数据,执行电子设备的各种功能和处理数据。可选地,处理器1210可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1210可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责触摸显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligence,AI)功能;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1210中,单独通过一块芯片进行实现。
存储器1220可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器1220包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器1220可用于存储指令、程序、代码、代码集或指令集。存储器1220可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据电子设备的使用所创建的数据(比如音频数据、电话本)等。
本申请实施例中的电子设备还包括通信组件1230和显示组件1240。其中,通信组件1230可以为蓝牙组件、WiFi(Wireless Fidelity,无线保真)组件、NFC(Near Field Communication,近场通信技术)组件等等,用于通过有线或无线网络与外部设备(服务器或其他终端设备)进行通信;显示组件1240用于进行图形用户界面展示,和/或,接收用户交互操作。
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备的结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备中还包括射频电路、输入单元、传感器、音频电路、扬声器、麦克风、电源等部件,在此不再赘述。
本申请实施例还提供一种计算机可读存储介质,该可读存储介质中存储有至少一条指令,至少一条指令由处理器加载并执行以实现上述任一实施例所述的资源传输方法。
可选的,该计算机可读存储介质可以包括:ROM、RAM、固态硬盘(SSD,Solid State Drives)或光盘等。其中,RAM可以包括电阻式随机存取记忆体(ReRAM,Resistance Random Access Memory)和动态随机存取存储器(DRAM,Dynamic Random Access Memory)。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;电子设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述电子设备执行以实现上述任一实施例所述的资源传输方法。
以上所述仅为本申请的可选的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (18)

  1. 一种资源传输方法,所述方法应用于电子设备,所述电子设备支持运行第一系统和第二系统;
    所述方法包括:
    在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,所述第一系统通过第一数据传输通道向所述第二系统传输目标引导加载固件;
    所述第一系统触发所述第二系统运行所述目标引导加载固件;
    所述第二系统通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,所述第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率;
    所述第一系统通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
  2. 根据权利要求1所述的方法,其中,所述第一系统通过第一数据传输通道向所述第二系统传输目标引导加载固件,包括:
    所述第一系统向所述第二系统发送固件擦除指令;
    所述第二系统基于所述固件擦除指令,擦除历史引导加载固件;
    在所述历史引导加载固件擦除完毕的情况下,所述第一系统通过所述第一数据传输通道,向所述第二系统传输所述目标引导加载固件。
  3. 根据权利要求2所述的方法,其中,所述方法还包括:
    所述第一系统向所述第二系统发送存储空间配置获取请求;
    所述第二系统向所述第一系统发送存储空间配置信息,所述存储空间配置信息用于指示存储引导加载固件的存储空间的配置情况;
    在所述历史引导加载固件擦除完毕的情况下,所述第一系统通过所述第一数据传输通道,向所述第二系统传输所述目标引导加载固件,包括:
    在所述历史引导加载固件擦除完毕的情况下,所述第一系统基于所述存储空间配置信息,通过所述第一数据传输通道,向所述第二系统传输所述目标引导加载固件。
  4. 根据权利要求2所述的方法,其中,所述第一系统向所述第二系统发送固件擦除指令,包括:
    在所述目标引导加载固件不同于所述历史引导加载固件的情况下,所述第一系统向所述第二系统发送所述固件擦除指令;
    所述方法还包括:
    在所述第一系统的第一存储空间中存在所述第二系统的待升级资源,且所述引导加载固件与所述历史引导加载固件相同的情况下,所述第一系统触发所述第二系统运行所述历史引导加载固件。
  5. 根据权利要求1所述的方法,其中,所述在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,所述第一系统通过第一数据传输通道向所述第二系统传输引导加载固件,包括:
    在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,所述第一系统触发复位信号;
    在检测到所述复位信号的情况下,所述第二系统向所述第一系统发送第一握手请求;
    所述第一系统向所述第二系统发送所述第一握手请求对应的第一握手响应;
    所述第二系统向所述第一系统发送对所述第一握手响应的确认响应;
    在接收到所述确认响应的情况下,所述第一系统通过所述第一数据传输通道向所述第二系统传输所述目标引导加载固件。
  6. 根据权利要求5所述的方法,其中,所述第一系统通过第一数据传输通道向所述第二系统传输目标引导加载固件之后,所述方法还包括:
    在所述目标引导加载固件传输完成的情况下,所述第二系统向所述第一系统发送固件传输完成响应;
    所述第一系统触发所述第二系统运行所述目标引导加载固件,包括:
    在接收到所述固件传输完成响应的情况下,所述第一系统触发所述复位信号;
    在检测到所述复位信号情况下,所述第二系统向所述第一系统发送第一握手请求;
    在未接收到所述第一握手请求对应的所述第一握手响应的情况下,所述第二系统运行所述目标引导加载固件。
  7. 根据权利要求1所述的方法,其中,所述第二系统通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,包括:
    所述第一系统触发升级信号;
    在检测到所述升级信号的情况下,所述第二系统通过运行所述目标引导加载固件,初始化所述第二数据传输通道;
    所述第一系统通过所述第二数据传输通道向所述第二系统发送第二握手请求;
    所述第二系统通过所述第二数据传输通道向所述第一系统发送所述第二握手请求对应的第二握手响应,以使能所述第二数据传输通道;
    所述方法还包括:
    在所述待升级资源完成传输的情况下,所述第一系统停止触发所述升级信号。
  8. 根据权利要求1所述的方法,其中,所述第一系统通过所述第二数据传输通道,向所述第二系统传输所述待升级资源,包括:
    所述第一系统向所述第二系统发送版本信息获取请求;
    所述第二系统向所述第一系统返回当前资源版本信息;
    在所述当前资源版本信息与所述待升级资源的版本信息不一致的情况下,所述第一系统通过所述第二数据传输通道,向所述第二系统发送资源传输请求;
    所述第二系统向所述第一系统发送对所述资源传输请求的请求响应;
    在接收到所述请求响应的情况下,所述第一系统通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
  9. 根据权利要求8所述的方法,其中,所述资源传输请求中包含存储分区信息,所述存储分区信息用于指示存储所述待升级资源的分区;
    所述第二系统向所述第一系统发送对所述资源传输请求的请求响应,包括:
    所述第二系统对所述资源传输请求中包含的所述存储分区信息进行有效性校验;
    在所述存储分区信息通过有效性校验的情况下,所述第二系统向所述第一系统发送对所述资源传输请求的所述请求响应。
  10. 根据权利要求8所述的方法,其中,所述资源传输请求中包含目标校验值,所述目标校验值由所述第一系统基于所述待升级资源生成;
    所述方法还包括:
    在接收所述第一系统传输的所述待升级资源的过程中,所述第二系统对已写入资源进行回读校验,得到回读校验值;
    在所述待升级资源完全写入的情况下,所述第二系统基于所述回读校验值以及所述目标校验值,对写入的所述待升级资源进行写入校验;
    基于写入校验结果,通过所述第二数据传输通道向所述第一系统发送升级结果响应。
  11. 根据权利要求8所述的方法,其中,所述第二系统的第二存储空间包括至少两个存储子空间,所述资源传输请求包括至少两种针对不同类型资源的资源传输子请求;
    所述方法还包括:
    所述第二系统通过运行的所述目标引导加载固件,基于所述资源传输子请求确定待升级子资源对应的目标存储子空间;
    所述第二系统将所述待升级子资源写入所述目标存储子空间。
  12. 根据权利要求11所述的方法,其中,所述第二系统的所述第二存储空间包括Nor Flash和eMMC,所述Nor Flash用于写入所述待升级资源中的固件资源,所述eMMC用于写入所述待升级资源中的文件资源。
  13. 根据权利要求1所述的方法,其中,所述待升级资源以资源数据包的形式传输,且所述第二系统写入资源数据包与接收所述资源数据包并行执行。
  14. 根据权利要求1所述的方法,其中,所述第一数据传输通道为UART通道或SWD通道,所述第 二数据传输通道为SPI通道。
  15. 一种资源传输装置,所述装置用于电子设备,所述电子设备中支持运行第一系统和第二系统;
    所述装置包括:
    第一系统模块,用于在所述第一系统的第一存储空间中存在所述第二系统的待升级资源的情况下,通过第一数据传输通道向所述第二系统传输目标引导加载固件;
    所述第一系统模块,还用于触发所述第二系统运行所述目标引导加载固件;
    第二系统模块,用于通过运行所述目标引导加载固件,使能与所述第一系统之间的第二数据传输通道,所述第二数据传输通道的数据传输速率大于第一数据传输通道的数据传输速率;
    所述第一系统模块,还用于通过所述第二数据传输通道,向所述第二系统传输所述待升级资源。
  16. 一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至14任一所述的资源传输方法。
  17. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如权利要求1至14任一所述的资源传输方法。
  18. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;电子设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述电子设备执行如权利要求1至14任一所述的资源传输方法。
PCT/CN2024/087908 2024-01-26 2024-04-16 资源传输方法、装置、电子设备、介质及计算机程序产品 Pending WO2025156458A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410119616.4 2024-01-26
CN202410119616.4A CN120386747A (zh) 2024-01-26 2024-01-26 资源传输方法、装置、电子设备、介质及计算机程序产品

Publications (1)

Publication Number Publication Date
WO2025156458A1 true WO2025156458A1 (zh) 2025-07-31

Family

ID=96490318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/087908 Pending WO2025156458A1 (zh) 2024-01-26 2024-04-16 资源传输方法、装置、电子设备、介质及计算机程序产品

Country Status (2)

Country Link
CN (1) CN120386747A (zh)
WO (1) WO2025156458A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301858A1 (en) * 2014-04-21 2015-10-22 National Tsing Hua University Multiprocessors systems and processes scheduling methods thereof
CN110704077A (zh) * 2018-07-10 2020-01-17 中兴通讯股份有限公司 固件远程升级方法、装置、终端、移动设备及存储介质
WO2022218107A1 (zh) * 2021-04-14 2022-10-20 Oppo广东移动通信有限公司 数据传输方法、装置、设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301858A1 (en) * 2014-04-21 2015-10-22 National Tsing Hua University Multiprocessors systems and processes scheduling methods thereof
CN110704077A (zh) * 2018-07-10 2020-01-17 中兴通讯股份有限公司 固件远程升级方法、装置、终端、移动设备及存储介质
WO2022218107A1 (zh) * 2021-04-14 2022-10-20 Oppo广东移动通信有限公司 数据传输方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN120386747A (zh) 2025-07-29

Similar Documents

Publication Publication Date Title
US20110231640A1 (en) Methods and apparatus for priority initialization of a second processor
US11057762B2 (en) Electronic device and method for switching electronic device between dual standby mode and single standby mode
KR102447493B1 (ko) 랭크 단위로 메모리 장치를 트레이닝하는 전자 장치 및 그것의 메모리 트레이닝 방법
US20220210264A1 (en) Method and apparatus for executing application
EP3926466A1 (en) Electronic device which prefetches application and method therefor
WO2024078218A1 (zh) 系统启动方法及电子设备
US11157264B2 (en) Electronic device and method for controlling update of electronic device
US20200004578A1 (en) Method for fingerprint recognition and related products
US11379458B2 (en) Electronic device and data management method thereof
CN113360161B (zh) 资源升级方法及相关产品
US12093529B2 (en) Electronic device and operation method thereof
US20200201518A1 (en) Method for starting application and electronic device for implementing same
CN110007935A (zh) 一种程序升级的处理方法、装置及设备
CN106227571A (zh) 系统升级方法及其移动终端
CN114443083A (zh) 系统升级方法、装置、电子设备及存储介质
US12086420B2 (en) Memory management method and electronic device
CN106980513A (zh) 一种双引导文件的切换方法及装置
CN101373438B (zh) 一种基本输入输出系统管理方法、系统和装置
WO2025156458A1 (zh) 资源传输方法、装置、电子设备、介质及计算机程序产品
CN101515240A (zh) 一种数字信号处理器加载方法、电子装置以及电子系统
KR20090034140A (ko) 복수의 포트를 갖는 메모리를 구비한 휴대 단말기 및 부팅제어 방법
CN117742805B (zh) 芯片初始化方法和装置
WO2025016088A1 (zh) 多联机空调器的升级方法、装置、设备和存储介质
US20230033562A1 (en) Method and apparatus for reducing operation of garbage collection
CN110286963B (zh) 控制代码加载方法、装置、启动控制器以及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24919548

Country of ref document: EP

Kind code of ref document: A1