CN116974608A - Data updating method and device and storage medium - Google Patents

Data updating method and device and storage medium Download PDF

Info

Publication number
CN116974608A
CN116974608A CN202310969411.0A CN202310969411A CN116974608A CN 116974608 A CN116974608 A CN 116974608A CN 202310969411 A CN202310969411 A CN 202310969411A CN 116974608 A CN116974608 A CN 116974608A
Authority
CN
China
Prior art keywords
partition
updating
updated
hardware
electronic equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310969411.0A
Other languages
Chinese (zh)
Inventor
刘兆龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology 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 Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202310969411.0A priority Critical patent/CN116974608A/en
Publication of CN116974608A publication Critical patent/CN116974608A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal 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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data updating method, equipment and a storage medium, wherein in the data updating method, after data to be updated comprising an updating program package and updating hardware partition information is acquired, current hardware partition information stored in a first partition by electronic equipment is cleared, an operating program stored in a second partition is updated according to the updating program package, and the updating hardware partition information is stored in the first partition when the updating progress meets preset updating conditions. Compared with the prior art, the method and the device have the advantages that the current hardware partition information of the electronic equipment in the first partition is cleared, so that the current hardware partition information of the electronic equipment is incomplete, the electronic equipment cannot be started normally at the moment, the updated hardware partition information is stored into the first partition according to the updating progress of the updated program package, the updating progress of the updated program package is determined according to the updated hardware partition information in the first partition, and therefore production efficiency is improved.

Description

Data updating method and device and storage medium
Technical Field
The embodiment of the application relates to a test technology, and relates to a data updating method, data updating equipment and a storage medium, which are not limited to the test technology.
Background
When the electronic equipment is produced in mass production in the factory, when the program to be updated is burnt to the electronic equipment, the situation that the program of the electronic equipment is burnt incompletely exists with a certain probability, the electronic equipment can still be started normally even though the program is burnt incompletely at the moment, and at the moment, due to the fact that the electronic equipment is burnt incompletely, the electronic equipment cannot be operated normally due to incomplete operation program after the electronic equipment is started, technicians need to debug all parameters of the electronic equipment to determine problem points, maintenance workload of the technicians is increased, and therefore production efficiency is affected.
Disclosure of Invention
In view of this, the data updating method, the device and the storage medium provided by the embodiment of the application can directly expose the problem of incomplete burning, thereby improving the production efficiency.
In a first aspect, a data updating method provided by an embodiment of the present application is applied to an electronic device, and the method includes: acquiring data to be updated, wherein the data to be updated comprises an update program package and update hardware partition information; clearing data stored in a first partition of the electronic equipment, wherein current hardware partition information of the electronic equipment is stored in the first partition; updating data stored in a second partition of the electronic equipment according to the updating program package, wherein the second partition is used for storing programs required by the running of the electronic equipment; and when the update progress of the update program package meets a preset update condition, storing the updated hardware partition information into the first partition.
In the data updating method, after the data to be updated including the updating program package and the updating hardware partition information is obtained, the current hardware partition information stored in the first partition by the electronic equipment is cleared, the running program stored in the second partition by the electronic equipment is updated according to the updating program package, and the updating hardware partition information is stored in the first partition when the updating progress of the updating program package meets the preset updating condition. Compared with the prior art, the method and the device have the advantages that the current hardware partition information of the electronic equipment in the first partition is cleared before the update program package is updated, so that the current hardware partition information of the electronic equipment is incomplete, the electronic equipment is in a state that the electronic equipment cannot be started normally at the moment, the update hardware partition information is stored into the first partition according to the update progress of the update program package, and therefore a technician can determine the update progress of the update program package according to the update hardware partition information in the first partition, whether the burning process of the update program package is complete or not is directly exposed, and production efficiency is improved.
In some embodiments, the updating condition includes that the updating of the second partition is completed, and when the updating progress of the updating package meets a preset updating condition, storing updated hardware partition information to the first partition includes: and storing the updated hardware partition information to the first partition when the second partition updating is completed.
In some embodiments, the first partition includes a main partition and a backup partition, the main partition and the backup partition each store the current hardware partition information, and the purging the data stored in the first partition of the electronic device includes: clearing the current hardware partition information stored in the main partition and the backup partition; the storing the updated hardware partition information to the first partition includes: and storing the updated hardware partition information to the main partition and the backup partition.
In some embodiments, the first partition includes a main partition and a backup partition, the main partition and the backup partition each store the current hardware partition information, and the purging the data stored in the first partition of the electronic device includes: clearing the current hardware partition information stored in the main partition; the storing the updated hardware partition information to the first partition includes: and storing the updated hardware partition information to the main partition, and updating the partition information stored in the backup partition according to the updated hardware partition information.
In some embodiments, prior to said clearing the current hardware partition information stored in the main partition, the method further comprises: and setting the electronic equipment in a target mode, and prohibiting the data of the main partition from being restored according to the backup partition in the target mode.
In some embodiments, the method further comprises: executing a startup process, and determining whether the electronic equipment is started normally; under the condition that the electronic equipment is started normally, the electronic equipment is instructed to finish updating according to the data to be updated; and under the condition that the electronic equipment cannot be started, indicating that the electronic equipment does not complete updating.
In some embodiments, the updated hardware partition information and the current hardware partition information are globally unique identification partition table GPT.
In a second aspect, an electronic device provided by an embodiment of the present application includes: the updating data acquisition module is used for acquiring data to be updated, wherein the data to be updated comprises an updating program package and updating hardware partition information; the first partition clearing module is used for clearing data stored in a first partition of the electronic equipment, and current hardware partition information of the electronic equipment is stored in the first partition; the second partition updating module is used for updating data stored in a second partition of the electronic equipment according to the updating program package, and the second partition is used for storing programs required by the operation of the electronic equipment; and the first partition updating module is used for storing the updated hardware partition information to the first partition according to the updating progress of the updating program package.
In a third aspect, a computer device provided in an embodiment of the present application includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor implements the method described in the embodiment of the present application when executing the program.
In a fourth aspect, a computer readable storage medium is provided according to an embodiment of the present application, where a computer program is stored, where the computer program is executed by a processor to implement the method provided according to the embodiment of the present application.
It should be understood that, the second to fourth aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects obtained by each aspect and the corresponding possible implementation manner are similar, and are not repeated.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a flow chart of a data updating method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another data updating method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an implementation flow of a data update method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another electronic device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the specific technical solutions of the present application will be described in further detail below with reference to the accompanying drawings in the embodiments of the present application. The following examples are illustrative of the application and are not intended to limit the scope of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
It should be noted that the term "first/second/third" in relation to embodiments of the present application is used to distinguish between similar or different objects, and does not represent a particular ordering of the objects, it being understood that the "first/second/third" may be interchanged with a particular order or sequencing, as permitted, to enable embodiments of the present application described herein to be implemented in an order other than that illustrated or described herein.
The embodiment of the application provides a data updating method which is applied to electronic equipment, wherein the electronic equipment can be various types of equipment with information processing capability in the implementation process. For example, the electronic device may include a personal computer, a notebook computer, a palm top computer, a server, or the like; the electronic device may also be a mobile terminal, which may include a mobile phone, a car computer, a tablet computer, a projector, or the like, for example. The functions performed by the method may be performed by a processor in an electronic device, which may of course be stored in a computer storage medium, as will be seen, comprising at least a processor and a storage medium.
For example, as shown in fig. 1, the electronic device 10 may include a processor 101, an external memory interface 102, an internal memory 103, a universal serial bus (universal serial bus, USB) interface 104, a camera module 105, a display 106, and keys 107.
It should be understood that the illustrated construction of the embodiments of the present application does not constitute a particular limitation of the electronic device 10. In other embodiments of the application, the electronic device 10 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 101 may include one or more processing units, such as: the processor 101 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. By way of example, the processor 101 may be a smart terminal CPU, such as a Snapdragon-series processor, or the like. In some embodiments, the processor 101 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative and not limiting to the structure of the electronic device 10. In other embodiments of the present application, the electronic device 10 may also employ different interfaces in the above embodiments, or a combination of interfaces.
The electronic device 10 implements display functions via a GPU, a display screen 106, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 106 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 101 may include one or more GPUs that execute program instructions to generate or change display information. The display 106 is used to display images, videos, and the like.
The electronic device 10 may implement shooting functions through an ISP, a shooting module 105, a video codec, a GPU, a display screen 106, an application processor, and the like. The ISP is used for processing the data fed back by the shooting module 105. The shooting module 105 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. In some embodiments, the photographing module 105 may be a camera.
The external memory interface 102 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 10. The external memory card communicates with the processor 101 through the external memory interface 102 to implement a data storage function. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 103 may be used to store computer executable program code comprising instructions. The internal memory 103 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 10 (e.g., audio data, phonebook, etc.), and so forth.
The keys 107 include a power-on key, a volume key, and the like. The keys 107 may be mechanical keys. Or may be a touch key. The electronic device 10 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 10.
In addition, the electronic device according to the embodiment of the present application may further be provided with an operating system, on which an application program may be installed and run.
Fig. 2 is a flowchart of a data updating method according to an embodiment of the present application. As shown in fig. 1, the method may include the steps of:
step S101, obtaining data to be updated, wherein the data to be updated comprises an update program package and update hardware partition information;
step S102, data stored in a first partition of the electronic equipment is cleared, and current hardware partition information of the electronic equipment is stored in the first partition;
step S103, updating data stored in a second partition of the electronic equipment according to the updating program package, wherein the second partition is used for storing programs required by the running of the electronic equipment;
step S104, when the update progress of the update package meets the preset update condition, the updated hardware partition information is stored into the first partition.
It should be understood that the above hardware partition information is used to indicate the location and capacity size of the underlying actual disk corresponding to each partition of the electronic device. The current hardware partition information stored in the first partition of the electronic device refers to partition information currently used by the electronic device, namely, the position and the capacity of a lower-layer actual disk corresponding to the original partition are stored in the first partition; the updated hardware partition information is used for indicating the partition information corresponding to the data to be updated in the current update, that is, the updated hardware partition information is the position and capacity of the lower layer actual disk corresponding to each partition after the current update is recorded.
Alternatively, the updated hardware partition information may be a partition table configuration file, where the update package and the partition table configuration file are compressed into a system update package, and the partition table configuration file is used to indicate the size and start address of each partition and the update package. For example, for one of the following records in the partition table configuration file: < filename = "boot. Img" label = "boot" size_in_kb = "65536.0" start_byte_hex = "0x18200000"/>, filename represents the name of the package to be updated, label represents the name of the partition, size_in_kb represents the size of the partition, start_byte_hex represents the start address of the partition, so the record represents that the package named boot. Img is burned in the boot partition, the size of the boot partition is 65536KB, and the start address is 0x18200000; for another example, for one of the following records in the partition table configuration file: the term "file=" "label=" reserve "size_in_kb=" 1024.0 "start_byte_hex=" 0x1c200000 "/>" means that the package is not updated in the reserve partition, the size of the reserve partition is 1024KB, and the start address is 0x1c200000, so that the updated hardware partition information may be obtained from the partition table configuration file and the current hardware partition information in the system installation package, or the updated hardware partition information may be generated in advance, and the updated hardware partition information may be compressed into the system installation package together, which is not limited herein.
Optionally, the data to be updated may be obtained from other electronic devices by the electronic device through a connection burning tool, or may be obtained after being automatically downloaded through a network, and may be specifically designed according to needs, which is not limited by the present application.
In an exemplary embodiment, when the electronic device obtains data to be updated from other electronic devices through the connection writing tool, the electronic device receives the data to be updated sent by the other electronic devices online through the writing tool, and in a transmission process, when the data to be updated is larger, the data to be updated can be divided into a plurality of data to be transmitted, so that the data to be updated can be transmitted quickly and completely. The writing tool can comprise writing hardware and writing software, and the writing software can convert data to be updated into transmission data so as to realize the transmission of the writing hardware; the burning hardware realizes connection between the electronic device and other electronic devices, and transmits transmission data sent from the other electronic devices to the electronic device, so that the electronic device can receive the transmission data and convert the transmission data into data to be updated. In some embodiments, the writing tool may be a universal serial bus (Universal Serial Bus, USB) writer.
When the electronic device automatically downloads the data to be updated through the network, the electronic device may receive a wireless communication packet sent by the server, where the wireless communication packet may be that the electronic device sends an update request to the server storing the wireless communication packet, and the server sends the update request to the electronic device, or the server storing the wireless communication packet automatically pushes the update request to the electronic device, which may be specifically designed according to the requirement. After receiving the wireless communication packet, the electronic device can analyze the wireless communication packet to obtain data to be updated therein, so as to execute a subsequent data updating method according to the data to be updated.
It should be appreciated that the update progress of the update package is used to indicate the progress of updating the data stored in the second partition of the electronic device according to the update package, i.e. the progress of updating the content of the update package to the electronic device, to indicate whether the update is completed. In some embodiments, the update progress may be displayed on a display screen of the electronic device, for example, when the update progress is 50%, the progress bar displayed by the electronic device is only filled with 50%, so as to prompt the user of the update progress of the second partition.
Alternatively, the update condition may include that the second partition is updated, and the target sub-partition corresponding to the target sub-package is updated when the update of the target sub-package is completed. Can be designed according to the requirements, and the application is not limited.
Optionally, when the update condition includes that the second partition update is completed, the step S104 may include:
and storing the updated hardware partition information to the first partition when the second partition updating is completed.
It should be understood that the second partition update completion refers to the content of the update package having been fully updated into the second partition, i.e., the update progress of the update package is 100%, at which point the full content of the update package already exists in the second partition.
It can be understood that after the content of the update package has been completely updated into the second partition, the updated hardware partition information is stored in the first partition, so that the electronic device does not have hardware partition information before the update is completed, and a technician can determine whether the update of the second partition is completed by querying whether the hardware partition information exists in the first partition of the electronic device.
Optionally, when the update condition includes updating the target sub-partition corresponding to the target sub-package when the update of the target sub-package is completed, the update package may include a plurality of sub-packages, the update hardware partition information may include a plurality of sub-partition information, and the plurality of sub-partition information corresponds to the plurality of sub-packages one by one, and accordingly, the step S104 may include:
And under the condition that the updating of the target sub-program package is completed, storing target sub-partition information corresponding to the target sub-program package into the first partition, wherein the target sub-program package is any one or more of a plurality of sub-program packages.
Alternatively, the above-mentioned updating the hardware partition information includes a plurality of sub-partition information may be performed by receiving a selection instruction input by a user to determine that the update program includes a corresponding plurality of sub-partitions when the data to be updated is manufactured, for example, providing a partition selection control for the user so that the user selects the update program to include a corresponding partition through the partition selection control; or determining a plurality of sub-partitions according to the update package and the partition table configuration file; alternatively, all partitions of the update package may be determined as a plurality of sub-partitions, without limitation.
After determining a plurality of sub-partitions for updating the hardware partition information, the sub-partition information of the hardware partition information can be updated according to the update progress of the update package, for example, the update package includes a sub-package a, a sub-package B and a sub-package C, the sub-package a needs to be updated to the partition a corresponding to the partition information of the partition a of the electronic device, the sub-package B needs to be updated to the partition B corresponding to the partition information of the partition B of the electronic device, the sub-package C needs to be updated to the partition information of the partition C corresponding to the electronic device, the partition information of the partition a can be stored in the first partition after the update package updates the sub-package a, the partition information of the partition B can be stored in the first partition after the update package updates the sub-package B, and so on.
It should be noted that, the updating process of the first partition and the second partition of the electronic device may be implemented with reference to the prior art, which is not described herein.
It can be understood that the update package is divided into a plurality of sub packages in advance, the update hardware partition information includes a plurality of sub-partition information, the plurality of sub-partition information corresponds to the plurality of sub-packages one by one, after the content of a certain sub-package in the update package has been completely updated into the second partition, the update hardware partition information corresponding to the sub-package is stored into the first partition, so that the electronic device does not have the hardware partition information corresponding to the sub-package before the update of the sub-package is not completed, and a technician can determine whether the update of the sub-package is completed by querying whether the hardware partition information corresponding to the sub-package exists in the first partition of the electronic device.
Alternatively, the first partition may include a main partition and a backup partition, where current hardware partition information is stored in both the main partition and the backup partition.
Optionally, the step S102 may include:
clearing the current hardware partition information stored in the main partition and the backup partition;
accordingly, the step S104 may include:
And storing the updated hardware partition information to the main partition and the backup partition.
The first partition includes a main partition and a backup partition, where the main partition and the backup partition include partition information of a partition a, partition information of a partition B, and partition information of a partition C, and the updated hardware partition information includes updated partition information of the partition a, partition information of the partition B, and partition information of the partition C.
It can be understood that by clearing all contents of the main partition and the backup partition before updating, it can be ensured that when the updated hardware partition information is not stored in the first partition, the electronic device lacks partition information in the main partition and the backup partition, so that a technician can directly determine whether the update package is updated completely through the missing condition of the partition information in the main partition and the backup partition of the electronic device, and the update efficiency is improved.
Optionally, the step S102 may include:
clearing the current hardware partition information stored in the main partition;
accordingly, the step S104 may include:
and storing the updated hardware partition information to the main partition, and updating the partition information stored in the backup partition according to the updated hardware partition information.
The first partition includes a main partition and a backup partition, where the main partition and the backup partition include partition information of a partition a, partition information of a partition B, and partition information of a partition C, and the updated hardware partition information includes updated partition information of the partition a, partition information of the partition B, and partition information of the partition C, and before updating the update package, the original partition information of the partition a, partition information of the partition B, and partition information of the partition C in the main partition are cleared, and after updating, the updated partition information of the partition a, the updated partition information of the partition B, and the updated partition information of the partition C in the backup partition are stored in the main partition, and updated to form updated partition information of the partition a, partition information of the partition B, and partition information of the partition C.
It can be understood that by clearing the whole content of the main partition before updating, it can be ensured that when the updated hardware partition information is not stored in the first partition, the electronic device lacks the main partition information and the partition information in the backup partition is still the original partition information, so that a technician can directly determine whether the update package is updated through the deletion condition of the partition information in the main partition of the electronic device or whether the partition information in the backup partition is updated partition information, and the updating efficiency is improved.
In some embodiments, before executing the above-described clearing of the current hardware partition information stored in the main partition, the method may further include: and setting the electronic equipment in a target mode, and prohibiting the data of the main partition from being restored according to the backup partition in the target mode. Therefore, when the electronic equipment is provided with the function of recovering the main partition automatically according to the backup partition when the main partition is defective, the electronic equipment can automatically store the data of the backup partition into the main partition, and the updating progress of the updating program package can be ensured to be determined by technicians according to the defect condition of the main partition.
Optionally, the update package includes a plurality of sub packages, the update hardware partition information includes a plurality of sub partition information, the plurality of sub partition information corresponds to the plurality of sub packages one by one, and the step S102 may include:
The method comprises the steps of clearing target partition information in a first partition, wherein the storage positions of the target partition information and a plurality of sub-partition information in the first partition are the same;
accordingly, the step S104 may include:
and when the updating of the target sub-program package of the updating program package is completed, storing the target sub-partition information into a storage position corresponding to the target sub-partition information in the first partition.
It should be understood that the above-mentioned target partition information refers to partition information indicating the same storage location as a plurality of sub-partition information of updated hardware partition information, for example, the plurality of sub-partition information is partition information of a partition, partition information of B partition, and partition information of C partition, and only the partition information of a partition, the partition information of B partition, and the partition information of C partition are cleared when clearing the first partition, and partition information of other partitions is not processed, thereby ensuring that partition information of a corresponding partition does not exist before updating of the update package is performed.
The update package includes a sub-package a, a sub-package B, and a sub-package C, where the sub-package a needs to be updated to the partition a, the sub-package B needs to be updated to the partition B, the sub-package C needs to be updated to the partition C, the partition information of the partition C corresponds to the electronic device, and the partition information of the partition a, the partition information of the partition B, and the partition information of the partition C are cleared before the update package starts to update the second partition, and after the update package updates the sub-package a, the partition information of the partition a can be stored to the first partition, after the update package updates the sub-package B, the partition information of the partition B can be stored to the first partition, and so on.
It can be understood that, by clearing the current hardware partition information in the first partition completely in advance, when a certain sub-program package in the update program package is updated, the sub-program package including the corresponding target sub-partition information is stored in a storage position corresponding to the target sub-partition information in the first partition, so that the update condition of the update program package is determined according to the sub-partition information in the first partition.
Preferably, the above hardware partition information may be a globally unique identification partition table (GUID Partition Table, GPT) or a Main Boot Record (MBR), which is not limited by the present application.
In the data updating method, after the data to be updated including the updating program package and the updating hardware partition information is obtained, the current hardware partition information stored in the first partition by the electronic equipment is cleared, the running program stored in the second partition by the electronic equipment is updated according to the updating program package, and the updating hardware partition information is stored in the first partition according to the updating progress of the updating program package. Compared with the prior art, the method and the device have the advantages that the current hardware partition information of the electronic equipment in the first partition is cleared before the update program package is updated, so that the current hardware partition information of the electronic equipment is incomplete, the electronic equipment is in a state that the electronic equipment cannot be started normally at the moment, the update hardware partition information is stored into the first partition according to the update progress of the update program package, and therefore a technician can determine the update progress of the update program package according to the update hardware partition information in the first partition, whether the burning process of the update program package is complete or not is directly exposed, and production efficiency is improved.
Fig. 3 is a flow chart of another data updating method according to an embodiment of the present application, as shown in fig. 3, the method may include the following steps:
step S201, obtaining data to be updated, wherein the data to be updated comprises an update program package and update hardware partition information;
step S202, data stored in a first partition of the electronic equipment is cleared, and current hardware partition information of the electronic equipment is stored in the first partition;
step S203, updating data stored in a second partition of the electronic device according to the update package, wherein the second partition is used for storing programs required by the operation of the electronic device;
step S204, when the update progress of the update package meets the preset update condition, storing the updated hardware partition information into the first partition;
step S205, executing a startup procedure, and determining whether the electronic equipment is started normally, wherein the electronic equipment is instructed to finish updating according to the data to be updated under the condition that the electronic equipment is started normally; and under the condition that the electronic equipment cannot be started, indicating that the electronic equipment does not complete updating.
Note that, the execution manner of the steps S201 to S204 may be identical to the execution manner of the steps S101 to S104, and will not be described here again.
Optionally, under the condition that the electronic device is normally started, a prompt message for indicating that the update is completed may be displayed in a display screen of the electronic device, for example, after the electronic device is successfully started, a prompt box of "the system has been successfully updated" is popped up, so as to prompt a user that the update package is successfully updated.
According to the data updating method, after the updated hardware partition information is stored in the first partition, the starting-up process is automatically executed to determine whether the electronic equipment can be started normally, if the electronic equipment is started normally, the user electronic equipment is indicated to complete updating, and if the electronic equipment cannot be started, the user electronic equipment is indicated to complete updating, so that an updating result of data to be updated is directly prompted to a user through the angle of whether the electronic equipment can be started normally, the user is prevented from being started manually for the electronic equipment to verify the updating result, and user operation is reduced.
An exemplary application of the embodiments of the present application in a practical application scenario will be described below.
Fig. 4 is a schematic flow chart of an implementation of a data updating method according to an embodiment of the present application. As shown in fig. 4, the method comprises the steps of:
step 1, connecting an electronic device with a burning tool to obtain data to be updated, wherein the data to be updated comprises a program package to be updated, a GPT and a backup GPT;
Step 2, loading a program package to be updated through a burning tool;
step 3, erasing the GPT and the backup GPT of the electronic equipment;
step 4, normally updating the running program of the electronic equipment by using the program package to be updated;
and 5, after the running program of the electronic equipment is updated, storing the GPT and the backup GPT in the data to be updated into the electronic equipment.
Since the partition loading is performed according to the GPT partition table, if the partition table is erased, the machine cannot be started, in this embodiment, the GPT and its backup partition are erased before the writing, and the GPT and its backup partition are restored in the last step of the writing, so that it can be directly confirmed whether the writing is complete, if the writing is complete, the machine can be started normally after the writing is complete, if the writing is incomplete, the machine cannot load the partition data normally, and the machine cannot be started.
It should be understood that, although the steps in the flowcharts of fig. 1-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
Based on the foregoing embodiments, the embodiments of the present application provide an electronic device, where the electronic device includes each module included, and each unit included in each module may be implemented by a processor; of course, the method can also be realized by a specific logic circuit; in an implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where, as shown in fig. 5, the electronic device includes:
the update data acquisition module 501 is configured to acquire data to be updated, where the data to be updated includes an update package and update hardware partition information;
a first partition removal module 502, configured to remove data stored in a first partition of the electronic device, where current hardware partition information of the electronic device is stored in the first partition;
a second partition updating module 503, configured to update data stored in a second partition of the electronic device according to an update package, where the second partition is used to store a program required for running by the electronic device;
the first partition updating module 504 is configured to store updated hardware partition information to the first partition when an update progress of the update package meets a preset update condition.
In some embodiments, the update condition includes that the second partition update is completed, and accordingly, the first partition update module 504 may be specifically configured to:
and storing the updated hardware partition information to the first partition when the second partition updating is completed.
In some embodiments, the first partition includes a main partition and a backup partition, where the main partition and the backup partition each store current hardware partition information, and the first partition removal module 502 may be specifically configured to:
clearing the current hardware partition information stored in the main partition and the backup partition;
accordingly, the first partition update module 504 may be specifically configured to:
and storing the updated hardware partition information to the main partition and the backup partition.
In some embodiments, the first partition includes a main partition and a backup partition, where the main partition and the backup partition each store current hardware partition information, and the first partition removal module 502 may be specifically configured to:
clearing the current hardware partition information stored in the main partition;
accordingly, the first partition update module 504 may be specifically configured to:
and storing the updated hardware partition information to the main partition, and updating the partition information stored in the backup partition according to the updated hardware partition information.
In some embodiments, the electronic device may further include:
and the target mode setting module is used for setting the electronic equipment to be in a target mode before updating the data stored in the second partition of the electronic equipment according to the updating program package, and prohibiting the data of the main partition from being restored according to the backup partition in the target mode.
In some embodiments, the electronic device may further include:
the starting-up flow execution module is used for executing a starting-up flow and determining whether the electronic equipment is normally started up; under the condition that the electronic equipment is started normally, the electronic equipment is instructed to finish updating according to the data to be updated; and under the condition that the electronic equipment cannot be started, indicating that the electronic equipment does not complete updating.
In some embodiments, the hardware partition information and the current hardware partition information are updated to globally unique identification partition table GPT.
The description of the apparatus embodiments above is similar to that of the method embodiments above, with similar benefits as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, please refer to the description of the embodiments of the method of the present application.
It should be noted that, in the embodiment of the present application, the division of the modules by the electronic device shown in fig. 5 is schematic, which is merely a logic function division, and another division manner may be adopted in actual implementation. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. Or in a combination of software and hardware.
It should be noted that, in the embodiment of the present application, if the method is implemented in the form of a software functional module, and sold or used as a separate product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partly contributing to the related art, embodied in the form of a software product stored in a storage medium, including several instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
The embodiment of the application provides a computer device, which can be a server, and the internal structure diagram of the computer device can be shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data updating method.
An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method provided in the above-described embodiment.
Embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the method provided by the method embodiments described above.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, the data updating method provided by the application can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in fig. 6. The memory of the computer device may store the various program modules that make up the electronic device. The computer program constituted by the respective program modules causes the processor to execute the steps in the data updating method of the respective embodiments of the present application described in the present specification.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor implementing the steps of the data update method described above when the computer program is executed.
It should be noted here that: the description of the storage medium and apparatus embodiments above is similar to that of the method embodiments described above, with similar benefits as the method embodiments. For technical details not disclosed in the storage medium, the storage medium and the device embodiments of the present application, please refer to the description of the method embodiments of the present application.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" or "some embodiments" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "in some embodiments" in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
The term "and/or" is herein merely an association relation describing associated objects, meaning that there may be three relations, e.g. object a and/or object B, may represent: there are three cases where object a alone exists, object a and object B together, and object B alone exists.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments are merely illustrative, and the division of the modules is merely a logical function division, and other divisions may be implemented in practice, such as: multiple modules or components may be combined, or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or modules, whether electrically, mechanically, or otherwise.
The modules described above as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules; can be located in one place or distributed to a plurality of network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated in one processing unit, or each module may be separately used as one unit, or two or more modules may be integrated in one unit; the integrated modules may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partly contributing to the related art, embodied in the form of a software product stored in a storage medium, including several instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the application can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the application can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
The foregoing is merely an embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data updating method, applied to an electronic device, the method comprising:
acquiring data to be updated, wherein the data to be updated comprises an update program package and update hardware partition information;
clearing data stored in a first partition of the electronic equipment, wherein current hardware partition information of the electronic equipment is stored in the first partition;
updating data stored in a second partition of the electronic equipment according to the updating program package, wherein the second partition is used for storing programs required by the running of the electronic equipment;
and when the update progress of the update program package meets a preset update condition, storing the updated hardware partition information into the first partition.
2. The method of claim 1, wherein the update condition includes the second partition being updated, and wherein storing the updated hardware partition information to the first partition when a preset update condition is satisfied according to an update progress of the update package comprises:
And storing the updated hardware partition information to the first partition when the second partition updating is completed.
3. The method of claim 2, wherein the first partition comprises a main partition and a backup partition, wherein the current hardware partition information is stored in both the main partition and the backup partition, and wherein the purging the data stored in the first partition of the electronic device comprises:
clearing the current hardware partition information stored in the main partition and the backup partition;
the storing the updated hardware partition information to the first partition includes:
and storing the updated hardware partition information to the main partition and the backup partition.
4. The method of claim 2, wherein the first partition comprises a main partition and a backup partition, wherein the current hardware partition information is stored in both the main partition and the backup partition, and wherein the purging the data stored in the first partition of the electronic device comprises:
clearing the current hardware partition information stored in the main partition;
the storing the updated hardware partition information to the first partition includes:
and storing the updated hardware partition information to the main partition, and updating the partition information stored in the backup partition according to the updated hardware partition information.
5. The method of claim 4, wherein prior to said clearing of current hardware partition information stored in said main partition, said method further comprises:
and setting the electronic equipment in a target mode, and prohibiting the data of the main partition from being restored according to the backup partition in the target mode.
6. The method of any one of claims 1-5, wherein the method further comprises:
executing a startup process, and determining whether the electronic equipment is started normally;
under the condition that the electronic equipment is started normally, the electronic equipment is instructed to finish updating according to the data to be updated; and under the condition that the electronic equipment cannot be started, indicating that the electronic equipment does not complete updating.
7. The method of claim 1, wherein the updated hardware partition information and the current hardware partition information are globally unique identification partition table GPT.
8. An electronic device, the electronic device comprising:
the updating data acquisition module is used for acquiring data to be updated, wherein the data to be updated comprises an updating program package and updating hardware partition information;
the first partition clearing module is used for clearing data stored in a first partition of the electronic equipment, and current hardware partition information of the electronic equipment is stored in the first partition;
The second partition updating module is used for updating data stored in a second partition of the electronic equipment according to the updating program package, and the second partition is used for storing programs required by the operation of the electronic equipment;
and the first partition updating module is used for storing the updated hardware partition information to the first partition when the updating progress of the updating program package meets the preset updating condition.
9. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the program is executed.
10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any one of claims 1 to 7.
CN202310969411.0A 2023-08-02 2023-08-02 Data updating method and device and storage medium Pending CN116974608A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310969411.0A CN116974608A (en) 2023-08-02 2023-08-02 Data updating method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310969411.0A CN116974608A (en) 2023-08-02 2023-08-02 Data updating method and device and storage medium

Publications (1)

Publication Number Publication Date
CN116974608A true CN116974608A (en) 2023-10-31

Family

ID=88479356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310969411.0A Pending CN116974608A (en) 2023-08-02 2023-08-02 Data updating method and device and storage medium

Country Status (1)

Country Link
CN (1) CN116974608A (en)

Similar Documents

Publication Publication Date Title
US20030088557A1 (en) Image-taking apparatus, image-taking method, image-taking program, and storage medium having image-taking program stored thereon
US20170048117A1 (en) Information processing device and method of displaying download progress state
CN110377391B (en) Picture display method and device, mobile terminal and storage medium
US20220100490A1 (en) Firmware updating method, and electronic apparatus and storage media for same
CN107577472B (en) Software installation method and device and computer readable storage medium
US11157264B2 (en) Electronic device and method for controlling update of electronic device
CN111290773B (en) System upgrade method, device and readable storage medium
CN110650247A (en) Method for customizing on/off animation, intelligent terminal and storage medium
CN117707626A (en) System starting method and electronic equipment
CN112306368B (en) Method and device for expanding user data partition by EMMC (enhanced multi-media card)
US11361402B2 (en) Electronic device and method for saving image
US11107201B2 (en) Electronic device for processing image and image processing method thereof
CN116974608A (en) Data updating method and device and storage medium
US20080263064A1 (en) File processing method and apparatus for mobile terminal using an external device
WO2020190079A1 (en) Electronic device for searching for file information stored in external device and operation method thereof
US7671904B2 (en) Apparatus and method for capturing images
CN114020308A (en) Camera equipment upgrading method, device, equipment and medium
CN113849839A (en) Picture display method and device, server, electronic equipment and storage medium
CN114237720A (en) Loading device, apparatus and method for depth camera and storage medium
CN103677890A (en) Information processing apparatus, information processing method, and program
CN116028433B (en) Data migration method and electronic equipment
JP2007006125A (en) Image processing support apparatus, electronic camera, image processing apparatus, development processing system, and program for fulfilling these image processing support apparatus and image processing apparatus
TWI811063B (en) Method of setting basic input output system
WO2021162367A1 (en) Electronic device and method for initializing electronic device
KR101009954B1 (en) The home network device, the peripheral device install program system and method for setting the peripheral device install program

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