CN112988691A - File updating method and device based on embedded system and terminal equipment - Google Patents

File updating method and device based on embedded system and terminal equipment Download PDF

Info

Publication number
CN112988691A
CN112988691A CN202110350209.0A CN202110350209A CN112988691A CN 112988691 A CN112988691 A CN 112988691A CN 202110350209 A CN202110350209 A CN 202110350209A CN 112988691 A CN112988691 A CN 112988691A
Authority
CN
China
Prior art keywords
data
file
check data
original
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110350209.0A
Other languages
Chinese (zh)
Inventor
卓深
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ubtech Technology Co ltd
Original Assignee
Shenzhen Ubtech Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ubtech Technology Co ltd filed Critical Shenzhen Ubtech Technology Co ltd
Priority to CN202110350209.0A priority Critical patent/CN112988691A/en
Publication of CN112988691A publication Critical patent/CN112988691A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of data updating processing, and provides a file updating method, a device, terminal equipment and a readable storage medium based on an embedded system, wherein the method comprises the following steps: when a data updating package is received, first check data corresponding to the data updating package is obtained, second check data of original file data are obtained, the first check data are detected according to the second check data, a detection result is obtained, and when the detection result indicates that the first check data do not meet the preset requirement, file updating processing is completed according to the data updating package. According to the file updating method and device, the second check data of the data updating package and the first check data of the original file are detected, when the detection result indicates that the first check data do not meet the preset requirement, the file updating processing is completed according to the data updating package, repeated updating operation of the file can be avoided, the data transmission efficiency of an embedded system is improved, resource loss is reduced, and meanwhile the file updating efficiency is improved.

Description

