CN110908733B - Working mode determining method and device, and control method and device - Google Patents

Working mode determining method and device, and control method and device Download PDF

Info

Publication number
CN110908733B
CN110908733B CN201911117253.6A CN201911117253A CN110908733B CN 110908733 B CN110908733 B CN 110908733B CN 201911117253 A CN201911117253 A CN 201911117253A CN 110908733 B CN110908733 B CN 110908733B
Authority
CN
China
Prior art keywords
spl
mode
electronic equipment
electronic device
working mode
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.)
Active
Application number
CN201911117253.6A
Other languages
Chinese (zh)
Other versions
CN110908733A (en
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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co 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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201911117253.6A priority Critical patent/CN110908733B/en
Publication of CN110908733A publication Critical patent/CN110908733A/en
Application granted granted Critical
Publication of CN110908733B publication Critical patent/CN110908733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The disclosure relates to a method and a device for determining a working mode, and a method and a device for controlling the working mode, which are applied to electronic equipment, wherein the method comprises the following steps: after the electronic equipment is powered on, reading a secondary boot loader SPL, wherein the SPL is a first-stage executive program of a boot loader Bootloader; and determining the working mode of the electronic equipment according to the integrity of the SPL, wherein the working mode comprises a starting loading mode and a downloading mode. The method for determining the working mode has the advantages of being simple in implementation mode, low in cost, safe and reliable, and for the electronic equipment which is not provided with the Strap Pin (or other special keys) or the command interaction mode, the electronic equipment can be ensured to work normally through the method for determining the working mode, and when the electronic equipment is powered off or is shut down due to power failure or other abnormal conditions, the working mode can be rapidly determined according to the integrity of the SPL after the electronic equipment is powered on and started.

Description

Working mode determining method and device, and control method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for determining a working mode, and a method and an apparatus for controlling the working mode.
Background
Some electronic devices (such as mobile phones and the like) connect a pull-up resistor or a pull-down resistor to a certain Pin of a main chip, and after the electronic devices are powered on, the electronic devices can determine to execute a preset action according to the signal level state of the Pin, and the Pin of the chip playing the role is called Strap Pin. After power-on starting, if the electronic device detects a Strap Pin (or other special keys, signals sent by these special keys or special combination keys can inform the electronic device to enter a download mode or a start loading mode) signal indicating that the electronic device enters the download mode, a download task is executed, otherwise, the electronic device enters the start loading mode, however, many electronic devices do not set the Strap Pin (or other special keys), and therefore, the working mode cannot be determined by detecting the Strap Pin (or other special keys) signal. Some electronic devices may support a command interaction mode to select an entry working mode, for example, after receiving a mode instruction of an upper computer (computer) through the command interaction mode, the electronic devices may directly enter a download mode or enter a start loading mode, and the command interaction mode has a disadvantage that: the electronic equipment does not know when the upper computer sends the instruction, but cannot wait for the mode instruction of the upper computer all the time, so that a fixed waiting time needs to be set, and the waiting time is set too long to influence the normal starting speed and too short to influence the working efficiency and experience, so that the electronic equipment has great disadvantages. Therefore, the method for selecting the working mode of the electronic equipment by adopting the related technology is not friendly, and the user experience is influenced.
And for the electronic equipment which is not provided with the Strap Pin (or other special keys) and does not support a command interaction mode, if the electronic equipment is powered on and cannot select a working mode after power failure or other abnormity occurs to cause shutdown when a system is installed or upgraded or under other conditions.
Disclosure of Invention
In view of this, the present disclosure provides an operation mode determining method applied in an electronic device, the method including:
after the electronic equipment is powered on, reading a secondary boot loader SPL, wherein the SPL is a first-stage executive program of a boot loader Bootloader;
and determining the working mode of the electronic equipment according to the integrity of the SPL, wherein the working mode comprises a starting loading mode and a downloading mode.
In one possible embodiment, the determining the operation mode of the electronic device according to the integrity of the SPL includes:
and determining that the working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete.
In one possible embodiment, the method further comprises:
controlling the electronic equipment to enter the downloading mode so as to download the target file from the target storage space;
and after the target SPL file is downloaded from the target storage space, ending the downloading mode, wherein the target SPL file comprises a complete SPL.
In one possible embodiment, the determining the operation mode of the electronic device according to the integrity of the SPL includes:
and under the condition that the SPL is complete, determining the working mode of the electronic equipment as the starting loading mode.
In one possible embodiment, the method further comprises:
and controlling the electronic equipment to enter the boot loading mode so that the electronic equipment enters an operating system.
According to another aspect of the present disclosure, a control method is provided, which is applied to a control device electrically connected to an electronic device, wherein the method includes:
and when the electronic equipment is powered on and started, determining a working mode according to the integrity of the secondary boot loader SPL, wherein the working mode comprises a starting loading mode and a downloading mode.
In one possible embodiment, the method further comprises:
destroying the integrity of the SPL of an electronic device.
In one possible embodiment, the method further comprises:
and setting a target file which is finally downloaded by the electronic equipment in the downloading mode as a target SPL file, wherein the target SPL file comprises a complete SPL.
According to another aspect of the present disclosure, an operation mode determining apparatus is provided, which is applied in an electronic device, and includes:
the reading module is used for reading a secondary boot loader SPL after the electronic equipment is powered on, wherein the SPL is a first-stage executive program of a boot loader Bootloader;
and the determining module is connected with the reading module and used for determining the working mode of the electronic equipment according to the integrity of the SPL, wherein the working mode comprises a loading starting mode and a downloading mode.
According to another aspect of the present disclosure, a control apparatus is provided, which is applied to a control device electrically connected to an electronic device, wherein the apparatus includes:
the device comprises a setting module and a loading module, wherein the setting module is used for setting the working mode of the electronic equipment which is determined according to the integrity of a secondary boot loader (SPL) when the electronic equipment is powered on and started, and the working mode comprises a starting loading mode and a downloading mode.
According to another aspect of the present disclosure, an operation mode determination apparatus is provided, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
and executing the working mode determining method.
According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, having stored thereon computer program instructions, which when executed by a processor, implement the method of operating mode determination.
According to another aspect of the present disclosure, there is provided a control apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the above control method.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the above-described control method.
Various aspects of the embodiment of the disclosure can determine the working mode of the electronic device according to the integrity of the SPL, and compared with the related art that the working mode is determined through the Strap Pin (or other special keys) or the command interaction mode, the embodiment of the disclosure has the characteristics of simple implementation mode, low cost, safety and reliability, and for the electronic device without the Strap Pin (or other special keys) or the command interaction mode, the embodiment of the disclosure can ensure that the electronic device can normally work, and when the electronic device is powered off due to power failure or other abnormal conditions, the working mode can be rapidly determined according to the integrity of the SPL after the electronic device is powered on and started.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow chart of an operation mode determination method according to an embodiment of the present disclosure.
Fig. 2 shows a schematic diagram of an operation mode determination method according to an embodiment of the present disclosure.
Fig. 3 shows a flow chart of a method of operation determination according to an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of a method of determining an operation mode according to an embodiment of the present disclosure.
Fig. 5 shows a schematic diagram of a control method according to an embodiment of the present disclosure.
Fig. 6 shows a schematic diagram of a control method according to an embodiment of the present disclosure.
Fig. 7 shows a schematic diagram of an operation mode determination apparatus according to an embodiment of the present disclosure.
FIG. 8 shows a schematic diagram of a control device according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart illustrating an operation mode determination method according to an embodiment of the present disclosure.
The method is applied to an electronic device, which may include a terminal, a server, and the like, where the terminal is also referred to as a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), and the like, and is a device that provides voice and/or data connectivity to a user, for example, a handheld device, a vehicle-mounted device, and the like having a wireless connection function. Currently, some examples of terminals are: a mobile phone (mobile phone), a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in city (smart city), a wireless terminal in smart home (smart home), a wireless terminal in vehicle networking, and the like. Of course, the embodiment of the present disclosure does not limit the specific type and implementation manner of the electronic device, and a person skilled in the art may select the electronic device according to needs.
As shown in fig. 1, the method includes:
s11, after the electronic equipment is powered on, reading a Secondary boot Loader (SPL), wherein the SPL is a first-stage executive Program of the boot Loader Bootloader;
s12, determining the working mode of the electronic equipment according to the integrity of the SPL, wherein the working mode comprises a loading starting mode and a downloading mode.
Through the method, the working mode of the electronic equipment can be determined according to the integrity of the SPL, compared with the related technology that the working mode of the electronic equipment is determined through the Strap Pin (or other special keys) or the command interaction mode, the working mode determining method provided by the embodiment of the disclosure has the advantages of being simple in implementation mode, low in cost, safe and reliable, and capable of ensuring that the electronic equipment can normally work for the electronic equipment without the Strap Pin (or other special keys) or the command interaction mode, and when the electronic equipment is powered off due to power failure or other abnormal conditions, the working mode can be rapidly determined according to the integrity of the SPL after the electronic equipment is powered on and started.
The Bootloader may be a first segment program executed by the embedded system after being powered on, and may complete initialization of a processor (for example, a central processing unit CPU) of the electronic device and related hardware, and after the Bootloader completes initialization of the CPU and the related hardware, the Bootloader may load an operating system of the electronic device or a solidified embedded application program into a memory (for example, a RAM), and then jump to a space where the operating system is located, and start the operating system to run. In one example, bootloader may be a U-Boot or the like.
The SPL may move the code of the second stage of the Bootloader to a System memory (System Ram, also called an off-chip memory) of the electronic device for operation.
In one example, a boot loading mode, which may also be referred to as an "autonomous" mode, is initiated. In the boot load mode, the electronic device may run from loading the operating system into memory.
In one example, the downloading mode may refer to the electronic device downloading a target file (e.g., downloading a kernel image and a root file system image, etc.) from a target storage space (e.g., host) via a serial connection, a network connection, or a communication means.
In one example, the electronic device may be configured in advance to implement an integrity determination mode of operation from the SPL, which will be described in detail later.
The following describes an exemplary method for determining the different operating modes.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating an operation mode determining method according to an embodiment of the disclosure.
In a possible implementation manner, the step S12 of determining the operation mode of the electronic device according to the integrity of the SPL may include:
step S121, determining that the working mode of the electronic device is the download mode when the SPL is not complete.
In one example, the SPL incompleteness may include a plurality of cases, for example, the SPL incompleteness may include that a storage space storing the SPL is empty, that only a part of the SPL is in the storage space, that the SPL in the storage space is wrong, and the like, that is, the SPL incompleteness may include that a code of the SPL is incomplete, or that the code of the SPL cannot run normally, and a boot function of the SPL cannot be implemented.
In an example, the electronic device may determine whether the SPL is complete according to a comparison between the size of the SPL file and a preset size, for example, if the storage space for storing the SPL is empty, it may be determined that the SPL file does not exist, and the SPL is incomplete. And if the storage space for storing the SPL is not empty, judging whether the size of the SPL file is the same as the preset size or not, and if not, judging that the SPL is incomplete. Of course, the SPL file may also be compared with a preset SPL file to determine whether the SPL is complete, for example, the electronic device may compare the SPL file with the preset SPL file, and if the SPL file is different from the preset SPL file, it may be determined that the SPL file is incomplete.
Of course, the above description is exemplary, and the embodiment of the present disclosure does not limit a specific implementation of how to detect the integrity of the SPL, and in addition, the present disclosure does not limit the type and the location of the storage space for storing the SPL, and a person skilled in the art may determine the type and the location according to actual needs or specific situations.
Of course, the electronic device may be configured in advance to directly enter the downloading mode when the SPL is incomplete, which will be described later.
In one possible embodiment, as shown in fig. 2, the method may further include:
step S13, controlling the electronic equipment to enter the downloading mode so as to download the target file from the target storage space;
and step S14, after the target SPL file is downloaded from the target storage space, ending the downloading mode, wherein the target SPL file comprises a complete SPL.
In one example, the target storage space may be a HOST, an external storage device, and the disclosure is not limited thereto.
In the download mode, the electronic device may download the target file from the target storage space in a serial port manner, a wireless network, and other communication manners, which is not limited in this disclosure. Of course, the embodiment of the present disclosure does not limit the specific size and type of the target file, and those skilled in the art may determine the size and type according to needs or actual situations.
Because the working mode of the electronic device can be determined through the integrity of the SPL, the embodiment of the present disclosure can download the target SPL file at the last step of the whole downloading stage, so that when the electronic device needs to be maintained in the downloading mode (for example, system installation, system file update, and the like), the incomplete characteristic of the SPL can be maintained, and thus, even if the electronic device is powered off or restarted due to power failure or other abnormal conditions, after the electronic device is powered on again, the electronic device can quickly judge that the SPL is incomplete, and accordingly, the electronic device enters the downloading mode to continue downloading the target file.
In one example, when the downloading of the target SPL file as the last target file is completed, the entire downloading process may be considered to be completed, and thus the downloading mode may be terminated, in which case the electronic device may be automatically restarted or shut down. It is expected that, after the electronic device is started again, since the SPL file is updated to the complete target SPL file, the electronic device may enter the boot loading mode to start normally.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for determining a working mode according to an embodiment of the present disclosure.
In a possible implementation manner, the step S12 of determining the operation mode of the electronic device according to the integrity of the SPL may include:
step S123, determining that the operating mode of the electronic device is the start loading mode when the SPL is complete.
In one example, the SPL is complete, which may mean that the SPL file maintains integrity.
In one example, the electronic device may determine whether the SPL is complete according to a comparison between the size of the SPL file and a preset size, for example, if a storage space for storing the SPL is not empty, determine whether the size of the SPL file is the same as the preset size, and if the size is the same, determine that the SPL is complete. Of course, the SPL file may also be compared with a preset SPL file to determine whether the SPL is complete, for example, the electronic device compares the SPL file with the preset SPL file, and if the SPL file is the same as the preset SPL file, it may be determined that the SPL is complete.
Of course, the above description is exemplary, and the disclosure does not limit the specific implementation of how to detect the integrity of the SPL, and in addition, the disclosure does not limit the type and location of the storage space for storing the SPL, which can be determined by those skilled in the art according to actual needs or specific situations.
Of course, the electronic device may be configured in advance to directly enter the boot loading mode when the SPL is complete, and this configuration will be described later.
In one possible embodiment, as shown in fig. 3, the method may further include:
and S16, controlling the electronic equipment to enter the starting loading mode so that the electronic equipment enters an operating system.
When the SPL is complete, the electronic device may move the program of the second stage of the BootLoader to the memory through the SPL, so as to perform the next stage of starting until the operating system of the electronic device is successfully operated.
Of course, the present disclosure does not limit the operation mode of the boot loading mode and the normal boot mode of the electronic device, and those skilled in the art can learn by referring to the related art.
As can be seen from the above description, the working mode of the electronic device can be determined according to the integrity of the SPL in the embodiment of the present disclosure, and the working mode determining method provided in the embodiment of the present disclosure can ensure that the electronic device can work normally.
Of course, the disclosure is not limited thereto, and the working method determination method of the embodiment of the disclosure may also be combined with the related art, and the following description is made by exemplarily describing that the electronic device is provided with a Strap Pin or other special keys.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a method for determining a working mode according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 4, after the electronic device is powered on and started, the SPL partition of the FASH storage for storing SPLs may be checked to determine whether SPLs are complete, and when the SPL partition is empty or the SPL integrity is damaged, the electronic device is controlled to enter the download mode.
In a possible implementation manner, as shown in fig. 4, when the SPL is complete, if the electronic device has a Strap Pin or another special key, the embodiment of the present disclosure may also detect a signal of the Strap Pin or another special key, and if the signal of the Strap Pin or another special key indicates that the electronic device enters the download mode, the electronic device is controlled to enter the download mode, otherwise, the electronic device is controlled to enter the start loading mode, so as to normally start the electronic device.
Of course, the above description is exemplary and should not be construed as limiting the present disclosure.
The electronic device may be configured in advance to determine the mode of operation based on the integrity of the SPL, as exemplary described below.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a control method according to an embodiment of the disclosure.
The method is applied to control equipment which is electrically connected with electronic equipment.
In one example, the control device may be an upper computer, a terminal, a server, or the like, or other devices obtained based on a general-purpose processor (e.g., a CPU, an MCU, or the like) or a patent processor, and the disclosure is not limited thereto.
The method comprises the following steps:
step S21, when the electronic equipment is powered on and started, the working mode is determined according to the integrity of the secondary boot loader SPL, and the working mode comprises a starting loading mode and a downloading mode.
Through the method, the control device of the embodiment of the disclosure can simply and quickly configure the electronic device to set the working mode of the electronic device to be determined according to the integrity of the secondary boot loader SPL when the electronic device is powered on and started, and compared with a configuration mode of adding pins and the like in the related art, the cost can be reduced, and the flexibility can be increased.
In one example, after the electronic device is connected, the control device of the embodiment of the present disclosure may write a written program into a chip of the electronic device, so that the electronic device first determines an operating mode according to the integrity of the secondary boot loader SPL after being powered on.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating a control method according to an embodiment of the disclosure.
In one possible embodiment, as shown in fig. 6, the method further comprises:
step S21, destroying the integrity of the SPL of the electronic device.
In an example, when the electronic device needs to install a system, upgrade a system, update a system, or the like, the integrity of the SPL of the electronic device may be damaged, so that the electronic device may enter a download mode after being powered on and started even if the electronic device is powered off due to power failure or other abnormal conditions during the entire downloading process, so as to continue downloading the target file.
Of course, the step S21 of destroying the integrity of the SPL of the electronic device may include various embodiments, for example, the storage space of the electronic device for storing the SPL may be emptied, a part of the SPL may be deleted, or a part of the content of the SPL may be changed.
Of course, the above description is exemplary, and the manner how the integrity of the SPL of an electronic device is destroyed is not limited by the embodiments of the present disclosure.
In one possible embodiment, as shown in fig. 6, the method further comprises:
and S23, setting the target file which is finally downloaded by the electronic equipment in the downloading mode as a target SPL file, wherein the target SPL file comprises a complete SPL.
Through the mode, the last downloaded target file is set as the target SPL file, so that the SPL of the electronic equipment can be ensured to be always in an incomplete state in the downloading mode, and therefore, in the downloading mode, when the electronic equipment is powered off due to power failure or other abnormal conditions, the electronic equipment can also enter the downloading mode after being powered on and started so as to continue downloading the target file, and after the electronic equipment finishes downloading the target SPL file, the whole downloading process can be considered to be finished.
Of course, the control device may also be configured to restart or close the electronic device after the electronic device completes downloading of the target SPL, which is not limited in this disclosure.
Referring to fig. 7, fig. 7 is a schematic diagram illustrating an operation mode determining apparatus according to an embodiment of the present disclosure.
The apparatus may be applied to an electronic device, as shown in fig. 7, and includes:
the reading module 61 is configured to read a secondary boot loader SPL after the electronic device is powered on, where the SPL is a first-stage execution program of a boot loader Bootloader;
and the determining module 62 is connected to the reading module 61, and configured to determine an operating mode of the electronic device according to the integrity of the SPL, where the operating mode includes a start loading mode and a download mode.
Through the above device, the working mode of the electronic device can be determined according to the integrity of the SPL, compared with the related art that the working mode is determined through the Strap Pin (or other special keys) or the command interaction mode, the working mode determining method has the characteristics of simple implementation mode, low cost, safety and reliability, and for the electronic device without the Strap Pin (or other special keys) or the command interaction mode, the working mode can be determined quickly according to the integrity of the SPL after the electronic device is powered on and started when the electronic device is powered off or is shut down due to other abnormal conditions.
In a possible implementation, the determining an operating mode of an electronic device according to the integrity of the SPL may include:
and determining that the working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete.
In a possible implementation, the determining module 62 may be further configured to:
controlling the electronic equipment to enter the downloading mode so as to download the target file from the target storage space;
and after the target SPL file is downloaded from the target storage space, ending the downloading mode, wherein the target SPL file comprises a complete SPL.
In a possible implementation manner, the determining an operating mode of an electronic device according to the integrity of the SPL may further include:
and under the condition that the SPL is complete, determining the working mode of the electronic equipment as the starting loading mode.
In one possible implementation, the determining module 62 may be further configured to:
and controlling the electronic equipment to enter the boot loading mode so that the electronic equipment enters an operating system.
Referring to fig. 8, fig. 8 is a schematic diagram of a control device according to an embodiment of the disclosure.
The apparatus may be applied to a control device electrically connected to an electronic device, wherein, as shown in fig. 8, the apparatus includes:
the setting module 64 is configured to set a working mode of the electronic device determined according to the integrity of the secondary boot loader SPL when the electronic device is powered on and started, where the working mode includes a start loading mode and a download mode.
Through the device, the control device of the embodiment of the disclosure can simply and quickly configure the electronic device to set the working mode of the electronic device to be determined according to the integrity of the secondary boot loader SPL when the electronic device is powered on and started, and compared with a mode of configuring by adding pins and the like in the related art, the cost can be reduced, and the flexibility can be increased.
In a possible implementation, the setting module 64 may be further configured to:
destroying the integrity of the SPL of an electronic device.
In a possible implementation, the setting module 64 may be further configured to:
and setting a target file which is finally downloaded by the electronic equipment in the downloading mode as a target SPL file, wherein the target SPL file comprises a complete SPL.
By the device, the last downloaded target file is set as the target SPL file, so that the SPL of the electronic equipment can be ensured to be in an incomplete state in the downloading mode all the time, and therefore in the downloading mode, when the electronic equipment is powered off due to power failure or other abnormal conditions, the electronic equipment can also enter the downloading mode after being powered on and started so as to continue downloading the target file, and after the electronic equipment finishes downloading the target SPL file, the whole downloading process can be considered to be finished.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or improvements to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (9)

