CN116048562B - Data updating method, electronic equipment and storage medium - Google Patents

Data updating method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116048562B
CN116048562B CN202210603491.3A CN202210603491A CN116048562B CN 116048562 B CN116048562 B CN 116048562B CN 202210603491 A CN202210603491 A CN 202210603491A CN 116048562 B CN116048562 B CN 116048562B
Authority
CN
China
Prior art keywords
data
data index
electronic equipment
index
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210603491.3A
Other languages
Chinese (zh)
Other versions
CN116048562A (en
Inventor
罗熙沛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210603491.3A priority Critical patent/CN116048562B/en
Publication of CN116048562A publication Critical patent/CN116048562A/en
Application granted granted Critical
Publication of CN116048562B publication Critical patent/CN116048562B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • 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)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data updating method, electronic equipment and a storage medium, which relate to the technical field of data updating, and can read data corresponding to a modified data index after an operating system of the electronic equipment is updated to a new version; the method comprises the following steps: after the electronic equipment detects a starting instruction, the electronic equipment acquires the corresponding relation between the second data index and the third data index in the configuration file, and judges whether the first data information comprises a first data index identical to the second data index; if the first data information comprises a first data index which is the same as the second data index, the electronic equipment adopts a third data index which corresponds to the second data index in the configuration file to replace the first data index which is the same as the second data index in the first data information; then, the electronic device may read the first data corresponding to the third data index according to the third data index.

Description

