CN113885928A - Program updating method and electronic device - Google Patents

Program updating method and electronic device Download PDF

Info

Publication number
CN113885928A
CN113885928A CN202110603262.7A CN202110603262A CN113885928A CN 113885928 A CN113885928 A CN 113885928A CN 202110603262 A CN202110603262 A CN 202110603262A CN 113885928 A CN113885928 A CN 113885928A
Authority
CN
China
Prior art keywords
partition
code block
function
electronic device
code
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.)
Granted
Application number
CN202110603262.7A
Other languages
Chinese (zh)
Other versions
CN113885928B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110603262.7A priority Critical patent/CN113885928B/en
Publication of CN113885928A publication Critical patent/CN113885928A/en
Application granted granted Critical
Publication of CN113885928B publication Critical patent/CN113885928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Program update method and electronic device. In the method, the electronic device adds a first code block in an update program to an independent partition, and if the code block is determined not to meet a first preset jump condition in the process of executing the code block in sequence, a third code block outside the independent partition is executed according to the execution sequence of a normal code block. If the first preset jump condition is met, the independent partition can be jumped to execute the first code block which realizes the same function but has different performance with the third code block instead of executing the third code block. Therefore, the capacity of the updating program can be reduced, the efficiency of providing new functions for users is improved, and the speed of downloading and installing the updating program by the electronic equipment of the users is also improved.

Description

