Data updating method and device and storage medium
During the data update process of electronic devices, the control information in the mirror configuration file to be updated is used to clear the original data in the target partition, and then the configuration data to be updated is stored, which solves the problem of data conflict after the update, ensuring that the device is used normally and Improve production efficiency.
Patent Information
- Application Number
- CN202311002218.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2025-02-18
AI Technical Summary
During the update process of user data partition of electronic devices, the content capacity of content to be updated may be smaller than the content capacity in the current device, resulting in the data before the update at some storage addresses after the update, causing data conflicts, which will affect the normality of the device. Usage and productivity.
By obtaining the image configuration file to be updated containing the configuration data to be updated and control information for indicating the clearing of the configuration data stored in the target partition, the electronic device first clears the original data in the target partition when loading the configuration file, and then clears the original data in the target partition, and then turns the The configuration data to be updated is stored in the target partition.
Ensure that the electronic equipment does not have both the updated data and the updated data at the same time, and ensure that the equipment can be used normally after the update, thereby improving production efficiency.
Smart Images

Figure CN119473335A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to testing technology, and relate to but are not limited to a data updating method and device, and a storage medium. Background Art
[0002] At present, when burning the content to be updated to an electronic device, it is usually necessary to add the content to be updated to the electronic device. When updating the data in the user data partition of the electronic device, there is usually a situation where the content capacity of the content to be updated is smaller than the content capacity of the current electronic device. For example, when the electronic device updates the data at the storage addresses from 1500 to 1600 of the user data partition, if the current electronic device stores data at the storage addresses from 1500 to 1600, but the content to be updated only stores data at 1500 to 1510 and 1550 to 1600, that is, there is no update data at the storage addresses from 1511 to 1549, but when the electronic device is updated, because the content to be updated only refers to The updated contents at 1500 to 1510 and 1550 to 1600 are shown, so the electronic device will only update the contents at the storage addresses 1500 to 1510 and 1550 to 1600 according to the contents to be updated, but will not update the contents at the storage addresses 1511 to 1549, resulting in that after the update, the electronic device has updated data at the storage addresses 1500 to 1510 and 1550 to 1600, while the data at the storage addresses 1511 to 1549 are still the data before the update. The coexistence of the two types of data usually leads to data conflicts, which results in the electronic device being unable to be used normally after the update and the partition corresponding to the storage address being unable to be mounted normally, thereby reducing production efficiency. Summary of the invention
[0003] In view of this, the data updating method, device and storage medium provided in the embodiments of the present application can ensure that the data before and after the update do not exist simultaneously in the electronic device, and ensure that the electronic device can be used normally after the update, thereby improving production efficiency.
[0004] In a first aspect, an embodiment of the present application provides a data updating method, which is applied to an electronic device, and the method includes: obtaining a mirror configuration file to be updated, the mirror configuration file to be updated including configuration data to be updated of a target partition and control information for indicating clearing configuration data stored in the target partition, the control information being located before the location of the configuration data to be updated in the mirror configuration file to be updated, and the target partition being used to store user information; loading the mirror configuration file to be updated, and after clearing the original data stored in the target partition, storing the configuration data to be updated in the target partition.
[0005] In the above data updating method, when a mirror configuration file to be updated including configuration data to be updated and control information for indicating clearing configuration data stored in a target partition is obtained, the electronic device will first clear the configuration data stored in the target partition according to the control information during the process of loading the mirror configuration file to be updated, and then store the configuration data to be updated in the target partition, so that the data in the target partition only contains updated content. Compared with the situation in the prior art where both data before the update and data after the update exist at the same time, the present application can clear the current data of the target partition before updating, and then update the target partition, which can ensure that both data before the update and data after the update do not exist in the electronic device at the same time, and ensure that the electronic device can be used normally after the update, thereby improving production efficiency.
[0006] In some embodiments, before obtaining the mirror configuration file to be updated, the method further includes: generating the mirror configuration file to be updated according to the configuration data to be updated and the control information.
[0007] In some embodiments, the configuration data to be updated includes multiple sub-configuration data, and generating the mirror configuration file to be updated based on the configuration data to be updated and the control information includes: inserting the control information before the sub-configuration data at a first sequential position of the multiple sub-configuration data; generating the mirror configuration file to be updated based on the control information and the multiple sub-configuration data.
[0008] In some embodiments, generating the mirror configuration file to be updated according to the control information and the plurality of sub-configuration data includes: sequentially filling in the control information and the plurality of sub-configuration data in a preset configuration file to generate the mirror configuration file to be updated.
[0009] In some embodiments, the sequentially filling in the control information and the multiple sub-configuration data in the preset configuration file includes: when obtaining the multiple sub-configuration data in accordance with a preset order, determining whether the currently obtained sub-configuration data is the sub-configuration data at the first sequential position in the preset order; in a case where the currently obtained sub-configuration data is the sub-configuration data at the first sequential position in the preset order, sequentially filling in the control information and the sub-configuration data at the first sequential position in the preset configuration file; in a case where the currently obtained sub-configuration data is not the sub-configuration data at the first sequential position in the preset order, filling in the currently obtained sub-configuration data in the preset configuration file to generate the mirror configuration file to be updated.
[0010] In some embodiments, before generating the mirror configuration file to be updated, the method further includes: generating the mirror configuration file to be updated includes: generating the mirror configuration file to be updated after all the sub-configuration data have been filled in the preset configuration file.
[0011] In some embodiments, the target partition includes multiple sub-partitions, the configuration data to be updated includes multiple sub-configuration data, and generating the mirror configuration file to be updated based on the configuration data to be updated and the control information includes: generating target partition information based on sub-partition information corresponding to each sub-configuration data; after inserting the control information into the first line of the target partition information, obtaining the inserted target partition information; and filling in the inserted target partition information and the multiple sub-configuration data in a preset configuration file in sequence to generate the mirror configuration file to be updated.
[0012] In some embodiments, the configuration data to be updated includes the multiple sub-configuration data and sub-partition information corresponding to each sub-configuration data, and storing the configuration data to be updated in the target partition includes: storing the multiple sub-configuration data in the corresponding sub-partitions in the target partition according to the sub-partition information corresponding to each sub-configuration data.
[0013] In some embodiments, the method further includes: splitting the configuration data to be updated into the plurality of sub-configuration data according to a preset data size.
[0014] In a second aspect, an electronic device provided by an embodiment of the present application includes: a configuration file acquisition module, used to acquire a mirror configuration file to be updated, the mirror configuration file to be updated includes configuration data to be updated of a target partition and control information for indicating clearing the configuration data stored in the target partition, the control information is located at a position of the mirror configuration file to be updated before the position of the configuration data to be updated in the mirror configuration file to be updated, and the target partition is used to store user information; a configuration file loading module, used to load the mirror configuration file to be updated, and after clearing the original data stored in the target partition, the configuration data to be updated is stored in the target partition.
[0015] In a third aspect, a computer device provided in an embodiment of the present application includes a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described in the embodiment of the present application when executing the program.
[0016] In a fourth aspect, the computer-readable storage medium provided in the embodiments of the present application has a computer program stored thereon, and when the computer program is executed by a processor, the method provided in the embodiments of the present application is implemented.
[0017] It should be understood that the second to fourth aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0019] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0020] Figure 2 A flowchart of a data updating method provided in an embodiment of the present application;
[0021] Figure 3 A flowchart of another data updating method provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of an implementation flow of a data updating method provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of an implementation flow of another data updating method provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application;
[0025] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0028] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0030] The embodiment of the present application provides a data updating method, which is applied to an electronic device, which can be various types of devices with information processing capabilities during the implementation process. For example, the electronic device can include a personal computer, a laptop computer, a palmtop computer or a server, etc.; the electronic device can also be a mobile terminal, for example, the mobile terminal can include a mobile phone, a car computer, a tablet computer or a projector, etc. The function implemented by the method can be implemented by calling the program code by the processor in the electronic device, and of course the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.
[0031] For example, Figure 1 As shown, the electronic device 10 may include a processor 101 , an external memory interface 102 , an internal memory 103 , a universal serial bus (USB) interface 104 , a camera module 105 , a display screen 106 and buttons 107 .
[0032] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0033] The processor 101 may include one or more processing units, for example: the processor 101 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. Exemplarily, the processor 101 can be a smart terminal CPU, such as a Snapdragon series processor, etc. In some embodiments, the processor 101 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0034] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0035] The electronic device 10 implements the display function through a GPU, a display screen 106, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 106 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 101 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 106 is used to display images, videos, etc.
[0036] The electronic device 10 can realize the shooting function through ISP, shooting module 105, video codec, GPU, display screen 106 and application processor. ISP is used to process the data fed back by the shooting module 105. The shooting module 105 is used to capture static images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion 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 other format. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. In some embodiments, the shooting module 105 can be a camera.
[0037] The external memory interface 102 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 101 through the external memory interface 102 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0038] The internal memory 103 can be used to store computer executable program codes, which include instructions. The internal memory 103 can include a program storage area and a data storage area. The program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 10 (such as audio data, a phone book, etc.), etc.
[0039] The key 107 includes a power key, a volume key, etc. The key 107 can be a mechanical key or a touch key. The electronic device 10 can receive key input and generate key signal input related to user settings and function control of the electronic device 10.
[0040] In addition, the electronic device involved in the embodiments of the present application may also be installed with an operating system, and application programs may be installed and run on the operating system, which is not limited in the embodiments of the present application.
[0041] Figure 2 A flow chart of a data updating method provided in an embodiment of the present application. Figure 1 As shown, the method may include the following steps:
[0042] Step S101, obtaining an image configuration file to be updated, the image configuration file to be updated includes configuration data to be updated of a target partition and control information for instructing to clear configuration data stored in the target partition, the control information is located in the image configuration file to be updated before the configuration data to be updated is located in the image configuration file to be updated, and the target partition is used to store user information;
[0043] Step S102, loading the mirror configuration file to be updated, and after clearing the original data stored in the target partition, storing the configuration data to be updated in the target partition.
[0044] It should be understood that the control information is located in the mirror configuration file to be updated before the configuration data to be updated is located in the mirror configuration file to be updated, so that the electronic device can first run the control information and then run the configuration data to be updated when running the mirror configuration file to be updated, so that the electronic device can clear the original data stored in the target partition and then store the configuration data to be updated in the target partition to ensure that the original data stored in the target partition can be cleared before the update, so that the electronic device only stores the updated data after the update is completed.
[0045] Optionally, the mirror configuration file to be updated can be obtained by the electronic device from other electronic devices by connecting to a burning tool, or can be obtained by automatically downloading from the network, or can be run by the electronic device itself after being manufactured. The specific design can be as needed and this application does not impose any restrictions.
[0046] Exemplarily, when an electronic device obtains data to be updated from other electronic devices via a connected burning tool, the electronic device receives the data to be updated sent by other electronic devices online through the burning tool. During the transmission process, when the data to be updated is large, the data to be updated can be divided into multiple data for transmission, thereby ensuring that the data to be updated can be quickly and completely transmitted during transmission. Among them, the above-mentioned burning tool may include burning hardware and burning software, and the burning software can convert the data to be updated into transmission data to realize the transmission of the burning hardware; the burning hardware realizes the connection between the electronic device and other electronic devices, and transmits the transmission data sent from other electronic devices to the electronic device, so that the electronic device can receive the transmission data and convert the transmission data into the data to be updated. In some embodiments, the burning tool can be a Universal Serial Bus (USB) burner.
[0047] Exemplarily, when the electronic device automatically downloads the data to be updated through the network, the electronic device can receive a wireless communication package sent by the server, wherein the wireless communication package can be an update request sent by the electronic device to the server storing the wireless communication package, and the server sends the update request to the electronic device, or the server storing the wireless communication package automatically pushes the package to the electronic device, which can be designed as needed and is not limited by this application. After receiving the wireless communication package, the electronic device can parse the wireless communication package to obtain the data to be updated therein, and then execute the subsequent data update method according to the data to be updated.
[0048] Exemplarily, when the electronic device is running on its own after creating the mirror configuration file to be updated, the electronic device may first use the mirror development tool to create the above-mentioned mirror configuration file to be updated, and then directly run the mirror configuration file to be updated so that the content of the mirror configuration file to be updated can be run on the electronic device itself to obtain the update effect corresponding to the mirror configuration file to be updated.
[0049] Optionally, the control information is based on being able to control the electronic device to clear the stored data in the target partition, and can be specifically designed as needed. For example, the control information can be command control information for instructing to clear the target partition, and this application does not impose any limitation thereto.
[0050] Optionally, the configuration data to be updated may include a partition table configuration file, which is used to indicate the size and start address of each block of the target partition and the corresponding configuration data to be updated. For example, for the following configuration record in the partition table configuration file:<filename="boot.img"label="userdata"size_in_KB="65536.0"start_byte_hex="0x18200000" / > , filename indicates the name of the configuration data to be updated, label indicates the name of the block, size_in_KB indicates the size of the partition, start_byte_hex indicates the starting address of the partition, so this record indicates that the package named boot.img is burned into the label block in the userdata partition. The size of the userdata partition is 65536kB and the starting address is 0x18200000; for another example, for the following record in the partition table configuration file:<filename=""label="userdata"size_in_KB="1024.0"start_byte_hex="0x1c200000" / > It means that the program package is not updated in the userdata partition. The size of the userdata partition is 1024kB and the starting address is 0x1c200000. Therefore, the control information can be written in the partition table configuration file, and the position of the control information in the partition table configuration file is before the configuration data to be updated. For example, the first line of the partition table configuration file is the control information, and the second line starts the configuration record of the configuration data to be updated, which is not limited here.
[0051] It should be noted that the update process of storing the configuration data to be updated in the target partition can be implemented with reference to the prior art, which will not be described in detail here.
[0052] In the above data updating method, when a mirror configuration file to be updated including configuration data to be updated and control information for indicating clearing configuration data stored in a target partition is obtained, the electronic device will first clear the configuration data stored in the target partition according to the control information during the process of loading the mirror configuration file to be updated, and then store the configuration data to be updated in the target partition, so that the data in the target partition only contains updated content. Compared with the situation in the prior art where both data before the update and data after the update exist at the same time, the present application can clear the current data of the target partition before updating, and then update the target partition, which can ensure that both data before the update and data after the update do not exist in the electronic device at the same time, and ensure that the electronic device can be used normally after the update, thereby improving production efficiency.
[0053] Figure 3A flowchart of another data updating method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the method may include the following steps:
[0054] Step S201, generating a mirror configuration file to be updated according to the configuration data to be updated and the control information;
[0055] Step S202, obtaining an image configuration file to be updated, the image configuration file to be updated includes configuration data to be updated of a target partition and control information for instructing to clear configuration data stored in the target partition, the control information is located before the configuration data to be updated in the image configuration file to be updated, and the target partition is used to store user information;
[0056] Step S203, loading the mirror configuration file to be updated, and after clearing the original data stored in the target partition, storing the configuration data to be updated in the target partition.
[0057] It should be noted that the execution method of the above steps S202 to S203 may be consistent with the execution method of the above steps S101 to S102, which will not be repeated here.
[0058] Optionally, the above-mentioned configuration data to be updated may include multiple sub-configuration data, or may only include a single configuration data. If the configuration data to be updated includes multiple sub-configuration data, the multiple sub-configuration data may be directly included when obtaining the configuration data to be updated, or the single configuration data may be divided into multiple sub-configuration data, and then the multiple sub-configuration data may be packaged as the configuration data to be updated.
[0059] Optionally, when dividing a single configuration data into multiple sub-configuration data, the single configuration data can be divided into multiple sub-configuration data of the same data size according to the preset data size. For example, if the preset data size is capacity A, then the data size of each sub-configuration data in the multiple sub-configuration data after division is capacity A; the single configuration data can also be divided into multiple sub-configuration data with a total number equal to the preset data number according to the preset data number. For example, if the preset data number is B, then the data number of the multiple sub-configuration data after division is B.
[0060] Optionally, the control information may be in the configuration data to be updated, or in the partition information corresponding to the configuration data to be updated. The specific design may be as required, and this application does not impose any limitation.
[0061] Optionally, if the control information is in the configuration data to be updated, the above step S201 may include:
[0062] inserting control information before sub-configuration data at a first sequential position of the plurality of sub-configuration data;
[0063] A mirror configuration file to be updated is generated according to the control information and the plurality of sub-configuration data.
[0064] It should be understood that the electronic device executes the update content in the configuration data to be updated line by line. For example, the first line of the configuration data to be updated is the update content of block A, and the second line is the update content of block B. When the electronic device executes the update according to the configuration data to be updated, it will first update the update content of block A, and then update the update content of block B. Therefore, inserting the control information before the sub-configuration data at the first sequential position can ensure that the clearing step of the target partition is executed before executing all the sub-configuration data.
[0065] It can be understood that by inserting control information before the sub-configuration data in the first sequential position of multiple sub-configuration data, the mirror configuration file to be updated generated thereby can ensure that the control information can be executed before the update is performed according to the multiple sub-configuration data, thereby ensuring the execution steps of clearing first and then updating.
[0066] Optionally, the mirror configuration file to be updated may be generated by sequentially filling control information and a plurality of sub-configuration data into a preset configuration file to generate the mirror configuration file to be updated.
[0067] Exemplarily, after obtaining the control information and the multiple sub-configuration data, the electronic device first fills the control information in the preset configuration file so that the position of the control information in the configuration file is before the multiple sub-configuration data, and then fills the multiple sub-configuration data in the preset configuration file to generate the mirror configuration file to be updated. Among them, the multiple sub-configuration data can be filled in the preset configuration file separately, or can be filled in the preset configuration file at the same time, which can be designed as needed and is not limited by this application.
[0068] It should be understood that the above-mentioned preset configuration file may be an additional configuration file, and the preset configuration file may include other data in addition to the control information and the plurality of sub-configuration data.
[0069] Optionally, the process of filling in the control information and the plurality of sub-configuration data in the preset configuration file in sequence may include the following steps 1 to 3:
[0070] Step 1, when acquiring multiple sub-configuration data in a preset order, determining whether the sub-configuration data currently acquired is the sub-configuration data at the first sequence position in the preset order;
[0071] Step 2, when the sub-configuration data currently obtained is the sub-configuration data at the first sequence position in the preset sequence, fill in the control information and the sub-configuration data at the first sequence position in the preset configuration file in sequence;
[0072] Step 3: When the sub-configuration data currently obtained is not the sub-configuration data at the first sequence position in the preset sequence, fill the preset configuration file with the sub-configuration data currently obtained to generate a mirror configuration file to be updated.
[0073] Optionally, the preset order may be an update order among multiple sub-configuration data when the electronic device executes the step of updating multiple sub-configuration data. The specific order may be designed as required and is not limited in this application.
[0074] Exemplarily, if multiple sub-configuration data include sub-configuration data A, sub-configuration data B and sub-configuration data C, and the preset order is that the first sequence position is sub-configuration data A, followed by sub-configuration data B and sub-configuration data C, then after the electronic device obtains any one of the multiple sub-configuration data, it will determine whether the currently obtained sub-configuration data is the sub-configuration data (sub-configuration data A) at the first sequence position in the preset order; if the currently obtained sub-configuration data is sub-configuration data A, then the control information and sub-configuration data A are filled in the preset configuration file in sequence; if the currently obtained sub-configuration data is sub-configuration data B or sub-configuration data C, then the currently obtained sub-configuration data is filled in the preset configuration file; and after sub-configuration data A, sub-configuration data B and sub-configuration data C are all obtained, a mirror configuration file to be updated is generated.
[0075] Optionally, when filling the control information and the plurality of sub-configuration data in the preset configuration file, it is also possible to judge whether all the sub-configuration data have been filled in the preset configuration file, and the judging process may include:
[0076] Determine whether all sub-configuration data are filled in the preset configuration file;
[0077] Accordingly, the generation process of the above-mentioned image configuration file to be updated may include:
[0078] After all sub-configuration data have been filled in the preset configuration file, the mirror configuration file to be updated is generated.
[0079] Optionally, the above-mentioned method of judging whether all sub-configuration data are filled in the preset configuration file may be to compare the content of the preset configuration file with the content of all sub-configuration data; if they are completely consistent, all sub-configuration data have been filled in the preset configuration file; otherwise, not all sub-configuration data have been filled in the preset configuration file; it may also be to judge whether the identifier of the sub-configuration data currently filled in is consistent with the preset identifier, and the identifier is used to indicate the filling progress of the sub-configuration data. For example, there are N sub-configuration data in total, and the multiple sub-configuration data are marked with identifiers from 1 to N in sequence. Then, the identifier of one of the sub-configuration data is N, which means that the sub-configuration data is the last one of the multiple sub-configuration data. The electronic device obtains the multiple sub-configuration data in the order of identifiers from 1 to N. When the sub-configuration data identified as N is obtained, it can be determined that all sub-configuration data are filled in the preset configuration file, thereby generating a mirror configuration file to be updated.
[0080] It can be understood that, when the sub-configuration data currently obtained is the sub-configuration data at the first sequence position in the preset sequence, the control information and the sub-configuration data at the first sequence position are sequentially filled in the preset configuration file; when the sub-configuration data currently obtained is not the sub-configuration data at the first sequence position in the preset sequence, the preset configuration file is filled with the sub-configuration data currently obtained to generate a mirror configuration file to be updated, thereby achieving that the generated mirror configuration file to be updated can ensure that the control information can be executed before the update is performed according to multiple sub-configuration data, thereby ensuring the execution steps of clearing first and then updating.
[0081] Optionally, if the control information is in the partition information corresponding to the configuration data, the above step S201 may include:
[0082] Generate target partition information according to the sub-partition information corresponding to each sub-configuration data;
[0083] After inserting the control information before the first line of the target partition information, the inserted target partition information is obtained;
[0084] The inserted target partition information and a plurality of sub-configuration data are sequentially filled into the preset configuration file to generate the mirror configuration file to be updated.
[0085] It should be understood that the configuration data to be updated includes partition information and configuration data, the configuration data is the specific update content, and the partition information is used to indicate the size and starting address of each sub-partition and the corresponding configuration data. In some embodiments, the partition information can be a partition table configuration file.
[0086] Optionally, the sub-partition information corresponding to each sub-configuration data can be determined by receiving a selection instruction input by the user when making the configuration data to be updated to include multiple corresponding sub-partitions. For example, a partition selection control is provided to the user so that the user can select the partition corresponding to the configuration data to be updated through the partition selection control; or, multiple sub-partitions are determined based on the configuration data to be updated and a partition table configuration file; or, all sub-partitions of the configuration data to be updated are determined as multiple sub-partitions, which is not limited here.
[0087] It should be understood that the above target partition information includes all sub-partition information, and control information is inserted before all sub-partition information to obtain the inserted target partition information, so that when the electronic device updates the configuration data according to the partition information, it can first execute the step of clearing the control information.
[0088] Exemplarily, if multiple sub-configuration data include sub-configuration data A, sub-configuration data B and sub-configuration data C, sub-configuration data A needs to be updated to sub-partition A of the target partition, corresponding to the partition information of sub-partition A of the target partition of the electronic device, sub-configuration data B needs to be updated to sub-partition B of the target partition, corresponding to the partition information of sub-partition B of the target partition of the electronic device, and sub-configuration data C needs to be updated to sub-partition C of the target partition, corresponding to the partition information of sub-partition C of the target partition of the electronic device, then the electronic device can generate target partition information, and the target partition information includes partition information of sub-partition A of the target partition, partition information of sub-partition B of the target partition and partition information of sub-partition C of the target partition.
[0089] Therefore, when the electronic device updates the configuration data according to the partition information, it can first execute the control information to clear the original configuration data of the target partition, and then update the configuration data.
[0090] Optionally, if the control information is in the partition information corresponding to the configuration data, the above step S203 may include:
[0091] According to the sub-partition information corresponding to each sub-configuration data, the plurality of sub-configuration data are stored in the corresponding sub-partition in the target partition.
[0092] Exemplarily, if multiple sub-configuration data include sub-configuration data A, sub-configuration data B and sub-configuration data C, sub-configuration data A needs to be updated to sub-partition A of the target partition, corresponding to the partition information of sub-partition A of the target partition of the electronic device, sub-configuration data B needs to be updated to sub-partition B of the target partition, corresponding to the partition information of sub-partition B of the target partition of the electronic device, sub-configuration data C needs to be updated to sub-partition C of the target partition, corresponding to the partition information of sub-partition C of the target partition of the electronic device, then when the electronic device updates multiple sub-configuration data, it will update sub-configuration data A to sub-partition A of the target partition, sub-configuration data B to sub-partition B of the target partition, and sub-configuration data C to sub-partition C of the target partition to complete the update.
[0093] In the above data update method, a mirror configuration file to be updated is first generated in the electronic device, and then the electronic device can perform self-update according to the mirror configuration file to be updated, thereby realizing an automated flow of the electronic device from updating content to updating process, avoiding the step of burning the mirror configuration file to be updated to the electronic device when performing an update on the electronic device in the prior art, thereby reducing the updating steps.
[0094] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0095] Figure 4 The following is a schematic diagram of the implementation process of the data updating method provided in the embodiment of the present application. Figure 4 As shown, the method includes the following steps S301 to S307:
[0096] Step S301, after obtaining the compiled mirror configuration file to be updated, the electronic device splits the configuration data to be updated into a plurality of sub-configuration data;
[0097] Step S302, determining a target sub-configuration data that is in a first order position according to a preset order among a plurality of sub-configuration data;
[0098] Step S303, fill in the control information of erasing the userdata partition in the first line of the preset configuration file, and fill in the partition data information corresponding to the target sub-configuration data starting from the second line;
[0099] Step S304, filling in other sub-configuration data in the preset configuration file in sequence, and after all other sub-configuration data are filled in, using the preset configuration file as the mirror configuration file to be updated;
[0100] Step S305, the electronic device loads the image configuration file to be updated through a burning tool;
[0101] Step S306, first clear the configuration data stored in the target partition according to the mirror configuration file to be updated;
[0102] Step S307: According to the mirror configuration file to be updated, after the clearing is completed, the configuration data to be updated is stored in the target partition.
[0103] Since this embodiment generates target partition information corresponding to the multiple sub-configuration data after splitting the configuration data to be updated and obtaining the multiple sub-configuration data, and fills the control information of erasing the userdata partition in the first line of the target partition information so that the erasing action is earlier than the updating action, it can be ensured that the data before the update and the data after the update do not exist in the userdata partition at the same time, thereby avoiding data conflicts.
[0104] The following describes an exemplary application of the embodiment of the present application in another practical application scenario.
[0105] Figure 5 The following is a schematic diagram of the implementation process of the data updating method provided in the embodiment of the present application. Figure 5 As shown, the method includes the following steps S401 to S407:
[0106] Step S401, after obtaining the compiled mirror configuration file to be updated, the first electronic device splits the configuration data to be updated into a plurality of sub-configuration data;
[0107] Step S402, the first electronic device determines a target sub-configuration data that is in a first order position according to a preset order among a plurality of sub-configuration data;
[0108] Step S403, the first electronic device fills in the control information of erasing the userdata partition in the first line of the preset configuration file, and fills in the partition data information corresponding to the target sub-configuration data starting from the second line;
[0109] Step S404, the first electronic device sequentially fills in other sub-configuration data in the preset configuration file, and after all other sub-configuration data are filled in, uses the preset configuration file as the mirror configuration file to be updated, and sends the mirror configuration file to be updated to the second electronic device through a burning tool when communicating with the second electronic device;
[0110] Step S405, the second electronic device loads the mirror configuration file to be updated after obtaining the mirror configuration file to be updated through a burning tool;
[0111] Step S406, the second electronic device first clears the configuration data stored in the target partition according to the mirror configuration file to be updated;
[0112] Step S407: the second electronic device stores the configuration data to be updated in the target partition according to the mirror configuration file to be updated after clearing is completed.
[0113] It should be understood that although Figure 1-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0114] Based on the foregoing embodiments, an embodiment of the present application provides an electronic device, which includes the modules included and the units included in the modules, which can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0115] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic equipment includes:
[0116] The configuration file acquisition module 601 is used to acquire the image configuration file to be updated, where the image configuration file to be updated includes the configuration data to be updated of the target partition and the control information for instructing to clear the configuration data stored in the target partition, where the control information is located before the configuration data to be updated in the image configuration file to be updated, and the target partition is used to store user information;
[0117] The configuration file loading module 602 is used to load the mirror configuration file to be updated, and after clearing the original data stored in the target partition, store the configuration data to be updated in the target partition.
[0118] In some embodiments, the electronic device may further include:
[0119] The configuration file generation module is used to generate the mirror configuration file to be updated according to the configuration data to be updated and the control information before obtaining the mirror configuration file to be updated.
[0120] In some embodiments, the configuration file generation module may include:
[0121] A first inserting submodule, configured to insert control information before a sub-configuration data at a first sequential position of the plurality of sub-configuration data;
[0122] The configuration file generation module is specifically used to generate a mirror configuration file to be updated according to the control information and multiple sub-configuration data.
[0123] In some embodiments, the configuration file generation module is specifically used to:
[0124] The control information and a plurality of sub-configuration data are sequentially filled into the preset configuration file to generate the mirror configuration file to be updated.
[0125] In some embodiments, the configuration file generation module is specifically used to:
[0126] When acquiring multiple sub-configuration data in a preset order, determining whether the sub-configuration data currently acquired is the sub-configuration data at the first sequence position in the preset order;
[0127] In the case where the sub-configuration data currently acquired is the sub-configuration data at the first sequence position in the preset sequence, the control information and the sub-configuration data at the first sequence position are sequentially filled in the preset configuration file;
[0128] In the case that the sub-configuration data currently obtained is not the sub-configuration data at the first sequence position in the preset sequence, the sub-configuration data currently obtained is filled in the preset configuration file to generate the mirror configuration file to be updated.
[0129] In some embodiments, the electronic device may further include:
[0130] The configuration file judgment module is used to judge whether all sub-configuration data are filled in the preset configuration file;
[0131] Accordingly, the above configuration file generation module is specifically used for:
[0132] After all sub-configuration data have been filled in the preset configuration file, the mirror configuration file to be updated is generated.
[0133] In some embodiments, the target partition includes multiple sub-partitions, the configuration data to be updated includes multiple sub-configuration data, and the configuration file generation module may include:
[0134] A partition information generating submodule, used to generate target partition information according to the sub-partition information corresponding to each sub-configuration data;
[0135] A second inserting submodule is used to insert the control information before the first line of the target partition information to obtain the inserted target partition information;
[0136] The configuration file generation module is specifically used to fill in the inserted target partition information and multiple sub-configuration data in the preset configuration file in sequence to generate the mirror configuration file to be updated.
[0137] In some embodiments, the configuration data to be updated includes multiple sub-configuration data and sub-partition information corresponding to each sub-configuration data, and the configuration file loading module 602 is specifically used to:
[0138] According to the sub-partition information corresponding to each sub-configuration data, the plurality of sub-configuration data are stored in the corresponding sub-partition in the target partition.
[0139] In some embodiments, the electronic device may further include:
[0140] The sub-data splitting module is used to split the configuration data to be updated into multiple sub-configuration data according to the preset data size.
[0141] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0142] It should be noted that in the embodiments of this application Figure 6 The division of modules in the electronic device shown is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. It may also be implemented in the form of a combination of software and hardware.
[0143] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0144] The embodiment of the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data update method is implemented.
[0145] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the above embodiment are implemented.
[0146] An embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps of the method provided in the above method embodiment.
[0147] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0148] In one embodiment, the data updating method provided by the present application can be implemented in the form of a computer program. Figure 7The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the electronic device. The computer program composed of various program modules enables the processor to execute the steps of the data updating method of various embodiments of the present application described in this specification.
[0149] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above data updating method when executing the computer program.
[0150] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0151] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0152] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0153] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0154] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0155] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0156] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0157] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0158] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0159] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0160] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0161] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0162] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data updating method, characterized in that: Applied to electronic equipment, the method comprises: Acquire an image configuration file to be updated, the image configuration file to be updated comprising configuration data to be updated of a target partition and control information for instructing to clear configuration data stored in the target partition, the control information being located before the configuration data to be updated in the image configuration file to be updated, and the target partition being used to store user information; The mirror configuration file to be updated is loaded, and after the original data stored in the target partition is cleared, the configuration data to be updated is stored in the target partition.
2. The method according to claim 1, characterized in that Before obtaining the mirror configuration file to be updated, the method further includes: The mirror configuration file to be updated is generated according to the configuration data to be updated and the control information.
3. The method according to claim 2, characterized in that The configuration data to be updated includes a plurality of sub-configuration data, and generating the mirror configuration file to be updated according to the configuration data to be updated and the control information includes: inserting the control information before the sub-configuration data at a first sequential position of the plurality of sub-configuration data; The mirror configuration file to be updated is generated according to the control information and the plurality of sub-configuration data.
4. The method according to claim 3, characterized in that The step of generating the mirror configuration file to be updated according to the control information and the plurality of sub-configuration data includes: The control information and the plurality of sub-configuration data are sequentially filled into a preset configuration file to generate the mirror configuration file to be updated.
5. The method according to claim 4, characterized in that The step of sequentially filling the control information and the plurality of sub-configuration data in a preset configuration file comprises: When acquiring the plurality of sub-configuration data in a preset order, determining whether the sub-configuration data currently acquired is the sub-configuration data at the first sequence position in the preset order; In a case where the sub-configuration data currently acquired is the sub-configuration data at the first sequence position in the preset sequence, sequentially filling the control information and the sub-configuration data at the first sequence position in the preset configuration file; In the case that the sub-configuration data currently obtained is not the sub-configuration data at the first sequence position in the preset sequence, the sub-configuration data currently obtained is filled into the preset configuration file to generate the mirror configuration file to be updated.
6. The method according to claim 5, characterized in that Before generating the mirror configuration file to be updated, the method further includes: Determining whether all sub-configuration data are filled in the preset configuration file; The generating the mirror configuration file to be updated includes: After all the sub-configuration data have been filled in the preset configuration file, the mirror configuration file to be updated is generated.
7. The method according to claim 2, characterized in that The target partition includes a plurality of sub-partitions, the configuration data to be updated includes a plurality of sub-configuration data and sub-partition information corresponding to each sub-configuration data, and generating the mirror configuration file to be updated according to the configuration data to be updated and the control information includes: Generate target partition information according to the sub-partition information corresponding to each sub-configuration data; After inserting the control information before the first line of the target partition information, the inserted target partition information is obtained; The inserted target partition information and the plurality of sub-configuration data are sequentially filled into a preset configuration file to generate the mirror configuration file to be updated.
8. The method according to claim 7, characterized in that The storing the configuration data to be updated in the target partition includes: According to the sub-partition information corresponding to each sub-configuration data, the plurality of sub-configuration data are stored in the corresponding sub-partition in the target partition.
9. The method according to any one of claims 3 to 8, characterized in that The method further comprises: The configuration data to be updated is divided into the multiple sub-configuration data according to a preset data size.
10. An electronic device, characterized in that: The electronic device comprises: a configuration file acquisition module, used to acquire an image configuration file to be updated, wherein the image configuration file to be updated includes configuration data to be updated of a target partition and control information for instructing to clear the configuration data stored in the target partition, wherein the control information is located before the configuration data to be updated in the image configuration file to be updated, and the target partition is used to store user information; The configuration file loading module is used to load the mirror configuration file to be updated, and after clearing the original data stored in the target partition, store the configuration data to be updated in the target partition.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.