CN106326310B - Resource encryption updating method for mobile phone client software - Google Patents

Resource encryption updating method for mobile phone client software Download PDF

Info

Publication number
CN106326310B
CN106326310B CN201510388140.5A CN201510388140A CN106326310B CN 106326310 B CN106326310 B CN 106326310B CN 201510388140 A CN201510388140 A CN 201510388140A CN 106326310 B CN106326310 B CN 106326310B
Authority
CN
China
Prior art keywords
file
files
mobile phone
phone client
updating
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.)
Expired - Fee Related
Application number
CN201510388140.5A
Other languages
Chinese (zh)
Other versions
CN106326310A (en
Inventor
杨杰会
邓文
刘学军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Lottery E Platform Technology Co ltd
Original Assignee
China Mobile Lottery E Platform 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 China Mobile Lottery E Platform Technology Co ltd filed Critical China Mobile Lottery E Platform Technology Co ltd
Priority to CN201510388140.5A priority Critical patent/CN106326310B/en
Publication of CN106326310A publication Critical patent/CN106326310A/en
Application granted granted Critical
Publication of CN106326310B publication Critical patent/CN106326310B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/18File system types
    • G06F16/182Distributed file systems
    • 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
    • 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/18File system types
    • G06F16/182Distributed file systems
    • G06F16/184Distributed file systems implemented as replicated file system
    • G06F16/1844Management specifically adapted to replicated 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)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a resource encryption updating method of mobile phone client software, which comprises the following steps: A. establishing an update file; B. updating and verifying; C. determining an update file list; D. downloading an update file; E. updating the software by using the update file; F. checking the correctness of the updating result; G. and performing update verification again to determine whether to continue updating. The invention can improve the defects of the prior art and reduce the influence of software update on the normal use of the software.

Description

