Mirror image file flashing method, analysis method, device, equipment and medium

CN115480784BActive Publication Date: 2026-10-27SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211121899.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2026-10-27
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

但是由于关机充电时设备所显示的关机充电动面和开机动面是相同的,会导致有些用户误以为设备当前是进入开机状态而误操作,由于实际设备系统并没有完整运行,只是调用了充电的功能,误操作会导致设备出现异常

Benefits of technology

[0006]本发明提供的镜像文件刷机方法的有益效果在于:上述方法复用同一存储分区存储不同的动画资源,在节省设备存储空间的基础上能够根据启动模式区别显示动画资源。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115480784B_ABST
    Figure CN115480784B_ABST
Patent Text Reader

Abstract

The application provides a mirror file flashing method, an analysis method and a device, comprising: an upper computer acquires two groups of images, one group of images is used to form a boot-up animation, and the second group of images is used to form a power-off charging animation; the upper computer compiles each frame of image in the first group of images and the second group of images into a corresponding mirror file in a compiling stage; the upper computer splices the mirror file corresponding to each frame of image and adds header information to obtain a final flashing mirror file; and the upper computer writes the flashing mirror file into a same specified storage partition of a terminal device. When the terminal device is started for the first time, the terminal device analyzes the flashing mirror file, stores an analysis result in a file system, and acquires a current device state, wherein the analysis result comprises the two groups of images; and the terminal device selects corresponding picture resources from the analysis result according to the current device state and displays the picture resources. The above method can reuse the same storage partition to store different animation resources, thereby saving device storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of terminal device design technology, and in particular to a method, parsing method, apparatus, device and medium for flashing image files. Background Technology

[0002] With the rapid development of the electronics industry and communication technology, smart home devices are becoming increasingly common, such as mobile phones, smart speakers, and smart bracelets, making people's lives more and more intelligent. For Android mobile smart devices such as mobile phones, tablets, and smartwatches, users use them very frequently, resulting in frequent charging. This increases the probability of battery abnormalities. Therefore, to ensure battery health and user safety, it's necessary to display a notification that the device is charging when it's powered off. However, because the display for charging while powered off is the same as the display for powering on, some users may mistakenly believe the device is powered on and accidentally operate it. Since the actual device system is not fully running, only the charging function is being used, this misoperation can lead to device malfunctions. To address this issue, existing technologies differentiate animation resources. Specifically, the Android device bootloader uses different partitions for animation resources corresponding to different device states (e.g., bootlogo partition, fastboot logo partition). During the boot process, the bootloader reads and displays the animation (logo) resources from different partitions based on the boot mode. This requires creating numerous resource partitions, and adding new partitions for new boot modes is cumbersome. These partitions also consume significant amounts of device storage space. Furthermore, the image resources displayed when the device is powered off and charging consist of multiple images, further consuming considerable storage space.

[0003] Therefore, it is necessary to develop a new solution to improve the aforementioned problems of existing technologies. Summary of the Invention

[0004] The purpose of this invention is to provide a method, parsing method, apparatus, device, and medium for flashing image files, so as to reuse the same storage partition to store different animation resources, and to distinguish and display animation resources according to the boot mode while saving device storage space.

[0005] In a first aspect, embodiments of the present invention provide a method for flashing a device using an image file. The method includes: acquiring two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a power-off charging animation; during the compilation stage, each frame of the first set of images and the second set of images is compiled into a corresponding image file; the image files corresponding to each frame of images are spliced ​​together and header information is added to obtain the final flashing image file; and the flashing image file is burned into the same designated storage partition of the terminal device.

[0006] The beneficial effects of the image file flashing method provided by the present invention are as follows: the above method reuses the same storage partition to store different animation resources, and can distinguish and display animation resources according to the boot mode while saving device storage space.

[0007] In one possible embodiment, each frame of the first group of images and the second group of images is compiled into a corresponding image file during the compilation phase, including: compiling each frame of the first group of images into a corresponding independent image file during the compilation phase; and compiling each frame of the second group of images into a vendor's image file during the compilation phase.

[0008] In another possible embodiment, the header information includes the type of the image file, the total number of image files and the size, starting address and offset of each image file.