Program updating method and electronic device
Technical Field
The present application relates to the field of terminal and communication technologies, and in particular, to a program updating method and an electronic device.
Background
With the increasing competition of the industry, the frequency of version updates of functional applications and device drivers is increasing, and the latest and best functions are provided for users.
However, a new version of the program has its own period from the development, testing, and adaptation of the user until the full version of the final push user is obtained. This period may reach three or four months or even longer, and cannot meet the current demand for quickly providing new functionality to the user.
Disclosure of Invention
The application provides a program update method for quickly installing new functions to consumer electronic devices in program version iterations, improving the efficiency of providing new functions to users.
In a first aspect, the present application provides a program updating method, including: the electronic equipment acquires an updating program, wherein the updating program comprises a first code block used for realizing a first function with a first performance; the electronic device adding the first code block to an independent partition in a memory of the electronic device; the independent partition is a partition which does not influence the normal starting of the electronic equipment; after executing the second code block outside the independent partition, the electronic device determines whether the first recording result meets a first preset jump condition; under the condition that the first recording result does not conform to the first preset jump condition, the electronic equipment executes a third generation code block outside the independent partition, wherein the third generation code block is used for realizing the first function with a second performance, and the second performance is different from the first performance; the electronic device executes the first code block in the independent partition in case that the first recording result meets the first preset jump condition.
In the above embodiment, the electronic device may add the first block of code in the update to the independent partition. In the process of executing the code blocks in sequence, if the first recording result is determined not to accord with the first preset skipping condition, the electronic equipment executes the third code block outside the independent partition according to the normal code block execution sequence. If the first recording result meets the first preset jumping condition, the electronic device can jump to the independent partition to execute the first code block which realizes the same function but different performance with the third code block instead of executing the third code block. Therefore, when the program needs to be updated, a code block different from a code block in the existing program may be included in the update program, and a code block identical to the code block in the existing program may not be included, so that the update program may not need to include the full amount of code of the program. On one hand, the number of code blocks needing to be tested in the updating program is reduced, so that a developer can develop the updating program more quickly. When the program version is iterated, an updating program which is smaller in capacity and meets the function requirements can be developed more quickly, new functions can be pushed to the user electronic equipment more quickly, and the efficiency of providing the new functions to users is improved. On the other hand, the capacity of the updating program is greatly reduced, and the speed of downloading and installing the updating program by the user electronic equipment is improved.
In combination with some embodiments of the first aspect, in some embodiments, the memory further includes a first partition and a second partition; the first partition includes the second code block therein, and the second partition includes the third code block therein.
In the above embodiment, after the second code block in the first partition is executed, whether to execute the first code block in the independent partition or the third code block in the second partition may be determined according to whether the first recording result meets the first preset jump condition, so that flexibility of code block distribution is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first partition further includes a preference function, where the preference function is used to obtain a recording result according to a first preset selection condition, where the first recording result is included; the first recording result is used for identifying the code block which meets the first preset selection condition in the first code block and the third code block.
In the above embodiment, the recording result including the first recording result is obtained by the preferred function in the first partition according to the first preset selection condition, and is used as a basis for selecting whether to execute the code block in the independent partition or execute the code block in the second partition, so that the running stability of the electronic device is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first preset selection condition is to select a code block with better performance when the same function is implemented in the second partition and the independent partition.
In the above embodiment, the preferred function selects, as the first preset selection condition, the code block with better performance when the same function is implemented in the second partition and the independent partition, so that the electronic device executes the code block with better performance, thereby improving the performance of the electronic device.
In combination with some embodiments of the first aspect, in some embodiments, the method further comprises: the preferred function sends a first information reporting instruction to the independent partition and the second partition, wherein the first information reporting instruction is used for indicating the function and the performance of the code block included in the independent partition and the second partition; the preferred function receives the functions and performances of the code blocks included in the independent partition and the second partition, wherein the functions and performances include that the first code block realizes the first function and the performance is the first performance, and the second code block realizes the first function and the performance is the second performance; the preferred function determines the code block with better performance when the independent partition and the second partition realize the same function as the preferred code block, and stores the code block as the recording result, wherein the code block comprises the first recording result; the first recorded result is used to identify a code block of the first code block and the third code block that performs better when the first function is implemented.
In the above embodiment, the independent partition and the second partition are enabled to report the functions and performances of the code blocks included therein by sending the first information reporting instruction to the independent partition and the second partition, and then the code blocks with better performances among the code blocks realizing the same functions are obtained by comparison and stored as the preferred code blocks. The accuracy of the preferred function in determining the preferred code block is improved.
In combination with some embodiments of the first aspect, in some embodiments, the method further comprises: the preferred function sends a second information reporting instruction to the independent partition, wherein the second information reporting instruction is used for indicating the function and the performance of the code block included in the independent partition; the preferred function receives the functions and performances of the code blocks which are reported by the independent partitions, wherein the functions and performances of the code blocks which are reported by the independent partitions comprise that the first code block realizes the first function and the first performance is the performance; the optimal function sends a third information reporting instruction to the second partition, wherein the third information reporting instruction is used for indicating the performance of reporting code blocks with the same functions of the independent partition by the second partition, and the code blocks with the same functions of the independent partition are code blocks which realize the same functions with the code blocks reported by the independent partition; the optimal function receives the performance of the independent partition code block with the same function reported by the second partition, wherein the performance of a third generation code block which also realizes the first function is the second performance; the preferred function determines a code block with better performance when the same function is realized in a code block which is reported by the independent partition and an independent partition and function code block which is reported by the second partition as a preferred code block, and stores the preferred code block as the recording result, wherein the preferred code block comprises the first recording result; the first recorded result is used to identify a code block of the first code block and the third code block that performs better when the first function is implemented.
In the above embodiment, the third information reporting instruction is sent to the independent partition first, after receiving the function and performance of the code block included in the code block reported by the independent partition, the third information reporting instruction indicating the performance of the code block reporting the same function of the independent partition is sent to the second partition, and finally the code block included in the code block reported by the independent partition and the code block reporting the same function of the independent partition reported by the second partition are followed, so that the code block with the better performance of the same function is determined to be the preferred code block. The number of information of the code blocks needing to be reported by the second partition is greatly reduced, the number of information of the code blocks needing to be received and compared by the optimal function is reduced, and the efficiency of determining the optimal code blocks by the optimal function is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first preset selection condition is to select a code block matching a physical device installed on the electronic device.
In the above embodiment, the code block matched with the physical device installed on the electronic device is selected as the first preset selection condition, so that the electronic device executes the code block most matched with the physical device, and the running stability of the electronic device is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first logging result is temporarily stored in an internal memory, or the first logging result is stored in a fourth partition of a storage.
In the above embodiment, the first recording result may be temporarily stored in the memory, so as to reduce occupation of the memory resource. Or the first recording result is stored in a fourth partition in the memory, so that repeated calculation of the first recording result is avoided, and the operating efficiency of the electronic equipment is improved.
With reference to some embodiments of the first aspect, in some embodiments, after executing the second code block outside the independent partition, the determining, by the electronic device, whether the first recording result meets a first preset jump condition specifically includes: after executing the second code block in the first partition, the electronic device determines whether the first recording result includes an identification of the independent partition; when the first recording result contains the identifier of the independent partition, the electronic equipment determines that the first recording result meets the first preset jump condition; and when the first recording result does not contain the identifier of the independent partition, the electronic equipment determines that the first recording result does not conform to the first preset jump condition.
In the above embodiment, the first recording result may be a record entry, and the electronic device may determine whether to execute the code block in the independent partition or execute the code block in the second partition by whether the record entry includes the identifier of the independent partition, so that the electronic device may accurately determine to which partition to execute the code block, and accuracy of the electronic device to jump to execute the code block is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first partition further includes a first flag bit, and the first recording result is a value of the first flag bit; the method further comprises the following steps: when the preference function determines that the first code block has better performance, the electronic device sets the first flag bit to a first preset value; when the preference function determines that the third generation code block performs better, the electronic device sets the first flag to other values different from the first preset value.
In the above embodiment, the preferred function stores the recording result through the value of the flag bit, so that the electronic device can read the recording result faster and more accurately and make a judgment according to the recording result, thereby improving the operating efficiency of the electronic device.
In combination with some embodiments of the first aspect, in some embodiments, the first flag is associated with the first function; the first partition also comprises a first selection function, and the first selection function is a selection function of the first function; the method further comprises the following steps: the electronic equipment transmits the value of the first zone bit to the first selection function; after executing the second code block outside the independent partition, the electronic device determines whether the first recording result meets a first preset jump condition, specifically including: after executing the second code block in the first partition, the first selection function determines whether the value of the first flag is the first preset value; when the value of the first zone bit is determined to be the first preset value, the first selection function determines that the first recording result meets the first preset jump condition; when the value of the first flag bit is determined not to be the first preset value, the first selection function determines that the first recording result does not conform to the first preset jump condition.
In the above embodiment, the preferred function passes the recorded result saved by the flag bit, and the flag bit may be passed to the selection function associated with the same function, and the selection function may select whether to execute the code block in the independent partition or the code block in the second partition according to the value of the flag bit, so as to improve the accuracy of skipping to execute the code block by the electronic device.
With reference to some embodiments of the first aspect, in some embodiments, after executing the second code block outside the independent partition, the determining, by the electronic device, whether the first recording result meets a first preset jump condition specifically includes: after executing the second code block in the first partition, the electronic device determines whether a value of a first flag is the first preset value; when the value of the first zone bit is determined to be the first preset value, the electronic equipment determines that the first recording result meets the first preset skipping condition; when the value of the first flag bit is determined not to be the first preset value, the electronic device determines that the first recording result does not conform to the first preset jump condition.
In the above embodiment, the electronic device determines whether to execute the code block in the independent partition or the code block in the second partition according to whether the value of the first flag bit is the first preset value, so that the accuracy of skipping to execute the code block by the electronic device is improved.
With reference to some embodiments of the first aspect, in some embodiments, the first partition and the second partition are partitions associated with normal booting of the electronic device.
In the embodiment, the electronic device can update the code blocks in the partitions related to normal starting of the electronic device through the code blocks in the independent partitions, so that the updating efficiency of the system is improved.
With reference to some embodiments of the first aspect, in some embodiments, the update program further includes a fourth code block, and the fourth code block is configured to implement the second function with the third capability; the method further comprises the following steps: the electronic device adding the fourth code block to the independent partition; after executing the first code block or the third code block, the electronic device determines whether a second recording result meets a second preset jump condition; under the condition that the second recording result does not accord with the second preset jumping condition, the electronic equipment executes a fifth code block outside the independent partition, wherein the fifth code block is used for realizing the second function with a fourth performance; the fourth property is different from the third property; and in the case that the second recording result meets the second preset jump condition, the electronic equipment executes the fourth code block in the independent partition.
In the above embodiments, the electronic device may carry a plurality of code blocks in one update program. When a plurality of code blocks in the conventional code block execution flow of the electronic equipment are executed, whether the code blocks in the execution independent partitions need to be jumped or not can be determined, and the efficiency of updating programs by the electronic equipment is improved.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors and memory; the memory coupled with the one or more processors, the memory to store computer program code, the computer program code including computer instructions, the one or more processors to invoke the computer instructions to cause the electronic device to perform:
obtaining an update program comprising a first block of code for implementing a first function at a first capability; adding the first code block to an independent partition in a memory of the electronic device; the independent partition is a partition which does not influence the normal starting of the electronic equipment; after executing the second code block outside the independent partition, determining whether the first recording result meets a first preset jump condition; executing a third code block outside the independent partition under the condition that the first recording result does not conform to the first preset jump condition, wherein the third code block is used for realizing the first function with a second performance, and the second performance is different from the first performance; executing the first code block in the independent partition in case that the first recording result meets the first preset jump condition.
In some embodiments in combination with the second aspect, the memory further includes, in some embodiments, a first partition and a second partition; the first partition includes the second code block therein, and the second partition includes the third code block therein.
With reference to some embodiments of the second aspect, in some embodiments, the first partition further includes a preference function, where the preference function is used to obtain a recording result according to a first preset selection condition, where the first recording result is included; the first recording result is used for identifying the code block which meets the first preset selection condition in the first code block and the third code block.
In combination with some embodiments of the second aspect, in some embodiments, the first preset selection condition is to select a code block with better performance when the same function is implemented in the second partition and the independent partition.
In some embodiments combined with some embodiments of the second aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: sending a first information reporting instruction to the independent partition and the second partition through the preferred function, wherein the first information reporting instruction is used for indicating the function and the performance of a code block included in the independent partition and the second partition; receiving the functions and performances of the code blocks included in the independent partition and the code blocks reported by the second partition through the preferred function, wherein the first code block realizes the first function and the performance is the first performance, and the second code block realizes the first function and the performance is the second performance; determining a code block with better performance when the independent partition and the second partition realize the same function as a preferred code block through the preferred function, and storing the code block as the recording result, wherein the code block comprises the first recording result; the first recorded result is used to identify a code block of the first code block and the third code block that performs better when the first function is implemented.
In some embodiments combined with some embodiments of the second aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: sending a second information reporting instruction to the independent partition through the preferred function, wherein the second information reporting instruction is used for indicating the function and the performance of the code block included in the independent partition; receiving the functions and performances of the code blocks included in the independent partition reported by the independent partition through the preferred function, wherein the first code block is included to realize the first function, and the performances are the first performances; sending a third information reporting instruction to the second partition through the preferred function, wherein the third information reporting instruction is used for indicating the performance of reporting code blocks with the same functions of the independent partition by the second partition, and the code blocks with the same functions of the independent partition are code blocks which realize the same functions as the code blocks reported by the independent partition; receiving the performance of the independent partition code block with the same function reported by the second partition through the preferred function, wherein the performance of a third generation code block which also realizes the first function is the second performance; determining, by the preferred function, a code block with better performance when the same function is realized in a code block included in the independent partition and an independent partition and same function code block reported by the second partition, as a preferred code block, and storing the preferred code block as the recording result, where the preferred code block includes the first recording result; the first recorded result is used to identify a code block of the first code block and the third code block that performs better when the first function is implemented.
In some embodiments in combination with some embodiments of the second aspect, the first preset selection condition is to select a code patch matching a physical device mounted on the electronic device.
In some embodiments, in combination with some embodiments of the second aspect, the first logging result is temporarily stored in the memory, or the first logging result is stored in a fourth partition of the storage.
With reference to some embodiments of the second aspect, in some embodiments, the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: determining whether the first recording result includes an identification of the independent partition after executing the second code block in the first partition; when the first recording result contains the identifier of the independent partition, determining that the first recording result meets the first preset jump condition; and when the first recording result does not contain the identifier of the independent partition, determining that the first recording result does not conform to the first preset jump condition.
In some embodiments, in combination with some embodiments of the second aspect, the first partition further includes a first flag bit, and the first recording result is a value of the first flag bit; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: when the preference function determines that the first code block has better performance, setting the first flag bit to a first preset value; when the preference function determines that the third generation code block has better performance, the first flag bit is set to other values different from the first preset value.
In some embodiments in combination with some embodiments of the second aspect, in some embodiments, the first flag is associated with the first function; the first partition also comprises a first selection function, and the first selection function is a selection function of the first function; the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: passing the value of the first flag bit to the first selection function; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: determining, by the first selection function, whether a value of the first flag is the first preset value after executing the second code block in the first partition; when the value of the first zone bit is determined to be the first preset value, determining that the first recording result meets the first preset jump condition through the first selection function; and when the value of the first zone bit is determined not to be the first preset value, determining that the first recording result does not accord with the first preset jump condition through the first selection function.
With reference to some embodiments of the second aspect, in some embodiments, the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: determining whether a value of a first flag is the first preset value after the second code block in the first partition is executed; when the value of the first zone bit is determined to be the first preset value, determining that the first recording result meets the first preset skipping condition; and when the value of the first flag bit is determined not to be the first preset value, determining that the first recording result does not conform to the first preset jump condition.
In some embodiments in combination with some embodiments of the second aspect, the first partition and the second partition are partitions associated with normal booting of the electronic device.
In some embodiments in combination with some embodiments of the second aspect, in some embodiments, the update program further includes a fourth code block, the fourth code block being for implementing the second function with the third capability; the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: adding the fourth code block to the independent partition; after executing the first code block or the third code block, determining whether a second recording result meets a second preset skipping condition; executing a fifth code block outside the independent partition under the condition that the second recording result does not conform to the second preset jump condition, wherein the fifth code block is used for realizing the second function with a fourth performance; the fourth property is different from the third property; and executing the fourth code block in the independent partition under the condition that the second recording result meets the second preset jump condition.
In a third aspect, an embodiment of the present application provides a chip system, where the chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is configured to invoke a computer instruction to cause the electronic device to perform a method as described in the first aspect and any possible implementation manner of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product including instructions, which, when run on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.
It is understood that the electronic device provided by the second aspect, the chip system provided by the third aspect, the computer program product provided by the fourth aspect, and the computer storage medium provided by the fifth aspect are all used to execute the method provided by the embodiments of the present application. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
Fig. 1 is a schematic diagram of a comparison between a program update flow and an exemplary scenario in an embodiment of the present application in an implementation of program update;
FIG. 2 is an exemplary diagram of a hardware architecture of an electronic device according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an exemplary comparison of a partition table with a partition table in an embodiment of the present application;
FIG. 4 is an exemplary diagram of a software architecture of an electronic device according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a program updating method according to an embodiment of the present application;
FIG. 6a is a partition table of an exemplary scenario in an embodiment of the present application;
FIG. 6b is a schematic flow chart of an embodiment of the present application;
FIG. 7a is a partition table of another exemplary scenario in an embodiment of the present application;
FIG. 7b is a schematic flow chart of another embodiment of the present application;
FIG. 8 is a schematic diagram illustrating a comparison of program update flow in another exemplary scenario of an embodiment of the present application and an implementation of a program update;
FIG. 9 is another flowchart illustrating a program update method according to an embodiment of the present application;
FIG. 10 is a schematic view of a partition table of an exemplary scenario in an embodiment of the present application;
FIG. 11 is a schematic diagram illustrating an exemplary scenario of an embodiment of the present application;
fig. 12 is another flowchart illustrating a program updating method according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the specification of the present application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
By adopting the program updating method provided by the embodiment of the application, the new function can be quickly installed to the user electronic equipment in the iteration of the program version, and the efficiency of providing the new function for the user is improved.
Fig. 1 is a schematic diagram illustrating an implementation of program update compared with a program update flow of an exemplary scenario in an embodiment of the present application.
An exemplary scenario: the user purchases a mobile phone sold by a manufacturer, the current driving version 1 of a camera (camera) of the mobile phone can support the camera to take a picture with 12M (1200 ten thousand) pixels at the maximum. One week after release, however, manufacturers are forced to compete for pressure and need to update the driving version of the camera immediately so that the camera can take a picture of up to 48M (4800 ten thousand) pixels. After analysis, the final manufacturer decides to modify the camera-driven code to support the camera to take a picture of higher pixels by means of algorithmic interpolation.
In one implementation of program update, as shown in fig. 1 (a), after the mobile phone is released for one week, a manufacturer starts to develop a camera driver version 2, and needs to complete the full amount of codes of the camera driver version 2 after 3 months through inherent cycles of development, testing, adaptation, and the like. The capacity of the camera drive version 2 is 300 MB.
At this time, the user needs to download and install the camera drive version 2 having a capacity of 300MB so that the mobile phone purchased 3 months ago can support taking a picture of 48M pixels.
If a user downloads a lot of videos in his mobile phone, there is no free capacity of 300MB, which may result in a failure of downloading drivers and a failure to install the camera driver version 2. At this time, the user needs to delete some collected and saved video contents, so that the mobile phone has a capacity of more than 300MB, and can download and install the camera drive version 2, thereby completing the support of 48M pixels by the camera.
And most probably, the friend of the user already supports 48M pixels in the camera of the mobile phone with the same price purchased by other manufacturers 3 months ago, so that the user is full of suffering from the eye discomfort of the friend for a few months.
Therefore, by adopting the program updating mode in the implementation mode, the updating period is long, and the updated function can be installed only by downloading the program package with large capacity, so that the user experience is poor, and a bad impression is generated for manufacturers.
With the program updating method in the embodiment of the present application, as shown in fig. 1 (b), after the mobile phone is released for one week, a manufacturer starts to develop the camera drive version 2, and at this time, it is not necessary to obtain the full amount of codes of the camera drive version 2 through an excessively long period of development, testing, adaptation, and the like. After only 3 days, the logic part code of the interpolation algorithm for making the camera support 48M pixels can be completed, wherein the interpolation algorithm for generating 48M pixels can be included, and the code which is not related to the lifting of the pixel value of the shot photo in the camera drive can be excluded as the updating program A. The capacity of the update program a is only 1 MB.
At this time, the user only needs to download the update program a with the capacity of 1MB, and the mobile phone adds the update program a to the independent partition in the mobile phone. Under the guidance of a high pixel selection function preset in a main logic program of the mobile phone, when a pixel algorithm needs to be executed, the mobile phone selects to execute an updating program A supporting 48M pixels stored in an independent partition, so that the camera supports 48M pixels.
Thus, when the camera of the handset needs to be updated to support higher pixels, the manufacturer can develop the related update program a after only 3 days. I.e., camera in the handset, can be updated from only 12M pixels to 48M pixels after only a few days. The updating speed is high, the capacity of the program package to be downloaded is small, and the user experience is greatly improved.
An exemplary electronic device 100 provided by embodiments of the present application is first described below.
Fig. 2 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application.
The following describes an embodiment specifically by taking the electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: the mobile terminal includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The SIM interface may be used to communicate with the SIM card interface 195, implementing functions to transfer data to or read data from the SIM card.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The internal memory 121 may include one or more Random Access Memories (RAMs) and one or more non-volatile memories (NVMs).
The random access memory may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), such as fifth generation DDR SDRAM generally referred to as DDR5 SDRAM, and the like;
the nonvolatile memory may include a magnetic disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operation principle, may include single-level cells (SLC), multi-level cells (MLC), three-level cells (TLC), four-level cells (QLC), etc. according to the level order of the memory cells, and may include universal FLASH memory (UFS), embedded multimedia memory cards (eMMC), etc. according to the storage specification.
The random access memory may be read and written directly by the processor 110, may be used to store executable programs (e.g., machine instructions) of an operating system or other programs in operation, and may also be used to store data of users and applications, etc.
The nonvolatile memory may also store executable programs, data of users and application programs, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect an external nonvolatile memory to extend the storage capability of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are saved in an external nonvolatile memory.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication.
The electronic device 100 may divide the internal memory 121 into a plurality of partitions with different functions and sizes through the partition table, and store various programs or data with different functions.
Illustratively, as shown in fig. 3 (a), an exemplary diagram of a partition table is shown. The partition table comprises an Xloader/preloader partition, an Lk partition, a Dtbo partition, a Boot partition, an Odm partition, a Vendor partition and a System partition:
xloader/preloader partition: associated with the chip, is a boot partition that is loaded for the chip. The method is characterized in that after a system is powered on, a user program which is completely mirrored to a memory and is executed first is loaded, a system clock and an external random access memory (SDRAM) are initialized, and after the initialization is completed, a lk partition is skipped to execute relevant code logic.
It will be appreciated that jumping from the xloader/preloader partition to the lk partition executes the associated code logic, which corresponds to a function call relationship. For example, among a plurality of functions (functions X1, X2, X3, and X4) executed sequentially by the xloader/preloader partition, one of the functions X2 is a call to execute a certain function L1 in the lk partition. Then the execution of the function X1 will jump to lk when the xloader/preloader partition finishes executing the function X2
lk (little kernel) partition: the main role is to initialize the hardware and start a boot loader. Reading the device tree configuration in the dtbo partition to load the device tree, reading boot.img files in the boot partition to start a kernel, reading related files in the odm partition, the vendor partition and the system partition to initialize and start related system functions, and starting an android operating system. Wherein, the device tree is configured as a data structure for describing hardware, and comprises a plurality of hardware detail configurations. For example, a general-purpose input/output (GPIO) configuration that supports screen lighting, normal camera opening, and the like, is included in the device tree configuration.
It will be appreciated that some blocks of code executed sequentially are included in the lk partition to implement its functions, e.g., functions L1, L2, L3, L4, etc., which implement different functions, respectively, that may be called by functions in the xloader/preloader partition. Each function may also contain a plurality of sub-functions that are executed sequentially. For example, the function L1 may include sub-functions lz1, lz2, lz3, lz4, and the like that are executed sequentially, and these functions may call functions in a dtbo partition or a boot partition to realize functions thereof. For example, if the lz2 function is to load the screen lighting configuration function D1 in the dtbo partition into the device tree by call to light the electronic device screen. Then function L1 is called in the lk partition to sequentially execute its sub-function lz1 and, when executing to sub-function lz2, it may jump to the dtbo partition to execute the screen illumination configuration function D1. After the dtbo partition finishes executing the screen shot configuration function D1, the function returns to the function L1 in the lk partition to continue to execute the subsequent sub-functions lz3, lz4, and so on in sequence.
It can be understood that the manner of executing code block or function jump in other partitions and between partitions is not described in detail later.
dtbo (device tree binary overlay) partition: the partition for storing the equipment tree configuration mainly comprises the configuration of the peripheral driver of a manufacturer. For example, a software and hardware interface GPIO configuration supporting screen lighting, camera normally on, and the like.
Carrying out boot partitioning: img files are stored, wherein the files comprise kernel. kernel, i.e. linux content image, includes kernel code for ensuring normal driving of peripheral devices such as screen and camera.
odm partition: the specific board-level support package of Original Design Manufacturer (ODM) is stored as some binary library functions, which mainly include loadable kernel modules, native libraries, security context policies, system attributes, applications and system files implemented by system functions. For example, an effect parameter of the screen (e.g., a parameter for realizing color saturation of the screen, a parameter for realizing definition of the screen, etc.), a camera effect parameter (e.g., a pixel algorithm, a night scene algorithm, etc.), and the like.
Carrying and partitioning: storing chip vendor and handset vendor modifications to the chip configuration (e.g., clock, frequency, power supply configuration, etc.). In addition, the driver file compiled by the handset manufacturer may also be included in the vendor partition (e.g., complete device id writing, associated feature log printing and storing), and may also include executable programs, libraries, system services, etc. proprietary to the manufacturer.
system partitioning: the partition basically comprises the whole android operating system, and mainly comprises an android user interface, an android kernel library, all preinstalled system application programs, a JNI (Java Native interface) and HAL (hardware Abstraction layer) layer dependent dynamic link library.
The following description will be given of the process of reading information between partitions, taking the procedure of starting the Android system as an example:
1. starting a power supply and starting a system:
when the power key is pressed, the chip code is guided to execute from a predefined place according to the data in the xloader/preloader partition. And loading a boot loader in the lk partition into a RAM and then executing.
2. Boot loader:
the bootstrap program is an applet before the Android operating system starts to run, and is mainly used for starting a kernel, and simultaneously driving hardware on an operation board, such as serial port printing, erasing and programming flash, loading a screen, basic hardware configuration of a camera device and the like.
3. Loading the equipment tree:
img in the boot partition is read by the boot program in the lk partition to load the kernel, and the device tree configuration in the dtbo partition is also read to load the device tree. And transmitting the physical address of the loaded device tree to the kernel, and configuring various hardware information by the kernel, such as software and hardware interface configuration supporting screen lightening and camera normally opening.
4. Kernel boot (boot):
the kernel is the lowest layer of the whole operating system and is responsible for driving the whole hardware, and providing the core functions and driving loading required by various systems, such as loading screens and cameras. And when the kernel completes system setting, starting an init process.
5. The init process is started:
the init process is the first process of a user control in the Android system, and is responsible for creating and mounting a partition required for starting (including a vendor partition, a system partition and an odm partition), reading relevant codes in the vendor partition, the system partition and the odm partition, initializing and starting system functions and services, and starting a Zygote process.
6. The Zygote process starts:
in the Android system, Zygote is a parent process of all application processes in the Android system, the processes of apps in the Android system are all split by the Zygote, and the Zygote is responsible for creating java virtual machines, registering a JNI method for the java virtual machines, creating server side sockets and starting a SystemServer process.
7. Starting a SystemServer process:
and the system Server process further starts a Launcher, and the Launcher displays the shortcut icon of the installed application on the interface after starting the Launcher. And finishing the whole starting process.
In contrast to the partition table shown in fig. 3 (a), in the embodiment of the present invention, when the internal memory 121 is partitioned, an additional independent partition may be previously partitioned.
Illustratively, as shown in fig. 3 (b), an exemplary diagram of a partition table in the embodiment of the present application is shown. The partition table comprises an Xloader/preloader partition, an Lk partition, a Dtbo partition, a Boot partition, an independent partition, an Odm partition, a Vendor partition and a System partition.
The independent partition: when leaving factory, the system is empty and does not store programs; the program of the function update may be stored subsequently.
In other partitions (such as partitions such as an Xloader/preloader partition, an Lk partition and the like), in some function codes calling code blocks of other partitions to realize functions, a selection function can be preset, and according to different determined results of the selection function, the function calling the corresponding code block in the preset partition (such as jumping to an odm partition to execute the corresponding code block) or the function calling the corresponding code block in an independent partition (such as jumping to an independent partition to execute the corresponding code block) can be continuously executed according to the original code logic. After the corresponding code block is executed, the corresponding code block returns to the function code of the original partition to continue executing the subsequent code logic.
And the selection of the selection function may be based on data of different origins.
For example, a preset selection function a in a function code a may be selected based on the value of a flag bit a preset in the function code a. The selection function may determine to perform a function calling a corresponding code block in a preset partition when the flag a has a value of 1, and may determine to perform a function calling a corresponding code block in an independent partition when the flag a has a value of 0.
As another example, a selection function a preset in the function code a may be determined based on a certain data record B. When the expected value recorded in the data record B is 5, and the selection function a determines that the result obtained by executing the function of calling the corresponding code block in the preset partition is 3, and the result obtained by executing the function of calling the corresponding code block in the independent partition is 5, the selection function a may determine to execute the function of calling the corresponding code block in the independent partition.
The selection function may also be based on data from other sources, and is not limited herein.
In some embodiments, the data source from which the selection function is selected may be determined by other functions (e.g., preferred functions) preset in the partition and stored in a particular partition of the electronic device. For example, a store partition may be further included after the partition table, and is used to store the value of the data source according to which the selection function in each partition selects. Before executing the function code a, a preferred function Y may be executed, and after comparing the code in the independent partition with the code in the other partitions, the value of the flag bit a in the function code a may be stored in a post-partition table store partition, or the expected value recorded in the data record B may be stored in the store partition. After execution of function code A, selection function A may be selected by reading the value of flag bit A or the value of data record B in the store partition.
It should be noted that some manufacturers may uniformly include some partitions after Boot partitioning, including Odm partition, Vendor partition, System partition, and the like, into a Super partition, and set the Super partition as a dynamic partition. With the help of dynamic partitioning, manufacturers can allocate the sizes of the mirror images in the Super partition at will without worrying about the sizes of the partitions. For example, from google version Q, the manner of Super partitioning is used in the android system.
In the partition table described in (b) of fig. 3, the independent partition is disposed after the boot partition and before the Super partition. It is understood that in some embodiments of the present application, the independent partition may be disposed in other locations (e.g., after the Xloader/preloader partition, before the Lk partition; e.g., after the Lk partition, before the Dtbo partition, etc.), which is not limited herein.
In this embodiment, the program stored in each partition of the internal memory 121 is a computer program code, the computer program code includes computer instructions, and the processor 110 may cause the electronic device 100 to execute the program updating method in this embodiment by calling the computer to execute the program.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention uses an Android system with a layered architecture as an example to exemplarily illustrate a software structure of the electronic device 100.
Fig. 4 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the system is divided into four layers, an application layer, an application framework layer, a Runtime (Runtime) and system library, and a kernel layer, from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 4, the application package may include applications (also referred to as applications) such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 4, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog interface. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Runtime (Runtime) includes a core library and a virtual machine. Runtime is responsible for scheduling and management of the system.
The core library comprises two parts: one part is the function that the programming language (e.g. java language) needs to call, and the other part is the core library of the system.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes programming files (e.g., java files) of the application layer and the application framework layer as binary files. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), two-dimensional graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provides a fusion of two-Dimensional (2-Dimensional, 2D) and three-Dimensional (3-Dimensional, 3D) layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing 3D graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The kernel layer at least comprises a display driver, a camera driver, an audio driver, a sensor driver and a virtual card driver.
The following describes exemplary workflow of the software and hardware of the electronic device 100 in connection with capturing a photo scene.
When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, a time stamp of the touch operation, and other information). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and taking a control corresponding to the click operation as a control of a camera application icon as an example, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera drive by calling a kernel layer, and captures a still image or a video through the camera 193.
It is understood that, in the embodiment of the present application, after the electronic device 100 executes the computer instructions stored in the Xloader/preloader partition of the internal memory 121, the Boot partition is booted to load, and at this time, the kernel layer in the software framework may be enabled. After the System partition is successfully loaded to be guided, the functions of the System library, the application framework layer and the application layer in the software framework can be enabled.
If some packages are updated in separate partitions of the internal memory 121, some functional modules at different layers in the software framework will be replaced accordingly according to the role of the packages. For example, if the package of display drivers is updated into the independent partition, the display drivers that are kernel in the software framework are replaced by new display drivers after the electronic device 100 determines to execute the program of the independent partition.
The following describes the method in the embodiment of the present application in detail with reference to the software and hardware structure of the above exemplary electronic device 100 and the scenario shown in fig. 1 (b):
fig. 5 is a flowchart illustrating a program updating method according to an embodiment of the present application.
S501, the electronic equipment shoots a picture by using a camera to obtain a picture A with a pixel value of 12M;
illustratively, as shown in fig. 6a, it is an exemplary diagram of the partition table of the internal memory 121 of the electronic device 100. When the electronic device 100 leaves the factory, a blank independent partition may be preset in the partition table of the internal memory 121. The odm partition includes the highest algorithm code that supports generation of 12M pixels, and other codes, such as a night scene algorithm code. A preference function may be preset in the LK partition to determine the code that works better in the independent partition and the odm partition. The LK partition may include BootLoader, preferred function, night scene algorithm calling code block, pixel algorithm calling code block, and other code blocks in order in the code logic. A pixel selection function, an odm partition pixel algorithm calling function and an independent partition pixel algorithm calling function are preset in the pixel algorithm calling code block, wherein:
the pixel selection function is used for selecting the algorithm code supporting the highest pixel from the independent partition and the odm partition to execute by judging whether the odm partition pixel algorithm calling function or the independent partition pixel algorithm calling function is executed;
the odm partition pixel algorithm calling function is used for calling the pixel algorithm function in the odm partition;
and the independent partition pixel algorithm calling function is used for calling the pixel algorithm function in the independent partition.
Illustratively, as shown in fig. 6b, the information flow diagram is an exemplary scenario after the electronic device 100 is powered on. After the power supply of the electronic device 100 is started, the code of the LK partition is booted and loaded from the xloader/preloader partition, and is executed according to the code logic sequence of code blocks such as Boot Loader, an optimal function, a night scene algorithm call code block, a pixel algorithm call code block and the like. After executing the preference function, the electronic device may determine that the independent partition is empty, with no more effective preference code. The electronic device may directly pass the result to a subsequent code block (e.g., a pixel point algorithm calling code block), or may store the result in the store partition.
After the preferred function is executed, the electronic equipment jumps back to the LK subarea to continue to sequentially execute the night scene algorithm calling code block, and the code block realizes the function by calling the night scene algorithm code in the ODM subarea. And the electronic equipment jumps to the ODM partition to execute the night scene algorithm codes, and jumps back to the LK partition after the execution is finished to continue to execute the pixel algorithm calling code blocks in sequence. The pixel algorithm calling function preset in the code block determines whether to execute the odm partition pixel algorithm calling function or the independent partition pixel algorithm calling function by judging which algorithm code with the highest supported pixel exists in the current independent partition and the odm partition.
It should be understood that, in the example in the embodiment of the present application, only a selection function (for example, a pixel selection function) is preset in the pixel algorithm call code block, in an actual application, a selection function (for example, a night scene algorithm selection function) may also be set in the night scene algorithm call code block, and when the code is executed to the selection function of the night scene algorithm call code block, it may also determine to execute the code in the ODM partition or the independent partition based on the result of the determination of the preferred function, which is not limited herein.
The pixel selection function may determine that the implementation code of the highest pixel 12M that the electronic device is expected to achieve is in the odm partition, while the independent partition is empty, by reading the result of the determination of the preference function, or the result of the determination (e.g., the value of the flag bit of the pixel algorithm) passed down by the pixel selection function according to the preference function. Therefore, the pixel selection function selects to execute the odm partition pixel calling function, jumps to the odm partition and executes to load the algorithm code supporting generation of 12M pixels into memory. After the execution is finished, the LK subarea is jumped back to continue to execute the subsequent code blocks in sequence.
Due to the fact that the algorithm codes supporting generation of 12M pixels in the ODM partition are loaded, after the electronic device 100 finishes system startup, the camera of the electronic device 100 can have the capability of supporting shooting of pictures with the highest 12M pixels. At this time, when the electronic apparatus 100 takes a picture using a camera, a picture a having a pixel value of 12M can be obtained.
It will be appreciated that the preference function may determine the preferred code that works better in the ODM partition and the independent partition in a variety of ways.
For example, in some embodiments, the preference function may compare the functional effect of the code in the independent partition to the functional effect of the code in the other partitions to determine the preferred code for each function. For example, the optimization function sends an information reporting instruction to the independent partition and the ODM partition, requests to report the effect of the codes included therein, and then compares the results to select the code with the better effect of each function as the optimization code. For example, if the ODM reports a version 1.0 supporting night scene algorithm codes and algorithm codes supporting generation of 12M pixels, and the independent partition reports null, the preference function may determine that the preference code of the night scene algorithm is in the ODM partition, and the preference code of the pixel algorithm is also in the ODM. For example, the ODM reports a version 1.0 supporting night scene algorithm codes and algorithm codes supporting generation of 12M pixels, and the independent partition reports algorithm codes supporting 48M pixels, so that the preferred function may determine that the preferred codes of the night scene algorithm are in the ODM partition, and the preferred codes of the pixel algorithm are in the independent partition. The above embodiment only takes the ODM partition including the night algorithm code and the pixel algorithm code as an example for explanation, and in practical application, the ODM partition may further include other algorithm codes, which is not limited. When the ODM contains multiple algorithm codes, the ODM may report all of the contained algorithm codes to the preferred function.
For another example, in some embodiments, the preferred function may first capture the effect of the code function in an independent partition and then determine whether the same function code in other partitions has a better effect. If the code of the same function in other partitions has better effect, it is determined to be the preferred code for that function. For example, the preferred function may first send an information reporting indication to the independent partition, requesting the independent partition to report the effect of the codes contained therein. If the independent partition reports empty, the preferred function may determine that the preferred codes of the functions are all in the original preset partition. If the reporting of the independent partition comprises an algorithm code supporting generation of 48M pixels, the optimal function sends an information reporting indication of the pixel algorithm code to the odm partition which originally stores the pixel algorithm code in a preset mode. If the odm partition feeds back an algorithm code that only supports the generation of 12M pixels, the preference function may determine that the preference code for the pixel algorithm function is in a separate partition.
The preferred function may also have many other ways to achieve its result, and is not limited herein.
It will be appreciated that the results of the execution of the preferred function may be stored in a number of ways:
in some embodiments, each function code block may be preset with a function flag bit, for example, a pixel algorithm flag bit may be included in a pixel algorithm calling code block. When the preference function determines that the preference code for the pixel algorithm function is in an independent partition, the value of the pixel algorithm flag bit may be set to 1. When the preference function determines that the preference code for the pixel algorithm function is in the odm partition, the value of the pixel algorithm flag bit may be set to 0. It is understood that the value of the pixel algorithm flag may be temporarily stored in the memory at and/or after the boot process, or may be stored in the store partition, which is not limited herein.
In some embodiments, the preferred function may directly save the results of the function execution as a record. For example, when the preference function determines that the preferred code for the pixel algorithm function is in an independent partition (the independent partition contains the algorithm code that is highest to support generation of 48M pixels), a record of the preferred code for the pixel algorithm function in the independent partition, or a record of the expected pixel value of the pixel algorithm function as 48M, may be kept. When the preference function determines that the preferred code for the pixel algorithm function is in the odm partition (the odm partition contains the highest algorithm code that supports 12M pixels being generated), a record of the preferred code for the pixel algorithm function in the odm partition may be kept, or a record of the expected pixel value of the pixel algorithm function as 12M may be kept. It is understood that the record of the execution result of the preferred function may be temporarily stored in the memory at the time of booting and/or after booting, or may be stored in the store partition, which is not limited herein.
The results of the execution of the preferred function may also be stored in many other ways, which are not limiting herein. In some embodiments, the result of the execution of the preferred function may be referred to as a logged result, which may include a first logged result, a second logged result, and so on.
S502, the electronic equipment downloads an updating program A, wherein the updating program A is a pixel algorithm program and comprises an algorithm code supporting generation of 48M pixels;
the electronic device 100 may download the update program a through system push, may download the update program a through a download link, and may download the update program a through a local USB copy, which is not limited herein.
S503, the electronic equipment adds the updating program A to the independent partition;
after the electronic device 100 downloads the update program a, the update program a may be added to the independent partition.
In some embodiments, the independent partition may be partitioned into different partitions, since updater A includes algorithm code that supports 48M pixel generation, while the algorithm code for pixel processing is stored in the odm partition. Thus, the updater A may be added to the odm-ext partition in the independent partition. Illustratively, as shown in fig. 7a, an exemplary schematic diagram of the partition table of the internal memory 121 of the electronic device 100 at this time is shown. The odm-ext partition in the independent partition includes algorithmic code to support the generation of 48M pixels.
S504, when the electronic equipment is started, determining that the independent partition contains a pixel algorithm code which supports generation of a higher pixel value than that of the odm partition;
illustratively, in conjunction with the partition table shown in fig. 7a, as shown in fig. 7b, the information flow diagram of another exemplary scenario after the electronic device 100 is powered on is shown. After the power supply of the electronic device 100 is started, the code of the LK partition is booted and loaded from the xloader/preloader partition, and is executed according to the code logic sequence of code blocks such as Boot Loader, an optimal function, a night scene algorithm call code block, a pixel algorithm call code block and the like. After executing the preferred function, the electronic device may determine that the pixel algorithm code in the independent partition supports 48M and the pixel algorithm code in the odm partition supports 12M, so the preferred code for the pixel algorithm function is the algorithm code in the independent partition that supports 48M pixels. The electronic device saves a record of the pixel algorithm function with the desired effect of 48M into the store partition, or saves a record of the preferred code of the pixel algorithm function as an independent partition into the store partition, or sets the value of the pixel algorithm flag bit preset in the pixel algorithm calling code block to 1.
S505, the electronic equipment determines to load and execute the algorithm code supporting generation of 48M pixels in the independent partition;
with reference to the information flow diagram shown in fig. 7b, after the preferred function is executed, the electronic device jumps back to the LK partition to continue to execute the night scene algorithm calling code block in sequence, and the code block realizes its function by calling the night scene algorithm code in the ODM partition. And the electronic equipment jumps to the ODM partition to execute the night scene algorithm codes, and jumps back to the LK partition after the execution is finished to continue to execute the pixel algorithm calling code blocks in sequence. The pixel algorithm calling function preset in the code block determines whether to execute the odm partition pixel algorithm calling function or the independent partition pixel algorithm calling function by judging which algorithm code with the highest supported pixel exists in the current independent partition and the odm partition.
In some embodiments, the pixel selection function determines that the desired effect of the pixel algorithm function of the electronic device is 48M by reading the results of the preferred function determination stored in the store partition. The pixel selection function first selects to execute the odm partition pixel algorithm call function, jumps to the odm partition to execute the first portion of the algorithm code in which generation of 12M pixels is supported, determines that it supports generation of only 12M pixels, not the desired 48M pixels. And then selecting and executing an independent partition pixel algorithm calling function, jumping to an independent partition to execute an algorithm code supporting generation of 48M pixels, determining that the algorithm code supports generation of 48M pixels, and loading the algorithm code supporting generation of 48M pixels into a memory in accordance with the expectation. After the execution is finished, the LK subarea is jumped back to continue to execute the subsequent code blocks in sequence.
In some embodiments, the pixel selection function determines that the preferred code for the pixel algorithm function of the electronic device is in a separate partition by reading the results of the preferred function determination stored in the store partition. The pixel selection function directly selects and executes the independent partition pixel algorithm calling function, jumps to the independent partition to execute and loads the algorithm codes supporting generation of 48M pixels into the memory. After the execution is finished, the LK subarea is jumped back to continue to execute the subsequent code blocks in sequence.
In some embodiments, the pixel selection function determines whether the independent partition pixel algorithm call function or the odm partition pixel algorithm call function needs to be executed at this time according to a pixel algorithm flag preset in the pixel algorithm call code block at factory. For example, since the preferred function in step S504 sets the value of the preset pixel algorithm flag to 1, and a rule of the independent partition pixel algorithm call function needs to be executed when the value of the preset pixel algorithm flag in the pixel selection function is 1, the pixel selection function may determine that the independent partition pixel algorithm call function needs to be executed at this time, and jump to the independent partition to execute and load the algorithm code supporting generation of 48M pixels into the memory. After the execution is finished, the LK subarea is jumped back to continue to execute the subsequent code blocks in sequence.
Due to the fact that the algorithm codes supporting generation of 48M pixels in the independent partition are loaded, after the electronic device 100 completes system startup, the camera of the electronic device 100 can have the capability of supporting shooting of the highest 48M pixel photo. At this time, when the electronic apparatus 100 takes a picture using a camera, a picture B having a pixel value of 48M can be obtained.
S506, the electronic equipment takes a picture by using the camera to obtain a picture B with a pixel value of 48M.
Since the electronic device 100 loads and executes the algorithm code supporting generation of 48M pixels in the independent partition during the system startup process, the camera of the electronic device 100 has the capability of supporting taking a picture of the highest 48M pixels after the system startup is completed. Therefore, at this time, the electronic device takes a picture by using the camera, and a picture B with a pixel value of 48M can be obtained.
In this embodiment, the independent partition may be preset in the partition table of the internal memory 121 of the electronic device 100. When a function update is required, the electronic device 100 may download the update program and add it to the separate partition. When the existing function codes are executed, the selection functions preset in other partitions can select and adjust the function codes in the updating programs in the execution independent partitions according to preset conditions. After the function codes in the independent partitions are executed, the original function codes can be skipped back to continue executing subsequent codes. Therefore, on one hand, a manufacturer only needs to issue a function code different from the existing code when updating the function, and does not need to wait for all codes to be issued after all packaging tests are completed, so that the time for updating the program and issuing the version is saved. On the other hand, since the issued updating program can only include the function code different from the existing code, the capacity of the updating program is greatly reduced, so that the user only needs to download the updating program package with small capacity to use the updated function.
It is understood that the above examples of the present application are only described by taking the example that the selection function is preset in the pixel algorithm calling code block, and in practical applications, a developer may set the selection function for more code blocks or different code blocks according to requirements. For example, in the above embodiment, if a selection function is also provided in the night scene algorithm call code block, it may also be determined by the selection function whether to execute the odm partition or the related night scene algorithm in the independent partition when the night scene algorithm call code block is executed. By adopting the mode, the requirement of upgrading and updating the night scene algorithm through independent partitioning can be met.
In some embodiments of the present application, the algorithm code that supports generation of 48M pixels in the example may also be referred to as a first code block, the night scene algorithm invocation code block may also be referred to as a second code block outside the independent partition, and the algorithm code that supports generation of 12M pixels may also be referred to as a third code block in the independent partition.
In some embodiments of the present application, a function (pixel algorithm) supporting generation of an algorithm code for 48M pixels and a function (pixel algorithm) supporting generation of an algorithm code for 12M pixels may be referred to as a first function, a performance (generation of 48M pixels) supporting generation of an algorithm code for 48M pixels may be referred to as a first performance, and a performance (generation of 12M pixels) supporting generation of an algorithm code for 12M pixels may be referred to as a second performance.
In some embodiments of the present application, the LK partition may be referred to as a first partition and the odm partition may be referred to as a second partition.
In some embodiments of the present application, the result of the execution of the preferred function may be referred to as a logged result, which may include a first logged result, a second logged result, and so on.
The following describes a program updating method in an embodiment of the present application with reference to another exemplary scenario:
example scenarios: a user purchases a mobile phone sold by a manufacturer, the mobile phone is provided with a display screen A, and the installed system is a user version 1 and can support the normal use of the display screen A. After one week, the manufacturer changes the supplier of the display screen. The manufacturer's subsequent handsets will be equipped with display B, which no longer has an inventory of display a. After several days, the user carelessly falls the mobile phone on the ground, the display screen A is broken, and only the display screen B can be replaced. However, the screen cannot be lit up after the display panel B is replaced.
As shown in fig. 8 (a), if a program update method in an implementation is adopted, a manufacturer starts development work of a new system adapted to the display B since a display provider is replaced, and needs to perform development, testing, adaptation, and the like, and after three months, development of the user version 2 supporting lighting of the display B is completed. The user needs to download the user version 2 with the capacity of 1GB, and the display screen B can be lightened only after the user version 2 is installed, so that the mobile phone provided with the display screen B and the system provided with the user version 2 can be normally used. And at this time, the user cannot use the mobile phone for more than 3 months.
As shown in fig. 8 (B), when the program updating method in the embodiment of the present application is adopted, for example, the manufacturer may complete the screen updating program B that can light up the display screen B after replacing the display screen supplier for 3 days. The screen update program B may not include other codes in the user version, but only include codes that support the use of the display screen B and are different from the codes that support the use of the display screen a in the original user version 1. The user only needs to download the screen updating program B with the capacity of 20MB and put the screen updating program B into the independent partition to lighten the display screen B, and the mobile phone which is provided with the display screen B and is provided with the user version 1 and the screen updating program B is normally used. The user may not need to wait or only need to wait for several days after changing display screen B.
The following describes the method in the embodiment of the present application in detail with reference to the software and hardware structure of the above exemplary electronic device 100 and the scenario shown in (b) in fig. 8:
fig. 9 is a flowchart illustrating a program updating method according to an embodiment of the present application.
S901, the electronic equipment cannot light the display screen B;
illustratively, the user version 1 is installed in the internal memory 121 of the electronic device 100, the code for driving the display screen a is stored in each partition, the code for driving the display screen B is not stored in each partition, and the preset independent partition is empty. Therefore, when the electronic apparatus 100 is replaced with the display B from the display a, the electronic apparatus 100 cannot turn on the display B.
S902, the electronic equipment downloads a screen updating program B, wherein the screen updating program B is a display screen driving program and comprises codes and effect parameters for driving the display of the display screen B;
for example, the effect parameters for driving the display screen B to display may include a parameter for realizing color saturation of the screen, a parameter for realizing definition of the screen, and the like.
It is understood that the screen update program B can be understood as an update program including a plurality of code blocks, code for driving the display of the display screen B, and effect parameters.
A code block in the screen update program B may call a code block in a partition in the user's version 1. A code block in the screen update program B may also be called by a code block in a partition in the user's version 1. In this way, when executing the code blocks, jump execution between the code blocks in the original user version and the code blocks in the production line version in the independent partition can be realized.
S903, adding the screen updating program B to the independent partition by the electronic equipment;
after the electronic device 100 downloads the screen update program B, the screen update program B may be added to a preset independent partition in the internal memory 121.
In some embodiments, according to the function of the code blocks in the screen update program B, the independent partition may also include a plurality of different partitions according to the positions of the code blocks in the partitions outside the independent partition, and the code blocks may be added to the different partitions in the independent partition respectively.
Illustratively, as shown in fig. 10, at this time, another exemplary schematic diagram of the partition table of the internal memory 121 of the electronic device 100 is shown. The independent partition comprises 4 partitions including lk-ext, dtbo-ext, boot-ext and patch-ext, and the electronic device can add the relevant code blocks in the screen updating program B to the partitions in the independent partition respectively, wherein:
lk-ext: logic including lk loading and checking dtbo-ext and boot-ext;
dtbo-ext: the system comprises peripheral driving equipment tree configuration and GPIO configuration, and is used for data interaction with hardware;
boot-ext: the method comprises the steps of (1) configuring a peripheral driving kernel scheme and nodes;
patch-ext: containing device effect configuration parameters and algorithm files involved in the vendor/odm/product partition (super partition).
S904, the electronic equipment determines whether the current assembled screen is a preset screen or not according to a flag bit A preset by a loader/preloader partition, and executes a screen updating program B in an independent partition;
it will be appreciated that the flag bit a may have two values, each corresponding to different code execution logic.
For example, it may be set that when the value of flag bit a is true, the code logic of the independent partition may be executed; when the flag bit A has a false value, the original normal code logic may be executed.
For example, it can be set that when the value of flag bit a is 1, the code logic of the independent partition can be executed; when the value of flag bit a is 0, the original normal code logic may be executed.
There may be other different corresponding relationships between the values of the flag bits and the execution code logic, and the corresponding relationships are not limited herein.
And the value of the flag bit may be determined and modified by a preset correlation function or state information. Illustratively, two GPIOs dedicated to the display screen may be spliced to form a value of idpin, each GPIO has three states, i.e., high level, low level, and idle, and it is assumed that 10 represents high level, 01 represents low level, and 00 represents idle. Through the splicing of the two GPIOs in different states, an idpin specially corresponding to the display screen can be formed. For example, if the display screen a is in a high level GPIO1 state and the GPIO2 state is empty, the dedicated corresponding idpin is 1000; and the GPIO1 of the display screen B is idle, the GPIO2 is low level, and the dedicated corresponding idpin is 0001. The loader/preloader partition can be preset with lcd _ xxx _ get _ lcd _ type function, after different display screens are connected with the mainboard, when the display screen is started, the lcd _ xxx _ get _ lcd _ type function can determine two GPIO states of the display screen by acquiring the voltage state of chip hardware pins, so as to determine the idpin value of the display screen. And then, identifying which screen is specific according to the idpin value of the display screen. If the lcd _ xxx _ get _ lcd _ type function identifies that the connected display screen is the display screen A, setting the value of the flag bit A to false, and executing the code block in the lk partition; if the lcd _ xxx _ get _ lcd _ type function identifies that the connected display is other display, for example, display B, the value of flag bit A is set to true, and the code block in lk-ext in the independent partition is executed. It is understood that after the execution of the code block in lk-ext is completed, a jump may be made to another partition outside the independent partition according to the function call indication in the code block or the function call indication in the code block of the previous stage, for example, an lk partition or a dtbo partition, etc., to execute the code block of the next step.
In addition, other flag bits, for example, the flag bit B, the flag bit C, and the like, may be set in the code blocks of the other partitions of the internal memory 121 of the electronic device 100. These flags may be set to different values, similar to flag a, based on different functions or feedback information about the device status. While the different values of the flag bits may cause the electronic device 100 to execute the code blocks in different partitions, which is not limited herein.
For example, in combination with the partition table shown in fig. 10, as shown in fig. 11, a schematic information flow diagram of another exemplary scenario after the electronic device 100 is powered on in the embodiment of the present application is shown. A plurality of flag bits, for example, a flag bit a, a flag bit B, a flag bit C, and a flag bit D, may be preset in each partition of the electronic device 100. When the default display screen a is installed in the electronic device 100, the values of the flags are false. After the electronic device 100 is started, code blocks such as a code block a, a code block B1, a code block D1, a code block E1, a code block F1, a code block G1, a code block H1, a code block I, a code block J, a code block K1, and a code block L in each partition may be sequentially executed, the system is normally started, and the display screen a is turned on. After the display screen is replaced by the display screen B, when the idpin value returned by the display screen connected with the mainboard per se is determined by the lcd _ xxx _ get _ lcd _ type function, and the currently assembled display screen of the electronic device 100 is not the default display screen A, the electronic device 100 can change the value of each flag bit to be tube. At this time, when the electronic apparatus 100 is started, the codes are executed in the order of the code block a, the code block B2, the code block D2, the code block E2, the code block F2, the code block G1, the code block H2, the code block I, the code block J, the code block K2, and the code block L, the system is normally started, and the display B provided in the electronic apparatus 100 is lighted.
It is to be understood that the code block B2, the code block D2, the code block E2, the code block F2, the code block H2, and the code block K2 added to the independent partition are different code blocks from all code blocks supporting lighting of the display screen a among all code blocks supporting lighting of the display screen B. For example, the code blocks of code block I, code block J, code block L, etc. need to be executed to light the display B, but since these code blocks supporting lighting of the display a already exist in the user version 1, in order to save time, the manufacturer may not include these code blocks in the screen update program B when generating the screen update program B, but only include the code blocks supporting lighting of the display B and not existing in the original user version 1 in the screen update program B. Thus, it is possible to greatly improve the efficiency of obtaining the screen update program B and to greatly reduce the size of the capacity of the screen update program B to be added to the independent partition.
It should be noted that each code block in fig. 11 is only an example for convenience of description, and in practical applications, many more reusable code blocks than this may be included in user version 1.
S905, the electronic equipment lights the display screen B.
Since the screen updating program B includes the necessary code blocks for supporting the lighting of the display screen B, the electronic device 100 can light the display screen B after executing the corresponding logic code of the screen updating program B.
Alternatively, in some embodiments, it may not be convenient to add screen update B directly to a separate partition in the presence of user version 1. In this case, the manufacturer may first obtain the production line version B including the screen update program B, and when the electronic device 100 is upgraded using the production line version B, the screen update program B may be added to the independent partition of the electronic device 100, and then the electronic device 100 may be upgraded using the user version 1. When the electronic device 100 is upgraded by using the user version 1, all data in the independent partition are not erased and are directly reserved, so that the display screen B can be jointly lightened by matching with the flag bit and the code block interface which are reserved in the user version 1.
Optionally, in some embodiments, after the manufacturer develops the complete user version 2, the electronic device 100 may download the user version 2, and upgrade the electronic device 100 using the user version 2. The user version 2 independent partition may be empty, with other partitions containing blocks of code that support the illumination of display B. The independent partition may be erased when the electronic device 100 is upgraded with user version 2.
With reference to the above embodiments, the following further describes the program updating method in the embodiments of the present application:
please refer to fig. 12, which is a flowchart illustrating a program updating method according to an embodiment of the present application.
S1201, the electronic equipment acquires an updating program which comprises a first code block;
the first code block is for implementing a first function at a first performance.
For example, in some embodiments, the algorithmic code in the embodiment described in fig. 5 that supports generation of 48M pixels may be referred to as a first code block.
For example, in some embodiments, any one of the code blocks in the updating procedure B in the embodiment described in fig. 9 may be referred to as a first code block.
The mode of acquiring the first code block by the electronic device may be, for example, according to system push download, trigger download link download, and high-dimensional USB write, and is not limited herein.
In some embodiments, the electronic device may obtain more code blocks, such as, but not limited to, a second code block, a third code block, a fourth code block, and so on.
S1202, the electronic device adds the first code block to an independent partition in a memory;
the electronic device may add the acquired code block to an independent partition in the memory, where the independent partition is a partition preset in the memory of the electronic device and does not affect normal startup of the electronic device.
Optionally, in some embodiments, the independent partition may be subdivided into a plurality of different partitions, for example, an lk-ext partition, a dtbo-ext partition, a boot-ext partition, a patch-ext partition, and the like, and each code block added to the independent partition may be added to a different partition in the independent partition according to a function of the code block, which is not limited herein.
S1203, after the electronic device executes the independent out-of-partition second code block, determining whether the first flag bit is a first preset value;
the independent partitions of the electronic equipment are some partitions supporting normal startup of the electronic equipment, and may include a first partition, a second partition, a third partition, and the like, such as an Xloader/preloader partition, an Lk partition, a Dtbo partition, a Boot partition, an Odm partition, a Vendor partition, and a System partition. The second code block may be any code block outside the independent partition, and a first flag may be preset behind the second code block. The value of the first flag bit may be modified by the electronic device according to a feedback value of a preset function or a state of the electronic device. For example, as described in step S907 of the embodiment shown in fig. 9, if the first flag is flag a, the value of flag a may be modified to be false or tube according to a preset lcd _ xxx _ get _ lcd _ type function.
After executing the second code block, the electronic device may execute a different code block according to whether the first flag is the first preset value.
It is understood that, after some other code blocks outside the independent partition, other flag bits, such as a second flag bit, a third flag bit, etc., may also be included, which is not limited herein. The values of these flag bits may be modified according to the same condition or different conditions, and are not limited herein.
S1204, when the first flag bit is a first preset value, the electronic device executes a third code block outside the independent partition;
the third code block is one code block after the second code block in normal sequential execution logic. The third code block is to implement the first function with a second performance, the second performance different from the first performance.
For example, in some embodiments, the algorithmic code in the embodiment described in fig. 5 that supports generation of 12M pixels may be referred to as a first code block.
For example, in some embodiments, any one of the code block B1, the code block D1, the code block E1, the code block F1, and the code block K1 in the embodiment illustrated in fig. 9 may be referred to as a first code block.
Generally, if the independent partition is empty or there is no code block with the same function as the third code block in the independent partition, the first flag bit will be the first preset value.
It is to be understood that, in some embodiments, the third code block may be followed by another flag, for example, a second flag, and the electronic device may determine whether to execute the code block outside the independent partition or execute the code block in the independent partition according to whether the second flag is a second preset value, which is not limited herein.
S1205, when the first flag is not the first preset value, the electronic device executes the first code block in the independent partition.
It should be noted that, since the first flag and the first code block have a corresponding relationship, when the first flag is not the first preset value, the electronic device executes the first code block in the independent partition, but does not execute other code blocks in the independent partition.
The corresponding relationship between the first flag bit and the first code block may have many expression forms, for example, the first flag bit carries an identifier of the first code block, the first flag bit includes address information of the first code block, the first flag bit calls a function in the first code block, or a corresponding relationship table of the first flag bit and the first code block stored in the electronic device, and the like, which is not limited herein.
It is to be understood that after the electronic device executes the first code block in the independent partition, which code block to execute is determined by the first code block. For example, if the first code block indicates a fourth code block outside the independent partition to which data is output, the fourth code block outside the independent partition is executed after the first code block is executed.
In the embodiment of the application, the electronic device may be preset with an independent partition, and a code outside the independent partition of the electronic device includes a flag bit. When the electronic device needs to perform function updating, the updating program containing the first code block can be downloaded, and the first code block is added into the independent partition. The electronic device may determine whether to execute a code block outside the independent partition or to jump to execute a code block in the independent partition based on the value of the flag. After executing a code block in an independent partition, the execution of a code block outside the independent partition may also be adjusted according to the instruction of the code block. In this way, the code block included in the update program may only include a necessary code block different from the code block already in the electronic device, which greatly improves the development efficiency on one hand and reduces the capacity size of the update program on the other hand.
It should be noted that, in steps S503-S504 of the above example, determining whether the electronic device executes the code block in the independent partition or the code block outside the independent partition according to whether the first flag bit is the first preset value is only an alternative. In some embodiments, after the electronic device executes the second code block outside the independent partition, the electronic device may determine whether the first recording result meets a first preset jump condition, and in the case that the first recording result does not meet the first preset jump condition, the electronic device may execute the third code block outside the independent partition; in case that the first recording result meets the first preset jump condition, the electronic device may execute the first code block in the independent partition.
The first preset jump condition may be different according to different requirements in practical application. For example, in some embodiments, the first preset jump condition is whether the first recording result includes an identifier of an independent partition; when the first recording result contains the identifier of the independent partition, determining that the first recording result meets a first preset skipping condition; and when the first recording result does not contain the identifier of the independent partition, determining that the first recording result does not accord with the first preset jump condition. For another example, in some embodiments, the first predetermined skip condition is whether the value of the first flag bit is a first predetermined value; when the value of the first zone bit is determined to be a first preset value, determining that the first recording result meets a first preset skipping condition; and when the value of the first zone bit is determined not to be the first preset value, determining that the first recording result does not accord with the first preset jump condition.
And in some embodiments the first logged result may be one of the results of the preferred function execution. The first recording result may be embodied in various ways, for example, stored as a record, or setting the value of a flag bit.
For example, in the embodiment shown in fig. 5, the first preset jump condition may be that there is an identification of an independent partition in the recorded result of the store partition. In the embodiment shown in fig. 9, the first predetermined skip condition may be that the value of the associated flag bit is 1.
The preference function may derive the recorded result according to a first preset selection condition. The first preset selection condition may be different according to different requirements in practical applications. For example, in some embodiments, the first preset selection condition is to select a code block with better performance in a partition other than the independent partition than when the same function is implemented in the independent partition. As another example, in some embodiments, the first preset jump condition is to select a code block that matches a physical device mounted on the electronic device.
For example, in the embodiment shown in fig. 5, the first preset selection condition may be to select a code block with better performance when the first function is implemented in the odm partition than in the independent partition. In the embodiment shown in fig. 9, the first preset selection condition may be that the electronic device is equipped with not a preset screen.
In some embodiments, a fourth code block for implementing a second function with a third capability may also be included in the update program; the electronic device may add the fourth code block to the independent partition; after executing the first code block or the third code block, the electronic device may determine whether a second recording result meets a second preset jump condition; in the case that the second recording result does not conform to the second preset jump condition, the electronic device may execute a fifth code block outside the independent partition, the fifth code block being used for implementing the second function with a fourth performance; the fourth property is different from the third property; in case that the second recording result meets the second preset jump condition, the electronic device may execute the fourth code block in the independent partition.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to a determination of …" or "in response to a detection of …", depending on the context. Similarly, depending on the context, the phrase "at the time of determination …" or "if (a stated condition or event) is detected" may be interpreted to mean "if the determination …" or "in response to the determination …" or "upon detection (a stated condition or event)" or "in response to detection (a stated condition or event)".
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.

Claims (18)

1. A program update method, comprising:
the electronic equipment acquires an updating program, wherein the updating program comprises a first code block, and the first code block is used for realizing a first function with a first performance;
the electronic device adding the first code block to an independent partition in a memory of the electronic device; the independent partition is a partition which does not influence the normal starting of the electronic equipment;
after executing the second code block outside the independent partition, the electronic device determines whether a first recording result meets a first preset jump condition;
under the condition that the first recording result does not meet the first preset skipping condition, the electronic equipment executes a third code block outside the independent partition, wherein the third code block is used for realizing the first function with a second performance, and the second performance is different from the first performance;
the electronic device executes the first code block in the independent partition if the first recording result meets the first preset jump condition.
2. The method of claim 1, further comprising a first partition and a second partition in the memory; the first partition includes the second code block therein, and the second partition includes the third code block therein.
3. The method according to claim 2, wherein the first partition further comprises a preference function, and the preference function is used for obtaining a recording result according to a first preset selection condition, wherein the first recording result is included; the first recording result is used for identifying a code block meeting the first preset selection condition in the first code block and the third code block.
4. The method of claim 3, wherein the first preset selection condition is selecting a code block with better performance when the same function is implemented in the second partition and the independent partition.
5. The method of claim 4, further comprising:
the optimization function sends a first information reporting instruction to the independent partition and the second partition, wherein the first information reporting instruction is used for indicating the function and the performance of the code block included in the independent partition and the second partition;
the preferred function receives the functions and performances of the code blocks included in the independent partition and the code blocks reported by the second partition, wherein the first code block realizes the first function and the performance is the first performance, and the second code block realizes the first function and the performance is the second performance;
the preferred function determines the code block with better performance when the independent partition and the second partition realize the same function as the preferred code block, and stores the code block as the recording result, wherein the code block comprises the first recording result; the first recording result is used for identifying a code block with better performance when the first function is realized in the first code block and the third code block.
6. The method of claim 4, further comprising:
the optimization function sends a second information reporting instruction to the independent partition, wherein the second information reporting instruction is used for indicating the function and the performance of the code block included in the independent partition;
the preferred function receives the functions and performances of the code blocks reported by the independent partitions, wherein the functions and performances of the code blocks include that the first code block realizes the first function and the first performance is the first performance;
the optimization function sends a third information reporting instruction to the second partition, wherein the third information reporting instruction is used for indicating the performance of reporting code blocks with the same functions of the independent partition by the second partition, and the code blocks with the same functions of the independent partition are code blocks which realize the same functions with the code blocks reported by the independent partition;
the optimal function receives the performance of the independent partition code block with the same function reported by the second partition, wherein the performance of a third generation code block which also realizes the first function is the second performance;
the preferred function determines that a code block with better performance when the same function is realized in a code block which is reported by the independent partition and an independent partition and function code block which is reported by the second partition is a preferred code block, and stores the preferred code block as the recording result, wherein the preferred code block comprises the first recording result; the first recording result is used for identifying a code block with better performance when the first function is realized in the first code block and the third code block.
7. The method according to claim 3, wherein the first preset selection condition is selecting a code block matching a physical device installed on the electronic device.
8. The method of claim 3, wherein the first logged result is temporarily stored in a memory, or the first logged result is stored in a fourth partition of a storage.
9. The method according to any of claims 3 to 8, wherein the determining, by the electronic device, whether the first recording result meets a first preset jump condition after executing the second code block outside the independent partition, specifically comprises:
after executing the second code block in the first partition, the electronic device determines whether the first recording result includes an identification of the independent partition;
when the first recording result contains the identifier of the independent partition, the electronic equipment determines that the first recording result meets the first preset skipping condition;
and when the first recording result does not contain the identifier of the independent partition, the electronic equipment determines that the first recording result does not accord with the first preset jump condition.
10. The method according to any one of claims 3 to 8, wherein the first partition further comprises a first flag bit, and the first recording result is a value of the first flag bit; the method further comprises the following steps:
when the preference function determines that the first code block has better performance, the electronic device sets the first flag bit to a first preset value;
when the preference function determines that the third generation code block has better performance, the electronic device sets the first flag bit to another value different from the first preset value.
11. The method of claim 10, wherein the first flag bit is associated with the first function; the first partition further comprises a first selection function, and the first selection function is a selection function of the first function;
the method further comprises the following steps:
the electronic device passes the value of the first flag bit to the first selection function;
after executing the second code block outside the independent partition, the electronic device determines whether the first recording result meets a first preset jump condition, which specifically includes:
after executing the second code block in the first partition, the first selection function determines whether the value of the first flag is the first preset value;
when the value of the first zone bit is determined to be the first preset value, the first selection function determines that the first recording result meets the first preset skipping condition;
and when the value of the first zone bit is determined not to be the first preset value, the first selection function determines that the first recording result does not accord with the first preset jump condition.
12. The method according to claim 10, wherein the determining, by the electronic device, whether the first recording result meets a first preset jumping condition after executing the second code block outside the independent partition, specifically comprises:
after executing the second code block in the first partition, the electronic device determines whether a value of a first flag is the first preset value;
when the value of the first zone bit is determined to be the first preset value, the electronic equipment determines that the first recording result meets the first preset skipping condition;
and when the value of the first zone bit is determined not to be the first preset value, the electronic equipment determines that the first recording result does not accord with the first preset jump condition.
13. The method according to any one of claims 1 to 10, wherein the first partition and the second partition are partitions related to normal startup of the electronic device.
14. The method according to any one of claims 1 to 13, characterized in that a fourth code block is further included in the update program, the fourth code block being used to implement a second function with a third capability; the method further comprises the following steps:
the electronic device adding the fourth code block to the independent partition;
after executing the first code block or the third code block, the electronic device determines whether a second recording result meets a second preset jump condition;
under the condition that the second recording result does not meet the second preset skipping condition, the electronic equipment executes a fifth code block outside the independent partition, wherein the fifth code block is used for realizing the second function with a fourth performance; the fourth property is different from the third property;
and under the condition that the second recording result meets the second preset jump condition, the electronic equipment executes the fourth code block in the independent partition.
15. An electronic device, characterized in that the electronic device comprises: one or more processors and memory;
the memory coupled with the one or more processors, the memory to store computer program code, the computer program code comprising computer instructions that the one or more processors invoke to cause the electronic device to perform the method of any of claims 1-14.
16. A chip system for application to an electronic device, the chip system comprising one or more processors for invoking computer instructions to cause the electronic device to perform the method of any of claims 1-14.
17. A computer program product comprising instructions for causing an electronic device to perform the method of any one of claims 1-14 when the computer program product is run on the electronic device.
18. A computer-readable storage medium comprising instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-14.
CN202110603262.7A 2021-05-31 2021-05-31 Program updating method and electronic device Active CN113885928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110603262.7A CN113885928B (en) 2021-05-31 2021-05-31 Program updating method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110603262.7A CN113885928B (en) 2021-05-31 2021-05-31 Program updating method and electronic device

Publications (2)

Publication Number Publication Date
CN113885928A true CN113885928A (en) 2022-01-04
CN113885928B CN113885928B (en) 2022-10-11

Family

ID=79010138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110603262.7A Active CN113885928B (en) 2021-05-31 2021-05-31 Program updating method and electronic device

Country Status (1)

Country Link
CN (1) CN113885928B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114546269A (en) * 2022-02-15 2022-05-27 京东科技信息技术有限公司 Storage mounting method and device and electronic equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866334A (en) * 2014-12-12 2015-08-26 北汽福田汽车股份有限公司 Method for partitioning and running software codes of controller
CN105183501A (en) * 2015-08-10 2015-12-23 珠海格力电器股份有限公司 Method for preventing errors in online program writing
CN105573864A (en) * 2015-12-15 2016-05-11 广州视源电子科技股份有限公司 Terminal system recovery method and system thereof
CN105867947A (en) * 2016-04-25 2016-08-17 青岛海信电器股份有限公司 Data processing method and device after upgrades of preset applications
CN106775650A (en) * 2016-11-25 2017-05-31 珠海我爱拍科技有限公司 A kind of upgrade method based on customization android system
CN107967141A (en) * 2017-11-27 2018-04-27 北京小米移动软件有限公司 Operating system update method, apparatus and terminal
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109634630A (en) * 2018-10-29 2019-04-16 平安科技(深圳)有限公司 Application program update method, apparatus, electronic equipment and storage medium
CN110399152A (en) * 2019-07-22 2019-11-01 浙江鸿泉车联网有限公司 A kind of device systems double copies upgrade method and device
CN110580167A (en) * 2018-06-11 2019-12-17 海能达通信股份有限公司 system upgrading method, intelligent device and server
CN111796848A (en) * 2020-07-08 2020-10-20 中国第一汽车股份有限公司 Bootloader software updating method and device, embedded controller and storage medium
CN112115017A (en) * 2020-08-07 2020-12-22 航天科工空间工程发展有限公司 Logic code monitoring method and device of satellite-borne software program

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866334A (en) * 2014-12-12 2015-08-26 北汽福田汽车股份有限公司 Method for partitioning and running software codes of controller
CN105183501A (en) * 2015-08-10 2015-12-23 珠海格力电器股份有限公司 Method for preventing errors in online program writing
CN105573864A (en) * 2015-12-15 2016-05-11 广州视源电子科技股份有限公司 Terminal system recovery method and system thereof
CN105867947A (en) * 2016-04-25 2016-08-17 青岛海信电器股份有限公司 Data processing method and device after upgrades of preset applications
CN106775650A (en) * 2016-11-25 2017-05-31 珠海我爱拍科技有限公司 A kind of upgrade method based on customization android system
CN107967141A (en) * 2017-11-27 2018-04-27 北京小米移动软件有限公司 Operating system update method, apparatus and terminal
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN110580167A (en) * 2018-06-11 2019-12-17 海能达通信股份有限公司 system upgrading method, intelligent device and server
CN109634630A (en) * 2018-10-29 2019-04-16 平安科技(深圳)有限公司 Application program update method, apparatus, electronic equipment and storage medium
CN110399152A (en) * 2019-07-22 2019-11-01 浙江鸿泉车联网有限公司 A kind of device systems double copies upgrade method and device
CN111796848A (en) * 2020-07-08 2020-10-20 中国第一汽车股份有限公司 Bootloader software updating method and device, embedded controller and storage medium
CN112115017A (en) * 2020-08-07 2020-12-22 航天科工空间工程发展有限公司 Logic code monitoring method and device of satellite-borne software program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周斐: "基于以太网的嵌入式设备数据更新加载系统", 《电声技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114546269A (en) * 2022-02-15 2022-05-27 京东科技信息技术有限公司 Storage mounting method and device and electronic equipment

Also Published As

Publication number Publication date
CN113885928B (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN112783564B (en) Method for accelerating starting of application program and electronic equipment
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
CN114461588B (en) Method for adjusting pre-reading window and electronic equipment
CN113704205A (en) Log storage method, chip, electronic device and readable storage medium
CN112667306A (en) Method, device and storage medium for installing plug-in
CN113885928B (en) Program updating method and electronic device
CN113784331B (en) Method and device for updating system data of user identity module card
CN117130541B (en) Storage space configuration method and related equipment
CN114546969A (en) File sharing method and device and electronic equipment
CN113741993A (en) Method and device for compiling plug-in dex file
WO2022111664A1 (en) Patching method, related apparatus, and system
CN114443109B (en) Patch repair method, electronic device and storage medium
CN116665751A (en) Test method and electronic equipment
CN113485709B (en) Application optimization method and device and electronic equipment
CN113590346B (en) Method and electronic equipment for processing service request
CN112783418B (en) Method for storing application program data and mobile terminal
CN114489471A (en) Input and output processing method and electronic equipment
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN116795476B (en) Wallpaper deleting method and electronic equipment
CN116841575B (en) Method and related device for generating image file
CN114996162B (en) Test method and related device
CN117009023B (en) Method for displaying notification information and related device
CN117707563A (en) Application resource processing method and related equipment
CN115952564A (en) Data writing method and terminal equipment
CN117992092A (en) Method for upgrading equipment and related equipment

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