Data updating method, electronic equipment and storage medium
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a data updating method, an electronic device, and a storage medium.
Background
Currently, an electronic device (such as a mobile phone) needs to install an operating system (such as iOS system and Android system) so as to be used by a user. Taking an operating system as an Android system as an example, most data in the Android system is stored in a settings database, so that the purposes of permanently storing the data and sharing the data among various applications can be achieved.
The setting database stores data in a key-value form, so that the electronic device can read the value data corresponding to the key through the key. However, when the operating system of the electronic device is upgraded, the keys in the settings database need to be modified according to different application scenarios. In this way, after the operating system of the electronic device is upgraded to a new version, the modified key may not correspond to the value data.
Disclosure of Invention
The embodiment of the application provides a data updating method, electronic equipment and a storage medium, which can read data corresponding to a modified data index after an operating system of the electronic equipment is updated to a new version.
The embodiment of the application adopts the following technical scheme:
in a first aspect, a data updating method is provided, and is applied to an electronic device, wherein the electronic device stores first data information, and the first data information comprises a plurality of first data indexes and first data corresponding to each first data index; the first data are user data generated in the running process of the electronic equipment; the method comprises the following steps: after the electronic equipment detects a starting instruction, the electronic equipment acquires a configuration file; the configuration file comprises a corresponding relation between a second data index and a third data index provided by each first APK in a plurality of first application packages APK of the electronic equipment, wherein the second data index is a data index before the upgrade of an operating system of the electronic equipment, and the third data index is a data index after the upgrade of the operating system; the electronic equipment judges whether the first data information comprises a first data index which is the same as the second data index; if the first data information comprises a first data index which is the same as the second data index, the electronic equipment adopts a third data index which corresponds to the second data index in the configuration file to replace the first data index which is the same as the second data index in the first data information; the replaced first data information comprises a third data index and first data corresponding to the third data index; when the electronic equipment receives an access request comprising the third data index, the electronic equipment reads corresponding first data from the first data information according to the third data index.
Based on the first aspect, the electronic device obtains the corresponding relation between the second data index and the third data index in the configuration file, when the electronic device determines that the first data index which is the same as the second data index exists in the first data information, that is, the first data information stores the unmodified data index (that is, the old key); subsequently, the electronic equipment replaces the first data index which is the same as the second data index according to the third data index which corresponds to the second data index in the configuration file, so that the replaced first data information comprises the third data index (namely a new key) and the first data which corresponds to the third data index; thus, when the electronic device receives the access request including the third data index, the electronic device may read the corresponding first data from the first data information according to the third data index.
In an implementation manner of the first aspect, the determining, by the electronic device, whether the first data information includes a first data index that is the same as the second data index includes: the electronic device traverses each second data index in the configuration file and judges whether the first data information comprises a first data index which is the same as the second data index.
In an implementation manner of the first aspect, the first data information further includes a plurality of fourth data indexes and second data corresponding to each fourth data index; the second data is not user data generated during operation of the electronic device; before the electronic device obtains the configuration file, the method further comprises: when the electronic equipment detects a starting instruction, the electronic equipment updates the data index of each second data in the first data information.
In one implementation manner of the first aspect, the method further includes: the electronic equipment upgrades the operating system so as to update the second data index of the user data generated in the running process of the electronic equipment into a third data index; generating a configuration file by the electronic equipment in the process of upgrading the operating system; wherein the configuration file includes a second data index and a third data index.
In one implementation manner of the first aspect, the method further includes: the electronic equipment acquires a fifth data index and a sixth data index provided by the second APK; the fifth data index is a data index before the first data in the second APK is updated, and the sixth data index is a data index after the first data in the second APK is updated; and the electronic equipment updates the configuration file by adopting the fifth data index and the sixth data index provided by the second APK.
In an implementation manner of the first aspect, after the electronic device detects the power-on instruction, the electronic device obtains a configuration file, including: after the electronic equipment detects a starting instruction, the electronic equipment judges whether the electronic equipment is started for the first time after the operating system is upgraded; if the electronic equipment is started for the first time after the operating system is upgraded, the electronic equipment acquires a configuration file.
In an implementation manner of the first aspect, after the electronic device detects the power-on instruction, the electronic device obtains a configuration file, including: after the electronic equipment detects a starting instruction, the electronic equipment judges whether the version information of the electronic equipment is smaller than preset version information or not; if the version information of the electronic equipment is smaller than the preset version information, the electronic equipment acquires the configuration file.
In a second aspect, an electronic device is provided, which has the functionality to implement the method described in the first aspect. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a third aspect, an electronic device is provided that includes a display screen, a memory, and one or more processors; the display screen, the memory and the processor are coupled; the memory is for storing computer program code, the computer program code comprising computer instructions; the memory stores first data information, wherein the first data information comprises a plurality of first data indexes and first data corresponding to each first data index; the first data are user data generated in the running process of the electronic equipment; the computer instructions, when executed by the processor, cause the electronic device to perform the steps of: after the electronic equipment detects a starting instruction, the electronic equipment acquires a configuration file; the configuration file comprises a corresponding relation between a second data index and a third data index provided by each first APK in a plurality of first application packages APK of the electronic equipment, wherein the second data index is a data index before the upgrade of an operating system of the electronic equipment, and the third data index is a data index after the upgrade of the operating system; the electronic equipment judges whether the first data information comprises a first data index which is the same as the second data index; if the first data information comprises a first data index which is the same as the second data index, the electronic equipment adopts a third data index which corresponds to the second data index in the configuration file to replace the first data index which is the same as the second data index in the first data information; the replaced first data information comprises a third data index and first data corresponding to the third data index; when the electronic equipment receives an access request comprising the third data index, the electronic equipment reads corresponding first data from the first data information according to the third data index.
In one possible design of the third aspect, the computer instructions, when executed by the processor, cause the electronic device to specifically perform the steps of: the electronic device traverses each second data index in the configuration file and judges whether the first data information comprises a first data index which is the same as the second data index.
In one possible design of the third aspect, the first data information further includes a plurality of fourth data indexes and second data corresponding to each fourth data index; the second data is not user data generated during operation of the electronic device; before the electronic device obtains the configuration file, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: when the electronic equipment detects a starting instruction, the electronic equipment updates the data index of each second data in the first data information.
In one possible design of the third aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: the electronic equipment upgrades the operating system so as to update the second data index of the user data generated in the running process of the electronic equipment into a third data index; generating a configuration file by the electronic equipment in the process of upgrading the operating system; wherein the configuration file includes a second data index and a third data index.
In one possible design of the third aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: the electronic equipment acquires a fifth data index and a sixth data index provided by the second APK; the fifth data index is a data index before the first data in the second APK is updated, and the sixth data index is a data index after the first data in the second APK is updated; and the electronic equipment updates the configuration file by adopting the fifth data index and the sixth data index provided by the second APK.
In one possible design of the third aspect, the computer instructions, when executed by the processor, cause the electronic device to specifically perform the steps of: after the electronic equipment detects a starting instruction, the electronic equipment judges whether the electronic equipment is started for the first time after the operating system is upgraded; if the electronic equipment is started for the first time after the operating system is upgraded, the electronic equipment acquires a configuration file.
In one possible design of the third aspect, the computer instructions, when executed by the processor, cause the electronic device to specifically perform the steps of: after the electronic equipment detects a starting instruction, the electronic equipment judges whether the version information of the electronic equipment is smaller than preset version information or not; if the version information of the electronic equipment is smaller than the preset version information, the electronic equipment acquires the configuration file.
In a fourth aspect, there is provided a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of the first aspects above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of the first aspects above.
The technical effects of any one of the design manners of the second aspect to the fifth aspect may be referred to the technical effects of the different design manners of the first aspect, and will not be repeated here.
Drawings
Fig. 1 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an operation partition of an operating system according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a data updating method according to an embodiment of the present application;
fig. 4 is a second flow chart of a data updating method according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a data updating method according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a data updating method according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the solution of the present embodiment of the present application, the technical solution of the present embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiment of the present application, and it is apparent that the described embodiment is only a part of the embodiment of the present application, not all the embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, shall fall within the scope of the application.
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The data updating method of the operating system provided by the embodiment of the application can be applied to electronic equipment, wherein the electronic equipment can be, for example, a mobile phone, a tablet personal computer, a handheld computer, a personal computer (personal computer, PC), a cellular phone, a personal digital assistant (personal digital assistant, PDA), a wearable device and the like. The embodiment of the application does not limit the specific form of the electronic equipment.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 1, the electronic device 100 may include: processor 110, external memory interface 120, internal memory 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 module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, etc.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, electronic device 100 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 110 may include one or more processing units, such as: the processor 110 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 memory, 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.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
The memory is used for storing instructions and data. In some embodiments, the memory may be a random access memory (random access memory, RAM), a read-only memory (ROM), a universal flash memory (universal flash storage, UFS), an embedded multimedia card (embedded multi media card, eMMC), a NAND flash memory, a Solid State Disk (SSD) or solid state drive, a mechanical hard disk, or the like.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 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 connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device. In other embodiments, the electronic device may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image 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. In some embodiments, the electronic device may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, and so on.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of electronic devices can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110. The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The external memory interface 120 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. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, audio, video, etc. files are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device and data processing by executing instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may include a storage program area and a storage data area by executing instructions stored in the internal memory 121.
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 (e.g., audio data, phonebook, etc.), and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device. The electronic device may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, the electronic device may include more or less components than illustrated, 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 hardware and software.
FIG. 2 is a schematic diagram of an operating system partition according to an embodiment of the present application, and exemplary, as shown in FIG. 2, the operating system includes: base partitions (e.g., common partitions), user data partitions (Userdata), and system partitions. The basic partition stores system data information which does not participate in the upgrade of the operating system. The user data partition is used for storing personal data information of the user, such as APP installed by the user, pictures, documents, videos and the like stored by the user. The system partition is used for storing the system data information of the operating system, and the operating system upgrade is to upgrade the system data information in the system partition.
For example, each time the electronic device is powered on, the electronic device updates (or loads) the system data information stored in the system partition of the operating system to a database (e.g., settings database) of the electronic device. Wherein the settings database may be disposed in a memory of the electronic device shown in fig. 1, such as a read only memory ROM; or the settingdatabase may be disposed in other memories of the electronic device, which is not limited by the embodiments of the present application.
In some embodiments, the electronic device may also modify the system data information loaded into the settings database by user operations while the user is using the electronic device. Wherein the modified system data information may be referred to as user data information. That is, the settings database may hold system data information or user data information.
It should be noted that the settings database is data information for storing data in the form of key-value; in each data information, the key is a data index corresponding to system data (or user data). The value is a value corresponding to system data (or user data).
The process of updating system data in a system partition to a settings database by an electronic device is described in detail below with reference to the accompanying drawings.
Firstly, the system data information is preset in a system partition of an operating system before the electronic equipment leaves the factory, and when the electronic equipment leaves the factory for the first time (or called first time), the electronic equipment updates the system data information preset in the system partition into a settings database.
For easy understanding, in the embodiment of the present application, the system data information preset in the system partition of the operating system may be referred to as initial data information when the electronic device is first powered on after leaving the factory. After leaving the factory, the system data information preset in the system partition of the operating system except for each startup after the first startup of the electronic equipment is called first data information.
In other words, when the electronic device is first powered on after leaving the factory, the electronic device updates the initial data information stored in the system partition of the operating system into the settings database. When the electronic equipment is started up for each time after the electronic equipment is started up for the first time, the electronic equipment updates the first data information stored in the system partition of the operating system into the settings database.
Fig. 3 is a schematic flow chart of data updating according to an embodiment of the present application. For example, as shown in fig. 3, when the electronic device is turned on for the first time after leaving the factory, the process of updating the initial data information stored in the system partition of the operating system to the settings database by the electronic device may be implemented by the following steps.
S201, the electronic equipment acquires initial data information.
In some embodiments, the initial data information may be saved under a target path of the operating system. Illustratively, the target path may be settingdefault.
Wherein the initial data information is stored in the form of an extensible markup language (extensible markup language, XML) file under the settings_defaults. That is, the XML file with the initial data information stored under the settingdefaults.
In some embodiments, the electronic device may parse the XML file according to the settingdefault. The initial data information includes a plurality of data indexes (keys) and initial data (value) corresponding to each data index.
S202, the electronic equipment writes the initial data information into a first database.
In some embodiments, the first database may be default settings.
It will be appreciated that the initial data information is stored in the first database in the form of key-value.
Illustratively, the plurality of initial data information stored in the first database is as follows:
<resources>
<!--2021-09-17 15:11:32,000-->
<integer accelerometer_rotation=“1”/>
<!--2021-09-17 15:11:32,000-->
<string app_name_two_lines=“true”/>
<!--2021-09-17 15:11:32,000-->
<stringcust_qs_tile_rules=“full#add:amVowifi_19,amVowifi2_20@lite#add:amVowifi_19,amVowifi2_20”/>
<!--2021-09-17 15:11:32,000-->
<string custom_number_delete_bracket=“true”/>
<!--2021-09-17 15:11:32,000-->
<string default_signature_enable=“true”/>
<!--2021-09-17 15:11:32,000-->
<string dialpad_touch_tone_type=“0”/>
<!--2021-09-17 15:11:32,000-->
<string email_convertable=“true”/>
<!--2021-09-17 15:11:32,000-->
<string email_signature_cust_string=“$STR$#mk”/>
<!--2021-09-17 15:11:32,000-->
</resources>
taking the above-mentioned < integer accelerometer _rotation= "1"/>, as an example, in the initial data information, the data index is integer accelerometer _rotation, and the initial data is 1.
The foregoing is merely illustrative of the initial data information stored in the first database, and is not meant to limit the present application.
S203, the electronic equipment writes the initial data information into the second database.
In some embodiments, the second database may be settingdb, i.e., settingdb in the above embodiments.
It will be appreciated that the initial data information is stored in the second database in the form of key-value.
It should be noted that, when the electronic device is turned on for the first time after leaving the factory, the plurality of initial data information stored in the first database is the same as the plurality of initial data information stored in the second database. For an illustration of the plurality of initial data information stored in the second database, reference may be made to the above embodiment, and details are not repeated here.
In some embodiments, the second database is partitioned with a plurality of data partitions, and partition identifications (tables) of the initial data information stored in each data partition are different. Taking the example of the second database being partitioned with three data partitions, the three data partitions may include, for example: settingsystem. Xml, settingsecurity. Xml, settingglobal.
Wherein the settingsystem xml may store data information of all users, such as data information of all users of the system, data information of all users of the third party application, and the like. settingjsecure.xml may hold data information of a user having storage rights, such as data information of a user having storage rights and being a system; the user of the third party application does not have the storage authority of the data partition, namely, the settingjsecure.xml cannot store the data information of the user of the system without the storage authority, and cannot store the data information of the user of the third party application. settingglobal xml can hold data information for all users of the system. The user of the third party application does not have the storage authority of the data partition, namely, the settingglobal. Xml cannot store the data information of the user of the third party application.
In some embodiments, each of the plurality of initial data information further includes a partition identification for the electronic device to save the initial data information in a corresponding data partition.
Taking the initial data information as < integer accelerometer _rotation= "1"/> asan example, for illustration, in the case where the initial data information includes partition identification, the initial data may be, for example, < integer accelerometer _rotation= "1" table= "global"/>. Wherein the partition of the initial data information is identified as global. Based on this, the electronic device can write the initial data information into the data partition set_global.xml according to the partition identification of the initial data information.
In some embodiments, individual application packages (android application package, APK) in the electronic device may share the read after the electronic device writes the initial data information to the second database. In other words, each APK in the electronic device may read, through a key, initial data corresponding to the key in the second database. Illustratively, the APK may read that the initial data corresponding to the key is "1" through the key= integer accelerometer _rotation. Subsequently, during the use of the electronic device, the electronic device may modify the initial data stored in the second database through the operation of the user. It should be appreciated that after the electronic device modifies the initial data stored in the second database by user operation, the modified initial data may be referred to as user data.
For example, taking the initial data information as < integer accelerometer _rotation= "1"/>, in the use process of the electronic device, the electronic device may modify the initial data to "0" through the operation of the user, and the modified initial data information is < integer accelerometer _rotation= "0"/>.
It should be appreciated that the modified initial data may be referred to as user data. On this basis, the APK in the electronic device reads that the user data corresponding to the key is "0" through the key= integer accelerometer _rotation.
In some embodiments, the state where the initial data information is a night upgrade is taken as an example, and illustratively, the initial data information is hw_system_light_upgrade_switch=0, that is, the initial state of the night upgrade is 0 (that is, the night upgrade is turned off). However, if the electronic device is in use, the electronic device updates the initial data information to hw_system_right_upgrade_switch=1 through the operation of the user, that is, the night upgrade state is 1 (that is, the night upgrade is turned on). It should be noted that, since the electronic device modifies the initial data through the operation of the user, the initial data is the user data.
S204, the electronic equipment calculates a hash value (hash) of the XML file under the target path, and stores the hash value of the XML file obtained through calculation.
In some embodiments, the electronic device takes the XML file as input, inputs the XML file into a preset algorithm model, and outputs a hash value corresponding to the XML file. Typically, hash values are represented by a string of a combination of letters and numbers.
The preset algorithm model has a function of calculating a hash value corresponding to the XML file. For an example of the preset algorithm model, reference may be made to related technologies, and details are not repeated in the embodiment of the present application.
In one implementation, if a plurality of initial data in the initial data information are stored under different target paths, in S204, the electronic device needs to calculate a hash value of the XML file under each of the plurality of target paths.
The hash values corresponding to the files having different contents are necessarily different. That is, even if the file names of the two files are the same, if the contents of the two files are different, the calculated hash values are different. Based on the above, at each power-on after the electronic device is powered on for the first time, whether the content of the XML file is modified can be determined by judging whether the hash value of the XML file changes. That is, when the hash value of the XML file changes at each power-on after the electronic device is first powered on, the electronic device determines that the content of the XML file is modified, that is, the system data stored in the system partition of the operating system is modified. If the hash value of the XML file is unchanged, the electronic device determines that the content of the XML file is not modified, i.e., the system data stored in the system partition of the operating system is not modified.
Based on the above, at each power-on after the electronic device is powered on for the first time, the electronic device can determine whether the content of the XML file is modified by determining whether the hash value of the XML file changes. If the content of the XML file is modified, the electronic equipment updates the modified XML file to the second database; if the content of the XML file is not modified, the electronic equipment is started normally, and the XML file is updated to the second database.
Fig. 4 is a schematic flow chart of data updating according to an embodiment of the present application. For example, as shown in fig. 4, the process of updating the system data information stored in the system partition of the operating system to the settings database by the electronic device at each power-on after the first power-on may be implemented by the following steps.
S301, the electronic device judges whether the hash value of the XML file under the target path changes.
In some embodiments, the electronic device may calculate a hash value of the XML file in the target path at each boot after the first boot, and compare the hash value of the XML file calculated in the first boot with the hash value of the XML file calculated in the first boot, so as to determine whether the hash value of the XML file in the target path changes.
For example, if the hash value of the XML file under the target path is unchanged, the electronic device is powered on normally, and the XML file does not need to be updated into the second database. If the hash value of the XML file under the target path changes, the electronic device executes S302.
In the embodiment of the present application, when the electronic device is first powered on after leaving the factory, the system data information stored in the operation partition of the operating system is referred to as initial data information. For convenience of distinction, the system data information stored in the operation partition of the operating system at each power-on of the electronic device after the first power-on is referred to as first data information.
In one implementation, if the plurality of first data information is stored in different target paths, in S301, the electronic device may traverse each target path and determine whether the hash value of the XML file in each target path changes.
S302, the electronic equipment acquires the first data information.
In some embodiments, the first data information may be saved under a target path of the operating system. Illustratively, the target path may be settingdefault.
The first data information is stored in the form of an XML file under the setting_defaults.xml path. That is, the XML file having the first data information stored in the settingdefault.
In some embodiments, the electronic device may parse the XML file according to the settingdefault. XML path to obtain the first data information. The first data information comprises a plurality of first data indexes and first data corresponding to each first data index.
S303, the electronic equipment traverses each first data index, and judges whether user data exist in the second database according to the first data index.
The electronic device traverses each first data index, and reads first data corresponding to the first data index from the first data information through the first data index key. If the electronic device can read the first data corresponding to the first data index from the first data information through the first data index key, and the first data corresponding to the first data index key is different from the initial data corresponding to the first data index key stored in the first database, the electronic device judges that the user data exists in the second database.
Accordingly, the electronic device traverses each first data index, and reads the first data corresponding to the first data index from the first data information through the first data index key. If the electronic equipment does not read the first data corresponding to the first data index from the first data information through the first data index key, the electronic equipment judges that the user data does not exist in the second database. Or if the electronic device can read the first data corresponding to the first data index from the first data information through the first data index key, and the first data corresponding to the first data index key is different from the initial data corresponding to the first data index key stored in the first database, the electronic device judges that the user data does not exist in the second database.
In some embodiments, when the electronic device determines that no user data is present in the second database, i.e., non-user data (or second data) is present in the second database. On the basis, the first data information stored in the second database also comprises a plurality of fourth data indexes and second data corresponding to each fourth data index, wherein the second data is not user data generated in the running process of the electronic equipment, namely, the second data is non-user data. Therefore, the electronic device can update the data index of each second data in the first data information, namely, update the fourth data index corresponding to each second data.
It should be noted that, in the embodiment of the present application, the electronic device may use an over-the-air technology (over the air technology, OTA) to upgrade the operating system. In general, when an operating system is upgraded by OTA, user data cannot be modified based on the principle of user data priority. That is, in the use process of the electronic device, if the electronic device modifies the initial data through the operation of the user, the modified initial data is the user data. In the embodiment of the application, the user data is preferentially protected based on the principle of user data priority, so that if the user data exists in the second database, the user data in the second database cannot be modified.
The requirement of the electronic equipment is different under different application scenes. Therefore, the APK in the electronic device needs to modify the first data index key of the second database (i.e. modify the old key to a new key) to meet the needs of the electronic device in different scenarios. As can be seen from the above embodiments, if the electronic device determines that the second database does not have the user data, the electronic device may modify the first data index key in the second database. Illustratively, the electronic device first updates the data index in the first database, and then the electronic device updates the first data index in the second database. That is, the electronic device updates the data index corresponding to the non-user data (or referred to as the second data) in the second database (e.g., updates the fourth data index corresponding to the second data) with respect to the non-user data.
However, if the electronic device determines that the user data exists in the second database, the user data is preferentially protected based on the principle of user data priority, so that the user data cannot be modified. I.e. the electronic device cannot modify the data index corresponding to the user data in the second database for the user data.
In this way, after the operating system of the electronic device is upgraded, since the data index corresponding to the user data in the second database is not modified, and the new key does not correspond to the user data, the electronic device cannot read the user data before the operating system is upgraded when receiving the access request including the new key.
Taking the switch state of the night upgrade as an example for illustration, the initial data information is hw_system_high_upgrade_switch=0, i.e. the initial state of the night upgrade is the off state. However, if the electronic device is in use, the electronic device updates the initial data information to hw_system_right_update_switch=1 through the operation of the user, that is, the night upgrade state is the on state. It should be noted that, since the electronic device modifies the initial data through the operation of the user, the initial data is the user data.
After that, if the APK of the electronic device modifies the key of the user data to be hn_system_high_upgrade_switch, after the operating system of the electronic device is upgraded, the new key does not correspond to the value before the operating system is upgraded because the user data cannot be modified, so that the electronic device cannot read the value of the historical version through the new key, that is, the electronic device cannot read the state of the night upgrade. In this case, the electronic device may default to the off state at night upgrade.
In some embodiments, the electronic device updates the data index of the user data generated during operation of the electronic device by upgrading the operating system in the presence of the user data in the second database. As shown in fig. 5, the data updating method provided by the embodiment of the present application further includes:
S304, after the electronic equipment detects a starting instruction, a configuration file is obtained.
The configuration file comprises a corresponding relation between a second data index and a third data index provided by each first APK in a plurality of first application packages APK of the electronic equipment, wherein the second data index is a data index before upgrading an operating system of the electronic equipment, and the third data index is a data index after upgrading the operating system. I.e. the second data index is the old key before the upgrade of the operating system of the electronic device, and the third data index is the new key after the upgrade of the operating system of the electronic device.
The electronic device analyzes the configuration file and obtains a corresponding relationship between the second data index and the third data index provided by each of the plurality of first application packages APK after the electronic device detects the start-up instruction.
The electronic device analyzes the configuration file, and the correspondence between the second data index and the third data index provided by each of the obtained first APKs in the plurality of first application packages APK is as follows:
<resources>
<HKeyUpdate value=“hn_alarm_list”scence=“hw_alarm_list”/>
<HKeyUpdate value=“hn_app_analytics_state”scence=“hw_app_analytics_state”/>
<HKeyUpdate value=“location_honor_ads”scence=“location_huawei_ads”table=“secure”/>
<HKeyUpdate value=“hn_full_ssid_name”scence=“hw_full_ssid_name”table=“system”/>
<HKeyUpdate value=“hn_nfc_url”scence=“hw_nfc_url”table=“global”/>
<resources>
it should be noted that the foregoing is merely illustrative of the parsed configuration file, and is not meant to limit the embodiments of the present application.
In some embodiments, when first data of each first APK in the plurality of APKs of the electronic device is updated, the electronic device generates a configuration file according to a second data index before updating the first data and a third data index after updating the first data according to each first APK, and stores the configuration file. That is, the electronic device stores the configuration file prior to the operating system upgrade.
In other embodiments, the electronic device generates the configuration file during an upgrade of the operating system. In an exemplary process, the electronic device collects a second data index and a third data index provided by each first APK in the plurality of APKs in the process of upgrading the operating system, and generates a configuration file.
And subsequently, before or during the process of upgrading the operating system, the electronic equipment updates the configuration file by adopting the fifth data index and the sixth data index provided by the second APK. The fifth data index is a data index before the first data in the second APK is updated, and the sixth data index is a data index after the first data in the second APK is updated.
The first APK and the second APK may be the same or different.
S305, the electronic device judges whether the first data information comprises a first data index which is the same as the second data index.
The electronic device reads first data corresponding to the second data index from the first data information through the second data index. If the electronic device can read the first data corresponding to the second data index from the first data information through the second data index, the electronic device judges that the first data index identical to the second data index is included in the first data information. If the electronic device does not read the first data corresponding to the second data index from the first data information through the second data index, the electronic device judges that the first data information does not comprise the first data index identical to the second data index.
Note that, the case where the first data information does not include the first data index identical to the second data index includes: one case is that the second data index does not have corresponding first data, i.e., the second data index key does not have corresponding first data value; another case is that the first data corresponding to the second data index is not modified, that is, the first data value corresponding to the second data index is non-user data.
In some embodiments, if the electronic device determines that the first data information includes the first data index identical to the second data index, the electronic device replaces the first data index identical to the second data index in the first data information with a third data index corresponding to the second data index in the configuration file.
The replaced first data information comprises a third data index and first data corresponding to the third data index.
For example, it is assumed that the first data information includes a first data index and first data corresponding to the first data index is: hw_system_right_upgrade_switch=1; the corresponding relation between the second data index and the third data index in the configuration information is as follows: hw_system_light_update_switch, hn_system_light_update_switch; on this basis, since the first data information includes the same first data index as the second data index, that is, the first data index hw_system_light_update_switch in the first data information is the same as the second data index hw_system_light_update_switch in the configuration file, the electronic device replaces the first data index in the first data information with the third data index hn_system_light_update_switch according to the third data index hn_system_light_update_switch corresponding to the second data index in the configuration file. At this time, the first data information includes the third data index and the first data corresponding to the third data index, that is, the first data information includes hn_system_light_update_switch=1.
And when the electronic equipment receives the access request comprising the third data index, the electronic equipment reads corresponding first data from the first data information according to the third data index.
Illustratively, when the electronic device receives an access request including a third data index hn_system_high_update_switch, the electronic device reads the corresponding first data as "1" from the first data information according to the third data index.
In some embodiments, the electronic device traverses each second data index in the configuration file, determining whether the first data information includes the same first data index as the second data index.
The electronic device obtains a second data index, and determines whether the first data information includes a first data index identical to the second data index. If the first data information includes the first data index identical to the second data index, the electronic device re-acquires another second data index, and judges whether the first data information includes the first data index identical to the second data index or not until all the second data indexes in the configuration file are judged.
Correspondingly, the electronic equipment acquires a second data index and judges whether the first data information comprises a first data index identical to the second data index. If the first data information does not include the first data index which is the same as the second data index, the electronic device re-acquires the other second data index, and judges whether the first data information includes the first data index which is the same as the second data index or not until all the second data indexes in the configuration file are judged.
In some embodiments, after the electronic device parses the configuration file, the configuration file includes a correspondence between the second data index, the third data index, and the partition identifier. On the basis, the electronic device can judge whether the first data information comprises the first data index identical to the second data index according to the partition identification included in the configuration file. For example, assuming that the partition identifier is table= "secure", the electronic device may determine whether the first data index identical to the second data index is included in the data partition set_secure.xml according to the partition identifier.
In summary, the electronic device obtains the correspondence between the second data index and the third data index in the configuration file, and when the electronic device determines that the first data index identical to the second data index exists in the first data information, that is, the first data information stores the unmodified data index (i.e., the old key); subsequently, the electronic equipment replaces the first data index which is the same as the second data index according to the third data index which corresponds to the second data index in the configuration file, so that the replaced first data information comprises the third data index (namely a new key) and the first data which corresponds to the third data index; thus, when the electronic device receives the access request including the third data index, the electronic device may read the corresponding first data from the first data information according to the third data index.
Taking into account the first boot after the electronic device is upgraded for the operating system; or when the version information of the electronic device is smaller than the preset version information, the electronic device needs to modify the first data index (i.e. the old key) included in the first data information.
In one implementation, if the electronic device needs to modify the first data index (i.e., the old key) included in the first data information, the electronic device will modify the first data index (i.e., the old key) included in the first data information when the electronic device is first powered on after upgrading the operating system. Based on this, if the electronic device is not first powered on after the operating system is upgraded, that is, the electronic device may have completed modifying the first data index, so the electronic device will not modify the first data index again.
In another implementation, for the electronic device of the new version (i.e., the version information is greater than or equal to the preset version information), the modification of the first data index is already completed when the electronic device is first powered on after leaving the factory. Therefore, if the electronic device is a new version, the electronic device will not modify the first data index again.
Based on this, in some embodiments, as shown in fig. 6, before the electronic device obtains the configuration file, the method further includes:
S3031, the electronic equipment judges whether the electronic equipment is started for the first time after the operation system is upgraded; or the electronic equipment judges whether the version information of the electronic equipment is smaller than the preset version information.
The preset version information may be, for example, an S version, or the preset version information may be, for example, version 6.0. The embodiment of the present application is not limited thereto.
The electronic device may determine whether the electronic device is first powered on after the operating system is upgraded by calling an interface packagermanagerex. The electronic equipment can acquire version information of the electronic equipment when leaving the factory through the ro.product.first_api_level configuration item.
In some embodiments, if the electronic device determines that the electronic device is first powered on after the operating system is upgraded; or the electronic equipment judges that the version information of the electronic equipment is smaller than the preset version information, and the electronic equipment acquires the corresponding relation between the second data index and the third data index in the configuration file, when the electronic equipment judges that the first data index which is the same as the second data index exists in the first data information, namely the first data information stores an unmodified data index (namely an old key); and then, the electronic equipment replaces the first data index which is the same as the second data index according to the third data index which corresponds to the second data index in the configuration file, so that the replaced first data information comprises the third data index (namely a new key) and the first data which corresponds to the third data index.
Correspondingly, if the electronic equipment judges that the electronic equipment is not the first startup after the operation system is upgraded; or the electronic device judges that the version information of the electronic device is larger than or equal to the preset version information, the electronic device does not need to repeatedly modify the first data index included in the first data information, and the power consumption of the electronic device can be effectively reduced.
An embodiment of the application provides an electronic device, which may include a display screen, a memory, and one or more processors; the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the functions or steps performed by the handset in the above-described embodiments. The structure of the electronic device may refer to the structure of the electronic device 100 shown in fig. 1.
Embodiments of the present application also provide a system on a chip 1800, as shown in FIG. 7, comprising at least one processor 1801 and at least one interface circuit 1802. The processor 1801 may be the processor 110 shown in fig. 1 in the foregoing embodiment. Interface circuit 1802 may be, for example, an interface circuit between processor 110 and external memory 120; or as an interface circuit between the processor 110 and the internal memory 121.
The processor 1801 and interface circuit 1802 described above may be interconnected by wires. For example, interface circuit 1802 may be used to receive signals from other devices (e.g., a memory of an electronic apparatus). For another example, interface circuit 1802 may be used to send signals to other devices (e.g., processor 1801). The interface circuit 1802 may, for example, read instructions stored in a memory and send the instructions to the processor 1801. The instructions, when executed by the processor 1801, may cause the electronic device to perform the steps performed by the handset 180 in the above embodiments. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
Embodiments of the present application also provide a computer readable storage medium, where the computer readable storage medium includes computer instructions, which when executed on an electronic device, cause the electronic device to perform the functions or steps performed by the electronic device in the above-described method embodiments.
Embodiments of the present application also provide a computer program product which, when run on a computer, causes the computer to perform the functions or steps performed by the electronic device in the method embodiments described above.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit 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.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method 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 random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should 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 (7)