[0009] Secondly, embodiments of the present invention provide an image file parsing method, which is applied to a terminal device. The method includes: parsing a flashing image file when the terminal device is first started, and storing the parsing result in a file system. The parsing result includes two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a power-off charging animation. Obtain the current device status; select the corresponding image resource from the parsing results based on the current device status and display it.

[0010] The beneficial effects of the above-mentioned image file parsing method provided by the present invention are as follows: when the system is first run, the image resources of charging while powered off are stored in the file system. During the power-on or power-off charging process, the resources are read and parsed according to the battery status, so that the terminal can display different animations when powered on and powered off, that is, while saving device storage space, the animation resources can be displayed differently according to the startup mode.

[0011] Thirdly, embodiments of the present invention also provide an image file flashing device, which includes modules / units for executing any of the possible design methods described in the first aspect. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0012] Fourthly, embodiments of the present invention also provide an image file parsing apparatus, which includes modules / units for executing any of the possible design methods described in the second aspect above. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0013] Fifthly, embodiments of the present invention provide a host computer, including a processor and a memory. The memory stores one or more computer programs; when the processor executes the one or more computer programs stored in the memory, the host computer is able to implement any of the possible design methods described in the first aspect.

[0014] In a sixth aspect, embodiments of the present invention provide a terminal device, including a processor and a memory. The memory stores one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the terminal device is able to implement the method of the design described in the second aspect.

[0015] In a seventh aspect, the present invention also provides a computer-readable storage medium storing a computer program that, when run on a host computer, causes the host computer to execute the method designed in the first or second aspect described above.

[0016] Eighthly, embodiments of the present invention also provide a method comprising a computer program product, wherein when the computer program product is run on a host computer, the host computer executes any possible design of the second aspect described above.

[0017] For the beneficial effects of the third to eighth aspects mentioned above, please refer to the descriptions in the first or second aspects mentioned above. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of a flashing system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the terminal device structure provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a method for flashing an image file according to an embodiment of the present invention; Figure 4 This is a schematic diagram of an image resource compression method provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the composition structure of a flashing image file provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of a flashing interface provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of a method for parsing an image file provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of an image file decompression method provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of an animation resource parsing method during the power-off charging process provided by an embodiment of the present invention; Figure 10 This is a schematic diagram of an image file flashing device provided in an embodiment of the present invention; Figure 11 This is a schematic diagram of a mirror file parsing device provided in an embodiment of the present invention; Figure 12 This is a schematic diagram of a host computer structure provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. In the description of the embodiments of the present invention, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the present invention. As used in the specification and appended claims of the present invention, the singular expressions “a,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present invention, “at least one” and “one or more” refer to one or more (including two). The term “and / or” is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0021] References to "one embodiment" or "some embodiments" as used in this specification mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the invention. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized. The term "connection" includes both direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0022] In embodiments of the present invention, the terms "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0023] The flashing system provided in this embodiment of the invention, such as Figure 1 As shown, the system includes a host computer 10 and a terminal device 20.

[0024] Figure 1 In one possible scenario, the host computer 10 and the terminal device 20 can establish a wired connection via a data cable; in another possible scenario, the host computer 10 and the terminal device 20 can establish a wireless network connection via wireless communication technology.

[0025] The host computer 10 is used to generate a flashing image file and burn the flashing image file into the same designated storage partition of the terminal device.

[0026] Terminal device 20 is used to parse the flashing image file, select the corresponding image resource from the parsing result according to the current device status, and display it.

[0027] Figure 2 A hardware configuration block diagram of terminal device 20 is shown.

[0028] In some embodiments, the terminal device 20 includes at least one of a tuner 210, a mobile communication module 220, a wireless communication module 230, a data acquisition unit 240, an external device interface 250, a controller 260, a display 270, an audio output interface 280, a memory, a power supply, and a user interface.

[0029] In some other embodiments, the tuner 210 senses electromagnetic waves through an antenna, converts the sensed electromagnetic waves into electrical signals, and then processes and transforms them through circuitry to finally convert them into sound, such as receiving broadcast signals wirelessly and demodulating audio signals from the broadcast signals.