File updating method and device based on embedded system and terminal equipment
Technical Field
The present application belongs to the technical field of data update processing, and in particular, to a file update method and apparatus based on an embedded system, a terminal device, and a readable storage medium.
Background
In the embedded system, since data transmission and transmission are basically performed in serial, and the hardware communication device of the embedded system is generally an external device with low speed, such as UART or bluetooth, the data transmission speed of the embedded system is low, and the time consumption for updating the file is long.
The existing file updating method based on the embedded system usually has the problems of repeated file updating, reduced data transmission efficiency and large resource loss.
Disclosure of Invention
The embodiment of the application provides a file updating method and device based on an embedded system, a terminal device and a readable storage medium, and can solve the problems of repeated file updating, low data transmission efficiency and large resource loss in the existing file updating method based on the embedded system.
In a first aspect, an embodiment of the present application provides a file updating method based on an embedded system, including:
when a data updating packet is received, acquiring first verification data corresponding to the data updating packet;
acquiring second check data of the original file data;
detecting the first check data according to the second check data to obtain a detection result;
and when the detection result indicates that the first check data does not meet the preset requirement, finishing file updating processing according to the data updating package.
In one embodiment, the first check data includes a plurality of types of check data among an updated file name, an updated file generation time, an updated file size, an updated cyclic redundancy check value, an updated information digest value, and an updated hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value;
the detecting the first check data according to the second check data to obtain a detection result includes:
comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
when any type of check data is detected to be different, the detection result is judged that the first check data does not meet the preset requirement.
In an embodiment, the detecting the first check data according to the second check data to obtain a detection result further includes:
and when all types of check data are detected to be the same, judging that the detection result is that the first check data meet the preset requirement.
In an embodiment, the comparing the first check data and the corresponding check data of the same type in the second check data according to a preset order includes:
comparing whether the updated file name is the same as the original file name;
when detecting that the updated file name is the same as the original file name, comparing whether the updated file generation time is the same as the original file generation time;
when the generation time of the updated file is detected to be the same as the generation time of the original file, comparing whether the size of the updated file is the same as that of the original file;
when the updated file size is detected to be the same as the original file size, comparing whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value;
when the updated cyclic redundancy check value is detected to be the same as the original cyclic redundancy check value, comparing whether the updated information abstract value is the same as the original information abstract value;
and when detecting that the updated message digest value is the same as the original message digest value, comparing whether the updated hash value is the same as the original hash value.
In one embodiment, when the detection result indicates that the first check data does not meet a preset requirement, the completing file update processing according to the data update package includes:
deleting the original file data when the detection result indicates that the first check data does not meet the preset requirement;
and writing new file data according to the data updating packet to finish file updating processing.
In one embodiment, the method further comprises:
and when the detection result indicates that the first check data meet the preset requirement, judging that the updating operation is finished.
In a second aspect, an embodiment of the present application provides an embedded system-based file updating apparatus, including:
the device comprises a receiving module, a verification module and a verification module, wherein the receiving module is used for acquiring first verification data corresponding to a data updating packet when the data updating packet is received;
the acquisition module is used for acquiring second check data of the original file data;
the detection module is used for detecting the first check data according to the second check data to obtain a detection result;
and the updating module is used for finishing file updating processing according to the data updating package when the detection result indicates that the first check data does not meet the preset requirement.
In one embodiment, the first check data includes a plurality of types of check data among an updated file name, an updated file generation time, an updated file size, an updated cyclic redundancy check value, an updated information digest value, and an updated hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value;
the detection module comprises:
the comparison unit is used for comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
the first detection unit is used for judging that the detection result is that the first check data does not meet the preset requirement when any type of check data is detected to be different.
In one embodiment, the detection module further includes:
and the second detection unit is used for judging that the detection result is that the first verification data meets the preset requirement when all types of verification data are detected to be the same.
In one embodiment, the comparison unit includes:
the first comparison subunit is used for comparing whether the updated file name is the same as the original file name;
the second comparison subunit is used for comparing whether the update file generation time is the same as the original file generation time or not when detecting that the update file name is the same as the original file name;
a third comparing subunit, configured to compare, when it is detected that the update file generation time is the same as the original file generation time, whether the size of the update file is the same as the size of the original file;
a fourth comparing subunit, configured to compare whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value when it is detected that the updated file size is the same as the original file size;
a fifth comparing subunit, configured to compare whether the updated information digest value is the same as the original information digest value or not when it is detected that the updated cyclic redundancy check value is the same as the original cyclic redundancy check value;
and the sixth comparison subunit is configured to, when it is detected that the updated message digest value is the same as the original message digest value, compare whether the updated hash value is the same as the original hash value.
In one embodiment, the update module includes:
the deleting unit is used for deleting the original file data when the detection result indicates that the first check data does not meet the preset requirement;
and the updating unit is used for writing new file data according to the data updating packet to finish file updating processing.
In one embodiment, the file updating apparatus based on an embedded system further includes:
and the judging module is used for judging that the updating operation is finished when the detection result indicates that the first check data meets the preset requirement.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the file updating method based on the embedded system according to any one of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the embedded system-based file updating method according to any one of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the file updating method based on an embedded system according to any one of the above first aspects.
According to the file updating method and device, the second check data of the data updating package and the first check data of the original file are detected, when the detection result indicates that the first check data do not meet the preset requirement, the file updating processing is completed according to the data updating package, repeated updating operation of the file can be avoided, the data transmission efficiency of an embedded system is improved, resource loss is reduced, and meanwhile the file updating efficiency is improved.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a file updating method based on an embedded system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of step S103 of a file updating method based on an embedded system according to an embodiment of the present application;
fig. 3 is a schematic flowchart of step S1031 of a file updating method based on an embedded system according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a step S104 of a file updating method based on an embedded system according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a file updating apparatus based on an embedded system according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The file updating method based on the embedded system can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices and notebook computers, and the specific types of the terminal devices are not limited at all.
Fig. 1 shows a schematic flowchart of a file updating method based on an embedded system provided in the present application, which can be applied to the above-mentioned notebook computer by way of example and not limitation.
S101, when a data updating packet is received, first verification data corresponding to the data updating packet is obtained.
In a specific application, when a data update package for executing file update is received, first verification data corresponding to the data update package is acquired; the first Check data refers to multiple types of Check data which are carried by the data update package and correspond to new file data and are used for file Check, and the Check data includes, but is not limited to, multiple types of update file names, update file generation time, update file size, update Cyclic Redundancy Check (CRC 32), update information Digest (Message-Digest Algorithm, MD5) and update Hash values (Secure Hash Algorithm 1, SHA-1). The data carried by the data update package includes, but is not limited to, new file data, first verification data of the new file data, and a designated address for performing a file update.
In one embodiment, when the method is applied to an embedded system, the current execution terminal is specifically a slave of the embedded system, and is configured to receive a data update packet sent by a host and detect whether a file update processing operation is required.
S102, second check-up data of the original file data are obtained.
In a specific application, when a data update package is received, in order to detect whether original file data is an updated file, it is required to detect whether the original file data is the same as new file data carried in the data update package, and therefore second check data of the original file data needs to be acquired; the second check data refers to multiple types of check data corresponding to the original file data and used for file check, and includes, but is not limited to, multiple types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information digest value, and original hash value. The original file data is file data stored in the designated address at the current time.
In one embodiment, the first check data includes a plurality of types of check data among an updated file name, an updated file generation time, an updated file size, an updated cyclic redundancy check value, an updated information digest value, and an updated hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value.
S103, detecting the first check data according to the second check data to obtain a detection result.
In specific application, the original file data and the new file data are detected through the first check data for the check data of multiple types contained in the second check data, and a check result of whether the first check data meets a preset requirement is obtained to judge whether the original file data and the new file data are the same or not, so that whether file updating processing is needed or not is determined. The preset requirement can be specifically set according to the actual situation.
In this embodiment, the preset requirement is set such that the first check data and the corresponding second check data of each type are the same. That is, when all types of check data are detected to be the same, the detection result is judged that the first check data meet the preset condition.
And S104, when the detection result indicates that the first check data does not meet the preset requirement, completing file updating processing according to the data updating package.
In a specific application, when the detection result indicates that the first check data does not meet the preset requirement, it is determined that the original file data is different from the new file data carried by the data update package, so that file update is required, and file update processing is completed according to the received data update package.
As shown in fig. 2, in one embodiment, the step S103 includes:
s1031, comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
s1032, when the different types of check data are detected, judging that the detection result is that the first check data do not meet the preset requirement.
In specific application, in order to improve the detection efficiency of original file data and new file data, a preset sequence is preset, the same type of check data in the first check data and the corresponding second check data are compared according to the preset sequence, and a comparison result of whether the same type of check data is the same is obtained; when the first check data of any type is detected to be different from the corresponding second check data, the detection result is judged that the first check data does not meet the preset requirement, namely the original file data is determined to be different from the new file data to be updated, and file updating processing is required. The preset sequence can be specifically set according to actual requirements.
In one embodiment, the step S103 further includes:
and when all types of check data are detected to be the same, judging that the detection result is that the first check data meet the preset requirement.
In specific application, when it is detected that all types of check data in the first check data and the second check data are the same, the detection result is judged that the first check data meet the preset requirement, and then the original file data and the new file data are judged to be the same without performing file updating processing.
As shown in fig. 3, in an embodiment, the step S1031 includes:
s10311, comparing whether the updated file name is the same as the original file name;
s10312, when detecting that the updated file name is the same as the original file name, comparing whether the updated file generation time is the same as the original file generation time;
s10313, when detecting that the generation time of the updated file is the same as the generation time of the original file, comparing whether the size of the updated file is the same as the size of the original file;
s10314, when detecting that the size of the updated file is the same as that of the original file, comparing whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value;
s10315, when detecting that the updated cyclic redundancy check value is the same as the original cyclic redundancy check value, comparing whether the updated information abstract value is the same as the original information abstract value;
and S10316, when detecting that the updated message digest value is the same as the original message digest value, comparing whether the updated hash value is the same as the original hash value.
In specific application, the preset sequence is set as a sequence from small to large of the detection difficulty of the verification data. The first check data comprises a plurality of types of check data in an updated file name, updated file generation time, an updated file size, an updated cyclic redundancy check value, an updated information digest value and an updated hash value; the second check data comprises a plurality of types of check data in the original file name, the original file generation time, the original file size, the original cyclic redundancy check value, the original information abstract value and the original hash value; and correspondingly setting a preset sequence to compare the sequence from the file name, the file generation time, the file size, the cyclic redundancy check value, the information abstract value to the hash value. Firstly, comparing whether the updated file name is the same as the original file name or not according to a preset sequence; when detecting that the updated file name is the same as the original file name, comparing whether the updated file generation time is the same as the original file generation time or not; when the generation time of the updated file is detected to be the same as the generation time of the original file, comparing whether the size of the updated file is the same as that of the original file or not; when the size of the updated file is detected to be the same as that of the original file, comparing whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value or not; when the updated cyclic redundancy check value is detected to be the same as the original cyclic redundancy check value, comparing whether the updated information abstract value is the same as the original information abstract value; and when the updated information digest value is detected to be the same as the original information digest value, comparing whether the updated hash value is the same as the original hash value, and finally judging whether the first check data meet the preset requirement according to the comparison result of whether the updated hash value is the same as the original hash value.
As shown in fig. 4, in an embodiment, the step S104 includes:
s1041, deleting the original file data when the detection result indicates that the first check data does not meet a preset requirement;
and S1042, writing new file data according to the data updating packet to complete file updating processing.
In specific application, when the detection result indicates that the first check data does not meet the preset requirement, deleting original file data stored in a specified address at the current moment, writing new file data carried by the original file data into the original file data according to the data updating packet, and completing file updating processing operation.
In one embodiment, the method further comprises:
and when the detection result indicates that the first check data meet the preset requirement, judging that the updating operation is finished.
In a specific application, when the detection result indicates that the first check data meets the preset requirement, it is determined that the original file data and the new file data stored in the designated address at the current time are the same, that is, the file updating operation is completed.
In the embodiment, the second check data of the data update package and the first check data of the original file are detected, and when the detection result indicates that the first check data does not meet the preset requirement, the file update processing is completed according to the data update package, so that repeated update operation of the file can be avoided, the data transmission efficiency of the embedded system is improved, the resource loss is reduced, and the file update efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the file updating method based on the embedded system described in the above embodiment, fig. 5 shows a structural block diagram of a file updating apparatus based on the embedded system provided in the embodiment of the present application, and for convenience of description, only the parts related to the embodiment of the present application are shown.
Referring to fig. 5, the file updating apparatus 100 based on an embedded system includes:
a receiving module 101, configured to obtain first check data corresponding to a data update packet when the data update packet is received;
the obtaining module 102 is configured to obtain second check data of the original file data;
the detection module 103 is configured to detect the first check data according to the second check data to obtain a detection result;
and the updating module 104 is configured to complete file updating processing according to the data updating packet when the detection result indicates that the first check data does not meet a preset requirement.
In one embodiment, the first check data includes a plurality of types of check data among an updated file name, an updated file generation time, an updated file size, an updated cyclic redundancy check value, an updated information digest value, and an updated hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value.
In one embodiment, the detection module 103 includes:
the comparison unit is used for comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
the first detection unit is used for judging that the detection result is that the first check data does not meet the preset requirement when any type of check data is detected to be different.
In one embodiment, the detection module 103 further includes:
and the second detection unit is used for judging that the detection result is that the first verification data meets the preset requirement when all types of verification data are detected to be the same.
In one embodiment, the comparison unit includes:
the first comparison subunit is used for comparing whether the updated file name is the same as the original file name;
the second comparison subunit is used for comparing whether the update file generation time is the same as the original file generation time or not when detecting that the update file name is the same as the original file name;
a third comparing subunit, configured to compare, when it is detected that the update file generation time is the same as the original file generation time, whether the size of the update file is the same as the size of the original file;
a fourth comparing subunit, configured to compare whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value when it is detected that the updated file size is the same as the original file size;
a fifth comparing subunit, configured to compare whether the updated information digest value is the same as the original information digest value or not when it is detected that the updated cyclic redundancy check value is the same as the original cyclic redundancy check value;
and the sixth comparison subunit is configured to, when it is detected that the updated message digest value is the same as the original message digest value, compare whether the updated hash value is the same as the original hash value.
In one embodiment, the update module 104 includes:
the deleting unit is used for deleting the original file data when the detection result indicates that the first check data does not meet the preset requirement;
and the updating unit is used for writing new file data according to the data updating packet to finish file updating processing.
In one embodiment, the embedded system based file updating apparatus 100 further includes:
and the judging module is used for judging that the updating operation is finished when the detection result indicates that the first check data meets the preset requirement.
In the embodiment, the second check data of the data update package and the first check data of the original file are detected, and when the detection result indicates that the first check data does not meet the preset requirement, the file update processing is completed according to the data update package, so that repeated update operation of the file can be avoided, the data transmission efficiency of the embedded system is improved, the resource loss is reduced, and the file update efficiency is improved.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Fig. 6 is a schematic structural diagram of the terminal device provided in this embodiment. As shown in fig. 6, the terminal device 6 of this embodiment includes: at least one processor 60 (only one shown in fig. 6), a memory 61, and a computer program 62 stored in the memory 61 and operable on the at least one processor 60, wherein the processor 60 executes the computer program 62 to implement the steps in any of the various embedded system-based file update method embodiments described above.
The terminal device 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is only an example of the terminal device 6, and does not constitute a limitation to the terminal device 6, and may include more or less components than those shown, or combine some components, or different components, such as an input/output device, a network access device, and the like.
The Processor 60 may be a Central Processing Unit (CPU), and the Processor 60 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD), a Flash memory Card (Flash Card), and the like, which are equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A file updating method based on an embedded system is characterized by comprising the following steps:
when a data updating packet is received, acquiring first verification data corresponding to the data updating packet;
acquiring second check data of the original file data;
detecting the first check data according to the second check data to obtain a detection result;
and when the detection result indicates that the first check data does not meet the preset requirement, finishing file updating processing according to the data updating package.
2. The embedded system-based file updating method of claim 1, wherein the first check data includes a plurality of types of check data among an update file name, an update file generation time, an update file size, an update cyclic redundancy check value, an update information digest value, and an update hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value;
the detecting the first check data according to the second check data to obtain a detection result includes:
comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
when any type of check data is detected to be different, the detection result is judged that the first check data does not meet the preset requirement.
3. The file updating method based on embedded system according to claim 2, wherein the detecting the first check data according to the second check data to obtain the detection result further comprises:
and when all types of check data are detected to be the same, judging that the detection result is that the first check data meet the preset requirement.
4. The file updating method based on the embedded system as claimed in claim 2, wherein the comparing the first check-up data and the corresponding check-up data of the same type in the second check-up data according to the preset order comprises:
comparing whether the updated file name is the same as the original file name;
when detecting that the updated file name is the same as the original file name, comparing whether the updated file generation time is the same as the original file generation time;
when the generation time of the updated file is detected to be the same as the generation time of the original file, comparing whether the size of the updated file is the same as that of the original file;
when the updated file size is detected to be the same as the original file size, comparing whether the updated cyclic redundancy check value is the same as the original cyclic redundancy check value;
when the updated cyclic redundancy check value is detected to be the same as the original cyclic redundancy check value, comparing whether the updated information abstract value is the same as the original information abstract value;
and when detecting that the updated message digest value is the same as the original message digest value, comparing whether the updated hash value is the same as the original hash value.
5. The file updating method based on the embedded system according to claim 1, wherein when the detection result indicates that the first check data does not satisfy the preset requirement, the file updating process is completed according to the data updating packet, and the method includes:
deleting the original file data when the detection result indicates that the first check data does not meet the preset requirement;
and writing new file data according to the data updating packet to finish file updating processing.
6. The embedded system-based file updating method of any one of claims 1 to 5, wherein the method further comprises:
and when the detection result indicates that the first check data meet the preset requirement, judging that the updating operation is finished.
7. A file updating device based on an embedded system is characterized by comprising:
the device comprises a receiving module, a verification module and a verification module, wherein the receiving module is used for acquiring first verification data corresponding to a data updating packet when the data updating packet is received;
the acquisition module is used for acquiring second check data of the original file data;
the detection module is used for detecting the first check data according to the second check data to obtain a detection result;
and the updating module is used for finishing file updating processing according to the data updating package when the detection result indicates that the first check data does not meet the preset requirement.
8. The embedded system-based file updating apparatus of claim 7, wherein the first check data includes a plurality of types of check data among an update file name, an update file generation time, an update file size, an update cyclic redundancy check value, an update information digest value, and an update hash value; the second check data comprises a plurality of types of check data in an original file name, original file generation time, original file size, original cyclic redundancy check value, original information abstract value and original hash value;
the detection module comprises:
the comparison unit is used for comparing the first check data with the corresponding check data of the same type in the second check data according to a preset sequence;
the first detection unit is used for judging that the detection result is that the first check data does not meet the preset requirement when any type of check data is detected to be different.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202110350209.0A 2021-03-31 2021-03-31 File updating method and device based on embedded system and terminal equipment Pending CN112988691A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110350209.0A CN112988691A (en) 2021-03-31 2021-03-31 File updating method and device based on embedded system and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110350209.0A CN112988691A (en) 2021-03-31 2021-03-31 File updating method and device based on embedded system and terminal equipment