1. The data updating method is characterized by being applied to electronic equipment, wherein first data information is stored in the electronic equipment, and the first data information comprises a plurality of first data indexes and first data corresponding to each first data index; the first data are user data generated in the running process of the electronic equipment; the method comprises the following steps:
after the electronic equipment detects a starting instruction, if the electronic equipment is started for the first time after the operating system is upgraded or the version information of the electronic equipment is smaller than the preset version information, the electronic equipment acquires a configuration file; the configuration file comprises a corresponding relation between a second data index and a third data index provided by each first application package APK of the plurality of first application packages APK of the electronic equipment, wherein the second data index is a data index before the upgrade of an operating system of the electronic equipment, and the third data index is a data index after the upgrade of the operating system;
The electronic equipment judges whether the first data information comprises a first data index which is the same as the second data index;
if the first data information comprises a first data index which is the same as the second data index, the electronic equipment replaces the first data index which is the same as the second data index in the first data information by adopting a third data index which is corresponding to the second data index in the configuration file; the replaced first data information comprises the third data index and first data corresponding to the third data index;
when the electronic equipment receives an access request comprising the third data index, the electronic equipment reads corresponding first data from the first data information according to the third data index.
2. The method of claim 1, wherein the electronic device determining whether the first data information includes a first data index that is the same as the second data index comprises:
the electronic equipment traverses each second data index in the configuration file and judges whether the first data information comprises a first data index identical to the second data index.
3. The method according to claim 1 or 2, wherein the first data information further comprises a plurality of fourth data indexes and second data corresponding to each fourth data index; the second data is not user data generated in the running process of the electronic equipment;
before the electronic device obtains the configuration file, the method further includes:
when the electronic equipment detects a starting instruction, the electronic equipment updates the data index of each second data in the first data information.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
the electronic equipment upgrades the operating system so as to update the second data index of the user data generated in the running process of the electronic equipment into the third data index;
the electronic equipment generates the configuration file in the process of upgrading the operating system; wherein the configuration file includes the second data index and the third data index.
5. The method according to claim 4, wherein the method further comprises:
the electronic equipment acquires a fifth data index and a sixth data index provided by a second APK; wherein the fifth data index is a data index before the first data in the second APK is updated, and the sixth data index is a data index after the first data in the second APK is updated;
And the electronic equipment updates the configuration file by adopting the fifth data index and the sixth data index provided by the second APK.
6. An electronic device, comprising: a display screen, a memory, and one or more processors; the display screen, the memory and the processor are coupled; the memory is used for storing computer program codes, and the computer program codes comprise computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the method of any of claims 1-5.
7. A computer-readable storage medium comprising computer instructions; the computer instructions, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-5.
CN202210603491.3A 2022-05-30 2022-05-30 Data updating method, electronic equipment and storage medium Active CN116048562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210603491.3A CN116048562B (en) 2022-05-30 2022-05-30 Data updating method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210603491.3A CN116048562B (en) 2022-05-30 2022-05-30 Data updating method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116048562A CN116048562A (en) 2023-05-02
CN116048562B true CN116048562B (en) 2023-10-27