[0030] The mobile communication module 220 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 20. The mobile communication module 220 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 220 can receive electromagnetic waves via an antenna, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the tuner / demodulator 210 for demodulation. The mobile communication module 220 can also amplify the signal modulated by the tuner / demodulator 210 and convert it into electromagnetic waves for radiation via the antenna. In some embodiments, at least some functional modules of the mobile communication module 220 may be housed in the controller 260. In some embodiments, at least some functional modules of the mobile communication module 220 and at least some modules of the controller 260 may be housed in the same device.

[0031] The wireless communication module 230 can provide solutions for wireless communication applications on the terminal device 20, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 230 can be one or more devices integrating at least one communication processing module. The wireless communication module 230 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to the controller 260. The wireless communication module 230 can also receive signals to be transmitted from the controller 260, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via the antenna.

[0032] In other embodiments, the collector 240 is used to collect signals from the external environment or to interact with the outside world. For example, the collector 240 includes a light receiver, a sensor for collecting ambient light intensity; or, the collector 240 includes an image collector, such as a camera, which can be used to collect external environmental scenes, user attributes, or user interaction gestures; or, the collector 240 includes a sound collector, such as a microphone, for receiving external sounds.

[0033] In some other embodiments, the external device interface 250 may include, but is not limited to, one or more of the following interfaces: High Definition Multimedia Interface (HDMI), analog or data high-definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, etc. It may also be a composite input / output interface formed by multiple interfaces mentioned above.

[0034] In some other embodiments, the controller 260 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be in an external device of the main device where the controller 260 is located, such as an external set-top box.

[0035] In other embodiments, controller 260 controls the operation of the display device and responds to user operations through various software control programs stored in memory. Controller 260 controls the overall operation of terminal device 20. For example, in response to receiving a user command to select a UI object to display on display 270, controller 260 can perform operations related to the object selected by the user command.

[0036] In some possible embodiments, controller 260 includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM, ROM, a first to an nth interface for input / output, a communication bus, etc.

[0037] A central processing unit (CPU) is used to execute operating system and application instructions stored in memory, as well as various interactive instructions received from external input, to execute various applications, data, and content in order to ultimately display and play various audio and video content. A CPU can include multiple processors, such as a main processor and one or more subprocessors.

[0038] In some embodiments, a graphics processor is used to generate at least one of various graphical objects, such as icons, operation menus, and user-input-based graphics. The graphics processor includes an arithmetic logic unit (ALU) that performs calculations based on various user-input interactive commands and displays various objects according to display attributes; it also includes a renderer that renders the various objects obtained from the ALU, the rendered objects being displayed on a monitor.

[0039] In some embodiments, the video processor is configured to receive external video signals and perform at least one of the following video processing operations according to the standard encoding and decoding protocol of the input signals: decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, image synthesis, etc., to obtain a signal that can be directly displayed or played on the terminal device 20.

[0040] In some embodiments, the video processor includes at least one of a demultiplexing module, a video decoding module, an image compositing module, a frame rate conversion module, and a display formatting module. The demultiplexing module demultiplexes the input audio and video data streams. The video decoding module processes the demultiplexed video signal, including decoding and scaling. The image compositing module, such as an image synthesizer, overlays and blends a graphical user interface signal generated by a graphics generator based on user input or its own generation with the scaled video image to generate a displayable image signal. The frame rate conversion module converts the input video frame rate. The display formatting module modifies the received frame rate-converted video output signal to conform to a display format, such as outputting RGB data signals.

[0041] In some embodiments, an audio processor is configured to receive external audio signals, perform decompression and decoding according to a standard codec protocol of the input signal, and at least one of the following processes: noise reduction, digital-to-analog conversion, and amplification, to obtain a sound signal that can be played in a speaker.

[0042] In some embodiments, the user can input user commands through a graphical user interface displayed on the display 270, and the user input interface receives the user input commands through the graphical user interface. Alternatively, the user can input user commands by inputting specific sounds or gestures, and the user input interface receives the user input commands by recognizing the sounds or gestures through sensors.

[0043] In some embodiments, a "user interface" is the medium through which an application or operating system interacts and exchanges information with a user, enabling the conversion between the internal form of information and a form acceptable to the user. A graphical user interface (GUI) refers to a user interface related to computer operation displayed graphically. It can be an interface element such as an icon, window, or control displayed on the screen of an electronic device, where controls can include at least one of the visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, and navigation bars.