Publications (1)

Publication Number Publication Date
CN112988691A true CN112988691A (en) 2021-06-18

Family

ID=76338768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110350209.0A Pending CN112988691A (en) 2021-03-31 2021-03-31 File updating method and device based on embedded system and terminal equipment

Country Status (1)

Country Link
CN (1) CN112988691A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097474A1 (en) * 2000-05-12 2003-05-22 Isochron Data Corporation Method and system for the efficient communication of data with and between remote computing devices
CN107682436A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment of more new file
WO2018039875A1 (en) * 2016-08-29 2018-03-08 北京小米移动软件有限公司 Method and apparatus for acquiring application upgrade package
CN109828767A (en) * 2017-11-23 2019-05-31 同方威视技术股份有限公司 Electronic lock equipment and its firmware upgrade method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097474A1 (en) * 2000-05-12 2003-05-22 Isochron Data Corporation Method and system for the efficient communication of data with and between remote computing devices
WO2018039875A1 (en) * 2016-08-29 2018-03-08 北京小米移动软件有限公司 Method and apparatus for acquiring application upgrade package
CN107682436A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment of more new file
CN109828767A (en) * 2017-11-23 2019-05-31 同方威视技术股份有限公司 Electronic lock equipment and its firmware upgrade method

Similar Documents