1. An operation mode determination method applied to an electronic device, the method comprising:
after the electronic equipment is powered on, reading a secondary boot loader SPL, wherein the SPL is a first-stage executive program of a boot loader Bootloader;
determining an operating mode of the electronic device according to the integrity of the SPL, where the operating mode includes a start loading mode and a download mode, and the determining the operating mode of the electronic device according to the integrity of the SPL includes: determining that a working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete, wherein the downloading mode is set to be that a target file which is downloaded last is a target SPL file; or determining the working mode of the electronic equipment as the starting loading mode under the condition that the SPL is complete.
2. The method of claim 1, further comprising:
controlling the electronic equipment to enter the downloading mode so as to download the target file from the target storage space;
and after the target SPL file is downloaded from the target storage space, ending the downloading mode, wherein the target SPL file comprises a complete SPL.
3. The method of claim 1, further comprising:
and controlling the electronic equipment to enter the boot loading mode so that the electronic equipment enters an operating system.
4. A control method applied to a control device electrically connected to an electronic device, wherein the method comprises:
the method comprises the following steps of setting a working mode of the electronic equipment according to the integrity of a secondary boot loader (SPL) when the electronic equipment is powered on and started, wherein the working mode comprises a start loading mode and a downloading mode, and the working mode is determined according to the integrity of the SPL and comprises the following steps: determining that the working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete; or determining the working mode of the electronic equipment as the starting loading mode under the condition that the SPL is complete;
and setting a target file which is finally downloaded by the electronic equipment in the downloading mode as a target SPL file, wherein the target SPL file comprises a complete SPL.
5. The method of claim 4, further comprising:
in any case where an electronic device needs to have a system installed, upgraded, or updated, the integrity of the SPL of the electronic device is destroyed.
6. An operation mode determination device, applied to an electronic device, the device comprising:
the reading module is used for reading a secondary boot loader SPL after the electronic equipment is powered on, wherein the SPL is a first-stage executive program of a boot loader Bootloader;
the determining module is connected to the reading module, and configured to determine a working mode of the electronic device according to the integrity of the SPL, where the working mode includes a start loading mode and a download mode, and the determining the working mode of the electronic device according to the integrity of the SPL includes: determining that a working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete, wherein the downloading mode is set to be that a target file downloaded last is a target SPL file, and the target SPL file comprises a complete SPL; or determining the working mode of the electronic equipment as the starting loading mode under the condition that the SPL is complete.
7. A control apparatus applied to a control device electrically connected to an electronic device, wherein the apparatus comprises:
the method comprises the following steps that a setting module is used for setting an electronic device to determine a working mode according to the integrity of a secondary boot loader (SPL) when the electronic device is powered on and started, wherein the working mode comprises a start loading mode and a downloading mode, and the determining of the working mode according to the integrity of the SPL comprises the following steps: determining that the working mode of the electronic equipment is the downloading mode under the condition that the SPL is not complete; or determining the working mode of the electronic equipment as the starting loading mode under the condition that the SPL is complete;
the setting module is further configured to set a target file that is downloaded by the electronic device last in the download mode as a target SPL file, where the target SPL file includes a complete SPL.
8. An operation mode determination apparatus, characterized by comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
performing the method of any one of claims 1 to 3.
9. A non-transitory computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method of any one of claims 1 to 3.
CN201911117253.6A 2019-11-15 2019-11-15 Working mode determining method and device, and control method and device Active CN110908733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911117253.6A CN110908733B (en) 2019-11-15 2019-11-15 Working mode determining method and device, and control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911117253.6A CN110908733B (en) 2019-11-15 2019-11-15 Working mode determining method and device, and control method and device