Family

ID=86120560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210603491.3A Active CN116048562B (en) 2022-05-30 2022-05-30 Data updating method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116048562B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101743546A (en) * 2007-08-06 2010-06-16 国际商业机器公司 Hierarchical storage management for a file system providing snapshots
CN107315825A (en) * 2017-07-05 2017-11-03 北京奇艺世纪科技有限公司 A kind of index upgrade system, method and device
CN110109695A (en) * 2019-04-17 2019-08-09 华为技术有限公司 Patch method, relevant apparatus and system
CN112269853A (en) * 2020-11-16 2021-01-26 Oppo广东移动通信有限公司 Search processing method, search processing device and storage medium
CN112328275A (en) * 2020-10-10 2021-02-05 岭东核电有限公司 Data updating method and device for nuclear power plant, terminal equipment and storage medium
CN114116072A (en) * 2020-08-31 2022-03-01 华为技术有限公司 Shared library multiplexing method and electronic equipment
CN114153844A (en) * 2021-11-23 2022-03-08 新华三大数据技术有限公司 Sub-table management method, device, equipment and storage medium based on index template
CN114185849A (en) * 2020-09-15 2022-03-15 中兴通讯股份有限公司 File operation method, file operation system, electronic device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431523A (en) * 2007-11-05 2009-05-13 国际商业机器公司 Method and micro-system for updating target system configuration in computer

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101743546A (en) * 2007-08-06 2010-06-16 国际商业机器公司 Hierarchical storage management for a file system providing snapshots
CN107315825A (en) * 2017-07-05 2017-11-03 北京奇艺世纪科技有限公司 A kind of index upgrade system, method and device
CN110109695A (en) * 2019-04-17 2019-08-09 华为技术有限公司 Patch method, relevant apparatus and system
CN114116072A (en) * 2020-08-31 2022-03-01 华为技术有限公司 Shared library multiplexing method and electronic equipment
CN114185849A (en) * 2020-09-15 2022-03-15 中兴通讯股份有限公司 File operation method, file operation system, electronic device and storage medium
CN112328275A (en) * 2020-10-10 2021-02-05 岭东核电有限公司 Data updating method and device for nuclear power plant, terminal equipment and storage medium
CN112269853A (en) * 2020-11-16 2021-01-26 Oppo广东移动通信有限公司 Search processing method, search processing device and storage medium
CN114153844A (en) * 2021-11-23 2022-03-08 新华三大数据技术有限公司 Sub-table management method, device, equipment and storage medium based on index template

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A Process Model for ERP Upgrade and Replacement Decisions;Goman M, Koch S;《Pacific Asia Journal of the Association for Information Systems》;第13卷(第2期);第1页 *
基于Android平台的智能手机多包连续升级技术改进与实现;张宇杰;《中国优秀硕士学位论文全文数据库 信息科技辑》(第4期);I138-1765 *
基于三层特权级的操作***安全体系结构的研究;李天佑;《中国优秀硕士学位论文全文数据库 信息科技辑》(第6期);I138-96 *