Publication Publication Date Title
CN109814524B (en) Vehicle diagnosis method, device and system
CN107832062B (en) Program updating method and terminal equipment
CN108038112B (en) File processing method, mobile terminal and computer readable storage medium
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN111694589B (en) Upgrade package generation method, device, server and computer readable storage medium
CN111343267B (en) Configuration management method and system
CN114465998A (en) Multi-device file transmission method and device, terminal device and readable storage medium
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN106775835B (en) Method, server and terminal for acquiring upgrade file
CN107679222B (en) Picture processing method, mobile terminal and computer readable storage medium
CN112015459A (en) Method and device for upgrading image file, terminal and readable storage medium
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN110245016B (en) Data processing method, system, device and terminal equipment
WO2021097624A1 (en) File processing method, file processing apparatus, and terminal device
CN109298956B (en) File transmission method and device and terminal equipment
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN109271266B (en) File transmission method and device and terminal equipment
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
CN112988691A (en) File updating method and device based on embedded system and terminal equipment
CN113055250B (en) Networking communication method, device, terminal equipment and storage medium
CN114258525B (en) Data updating method, device, terminal equipment and computer readable storage medium
CN113760237A (en) Compiling address updating method and device, terminal equipment and readable storage medium
CN114185804A (en) Interface testing method and device and terminal equipment
CN111352357B (en) Robot control method and device and terminal equipment
WO2021097622A1 (en) File processing method, file processing apparatus and terminal device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210618