Resource encryption updating method for mobile phone client software
Technical Field
The invention relates to the technical field of data updating, in particular to a resource encryption updating method for mobile phone client software.
Background
With the development of mobile phone hardware technology, software running in the smart phone is more and more complex. Software in the smart phone needs to be updated continuously. Chinese patent CN 102054045B discloses a resource updating system and method for an electronic device, which can efficiently update resource files in the electronic device and reduce the load of a server. However, when the software updating method is operated, the software cannot normally operate, and the software can be restarted after the updating is completed, so that the software updating method is inconvenient to use.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a resource encryption updating method for mobile phone client software, which can solve the defects of the prior art and reduce the influence of software updating on the normal use of the software.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows.
A resource encryption updating method for mobile phone client software comprises the following steps:
A. compressing data to be updated into a compressed file by the server, and simultaneously compiling an index file and an MD5 code of the content of the compressed file;
B. the mobile phone client runs software, is in communication connection with the server side, acquires the MD5 code of the compressed file, compares the MD5 code with the MD5 code of a corresponding resource file in the mobile phone client, if the MD5 codes are the same, the updating step is ended, and if the MD5 codes are different, the following steps are carried out;
C. the mobile phone client acquires the index file and determines a file list needing to be updated;
D. the method comprises the steps that when a mobile phone client runs software, files are downloaded from a server side according to a file list, the mobile phone client divides the downloaded files into two types, the downloaded files needing to be replaced by corresponding original files in the mobile phone client software are marked as first-type files, and the downloaded files needing to be added into the mobile phone client software are marked as second-type files;
E. directly adding the second type of files to corresponding positions of mobile phone client software; setting a buffer area in a mobile phone client for replacing a first class of files, storing original files which are not called by software and correspond to the first class of files into the buffer area, then replacing the original files by using the first class of files corresponding to the first class of files, establishing mapping relations between a plurality of first class of files and the original files for the original files which are called by the software and correspond to the first class of files, wherein different mapping relations are in a serial relation, an intermediate file is arranged between two adjacent mapping relations, sequentially replacing the files at the position of the original files by using the intermediate files from the intermediate file closest to the original files, and storing the replaced files into the buffer area;
F. when an error occurs in the file replacement process, restoring the file by using the file in the buffer area;
G. and recalculating the MD5 code for the updated file, ending the updating process if the updated MD5 code is the same as the MD5 code sent by the server side, and if the updated MD5 code is different from the MD5 code, starting to execute the step C in a circulating mode again.
Preferably, in step a, the index file includes a plurality of file feature keywords and file address pointers, and file address pointers are arranged between file blocks represented by different file feature keywords.
Preferably, the file feature keywords comprise a file block range mark and a verification module, when the mobile phone client downloads the file, the download interval is directly determined through the file block range mark, and after the download is finished, the integrity of the file is checked through the verification module.
Preferably, the file address pointer is in a bidirectional mapping relationship, the shortest path between file feature keywords is selected as a mapping main direction of the file address pointer, and the preferred mapping main direction is skipped between different downloading intervals.
Preferably, in step D, the mobile phone client preferentially downloads the update file of the part of the software being called.
Preferably, the buffer area is a stack structure, and when the files in the buffer area are used for restoration, at least two files on the top of the stack structure are used for restoration.
Adopt the beneficial effect that above-mentioned technical scheme brought to lie in: the invention improves the confidentiality of the updated resource, is convenient for dynamically updating the resource, has high updating efficiency and small occupation rate to the CPU. The invention realizes the synchronous execution of software operation and software updating by improving the updating step of the resource file, has high efficiency of the updating process and does not bring great pressure to the multithreading operation of the CPU.
Detailed Description
A resource encryption updating method for mobile phone client software is characterized by comprising the following steps:
A. compressing data to be updated into a compressed file by the server, and simultaneously compiling an index file and an MD5 code of the content of the compressed file; the index file comprises a plurality of file characteristic keywords and file address pointers, the file address pointers are arranged between file blocks represented by different file characteristic keywords, the file characteristic keywords comprise file block range marks and a verification module, when a mobile phone client downloads a file, a download interval is directly determined through the file block range marks, the integrity of the file is checked through the verification module after the download is finished, the file address pointers are in a bidirectional mapping relation, the shortest path between the file characteristic keywords is selected as a mapping main direction of the file address pointers, and the preferred mapping main direction is skipped between different download intervals;
B. the mobile phone client runs software, is in communication connection with the server side, acquires the MD5 code of the compressed file, compares the MD5 code with the MD5 code of a corresponding resource file in the mobile phone client, if the MD5 codes are the same, the updating step is ended, and if the MD5 codes are different, the following steps are carried out;
C. the mobile phone client acquires the index file and determines a file list needing to be updated;
D. the method comprises the steps that when a mobile phone client runs software, files are downloaded from a server side according to a file list, the mobile phone client divides the downloaded files into two types, the downloaded files needing to be replaced by corresponding original files in the mobile phone client software are marked as first-type files, and the downloaded files needing to be added into the mobile phone client software are marked as second-type files; the mobile phone client preferentially downloads the update file of the part of the software being called;
E. directly adding the second type of files to corresponding positions of mobile phone client software; setting a buffer area in a mobile phone client for replacing a first class of files, wherein the buffer area is of a stack structure, storing original files which are not called by software and correspond to the first class of files into the buffer area, then replacing the original files by using the first class of files corresponding to the buffer area, establishing mapping relations between a plurality of first class of files and the original files for the original files which are called by the software and correspond to the first class of files, wherein the different mapping relations are in a series relation, an intermediate file is arranged between every two adjacent mapping relations, sequentially replacing the files at the position of the original files by using the intermediate files from the intermediate file closest to the original files, and storing the replaced files into the buffer area; during replacement, a mirror image area is established in a mobile phone client operation memory, an operation program mirror image before replacement is established in the mirror image area, intermediate files are read into the operation memory one by one to realize the replacement of calling files, and the operation priority of the intermediate files in the operation memory is higher than that of the program file in the mirror image area;
F. when an error occurs in the file replacement process, the file in the buffer area is used for restoring the file, and when the file in the buffer area is used for restoring, at least two files at the top of the stack structure are used for restoring;
G. and recalculating the MD5 code for the updated file, ending the updating process if the updated MD5 code is the same as the MD5 code sent by the server side, and if the updated MD5 code is different from the MD5 code, starting to execute the step C in a circulating mode again.
Compared with the prior art, the method can reduce the program updating time by 80-90%, the occupation rate of the CPU in the updating process is averagely reduced by more than 20%, the updating process is high in safety, and the updating result is high in accuracy.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (6)

1. A resource encryption updating method for mobile phone client software is characterized by comprising the following steps:
A. the server side compresses the resource data of a specific type to be updated into a compressed file, and simultaneously codes an index file and an MD5 code of the content of the compressed file;
B. the mobile phone client runs software, is in communication connection with the server side, acquires the MD5 code of the compressed file, compares the MD5 code with the MD5 code of a corresponding resource file in the mobile phone client, if the MD5 codes are the same, the updating step is ended, and if the MD5 codes are different, the following steps are carried out;
C. the mobile phone client acquires the index file and determines a file list needing to be updated;
D. the method comprises the steps that when a mobile phone client runs software, files are downloaded from a server side according to a file list, the mobile phone client divides the downloaded files into two types, the downloaded files needing to be replaced by corresponding original files in the mobile phone client software are marked as first-type files, and the downloaded files needing to be added into the mobile phone client software are marked as second-type files;
E. directly adding the second type of files to corresponding positions of mobile phone client software; setting a buffer area in a mobile phone client for replacing a first class of files, storing original files which are not called by software and correspond to the first class of files into the buffer area, then replacing the original files by using the first class of files corresponding to the first class of files, establishing mapping relations between a plurality of first class of files and the original files for the original files which are called by the software and correspond to the first class of files, wherein different mapping relations are in a serial relation, an intermediate file is arranged between two adjacent mapping relations, sequentially replacing the files at the position of the original files by using the intermediate files from the intermediate file closest to the original files, and storing the replaced files into the buffer area;
F. when an error occurs in the file replacement process, restoring the file by using the file in the buffer area;
G. and recalculating the MD5 code for the updated file, ending the updating process if the updated MD5 code is the same as the MD5 code sent by the server side, and if the updated MD5 code is different from the MD5 code, starting to execute the step C in a circulating mode again.
2. The method for encrypting and updating the resources of the mobile phone client software according to claim 1, wherein: in the step A, the index file comprises a plurality of file characteristic keywords and file address pointers, and the file address pointers are arranged between file blocks represented by different file characteristic keywords.
3. The method for encrypting and updating the resources of the mobile phone client software according to claim 2, wherein: the file characteristic keywords comprise file block range marks and a verification module, when the mobile phone client downloads a file, a download interval is directly determined through the file block range marks, and the integrity of the file is verified through the verification module after the download is finished.
4. The method for encrypting and updating the resources of the mobile phone client software according to claim 3, wherein: the file address pointer is in a bidirectional mapping relation, the shortest path between file feature keywords is selected as the mapping main direction of the file address pointer, and the preferred mapping main direction is skipped between different downloading intervals.
5. The method for encrypting and updating the resources of the mobile phone client software according to claim 1, wherein: and step D, the mobile phone client preferentially downloads part of the update files called by the software.
6. The method for encrypting and updating the resources of the mobile phone client software according to claim 1, wherein: the buffer area is of a stack structure, and when files in the buffer area are used for restoration, at least two files on the top of the stack structure are used for restoration.
CN201510388140.5A 2015-07-06 2015-07-06 Resource encryption updating method for mobile phone client software Expired - Fee Related CN106326310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510388140.5A CN106326310B (en) 2015-07-06 2015-07-06 Resource encryption updating method for mobile phone client software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510388140.5A CN106326310B (en) 2015-07-06 2015-07-06 Resource encryption updating method for mobile phone client software

Publications (2)

Publication Number Publication Date
CN106326310A CN106326310A (en) 2017-01-11
CN106326310B true CN106326310B (en) 2021-05-14

Family

ID=57727360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510388140.5A Expired - Fee Related CN106326310B (en) 2015-07-06 2015-07-06 Resource encryption updating method for mobile phone client software

Country Status (1)

Country Link
CN (1) CN106326310B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107682436A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment of more new file
CN109908585B (en) * 2019-03-06 2022-12-27 珠海金山数字网络科技有限公司 File processing method and system, computing device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054045A (en) * 2010-12-31 2011-05-11 福建星网视易信息系统有限公司 System and method for updating resources of electronic device
CN103514016A (en) * 2013-09-22 2014-01-15 上海华为技术有限公司 Method and device for upgrading system version and base station controller
CN103984585A (en) * 2014-06-06 2014-08-13 浪潮电子信息产业股份有限公司 Method for upgrading Linux kernel in running process of kernel module capable of being plugged in thermal mode

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8825817B1 (en) * 2012-03-19 2014-09-02 Amazon Technologies, Inc. Using a template to update a stack of resources
US8904162B2 (en) * 2012-08-01 2014-12-02 Intel Corporation Methods and apparatus for performing secure BIOS upgrade

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054045A (en) * 2010-12-31 2011-05-11 福建星网视易信息系统有限公司 System and method for updating resources of electronic device
CN103514016A (en) * 2013-09-22 2014-01-15 上海华为技术有限公司 Method and device for upgrading system version and base station controller
CN103984585A (en) * 2014-06-06 2014-08-13 浪潮电子信息产业股份有限公司 Method for upgrading Linux kernel in running process of kernel module capable of being plugged in thermal mode

Also Published As

Publication number Publication date
CN106326310A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
US10055216B2 (en) Minimizing image copying during partition updates
CN111241061B (en) Writing method of state database, data processing device and storage medium
CN105335181A (en) OTA upgrade realization method and terminal
US20130268491A1 (en) Telemetry system for a cloud synchronization system
CN106790247A (en) A kind of method and apparatus of android system upgrading
CN109829287A (en) Api interface permission access method, equipment, storage medium and device
CN111078672B (en) Data comparison method and device for database
US10127037B2 (en) Method for recognizing application type
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN104978253A (en) Target file checking method and apparatus
CN110928802A (en) Test method, device, equipment and storage medium based on automatic generation of case
CN111177113B (en) Data migration method, device, computer equipment and storage medium
CN104866293A (en) Method and device for extending Android application program function
CN106886436A (en) A kind of method and apparatus of android system upgrading
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
CN106326310B (en) Resource encryption updating method for mobile phone client software
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN111290998A (en) Method, device and equipment for calibrating migration data and storage medium
US20190220363A1 (en) Method, apparatus and computer program product for improving inline pattern detection
CN108829575B (en) Test case recommendation method, electronic device and readable storage medium
JP6812826B2 (en) Storage method, storage device and storage program
CN116095064A (en) File downloading method, computer equipment and storage medium
CN106775802B (en) Method and system for quickly updating mass small files
CN112650710B (en) Data migration sending method and device, storage medium and electronic device
CN111880803B (en) Software construction method and device applied to multiple platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210514

CF01 Termination of patent right due to non-payment of annual fee