Publications (2)

Publication Number Publication Date
CN110908733A CN110908733A (en) 2020-03-24
CN110908733B true CN110908733B (en) 2023-01-13

Family

ID=69817635

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911117253.6A Active CN110908733B (en) 2019-11-15 2019-11-15 Working mode determining method and device, and control method and device

Country Status (1)

Country Link
CN (1) CN110908733B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651185B (en) * 2020-05-30 2022-11-11 展讯通信(上海)有限公司 Software upgrading method and device
CN112631625B (en) * 2020-11-20 2022-10-21 展讯通信(上海)有限公司 System upgrading method and device for embedded equipment and embedded equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7765393B1 (en) * 2006-07-11 2010-07-27 Network Appliance, Inc. Method and system of embedding a boot loader as system firmware
US9582262B2 (en) * 2014-06-16 2017-02-28 Wipro Limited Systems and methods for installing upgraded software on electronic devices
CN106775674B (en) * 2016-11-29 2020-06-05 深圳市恒扬数据股份有限公司 Equipment based on universal boot loader and starting method thereof
CN106874018A (en) * 2017-03-16 2017-06-20 武汉理工大学 A kind of electric automobile Electric Air-Conditioner Controller software refreshing system and method

Also Published As

Publication number Publication date
CN110908733A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
US9513900B2 (en) Peripheral device and method for updating firmware thereof
CN106257417B (en) Boot program upgrading method, embedded equipment, control equipment and embedded system
EP2375323A1 (en) Firmware image update and management
JP2006065857A (en) Method and device for forcibly downloading program in mobile communication terminal
WO2021136200A1 (en) Bootloader loading method, storage medium, and embedded terminal
CN110908733B (en) Working mode determining method and device, and control method and device
KR20190101171A (en) Method and apparatus for operating multimodal of near field communications circuitry
KR20130142073A (en) Method and terminal for using mobile memory card to boot up mobile phone operating system
EP2750034B1 (en) Electronic device having updatable bios and bios updating method thereof
CN109582372B (en) System starting method and device
CN101344853A (en) System and method for over the air programming
CN109634781A (en) One kind is based on embedded program two-region Backup Images system and starting method
KR20190109979A (en) Electronic device and method for controling update thereof
CN102081526B (en) Basic input/output system architecture
CN114138295A (en) Method, device and system for upgrading application program firmware of electronic equipment
US10838740B2 (en) Information processing apparatus and startup method
CN107870776B (en) IPMC online upgrading method and device
CN112667444A (en) System upgrading method, storage medium and terminal equipment
CN114527994A (en) Firmware programming method and system and vehicle control system
CN110134456A (en) For managing the method, apparatus, equipment and storage medium of operating system
CN115576587B (en) Firmware upgrading device and method for storage device
CN109271191B (en) Information processing method and electronic equipment
KR100490743B1 (en) Method for downloading file by using usb in the boot loader
KR100588199B1 (en) Method for recovering download mode in program download fail state of portable terminal, and portable terminal employing it
WO2011001305A1 (en) A method, apparatus and computer program for loading files during a boot- up process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant