CN110515646A - A kind of difference upgrade method and relevant device - Google Patents

A kind of difference upgrade method and relevant device Download PDF

Info

Publication number
CN110515646A
CN110515646A CN201910693020.4A CN201910693020A CN110515646A CN 110515646 A CN110515646 A CN 110515646A CN 201910693020 A CN201910693020 A CN 201910693020A CN 110515646 A CN110515646 A CN 110515646A
Authority
CN
China
Prior art keywords
data block
data
error correction
difference
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.)
Granted
Application number
CN201910693020.4A
Other languages
Chinese (zh)
Other versions
CN110515646B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910693020.4A priority Critical patent/CN110515646B/en
Publication of CN110515646A publication Critical patent/CN110515646A/en
Application granted granted Critical
Publication of CN110515646B publication Critical patent/CN110515646B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1012Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • H04W8/245Transfer of terminal data from a network towards a terminal

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the present application discloses a kind of difference upgrade method and relevant device.It include: to obtain difference packet when detecting to the progress differencing check failure of multiple data blocks, determine the cryptographic Hash of each data block in multiple data blocks in electronic equipment, and obtain the cryptographic Hash of each data block of multiple data blocks of original version;Determine the first cryptographic Hash, whether identical as the second cryptographic Hash of the first data block in electronic equipment of the first data block in difference packet;If not identical, the Forward Error Correction FEC functional interface of User space is called, error correction is carried out to the abnormal data in the first data block, and the first data block is written into the correct data after error correction;If they are the same, then differencing check is carried out to other data blocks in multiple data blocks;When the success of multiple data block complete verifications, multiple data blocks are upgraded using differential data.Using the embodiment of the present application, realizes that difference upgrading is abnormal and be automatically repaired, improve the efficiency and success rate of difference upgrading.

Description

A kind of difference upgrade method and relevant device
Technical field
This application involves electronic technology field more particularly to a kind of difference upgrade method and relevant devices.
Background technique
Difference upgrading is widely used in each as a kind of general remote download (over the air, OTA) upgrade technique In class device version more new scene, current main mobile device be all upgrade to carry out system update using difference, such as Android intelligent, wrist-watch, smart television etc..The difference portion for being mainly characterized in that upgrade package only and include version of difference upgrading Point, therefore upgrade package is more much smaller than full dose upgrade package.But in difference escalation process, if hardware store device occurs Exception will lead to differencing check failure, and then cause entirely to upgrade failure.
Summary of the invention
The embodiment of the present application provides a kind of difference upgrade method and relevant device, realizes that difference upgrading is abnormal and is automatically repaired, Improve the efficiency and success rate of difference upgrading.
In a first aspect, the embodiment of the present application provides a kind of difference upgrade method, comprising: when detecting to multiple data blocks When carrying out differencing check failure, the difference packet for difference upgrading is obtained, difference packet includes differential data, is determined in electronic equipment Multiple data blocks in each data block cryptographic Hash, and obtain original version from the Hash tree at difference packet or mirror image end Multiple data blocks each data block cryptographic Hash;Determine the first data block in multiple data blocks that difference packet is included It is first cryptographic Hash, whether identical as the second cryptographic Hash of the first data block in multiple data blocks in electronic equipment;If not phase Together, then the Forward Error Correction FEC functional interface for calling User space carries out error correction to the abnormal data in the first data block, and will entangle The first data block is written in correct data after mistake;If they are the same, then differencing check is carried out to other data blocks in multiple data blocks; When the success of multiple data block complete verifications, multiple data blocks are upgraded using differential data.Pass through encapsulation User space FEC interface corrects the FEC interface of User space to the data in data block by calling when differencing check failure, and The data block is written into correct data after correction, to realize self-repair function when difference upgrading failure, improves difference The efficiency and success rate of upgrading.
In a kind of possible design, difference packet or mirror image end include error correcting code, the corresponding error correction of a data block Code;Using the error correcting code of the first data block, error correction is carried out to the abnormal data in the first data block.Pass through the error correction in difference packet Number realizes the error correction to abnormal data, to realize self-repair function when difference upgrading failure.
In alternatively possible design, difference packet includes the value range of multiple data blocks;It is read from difference packet multiple The value range of data block;It is every in multiple data blocks from being searched in the Hash tree at mirror image end according to the value range of multiple data blocks The cryptographic Hash of a data block.The position of variance data block is accurately positioned by value range, obtains the accurate of data block to ensure Property.
In alternatively possible design, in the case where restoring recovery mode, the Forward Error Correction FEC function of User space is called Interface carries out error correction to the abnormal data in the first data block, and the first data block is written in the correct data after error correction, In, recovery mode is the mode modified to the data or system when electronic equipment.It realizes under recovery mode Self-repair function.
In alternatively possible design, multiple data blocks are the text in data block or file system in memory device Part.
Second aspect, the embodiment of the present application provide a kind of difference update device, which is configured as reality Method and function performed by electronic equipment, are realized by hardware/software in existing above-mentioned first aspect, hardware/software include with The above-mentioned corresponding module of function.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: processor, memory and communication bus, Wherein, communication bus executes the program stored in memory for realizing connection communication between processor and memory, processor The step of for realizing above-mentioned first aspect.
In a possible design, electronic equipment provided by the present application be may include for executing in above method design The corresponding module of the behavior of electronic equipment.Module can be software and/or be hardware.
Fourth aspect stores in computer readable storage medium this application provides a kind of computer readable storage medium There is instruction, when run on a computer, so that the method that computer executes above-mentioned various aspects.
5th aspect, this application provides a kind of computer program products comprising instruction, when it runs on computers When, so that the method that computer executes above-mentioned various aspects.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application or in background technique below will be implemented the application Attached drawing needed in example or background technique is illustrated.
Fig. 1 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application;
Fig. 2 is a kind of flow diagram of difference upgrading provided by the embodiments of the present application;
Fig. 3 is a kind of schematic diagram of differencing check provided by the embodiments of the present application;
Fig. 4 is a kind of schematic diagram of reading and writing data provided by the embodiments of the present application;
Fig. 5 is a kind of flow diagram of difference upgrade method provided by the embodiments of the present application;
Fig. 6 is a kind of flow diagram of difference packet generation method provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of difference update device provided by the embodiments of the present application;
Fig. 8 is the structural schematic diagram for a kind of electronic equipment that the embodiment of the present application proposes.
Specific embodiment
The embodiment of the present application is described below with reference to the attached drawing in the embodiment of the present application.
Fig. 1 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application.Electronic equipment 100 may include place Reason device 110, external memory interface 120, internal storage 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio-frequency module 170, loudspeaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, key 190, motor 191, indicator 192, camera 193, display screen 194 and user identifier Module (subscriber identification module, SIM) card interface 195 etc..Wherein sensor module 180 can wrap Include pressure sensor 180A, gyro sensor 180B, baroceptor 180C, Magnetic Sensor 180D, acceleration transducer 180E, range sensor 180F, close to optical sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, ambient light sensor 180L, bone conduction sensor 180M etc..
It is understood that the structure of the embodiment of the present application signal does not constitute the specific restriction to electronic equipment 100.In In other embodiments of the application, electronic equipment 100 may include than illustrating more or fewer components, or the certain portions of combination Part perhaps splits certain components or different component layouts.The component of diagram can be with hardware, software or software and hardware Combination realize.
Processor 110 may include one or more processing units, such as: processor 110 may include application processor (application processor, AP), modem processor, graphics processor (graphics processing Unit, GPU), image-signal processor (image signal processor, ISP), controller, Video Codec, number Signal processor (digital signal processor, DSP), baseband processor and/or neural network processor (neural-network processing unit, NPU) etc..Wherein, different processing units can be independent device, It can integrate in one or more processors.
Controller can generate operating control signal according to instruction operation code and clock signal, complete instruction fetch and execution The control of instruction.
Memory can also be set in processor 110, for storing instruction and data.In some embodiments, processor Memory in 110 is cache memory.The memory can save the instruction that processor 110 is just used or is recycled Or data.If processor 110 needs to reuse the instruction or data, can be called directly from the memory.It avoids Repeated access, reduces the waiting time of processor 110, thus improves the efficiency of system.
In some embodiments, processor 110 may include one or more interfaces.Interface may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit Sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiving-transmitting transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), universal input export (general-purpose Input/output, GPIO) interface, Subscriber Identity Module (subscriber identity module, SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface etc..
I2C interface is a kind of bi-directional synchronization universal serial bus, including serial data line (serial data line, SDA) He Yigen serial time clock line (derail clock line, SCL).In some embodiments, processor 110 may include Multiple groups I2C bus.Processor 110 can by different I2C bus interface distinguish coupled with touch sensors 180K, charger, Flash lamp, camera 193 etc..Such as: processor 110 can make processor by I2C interface coupled with touch sensors 180K 110 are communicated with touch sensor 180K by I2C bus interface, realize the touch function of electronic equipment 100.
I2S interface can be used for voice communication.In some embodiments, processor 110 may include multiple groups I2S bus. Processor 110 can be coupled by I2S bus with audio-frequency module 170, be realized logical between processor 110 and audio-frequency module 170 Letter.In some embodiments, audio-frequency module 170 can transmit audio signal to wireless communication module 160 by I2S interface, real The function of now being received calls by bluetooth headset.
Pcm interface can be used for voice communication, by analog signal sampling, quantization and coding.In some embodiments, sound Frequency module 170 can be coupled with wireless communication module 160 by pcm bus interface.In some embodiments, audio-frequency module 170 Audio signal can also be transmitted to wireless communication module 160 by pcm interface, realize the function to receive calls by bluetooth headset Energy.The I2S interface and the pcm interface may be used to voice communication.
UART interface is a kind of Universal Serial Bus, is used for asynchronous communication.The bus can be bidirectional communications bus. The data that it will be transmitted are converted between serial communication and parallel communications.In some embodiments, UART interface usually by with In connection processor 110 and wireless communication module 160.Such as: processor 110 passes through UART interface and wireless communication module 160 In bluetooth module communication, realize Bluetooth function.In some embodiments, audio-frequency module 170 can be by UART interface to nothing Line communication module 160 transmits audio signal, realizes the function that music is played by bluetooth headset.
MIPI interface can be used to connect the peripheral components such as processor 110 and display screen 194, camera 193.MIPI connects Mouth includes camera serial line interface (camera serial interface, CSI), display screen serial line interface (display Serial interface, DSI) etc..In some embodiments, processor 110 and camera 193 are communicated by CSI interface, real The shooting function of existing electronic equipment 100.Processor 110 and display screen 194 realize electronic equipment 100 by DSI interface communication Display function.
GPIO interface can pass through software configuration.GPIO interface can be configured as control signal, may be alternatively configured as counting It is believed that number.In some embodiments, GPIO interface can be used for connecting processor 110 and camera 193, display screen 194, wirelessly Communication module 160, audio-frequency module 170, sensor module 180 etc..GPIO interface can be additionally configured to I2C interface, and I2S connects Mouthful, UART interface, MIPI interface etc..
Usb 1 30 is the interface for meeting USB standard specification, specifically can be Mini USB interface, and Micro USB connects Mouthful, USB Type C interface etc..Usb 1 30 can be used for connecting charger for the charging of electronic equipment 100, can be used for Data are transmitted between electronic equipment 100 and peripheral equipment.It can be used for connection earphone, audio played by earphone.The interface It can be also used for connecting other electronic equipments, such as AR equipment etc..
It is understood that the interface connection relationship of each intermodule of the embodiment of the present application signal, only schematically illustrates, The structure qualification to electronic equipment 100 is not constituted.In other embodiments of the application, electronic equipment 100 can also be used The combination of different interface connection type or multiple interfaces connection type in above-described embodiment.
Charge management module 140 is used to receive charging input from charger.Wherein, charger can be wireless charger, It is also possible to wired charger.In the embodiment of some wired chargings, charge management module 140 can pass through usb 1 30 Receive the charging input of wired charger.In the embodiment of some wireless chargings, charge management module 140 can pass through electronics The Wireless charging coil of equipment 100 receives wireless charging input.While charge management module 140 is that battery 142 charges, may be used also To be power electronic equipment by power management module 141.
Power management module 141 is for connecting battery 142, charge management module 140 and processor 110.Power management mould Block 141 receives the input of battery 142 and/or charge management module 140, is processor 110, internal storage 121, display screen 194, the power supply such as camera 193 and wireless communication module 160.Power management module 141 can be also used for monitoring battery capacity, Circulating battery number, the parameters such as cell health state (electric leakage, impedance).In some other embodiment, power management module 141 Also it can be set in processor 110.In further embodiments, power management module 141 and charge management module 140 can also To be set in the same device.
The wireless communication function of electronic equipment 100 can pass through antenna 1, antenna 2, mobile communication module 150, wireless communication Module 160, modem processor and baseband processor etc. are realized.
Antenna 1 and antenna 2 electromagnetic wave signal for transmitting and receiving.Each antenna in electronic equipment 100 can be used for covering Cover single or multiple communication bands.Different antennas can also be multiplexed, to improve the utilization rate of antenna.Such as: it can be by antenna 1 It is multiplexed with the diversity antenna of WLAN.In other embodiments, antenna can be used in combination with tuning switch.
Mobile communication module 150, which can provide, applies wirelessly communicating on electronic equipment 100 including 2G/3G/4G/5G etc. Solution.Mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (low noise amplifier, LNA) etc..Mobile communication module 150 can receive electromagnetic wave by antenna 1, and to received electricity Magnetic wave is filtered, and the processing such as amplification is sent to modem processor and is demodulated.Mobile communication module 150 can also be right The modulated modulated signal amplification of demodulation processor, switchs to electromagenetic wave radiation through antenna 1 and goes out.In some embodiments, it moves At least partly functional module of dynamic communication module 150 can be arranged in processor 110.In some embodiments, mobile logical At least partly functional module of letter module 150 can be arranged in the same device at least partly module of processor 110.
Modem processor may include modulator and demodulator.Wherein, modulator is used for low frequency base to be sent Band signal is modulated into high frequency signal.Demodulator is used to received electromagnetic wave signal being demodulated into low frequency baseband signal.Then solution Adjust device that the low frequency baseband signal that demodulation obtains is sent to baseband processor.Low frequency baseband signal is through baseband processor Afterwards, it is delivered to application processor.Application processor is defeated by audio frequency apparatus (being not limited to loudspeaker 170A, receiver 170B etc.) Voice signal out, or image or video are shown by display screen 194.In some embodiments, modem processor can be Independent device.In further embodiments, modem processor can be independently of processor 110, with mobile communication module 150 or other function module be arranged in the same device.
It includes WLAN (wireless that wireless communication module 160, which can be provided and be applied on electronic equipment 100, Local area networks, WLAN) (such as Wireless Fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), Global Navigation Satellite System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), the short distance wireless communication technology (near field communication, NFC) are red The solution of the wireless communications such as outer technology (infrared, IR).Wireless communication module 160 can be integrated into few communication One or more devices of processing module.Wireless communication module 160 receives electromagnetic wave via antenna 2, by electromagnetic wave signal frequency modulation And filtering processing, by treated, signal is sent to processor 110.Wireless communication module 160 can also connect from processor 110 Signal to be sent is received, frequency modulation is carried out to it, is amplified, is switched to electromagenetic wave radiation through antenna 2 and go out.
In some embodiments, the antenna 1 of electronic equipment 100 and mobile communication module 150 couple, antenna 2 and channel radio Believe that module 160 couples, allowing electronic equipment 100, technology is communicated with network and other equipment by wireless communication.It is described Wireless communication technique may include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), CDMA access (code Division multiple access, CDMA), wideband code division multiple access (wideband code division multiple Access, WCDMA), time division CDMA (time-division code division multiple access, TD- SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM and/or IR technology etc..Institute Stating GNSS may include GPS (global positioning system, GPS), global navigational satellite system It unites (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou Navigation satellite system, BDS), quasi- zenith satellite system (quasi-zenith satellite System, QZSS) and/or satellite-based augmentation system (satellite based augmentation systems, SBAS).
Electronic equipment 100 realizes display function by GPU, display screen 194 and application processor etc..GPU is at image The microprocessor of reason connects display screen 194 and application processor.GPU is calculated for executing mathematics and geometry, is used for figure wash with watercolours Dye.Processor 110 may include one or more GPU, execute program instructions to generate or change display information.
Display screen 194 is for showing image, video etc..Display screen 194 includes display panel.Display panel can use liquid Crystal display screen (liquid crystal display, LCD), Organic Light Emitting Diode (organic light-emitting Diode, OLED), active matrix organic light-emitting diode or active-matrix organic light emitting diode (active-matrix Organic light emitting diode's, AMOLED), Flexible light-emitting diodes (flex light-emitting Diode, FLED), Miniled, MicroLed, Micro-oLed, light emitting diode with quantum dots (quantum dot light Emitting diodes, QLED) etc..In some embodiments, electronic equipment 100 may include 1 or N number of display screen 194, N For the positive integer greater than 1.
Electronic equipment 100 can be by ISP, camera 193, Video Codec, GPU, display screen 194 and at It manages device etc. and realizes shooting function.
ISP is used to handle the data of the feedback of camera 193.For example, opening shutter when taking pictures, light is passed by camera lens It is delivered on camera photosensitive element, optical signal is converted to electric signal, and camera photosensitive element passes to the electric signal at ISP Reason, is converted into macroscopic image.ISP can also be to the noise of image, brightness, colour of skin progress algorithm optimization.ISP can be with Exposure to photographed scene, the parameter optimizations such as colour temperature.In some embodiments, ISP can be set in camera 193.
Camera 193 is for capturing still image or video.Object generates optical imagery by camera lens and projects photosensitive member Part.Photosensitive element can be charge-coupled device (charge coupled device, CCD) or complementary metal oxide is partly led Body (complementary metal-oxide-semiconductor, CMOS) phototransistor.Photosensitive element turns optical signal It changes electric signal into, electric signal is passed into ISP later and is converted into data image signal.Data image signal is output to DSP by ISP Working process.Data image signal is converted into the RGB of standard, the picture signal of the formats such as YUV by DSP.In some embodiments, Electronic equipment 100 may include 1 or N number of camera 193, and N is the positive integer greater than 1.
Digital signal processor, in addition to can handle data image signal, can also handle it for handling digital signal His digital signal.For example, digital signal processor is used to carry out Fu to frequency point energy when electronic equipment 100 is when frequency point selects In leaf transformation etc..
Video Codec is used for compression of digital video or decompression.Electronic equipment 100 can be supported one or more Video Codec.In this way, electronic equipment 100 can play or record the video of a variety of coded formats, and such as: dynamic image is special Family's group (moving picture experts group, MPEG) 1, MPEG2, mpeg 3, MPEG4 etc..
NPU is neural network (neural-network, NN) computation processor, by using for reference biological neural network structure, Such as transfer mode between human brain neuron is used for reference, it, can also continuous self study to input information fast processing.Pass through NPU The application such as intelligent cognition of electronic equipment 100 may be implemented, such as: image recognition, recognition of face, speech recognition, text understanding Deng.
External memory interface 120 can be used for connecting external memory card, such as Micro SD card, realize that extension electronics is set Standby 100 storage capacity.External memory card is communicated by external memory interface 120 with processor 110, realizes that data store function Energy.Such as by music, the files such as video are stored in external memory card.
Internal storage 121 can be used for storing computer executable program code, and the executable program code includes Instruction.Internal storage 121 may include storing program area and storage data area.Wherein, storing program area can store operation system It unites, application program (such as sound-playing function, image player function etc.) needed at least one function etc..It storage data area can The data (such as audio data, phone directory etc.) etc. created in storage 100 use process of electronic equipment.In addition, storage inside Device 121 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a disk storage Device, flush memory device, generic flash memory (universal flash storage, UFS) etc..Processor 110 passes through operation It is stored in the instruction of internal storage 121, and/or is stored in the instruction for the memory being set in processor, electronics is executed and sets Standby 100 various function application and data processing.
Electronic equipment 100 can pass through audio-frequency module 170, loudspeaker 170A, receiver 170B, microphone 170C, earphone Interface 170D and application processor etc. realize audio-frequency function.Such as music, recording etc..
Audio-frequency module 170 is used to for digitized audio message to be converted into analog audio signal output, is also used for analogue audio frequency Input is converted to digital audio and video signals.Audio-frequency module 170 can be also used for audio-frequency signal coding and decoding.In some embodiments In, audio-frequency module 170 can be set in processor 110, or the partial function module of audio-frequency module 170 is set to processor In 110.
Loudspeaker 170A, also referred to as " loudspeaker ", for audio electrical signal to be converted to voice signal.Electronic equipment 100 can be with Music is listened to by loudspeaker 170A, or listens to hand-free call.
Receiver 170B, also referred to as " earpiece ", for audio electrical signal to be converted into voice signal.When electronic equipment 100 connects It answers a call or when voice messaging, it can be by the way that receiver 170B be answered voice close to human ear.
Microphone 170C, also referred to as " microphone ", " microphone ", for voice signal to be converted to electric signal.When making a phone call Or when sending voice messaging, voice signal can be input to microphone by mouth close to microphone 170C sounding by user 170C.At least one microphone 170C can be set in electronic equipment 100.In further embodiments, electronic equipment 100 can be set Two microphone 170C are set, in addition to collected sound signal, can also realize decrease of noise functions.In further embodiments, electronics is set Standby 100 can also be arranged three, four or more microphone 170C, realize that collected sound signal, noise reduction can also identify sound Directional recording function etc. is realized in source.
Earphone interface 170D is for connecting wired earphone.Earphone interface 170D can be usb 1 30, be also possible to Opening mobile electronic device platform (open mobile terminal platform, OMTP) standard interface of 3.5mm, the U.S. Cellular telecommunication industrial association (cellular telecommunications industry association of the USA, CTIA) standard interface.
Pressure signal can be converted into electric signal for experiencing pressure signal by pressure sensor 180A.In some implementations In example, pressure sensor 180A be can be set in display screen 194.There are many type of pressure sensor 180A, such as resistive pressure Sensor, inductance pressure transducer, capacitance pressure transducer, etc..Capacitance pressure transducer, can be including at least two Parallel-plate with conductive material.When effectively acting on pressure sensor 180A, the capacitor between electrode changes.Electronic equipment 100 determine the intensity of pressure according to the variation of capacitor.When there is touch operation to act on display screen 194, electronic equipment 100 is according to pressure Force snesor 180A detects the touch operation intensity.Electronic equipment 100 can also be believed according to the detection of pressure sensor 180A Number calculate touch position.In some embodiments, identical touch location, but the touch behaviour of different touch operation intensity are acted on Make, different operational orders can be corresponded to.Such as: when the touch operation for having touch operation intensity to be less than first pressure threshold value acts on When short message application icon, the instruction for checking short message is executed.When have touch operation intensity be greater than or equal to first pressure threshold When the touch operation of value acts on short message application icon, the instruction of newly-built short message is executed.
Gyro sensor 180B is determined for the athletic posture of electronic equipment 100.It in some embodiments, can be with Determine that electronic equipment 100 surrounds the angular speed of three axis (that is, x, y and z-axis) by gyro sensor 180B.Gyro sensors Device 180B can be used for shooting stabilization.Illustratively, when pressing shutter, gyro sensor 180B detection electronic equipment 100 is trembled Dynamic angle goes out the distance that lens module needs to compensate according to angle calculation, camera lens is allowed to offset electronic equipment by counter motion Stabilization is realized in 100 shake.Gyro sensor 180B can be also used for navigating, somatic sensation television game scene.
Baroceptor 180C is for measuring air pressure.In some embodiments, electronic equipment 100 passes through baroceptor The atmospheric pressure value that 180C is measured calculates height above sea level, auxiliary positioning and navigation.
Magnetic Sensor 180D includes Hall sensor.Electronic equipment 100 can use Magnetic Sensor 180D flip cover skin The folding of set.In some embodiments, when electronic equipment 100 is liding machine, electronic equipment 100 can be according to Magnetic Sensor The folding of 180D flip cover.And then according to the folding condition of the leather sheath detected or the folding condition of flip lid, setting flip lid is certainly The characteristics such as dynamic unlock.
Acceleration transducer 180E can detect the big of (the generally three axis) acceleration in all directions of electronic equipment 100 It is small.It can detect that size and the direction of gravity when electronic equipment 100 is static.It can be also used for identification electronic equipment posture, answer Switch for horizontal/vertical screen, the application such as pedometer.
Range sensor 180F, for measuring distance.Electronic equipment 100 can pass through infrared or laser distance measuring.In In some embodiments, photographed scene, electronic equipment 100 can use range sensor 180F ranging to realize rapid focus.
It may include such as light emitting diode (LED) and photodetector, such as photodiode close to optical sensor 180G. Light emitting diode can be infrared light-emitting diode.Electronic equipment 100 launches outward infrared light by light emitting diode.Electronics is set Standby 100 detect the infrared external reflection light from neighbouring object using photodiode.It, can be true when detecting sufficient reflected light Determining electronic equipment 100 nearby has object.When detecting insufficient reflected light, electronic equipment 100 can determine electronic equipment 100 do not have object nearby.Electronic equipment 100 can use to be pasted close to optical sensor 180G detection user's hand-hold electronic equipments 100 Nearly ear call, so that automatic distinguishing screen achievees the purpose that power saving.It can also be used for leather sheath mode, mouth close to optical sensor 180G Bag mode automatic unlocking and screen locking.
Ambient light sensor 180L is for perceiving environmental light brightness.Electronic equipment 100 can be according to the environment bright of perception Spend 194 brightness of automatic adjusument display screen.Automatic white balance adjustment when ambient light sensor 180L can also be used for taking pictures.Environment light Sensor 180L can also cooperate with close to optical sensor 180G, electronic equipment 100 be detected whether in pocket, with false-touch prevention.
Fingerprint sensor 180H is for acquiring fingerprint.The fingerprint characteristic that electronic equipment 100 can use acquisition realizes fingerprint Unlock accesses application lock, and fingerprint is taken pictures, fingerprint incoming call answering etc..
Temperature sensor 180J is for detecting temperature.In some embodiments, electronic equipment 100 utilizes temperature sensor The temperature of 180J detection, executes Temperature Treatment strategy.For example, when the temperature sensor 180J temperature reported is more than threshold value, electronics Equipment 100 executes the performance for reducing the processor being located near temperature sensor 180J, implements Thermal protection to reduce power consumption.In In other embodiments, when temperature is lower than another threshold value, electronic equipment 100 heats battery 142, leads to electricity to avoid low temperature The abnormal shutdown of sub- equipment 100.In some other embodiment, when temperature is lower than another threshold value, electronic equipment 100 is to battery 142 output voltage executes boosting, to avoid shutting down extremely caused by low temperature.
Touch sensor 180K, also referred to as " touch-control device ".Touch sensor 180K can be set in display screen 194, by touching It touches sensor 180K and display screen 194 forms touch screen, also referred to as " touch screen ".Touch sensor 180K acts on it for detecting On or near touch operation.The touch operation that touch sensor can will test passes to application processor, to determine touching Touch event type.Visual output relevant to touch operation can be provided by display screen 194.In further embodiments, it touches Touching sensor 180K also can be set in the surface of electronic equipment 100, different from the location of display screen 194.
The available vibration signal of bone conduction sensor 180M.In some embodiments, bone conduction sensor 180M can be with Obtain the vibration signal of human body part vibration bone block.Bone conduction sensor 180M can also contact human pulse, receive blood pressure and jump Dynamic signal.In some embodiments, bone conduction sensor 180M also can be set in earphone, be combined into bone conduction earphone.Sound Frequency module 170 can parse voice based on the vibration signal for the part vibration bone block that the bone conduction sensor 180M is obtained Signal realizes phonetic function.The blood pressure jitter solution that application processor can be obtained based on the bone conduction sensor 180M Heart rate information is analysed, realizes heart rate detecting function.
Key 190 includes power button, volume key etc..Key 190 can be mechanical key.It is also possible to touch-key. Electronic equipment 100 can receive key-press input, generate key letter related with the user setting of electronic equipment 100 and function control Number input.
Motor 191 can produce vibration prompt.Motor 191 can be used for calling vibration prompt, can be used for touching vibration Dynamic feedback.For example, acting on the touch operation of different application (such as taking pictures, audio broadcasting etc.), different vibrations can be corresponded to Feedback effects.The touch operation of 194 different zones of display screen is acted on, motor 191 can also correspond to different vibrational feedback effects. Different application scenarios (such as: time alarm receives information, alarm clock, game etc.) different vibrational feedback effects can also be corresponded to Fruit.Touch vibrational feedback effect can also be supported customized.
Indicator 192 can be indicator light, can serve to indicate that charged state, electric quantity change can be used for instruction and disappear Breath, missed call, notice etc..
SIM card interface 195 is for connecting SIM card.SIM card can be by being inserted into SIM card interface 195, or from SIM card interface 195 extract, and realization is contacting and separating with electronic equipment 100.Electronic equipment 100 can support 1 or N number of SIM card interface, N For the positive integer greater than 1.SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc..The same SIM Card interface 195 can be inserted into multiple cards simultaneously.The type of multiple cards may be the same or different.SIM card interface 195 Different types of SIM card can also be compatible with.SIM card interface 195 can also be with compatible external storage card.Electronic equipment 100 passes through SIM Card and network interaction realize the functions such as call and data communication.In some embodiments, electronic equipment 100 uses eSIM, That is: embedded SIM card.ESIM card can cannot separate in electronic equipment 100 with electronic equipment 100.
Below to this application involves noun explain: general (normal) start-up mode, is normal startup mode, electricity The power on mode that the individual palpation power supply key field of sub- equipment default enters.Restore (recovery) mode, is Android phone backup Function, refer to it is a kind of can the mode modified of data to the inside of electronic equipment or system.Under this scheme, may be used It, can also be in this factory reset existing system is backed up or be upgraded.Forward error correction (forward error Correction, FEC) it is that under certain condition, can be entangled automatically by decoding by the way that redundant correcting code is added in transmission code Positive transmission error code reduces the bit error rate for receiving signal.FEC coding gain is stronger, indicates that error-correcting performance is stronger.
As shown in Fig. 2, Fig. 2 is a kind of flow diagram of difference upgrading provided by the embodiments of the present application.It include: right first Variance data block (block) (or file) carries out differencing check, if differencing check success, then carries out difference block Difference upgrading, to the last difference upgrades successfully.If differencing check fails, difference upgrading failure.As shown in figure 3, Fig. 3 is A kind of schematic diagram of differencing check provided by the embodiments of the present application.First by the variance data block (block) of two versions (or File) it is fabricated to difference packet, wherein and the difference includes the hash value of the difference block of differential data and original version.In When upgrading starts, difference block (such as block2, block4, block (n-2) of the current version of calculating electronic equipment first With a hash value of block (n)), the hash value for the corresponding difference block for then being included with upgrade package is compared Compared with, if hash value is identical, illustrate that the data of original version in electronic equipment do not change, differencing check success, difference can be carried out Decilitre grade;If the corresponding difference that the hash value with upgrade package of the difference block of current version is included in electronic equipment When the hash value of block is not identical, illustrate that the data of original version in electronic equipment are changed for some reason, Difference upgrading can not continue, difference upgrading failure.It is whole when differencing check failure occurs in upgrading in this difference escalation process A upgrading will appear interruption.If upgraded again, needing very long one of interval to search the packet period could more new version.Also, again The data packet newly upgraded is full dose packet, waste bandwidth and flow.
Fig. 4 is a kind of schematic diagram of reading and writing data provided by the embodiments of the present application.The system of electronic equipment from top to bottom according to It is secondary to be divided into User space, file system, kernel (kernel) and memory device.Under normal start-up mode, forward error correction (forward error correction, FEC) is completed inside kernel, and detailed process includes: the journey first under User space Sequence read block (block) from memory device then calculates the current version of electronic equipment to buffer area (buffer) One hash value of a hash value of block, the corresponding block for then being included with upgrade package is compared, if not It is identical, then failure is verified, error correction is carried out using FEC error correction algorithm to the block of verification failure, and by the correct data after error correction Buffer is written, and returns to program.Under normal start-up mode, the partition data error correction needs of reading are borrowed in kernel Kernel device map (device-mapper) frame is helped, and by subregion carry at device-mapper virtual unit, this side Formula is not particularly suited for other (such as recovery) modes.In addition, under normal start-up mode, it can't after carrying out error correction It is written back to memory device, the data damaged on memory device are not repaired, therefore when carrying out difference upgrading, Wu Fabao Card difference upgrades successfully.
In order to solve the above-mentioned technical problem, the embodiment of the present application provides following solution.
As shown in figure 5, Fig. 5 is a kind of flow diagram of difference upgrade method provided by the embodiments of the present application.The application Step in embodiment includes at least:
S501 obtains the difference packet for difference upgrading when detecting to the progress differencing check failure of multiple data blocks, The difference packet includes differential data, determines the cryptographic Hash of each data block in the multiple data block in electronic equipment, with And each data block of the multiple data block of original version is obtained from the Hash tree at the difference packet or mirror image end Cryptographic Hash.
Wherein, multiple data blocks can be the file in the data block or file system in memory device.The difference Data are the variance data between the data for the version that currently data of more new version and electronic equipment currently save.It is the multiple Data block is variance data block, that is, the data block for needing to upgrade, difference includes not needing the data of the data block of upgrading.Institute The subregion mirror image that mirror image is the multiple data blocks upgraded to difference is stated, memory device may include embedded multi-media card (embedded multi media card, EMMC), unix filesystem (unix file system, UFS) etc., every number Size according to block includes but is not limited to 4k.
Specifically, can from server obtain for difference upgrade difference packet, difference upgrading start after, first into Row differencing check calculates a hash value of all data in electronic equipment in multiple variance data blocks, the difference packet A hash value of multiple variance data blocks of original version is included, if two hash values are identical, differencing check success can be with Directly carry out difference upgrading.If two hash are not identical, difference verification failure illustrates the original version in electronic equipment Changed for some reason, the abnormal data block required to look up out in multiple variance data blocks carries out error correction, so Difference upgrading can be just carried out afterwards.
Optionally, before carrying out difference upgrading to multiple data blocks, difference packet can be generated.As shown in fig. 6, Fig. 6 is A kind of flow diagram of difference packet generation method provided by the embodiments of the present application.It include: currently to be saved to electronic equipment first The data of version A and the data of current more new version B be compared, determine differential data, and differential data is packaged and is generated Difference packet.The difference packet can also include the corresponding hash value of multiple data blocks, which is according in multiple data blocks What all data of original version were calculated.
Wherein, for the system (such as part Android version) with hash data and error correcting code, hash value and error correction Code is placed on mirror image end, and difference packet can only include differential data.Alternatively, can be by the value range of the data block of each file It is recorded in difference packet, the value range of the data block is used for when carrying out difference upgrading to the file in file system from mirror image end The hash value of corresponding data block is searched in the Hash tree of tail.For no hash data and error correcting code system (such as other one A little systems), difference packet can also include the hash value and error correcting code of multiple data blocks, the corresponding hash value of data block and One error correcting code, the hash value are to be calculated according to the data of the original version in each data block.
For example, including 1000 data blocks in the memory device of electronic equipment, currently the data of more new version are set with electronics The data of the standby version currently saved are compared, and determination only needs to be updated 100 data blocks in memory device, and another 900 outer data blocks do not need to update, and differential data is the data of 100 data blocks.In the difference packet ultimately generated May include the data of 100 data blocks, difference packet also may include 100 data blocks 100 data blocks of data and 100 Hash value, a corresponding hash value of data block and an error correcting code.
For the system with hash data and error correcting code, when carrying out difference upgrading to the data block in memory device, If multiple data block differencing check failures, can search original version from the Hash tree (hash tree) at mirror image end Each data block hash value.When carrying out difference upgrading to the file in file system, if file differencing check fails, The value range that the data block of this document is then read from difference packet is searched from the Hash tree at mirror image end according to the value range To the hash to each data block.For the system (such as some other system) of no hash data and error correcting code, making The hash value of each data block of differential data and error correcting code have been saved in difference packet when difference packet.To data block When carrying out difference upgrading, if multiple data block differencing checks fail, each data block can be obtained from difference packet Hash value.
S502, determine the first data block in the multiple data block that the difference packet is included the first cryptographic Hash, It is whether identical as the second cryptographic Hash of the first data block in the multiple data block in the electronic equipment.Wherein, first Cryptographic Hash is to be calculated according to the data of the original version in the first data block, and the second cryptographic Hash is that electronic equipment is currently protected What the data in the first data block deposited were calculated, if not identical, S503 is executed, if they are the same, then executes S504.
For example, difference packet include 100 data blocks (data block 1, data block 2 ... ..., data block 100) data and 100 hash values, the corresponding hash value of a data block, can be respectively by the original hash value of data block each in difference packet The hash value of the corresponding data block currently saved with electronic equipment is compared, if it is determined that the hash value of data block 1 not phase With and data block 2 hash value it is also not identical, then illustrate that the data in data block 1 and data block 2 are changed, Wu Fajin The upgrading of row difference, therefore only need to carry out error correction to the data in data block 1 and data block 2.If the hash of other data blocks Be worth it is identical, then do not need carry out error correction.
It should be noted that in the case where multiple data blocks corresponding hash value, as long as one in multiple data blocks Data in data block change, then the hash value being calculated is with regard to different.Hash value included in subpackage of being on duty with Electronic equipment be calculated multiple data blocks of original version hash value it is not identical when, then need in all multiple data blocks Data carry out error correction.And in the embodiment of the present application, the corresponding hash value of a data block, if it is determined that some data block Hash it is not identical, then only need in the data block data carry out error correction, to improve data-handling efficiency.
S503 calls the Forward Error Correction FEC functional interface of User space, carries out to the abnormal data in first data block Error correction, and first data block is written into the correct data after error correction.
Specifically, Forward Error Correction FEC functional interface can be encapsulated under User space in advance.It is carried out under recovery mode Difference upgrade when, the Forward Error Correction FEC functional interface of User space can be called, to the abnormal data in first data block into Row error correction, and first data block is written into the correct data after error correction.
It is former from being searched in the Hash tree (hash tree) at mirror image end for the system with hash data and error correcting code The hash value of multiple data blocks of beginning version, then with the multiple data blocks for the current version being calculated in electronic equipment Hash value is compared, and finds out the data block of difference, then carries out error correction using the error correcting code that mirror image end saves.If to text File in part system carries out difference upgrading.The value range that the data block of this document is read from difference packet, according to the value range, The hash that corresponding data block is found from the Hash tree at mirror image end, with the current version that is calculated in electronic equipment Hash is compared, and finds out the data block of difference, then carries out error correction using the error correcting code that mirror image end saves.
It, will be poor when making the difference subpackage for the system (such as some other system) of no hash data and error correcting code The hash value and error correcting code of each data block of divided data have been saved in difference packet.Every number can be obtained from difference packet According to the hash value of block, it is compared, finds out with the hash value of the multiple data blocks for the current version being calculated in electronic equipment Then the data block of difference carries out error correction using the error correcting code saved in difference packet.
For example, having verified that the mirror image of starting (Android verified boot, AVB) verification for non-Android, i.e., The hash tree of mirror image data is not saved in mirror image end, such as kernel mirror image, boot ramdisk mirror image etc., it can When generating difference packet, the hash value and error correcting code of variance data block to be stored in difference packet.If the number in difference packet The hash value of the data block 1 currently saved saved according to hash value and the electronic equipment of block 1 is not identical, then illustrates that the electronics is set The data of the standby data block 1 currently saved are abnormal data, and the error correcting code for the data block 1 for including in difference packet can be used at this time Error correction is carried out to the abnormal data, and by the correct data writing data blocks 1 after error correction.
Optionally, after carrying out error correction to the data in the first data block, the hash value of the data after error correction is calculated again, And be compared the hash value for the first data block that the hash value and the Hash tree of difference packet or mirror image end include, if phase Together, then the data after error correction are correct data, which are written the first data block, if it is not the same, then after error correction Data are wrong data, need further to carry out error correction to the data.
S504 verifies other data blocks in the multiple data block.It can be according to above-mentioned identical method pair Other data blocks are verified, until multiple data block complete verifications finish.
S505, when the success of the multiple data block complete verification, using the differential data to the multiple data block Upgraded.Specifically, hash value and difference packet or the mirror image end of each data block being calculated in the electronic equipment When the hash value for the corresponding data block that Hash tree includes is all identical, then the error correction of specification exception data block finishes, and starts to carry out Difference upgrading.
In the embodiment of the present application, by encapsulating the FEC interface of User space, when differencing check failure, pass through calling pair The FEC interface of User space corrects the data in data block, and the data block is written in the correct data after correction, thus It realizes self-repair function when difference upgrading failure, improves the efficiency and success rate of difference upgrading.
It is above-mentioned to illustrate the method for the embodiment of the present application, the device of the embodiment of the present application is provided below.
Fig. 7 is referred to, Fig. 7 is a kind of structural schematic diagram of difference update device provided by the embodiments of the present application, the difference Update device may include obtaining module 701, determining module 702, processing module 703 and upgraded module 704, wherein Ge Gemo Block is described in detail as follows.
Module 701 is obtained, for obtaining and being used for difference liter when detecting to the progress differencing check failure of multiple data blocks The difference packet of grade, the difference packet includes differential data, determines each data block in the multiple data block in electronic equipment Cryptographic Hash, and from the Hash tree at the difference packet or mirror image end obtain original version the multiple data block it is every The cryptographic Hash of a data block;
Determining module 702, for determining the first data block in the multiple data block that the difference packet is included First cryptographic Hash, with the second cryptographic Hash of the first data block in the multiple data block in the electronic equipment whether phase Together;
Processing module 703, if the Forward Error Correction FEC functional interface of User space is called, to described first for not identical Abnormal data in data block carries out error correction, and first data block is written in the correct data after error correction;If they are the same, then right Other data blocks in the multiple data block carry out differencing check;
Upgraded module 704 is used for when the success of the multiple data block complete verification, using the differential data to described Multiple data blocks are upgraded.
Optionally, the difference packet or mirror image end include error correcting code, the corresponding error correction of a data block Code;
Processing module 703 is also used for the error correcting code of first data block, to the exception in first data block Data carry out error correction.
Optionally, the difference packet includes the value range of the multiple data block;
Module 701 is obtained, for reading the value range of the multiple data block from the difference packet;According to the multiple The value range of data block searches the Hash of each data block in the multiple data block from the Hash tree at the mirror image end Value.
Optionally, processing module 703 are also used in the case where restoring recovery mode, call the Forward Error Correction FEC of User space Functional interface carries out error correction to the abnormal data in first data block, and by the correct data write-in described the after error correction One data block, wherein the recovery mode is the mode modified to the data when electronic equipment or system.
Wherein, the multiple data block is the file in the data block or file system in memory device.
It should be noted that the realization of modules can also correspond to accordingly retouching for embodiment of the method referring to Figure 5 It states, executes method and function performed by electronic equipment in above-described embodiment.
With continued reference to FIG. 8, Fig. 8 is the structural schematic diagram for a kind of electronic equipment that the embodiment of the present application proposes.Such as Fig. 8 institute Show, which may include: at least one processor 801, at least one communication interface 802, at least one processor 803 With at least one communication bus 804.
Wherein, processor 801 can be central processor unit, general processor, digital signal processor, dedicated integrated Circuit, field programmable gate array or other programmable logic device, transistor logic, hardware component or it is any Combination.It, which may be implemented or executes, combines various illustrative logic blocks, module and electricity described in present disclosure Road.The processor is also possible to realize the combination of computing function, such as combines comprising one or more microprocessors, number letter Number processor and the combination of microprocessor etc..Communication bus 804 can be Peripheral Component Interconnect standard PCI bus or extension work Industry normal structure eisa bus etc..The bus can be divided into address bus, data/address bus, control bus etc..For convenient for indicate, It is only indicated with a thick line in Fig. 8, it is not intended that an only bus or a type of bus.Communication bus 804 is used for Realize the connection communication between these components.Wherein, the communication interface 802 of equipment is used for and other nodes in the embodiment of the present application Equipment carries out the communication of signaling or data.Memory 803 may include volatile memory, such as non-volatile dynamic random is deposited Take memory (nonvolatile random access memory, NVRAM), phase change random access memory (phase Change RAM, PRAM), magnetic-resistance random access memory (magetoresistive RAM, MRAM) etc., can also include non- Volatile memory, for example, at least a disk memory, Electrical Erasable programmable read only memory (electrically Erasable programmable read-only memory, EEPROM), flush memory device, such as anti-or flash memory (NOR Flash memory) or anti-and flash memory (NAND flash memory), semiconductor devices, such as solid state hard disk (solid State disk, SSD) etc..Memory 803 optionally can also be that at least one is located remotely from the storage of aforementioned processor 801 Device.Batch processing code can also be optionally stored in memory 803, and storage optionally can also be performed in processor 801 Performed program in device 803.
When detecting to the progress differencing check failure of multiple data blocks, the difference packet for difference upgrading is obtained, it is described Difference packet includes differential data, determines the cryptographic Hash of each data block in the multiple data block in electronic equipment, Yi Jicong The Hash of each data block of the multiple data block of original version is obtained in the difference packet or the Hash tree at mirror image end Value;
Determine the first data block in the multiple data block that the difference packet is included the first cryptographic Hash, with it is described Whether the second cryptographic Hash of the first data block in the multiple data block in electronic equipment is identical;
If not identical, the Forward Error Correction FEC functional interface of User space is called, to the abnormal number in first data block First data block is written according to progress error correction, and by the correct data after error correction;If they are the same, then in the multiple data block Other data blocks carry out differencing check;
When the success of the multiple data block complete verification, the multiple data block is risen using the differential data Grade.
Optionally, processor 801 is also used to perform the following operations:
Using the error correcting code of first data block, error correction is carried out to the abnormal data in first data block
Optionally, processor 801 is also used to perform the following operations:
The value range of the multiple data block is read from the difference packet;According to the value range of the multiple data block, The cryptographic Hash of each data block in the multiple data block is searched from the Hash tree at the mirror image end.
Optionally, processor 801 is also used to perform the following operations:
In the case where restoring recovery mode, the Forward Error Correction FEC functional interface of User space is called, to first data block In abnormal data carry out error correction, and first data block is written into the correct data after error correction, wherein the recovery Mode is the mode modified to the data when electronic equipment or system.
Wherein, the multiple data block is the file in the data block or file system in memory device.
Further, processor can also be matched with memory and communication interface, be executed electric in above-mentioned application embodiment The operation of sub- equipment.
The embodiment of the present application also provides a kind of processors, for coupling with memory, for executing the various embodiments described above Any means and function of electronic equipment involved in middle any embodiment.
The embodiment of the present application also provides a kind of computer program products comprising instruction, when running on computers, So that computer executes any means and function of electronic equipment involved in any embodiment in the various embodiments described above.
The embodiment of the present application also provides a kind of devices, for executing electricity involved in any embodiment in the various embodiments described above Any means and function of sub- equipment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid state disk (SSD)) etc..
Above-described specific embodiment has carried out further the purpose of the application, technical scheme and beneficial effects It is described in detail.Within the spirit and principles of this application, any modification, equivalent replacement, improvement and so on should be included in Within the protection scope of the application.

Claims (13)

1. a kind of difference upgrade method characterized by comprising
When detecting to the progress differencing check failure of multiple data blocks, the difference packet for difference upgrading, the difference are obtained Packet includes differential data, determines the cryptographic Hash of each data block in the multiple data block in electronic equipment, and from described The cryptographic Hash of each data block of the multiple data block of original version is obtained in difference packet or the Hash tree at mirror image end;
Determine the first data block in the multiple data block that the difference packet is included the first cryptographic Hash, with the electronics Whether the second cryptographic Hash of the first data block in the multiple data block in equipment is identical;
If not identical, call the Forward Error Correction FEC functional interface of User space, to the abnormal data in first data block into Row error correction, and first data block is written into the correct data after error correction;If they are the same, then to its in the multiple data block He verifies data block;
When the success of the multiple data block complete verification, the multiple data block is upgraded using the differential data.
2. the method as described in claim 1, which is characterized in that the difference packet or the mirror image end include error correcting code, and one A corresponding error correcting code of the data block;The Forward Error Correction FEC functional interface for calling User space, to described first Abnormal data in data block carries out error correction
Using the error correcting code of first data block, error correction is carried out to the abnormal data in first data block.
3. method according to claim 1 or 2, which is characterized in that the difference packet includes the range of the multiple data block Value;Each data of the multiple data block that original version is obtained from the Hash tree at the difference packet or mirror image end The cryptographic Hash of block includes:
The value range of the multiple data block is read from the difference packet;
According to the value range of the multiple data block, searched from the Hash tree at the mirror image end every in the multiple data block The cryptographic Hash of a data block.
4. the method according to claim 1, which is characterized in that the Forward Error Correction FEC function for calling User space Energy interface carries out error correction to the abnormal data in first data block, and the correct data after error correction is written described first Data block includes:
In the case where restoring recovery mode, the Forward Error Correction FEC functional interface of User space is called, in first data block Abnormal data carries out error correction, and first data block is written in the correct data after error correction, wherein the recovery mode For the mode modified to the data when electronic equipment or system.
5. method according to any of claims 1-4, which is characterized in that the multiple data block is the number in memory device According to the file in block or file system.
6. a kind of difference update device, which is characterized in that described device includes:
Module is obtained, for obtaining the difference for difference upgrading when detecting to the progress differencing check failure of multiple data blocks Subpackage, the difference packet includes differential data, determines the Hash of each data block in the multiple data block in electronic equipment Value, and from the Hash tree at the difference packet or mirror image end obtain original version the multiple data block each data The cryptographic Hash of block;
Determining module, for determining the first Hash of the first data block in the multiple data block that the difference packet is included It is worth, is whether identical as the second cryptographic Hash of the first data block in the multiple data block in the electronic equipment;
Processing module, if the Forward Error Correction FEC functional interface of User space is called, to first data block for not identical In abnormal data carry out error correction, and first data block is written into the correct data after error correction;If they are the same, then to described more Other data blocks in a data block are verified;
Upgraded module is used for when the success of the multiple data block complete verification, using the differential data to the multiple number Upgraded according to block.
7. device as claimed in claim 6, which is characterized in that the difference packet or the mirror image end include error correcting code, and one A corresponding error correcting code of the data block;
The processing module is also used for the error correcting code of first data block, to the abnormal number in first data block According to progress error correction.
8. device as claimed in claims 6 or 7, which is characterized in that the difference packet includes the range of the multiple data block Value;
The acquisition module is also used to read the value range of the multiple data block from the difference packet;According to the multiple The value range of data block searches the Hash of each data block in the multiple data block from the Hash tree at the mirror image end Value.
9. such as the described in any item devices of claim 6-8, which is characterized in that
The processing module is also used in the case where restoring recovery mode, calls the Forward Error Correction FEC functional interface of User space, Error correction is carried out to the abnormal data in first data block, and first data block is written into the correct data after error correction, Wherein, the recovery mode is the mode modified to the data when electronic equipment or system.
10. device according to any one of claims 1-4, which is characterized in that the multiple data block is in memory device File in data block or file system.
11. a kind of electronic equipment characterized by comprising memory, communication bus and processor, wherein the memory For storing program code, the processor is required described in any one of 1-5 for calling said program code for perform claim Method.
12. a kind of computer readable storage medium, which is characterized in that instruction is stored in the computer readable storage medium, When run on a computer, so that computer perform claim requires the described in any item methods of 1-5.
13. a kind of computer program product comprising instruction, which is characterized in that when run on a computer, so that calculating Machine perform claim requires the described in any item methods of 1-5.
CN201910693020.4A 2019-07-26 2019-07-26 Differential upgrading method and related equipment Active CN110515646B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910693020.4A CN110515646B (en) 2019-07-26 2019-07-26 Differential upgrading method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910693020.4A CN110515646B (en) 2019-07-26 2019-07-26 Differential upgrading method and related equipment

Publications (2)

Publication Number Publication Date
CN110515646A true CN110515646A (en) 2019-11-29
CN110515646B CN110515646B (en) 2022-03-25

Family

ID=68624128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910693020.4A Active CN110515646B (en) 2019-07-26 2019-07-26 Differential upgrading method and related equipment

Country Status (1)

Country Link
CN (1) CN110515646B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286564A (en) * 2020-10-22 2021-01-29 上海艾拉比智能科技有限公司 Differential upgrade algorithm for binary system files of IOT (input/output) equipment
CN112527370A (en) * 2020-12-04 2021-03-19 成都中科慧源科技有限公司 Method for remotely and differentially upgrading Internet of things equipment
CN112631633A (en) * 2021-01-07 2021-04-09 南方电网数字电网研究院有限公司 Function module upgrading method and device based on double-core intelligent electric meter
CN113590168A (en) * 2021-07-29 2021-11-02 百度在线网络技术(北京)有限公司 Embedded equipment upgrading method, device, equipment, medium and program product
CN113791814A (en) * 2021-08-24 2021-12-14 福建魔方电子科技有限公司 Method, device, equipment and medium for updating production presets on Android platform
CN115499093A (en) * 2022-08-01 2022-12-20 北京北方联星科技有限公司 SBAS signal non-decoding frame synchronization method based on FEC coding
WO2024066523A1 (en) * 2022-09-29 2024-04-04 华为技术有限公司 Check method and apparatus
CN115499093B (en) * 2022-08-01 2024-05-24 北京北方联星科技有限公司 SBAS signal non-decoding frame synchronization method based on FEC coding

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634938A (en) * 2009-08-20 2010-01-27 成都市华为赛门铁克科技有限公司 Data migration method and data migration device of solid state disk and solid state disk
CN102081536A (en) * 2010-12-30 2011-06-01 华为终端有限公司 Method for updating increment, and server
CN103729225A (en) * 2014-01-22 2014-04-16 中国人民解放军国防科学技术大学 Content-defined chunking remote file real-time updating method
CN104184543A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Data transmission method, device and system
CN104503801A (en) * 2014-12-30 2015-04-08 北京奇虎科技有限公司 Software updating instruction distributing method, communication server and terminal device
US20150339113A1 (en) * 2013-05-10 2015-11-26 Box, Inc. Identification and handling of items to be ignored for synchronization with a cloud-based platform by a synchronization client
CN105138347A (en) * 2015-07-17 2015-12-09 广东欧珀移动通信有限公司 Difference upgrade patch generating method, software upgrading method and corresponding apparatus
CN107409020A (en) * 2015-03-02 2017-11-28 高通股份有限公司 Fast radio link with low delay transmission controls Fault recovery

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634938A (en) * 2009-08-20 2010-01-27 成都市华为赛门铁克科技有限公司 Data migration method and data migration device of solid state disk and solid state disk
CN102081536A (en) * 2010-12-30 2011-06-01 华为终端有限公司 Method for updating increment, and server
US20150339113A1 (en) * 2013-05-10 2015-11-26 Box, Inc. Identification and handling of items to be ignored for synchronization with a cloud-based platform by a synchronization client
CN104184543A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Data transmission method, device and system
CN103729225A (en) * 2014-01-22 2014-04-16 中国人民解放军国防科学技术大学 Content-defined chunking remote file real-time updating method
CN104503801A (en) * 2014-12-30 2015-04-08 北京奇虎科技有限公司 Software updating instruction distributing method, communication server and terminal device
CN107409020A (en) * 2015-03-02 2017-11-28 高通股份有限公司 Fast radio link with low delay transmission controls Fault recovery
CN105138347A (en) * 2015-07-17 2015-12-09 广东欧珀移动通信有限公司 Difference upgrade patch generating method, software upgrading method and corresponding apparatus

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286564A (en) * 2020-10-22 2021-01-29 上海艾拉比智能科技有限公司 Differential upgrade algorithm for binary system files of IOT (input/output) equipment
CN112527370A (en) * 2020-12-04 2021-03-19 成都中科慧源科技有限公司 Method for remotely and differentially upgrading Internet of things equipment
CN112631633A (en) * 2021-01-07 2021-04-09 南方电网数字电网研究院有限公司 Function module upgrading method and device based on double-core intelligent electric meter
CN113590168A (en) * 2021-07-29 2021-11-02 百度在线网络技术(北京)有限公司 Embedded equipment upgrading method, device, equipment, medium and program product
CN113590168B (en) * 2021-07-29 2024-03-01 百度在线网络技术(北京)有限公司 Method, device, equipment, medium and program product for upgrading embedded equipment
CN113791814A (en) * 2021-08-24 2021-12-14 福建魔方电子科技有限公司 Method, device, equipment and medium for updating production presets on Android platform
CN113791814B (en) * 2021-08-24 2024-03-26 福建魔方电子科技有限公司 Method, device, equipment and medium for updating production presets on Android platform
CN115499093A (en) * 2022-08-01 2022-12-20 北京北方联星科技有限公司 SBAS signal non-decoding frame synchronization method based on FEC coding
CN115499093B (en) * 2022-08-01 2024-05-24 北京北方联星科技有限公司 SBAS signal non-decoding frame synchronization method based on FEC coding
WO2024066523A1 (en) * 2022-09-29 2024-04-04 华为技术有限公司 Check method and apparatus

Also Published As

Publication number Publication date
CN110515646B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN110515646A (en) A kind of difference upgrade method and relevant device
CN110109695B (en) Patch method, related device and system
CN113498124B (en) SIM card and eSIM card switching method and electronic equipment
CN110347269A (en) A kind of sky mouse mode implementation method and relevant device
CN110633090B (en) Patch method, related device and system
CN112468979B (en) SIM card drop recovery method of electronic equipment and electronic equipment
WO2022089000A1 (en) File system check method, electronic device, and computer readable storage medium
CN111865646A (en) Terminal upgrading method and related device
CN113704205A (en) Log storage method, chip, electronic device and readable storage medium
CN115589051B (en) Charging method and terminal equipment
CN111104295A (en) Method and equipment for testing page loading process
CN112667306A (en) Method, device and storage medium for installing plug-in
CN111249728B (en) Image processing method, device and storage medium
CN110806994B (en) Signal transmission method and device
CN113901485B (en) Application program loading method, electronic device and storage medium
WO2022022466A1 (en) Method and apparatus for determining file storage position, and terminal
CN114780029A (en) Device identification method and related device
CN114443109A (en) Patch repair method, electronic device, and storage medium
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN114690849A (en) Clock skew determination method, device and storage medium
CN114816973A (en) Method and device for debugging codes, electronic equipment and readable storage medium
CN114153638A (en) Application exception exit repairing method and device and electronic equipment
CN114077519A (en) System service recovery method and device and electronic equipment
CN115952564B (en) Data writing method and terminal equipment
CN114117455B (en) Safe starting method of electronic equipment and electronic 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