[0044] In some embodiments, the display 270 includes a display screen component for presenting an image, a driving component for driving image display, a component for receiving image signals from the controller output, and a user control interface, etc.

[0045] In other embodiments, the display 270 may be at least one of a liquid crystal display, an organic light-emitting diode (OLED) display, and a projection display, and may also be a projection device and a projection screen.

[0046] In some other embodiments, the audio output interface 280 includes a speaker, external audio output electronics, etc.

[0047] In some embodiments, the user interface is an interface that can be used to receive control input (e.g., physical buttons on the display device body, or others).

[0048] In specific implementation, the aforementioned terminal device 20 can be a mobile phone, tablet computer, handheld computer, personal computer (PC), cellular phone, personal digital assistant (PDA), wearable device (such as smartwatch), smart home device (such as television), in-vehicle computer, game console, and augmented reality (AR) / virtual reality (VR) device, etc. This embodiment does not impose any special restrictions on the specific device form of the terminal device 20.

[0049] The method provided by this invention can be applied to mobile smart terminal devices running the Android system, such as mobile phones, tablets, and other traditional Android mobile electronic products. It can also be applied to other Android system display devices, such as Android smartwatches. Since they all run the Android system, the only difference is the screen resolution of the devices. Therefore, the steps performed on different platform solutions are the same; only the resolution of the image resources displayed on each device differs.

[0050] based on Figure 1 The present invention provides a flowchart of a method for flashing an image file, as shown in the following embodiment: Figure 3 As shown, the method includes the following steps: S301, the host computer 10 acquires two sets of images, the first set of images is used to form a power-on animation, and the second set of images is used to form a power-off charging animation.

[0051] S302, during the compilation phase, the host computer 10 compiles each frame of the first group of images and the second group of images into a corresponding image file.

[0052] S303, the host computer 10 splices the image files corresponding to each frame of the image and adds header information to obtain the final flashing image file.

[0053] S304, the host computer 10 burns the flashing image file into the same designated storage partition of the terminal device 20.

[0054] In one possible embodiment, the host computer 10 compiles each frame of the first group of images and the second group of images into a corresponding image file during the compilation phase. This includes: compiling each frame of the first group of images into a corresponding independent image file during the compilation phase; and compiling each frame of the second group of images into an image file under the vendor folder during the compilation phase. The header information includes the type of the image file, the total number of image files, the size of each image file, the starting address, and the offset.

[0055] Specifically, the host computer 10 compiles each frame of image into a corresponding image file during the compilation phase, thus compressing image resources. Typically, the compression rate is approximately 96%. Combined with... Figure 4 Let's assume there are n frames in the first and second image groups, named logo1.bmp, logo2.bmp, ..., logon.bmp. During the compilation phase, the host computer 10 converts these n frames into the following image files: logo1.bin, logo2.bin, ..., logon.bin. To ensure the integrity of the image files, the multiple scattered image files are concatenated to obtain the intermediate image file temp_logo.bin = logo1.bin + logo2.bin + logo3.bin + ... + logon.bin. To facilitate subsequent decompression and differentiation between the two groups of images, header information is added to the concatenated intermediate image file, resulting in the final flashing image file final_logo.bin = bin_header_info + temp_logo.bin. Figure 5 As shown.

[0056] For example, the definition of the header information bin_header_info in the encoding is as follows: struct bin_header_info { char signature[2]; uint16_tfile_number; uint32_t bin_file_size[0]; }; The signature uses two char type characters to indicate that the current logo file type can be a single image or a mirror file, which is compatible with the animation display method originally used by the terminal device. file_number indicates the number of animation resources in the current final_logo.bin file. bin_file_size is an array that records the size of each mirror file when compiling the mirror file, which is used by the terminal device to calculate the offset when displaying.

[0057] It can be seen that, as Figure 6 As shown, the above method replaces the single image resource in the original storage partition with the generated bootloader flashing image file, directly burning the flashing image file to the terminal device's storage partition. This way, other partitions (such as the fastboot logo partition) are no longer occupied. This method enables the reuse of the same storage partition to store different animation resources, saving device storage space while differentiating animation resources based on the boot mode.

[0058] based on Figure 1 The flashing system shown in the embodiment of the present invention also provides a flowchart of an image file parsing method, as follows: Figure 7 As shown, the method includes the following steps: S701, when the terminal device is started for the first time, the flashing image file is parsed and the parsing result is stored in the file system. The parsing result includes two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a shutdown charging animation.

[0059] S702, obtain the current device status; select the corresponding image resource from the parsing results based on the current device status and display it.

[0060] In one possible embodiment, selecting and displaying the corresponding image resource from the parsing results based on the current device status includes: determining whether the current device status is normal power-on mode or power-off charging mode; and reading and parsing the header information of the flashing image file from a designated storage partition based on the flags corresponding to the normal power-on mode or power-off charging mode, such as... Figure 8As shown, based on the image file type, total number of image files, size of each image file, starting address, and offset in the header information, the required image resources are selected from the parsing results and displayed. Considering that during the device's charging process when it is powered off, the battery may experience some abnormal states (e.g., overheating, low temperature, undervoltage, etc.) in addition to the normal charging process, representing these states can better remind the user of the device's health status.

[0061] Therefore, as Figure 9 As shown, during the power-off charging process, this embodiment can also determine the index value corresponding to the battery status based on the battery status of the terminal device. When the battery status is in an abnormal state such as overheating or low temperature, the header information in the flashing image file is parsed according to the index value. Based on the image file type, total number of image files, size of each image file, starting address, and offset in the header information, the required image resources are selected from the parsing results and displayed. Additionally, when the battery status is normal, the current battery percentage is read, and at least two image frames corresponding to that percentage are determined. These at least two image frames are then displayed in a loop. For example, if the current battery level is 55%, in a normal state, the current battery percentage needs to be read, the integer 10% values ​​above and below the battery level need to be calculated, two corresponding indices need to be set, and two images representing 50% and 60% battery levels are decompressed and dynamically looped to represent the battery charging from 50% to 60%. This method effectively represents the battery charging progress, thus saving device storage space.

[0062] In summary, this invention enables the compression of animation resources during the compilation stage, distinguishes between animation resources displayed during normal boot and those displayed during charging while the device is powered off, and displays animation resources showing the charging percentage or battery health status based on the battery condition. This allows for the reuse of a single partition to store multiple animation resources without creating new partitions. Furthermore, the invention compresses and concatenates various animation resources into a single image file during the compilation of the flashing image file, eliminating the need for multiple partitions. During the device startup loading stage and the charging stage while powered off, the image file is parsed, and the necessary image resources are extracted, decompressed, and displayed.

[0063] In some embodiments of the present invention, an image file flashing device is also disclosed, such as... Figure 10 As shown, the device is used to implement the methods described in the above method embodiments, and includes: The acquisition unit 1001 is used to acquire two sets of images, wherein the first set of images is used to form a power-on animation and the second set of images is used to form a power-off charging animation. The compilation unit 1002 is used to compile each frame of the first group of images and the second group of images into a corresponding image file during the compilation stage. The splicing unit 1003 is used to splice the image files corresponding to each frame of the image and add header information to obtain the final flashing image file; The flashing unit 1004 is used to flash the flashing image file into the same designated storage partition of the terminal device.

[0064] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0065] In some embodiments of the present invention, an image file flashing device is also disclosed, such as... Figure 11 As shown, the device is used to implement the methods described in the above method embodiments, and includes: The parsing unit 1101 is used to parse the flashing image file when the terminal device is first started, and to store the parsing result in the file system. The parsing result includes two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a power-off charging animation. Acquisition unit 1102 is used to acquire the current device status; Display unit 1103 is used to select and display the corresponding image resource from the parsing result according to the current device status.

[0066] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0067] In other embodiments of the present invention, a host computer is disclosed, such as... Figure 12 As shown, the host computer may include: one or more processors 1201; a memory 1202; a display 1203; one or more application programs (not shown); and one or more computer programs 1204. These devices can be connected via one or more communication buses 1205. The one or more computer programs 1204 are stored in the memory 1202 and configured to be executed by the one or more processors 1201. The one or more computer programs 1204 include instructions that can be used to perform actions such as... Figure 3 The steps executed by the host computer in the corresponding embodiment.

[0068] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0069] In the various embodiments of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0070] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0071] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present invention should be covered within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.

Claims

1. A method for flashing an image file, applied to a host computer, characterized in that, include: Two sets of images are acquired, the first set of images is used to generate the boot animation, and the second set of images is used to generate the power-off charging animation. During the compilation phase, each frame in the first group of images is compiled into a corresponding independent image file; During the compilation phase, each frame in the second set of images is compiled into an image file under the vendor folder; The image files corresponding to each frame are stitched together and header information is added to obtain the final flashing image file; the header information includes the type of image file, the total number of image files, the size of each image file, the starting address, and the offset; The flashing image file is burned into the same designated storage partition of the terminal device.

2. A method for parsing image files, applied to terminal devices, characterized in that, include: When the terminal device is first started, the flashing image file is parsed and the parsing results are stored in the file system. The parsing results include two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a power-off charging animation. Get the current device status. Determine whether the current device status is normal power-on mode or power-off charging mode; Based on the flags corresponding to the normal power-on mode or the power-off charging mode, the header information of the flashing image file is read and parsed from the specified storage partition. Based on the image file type, total number of image files, size of each image file, starting address and offset in the header information, the required image resources are selected from the parsing results and displayed. Specifically, based on the flag corresponding to the power-off charging mode, the header information of the flashing image file is read and parsed from the designated storage partition. Based on the image file type, total number of image files, size of each image file, starting address, and offset in the header information, the required image resources are selected and displayed from the parsing results, including: Based on the battery status of the terminal device, determine the index value corresponding to the battery status; When the battery status is abnormal, the header information in the flashing image file is parsed according to the index value. Based on the image file type, total number of image files, size of each image file, starting address and offset in the header information, the required image resources are selected from the parsing results and displayed. When the battery status is normal, the current battery power percentage is read, and at least two image resources corresponding to the percentage are determined; the at least two image resources are then displayed in a loop.

3. A device for flashing image files, applied to a host computer, characterized in that, The device includes: The acquisition unit is used to acquire two sets of images, wherein the first set of images is used to form a power-on animation and the second set of images is used to form a power-off charging animation. The compilation unit is used to compile each frame of the first group of images into a corresponding independent image file during the compilation phase; and to compile each frame of the second group of images into an image file under the vendor folder during the compilation phase. The stitching unit is used to stitch together the image files corresponding to each frame of the image and add header information to obtain the final flashing image file; the header information includes the type of image file, the total number of image files, the size of each image file, the starting address and the offset; The flashing unit is used to flash the flashing image file into the same designated storage partition of the terminal device.

4. A mirror file parsing device, applied to a terminal device, characterized in that, include: The parsing unit is used to parse the flashing image file when the terminal device is first started, and to store the parsing results in the file system. The parsing results include two sets of images, wherein the first set of images is used to form a boot animation and the second set of images is used to form a power-off charging animation. The acquisition unit is used to acquire the current device status; The display unit is used to determine whether the current device status is normal power-on mode or power-off charging mode. Based on the flags corresponding to the normal power-on mode or the power-off charging mode, the header information of the flashing image file is read and parsed from the specified storage partition. Based on the image file type, total number of image files, size of each image file, starting address and offset in the header information, the required image resources are selected from the parsing results and displayed. Specifically, the display unit, when reading and parsing the header information of the flashing image file from a designated storage partition according to the flag corresponding to the power-off charging mode, and selecting and displaying the required image resources from the parsing results based on the image file type, total number of image files, size of each image file, starting address, and offset in the header information, is used for: Based on the battery status of the terminal device, determine the index value corresponding to the battery status; When the battery status is abnormal, the header information in the flashing image file is parsed according to the index value. Based on the image file type, total number of image files, size of each image file, starting address and offset in the header information, the required image resources are selected from the parsing results and displayed. When the battery status is normal, the current battery power percentage is read, and at least two image resources corresponding to the percentage are determined; the at least two image resources are then displayed in a loop.

5. A host computer, characterized in that, include: Processor and memory, wherein the memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the host computer performs the method described in claim 1.

6. A terminal device, characterized in that, include: Processor and memory, wherein the memory is used to store computer programs; The processor is used to execute the method of claim 2 based on the computer program stored in the memory.

7. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the method of claim 1 or 2.