Also Published As

Publication number Publication date
CN116048562A (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN112783564B (en) Method for accelerating starting of application program and electronic equipment
CN110515646B (en) Differential upgrading method and related equipment
CN113254409B (en) File sharing method, system and related equipment
CN112214294B (en) Method for calling hardware interface and electronic equipment
CN110989961A (en) Sound processing method and device
WO2021185352A1 (en) Version upgrade method and related apparatus
CN115333941A (en) Method for acquiring application running condition and related equipment
CN113784331B (en) Method and device for updating system data of user identity module card
CN113656089B (en) Class verification method and device in application program
CN112817610A (en) Cota package installation method and related device
CN116048562B (en) Data updating method, electronic equipment and storage medium
CN114253737B (en) Electronic device, memory recovery method thereof and medium
CN113590346B (en) Method and electronic equipment for processing service request
CN114443117B (en) Custom package processing method and electronic equipment
CN113721836A (en) Data deduplication method and device
CN111221544A (en) Management method and terminal for pre-installed application software
WO2024131823A1 (en) Installation-free application upgrading method and electronic device
CN116048594B (en) Software upgrading method and related device
CN117009023B (en) Method for displaying notification information and related device
CN116049096B (en) Data migration method, electronic equipment and storage medium
CN116795476B (en) Wallpaper deleting method and electronic equipment
CN116667268B (en) Method for preventing triggering over-current protection and electronic equipment
CN116049095A (en) Data migration method, electronic equipment and storage medium
CN117707563A (en) Application resource processing method and related equipment
CN116931802A (en) Control method and central control 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