WO2019071858A1 - File update method, apparatus, and device - Google Patents

File update method, apparatus, and device Download PDF

Info

Publication number
WO2019071858A1
WO2019071858A1 PCT/CN2017/120167 CN2017120167W WO2019071858A1 WO 2019071858 A1 WO2019071858 A1 WO 2019071858A1 CN 2017120167 W CN2017120167 W CN 2017120167W WO 2019071858 A1 WO2019071858 A1 WO 2019071858A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
updated
local
array
name
Prior art date
Application number
PCT/CN2017/120167
Other languages
French (fr)
Chinese (zh)
Inventor
汪刚
陈少杰
张文明
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2019071858A1 publication Critical patent/WO2019071858A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method, an apparatus, and a device for updating a file.
  • N files stored locally on the mobile terminal and M files of the N files are available, deletion is not required; in the prior art, all N files are usually deleted, or both are deleted. Do not delete. Therefore, the prior art has at least the following technical defects: no deletion of N files will occupy a large amount of storage space on the mobile terminal, affecting the use of the mobile terminal; and all deletions will result in the available M files needing to be served from the next use. The end of the download again, wasting traffic.
  • the present invention provides a method, apparatus and apparatus for updating a file.
  • An aspect of the present invention provides a method for updating a file, including: S1, after sending a request message for acquiring configuration file data to a server, receiving configuration file data returned by the server; wherein the configuration file is generated in advance by the server. a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value is used for Whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, the file to be updated is cancelled and the local file is retained.
  • the step of sending the request message for acquiring the configuration file data to the server in the S1 further includes: S11: acquiring an address of the configuration file download link, and sending the request message to the server according to the address; S12, receiving the server The returned error code, if the error code is 0, the request is successful, and the configuration file data returned by the server is received.
  • the step S2 further includes: S21, parsing the configuration file data to obtain a data dictionary; S22, performing value processing on the data dictionary, and acquiring an array to be updated including at least one element; wherein each The element records at least one name of the file to be updated and an MD5 value.
  • the step S3 further includes: obtaining a name of the local file by looping through the traversal, and storing the name of the local file to a local array; acquiring a path corresponding to the name of the local file;
  • the local file is MD5 encrypted, and the MD5 value corresponding to the local file is obtained.
  • the step S3 further includes: S31, traversing the array to be updated, comparing each file to be updated in the array to be updated with a local file in the local array; if there is a name and an MD5 value The same file to be updated and the local file are added to the pre-created cancel download array; S32, traversing the array to be updated, and determining each file to be updated in the array to be updated If the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, the file to be updated is downloaded according to the download link, and the deleted name is not included in the file. The cancel downloading the local file in the array.
  • the step S22 further includes: S23, determining whether the array to be updated is an array type, and if not an array type, terminating the file update.
  • the step of obtaining the address of the configuration file download link in the step S11 further includes: acquiring a base address and a fixed address of the configuration file download link; splicing the base address and the fixed address to obtain an address of the configuration file download link .
  • Another aspect of the present invention provides an apparatus for updating a file, including: a receiving module, configured to: after receiving a request message for acquiring configuration file data from a server, receive configuration file data returned by a server; wherein the configuration file is a pre-service a text type file generated by the terminal for storing the file information to be updated; an obtaining module, configured to parse the configuration file data, and obtain a name and an MD5 value of at least one file to be updated in the configuration file data; The MD5 value is used to check whether the file information is consistent.
  • the update module is configured to cancel downloading the file to be updated and retain the local file if there are files to be updated and local files whose names and MD5 values are the same.
  • Yet another aspect of the present invention provides an apparatus for updating a file, comprising: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores a program executable by the processor The instruction, the processor, the method, the method, the method, the method, the method, the Wherein, the configuration file is a text type file for storing the information of the file to be updated generated by the server in advance; S2, parsing the configuration file data, obtaining a name of at least one file to be updated in the configuration file data, and An MD5 value, wherein the MD5 value is used to check whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, canceling downloading the file to be updated, and retaining the local file.
  • the configuration file is a text type file for storing the information of the file to be updated generated by the server in advance
  • S2 parsing the configuration file data, obtaining a name of at least one file to be updated in the configuration file data
  • Yet another aspect of the present invention provides a non-transitory computer readable storage medium storing computer instructions that cause the computer to perform an update file provided by the above aspects of the present invention
  • the method includes, for example, S1, after receiving a request message for obtaining configuration file data from the server, receiving configuration file data returned by the server; wherein the configuration file is a text type generated by the server in advance for storing the information of the file to be updated.
  • Yet another aspect of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer
  • the method for causing the computer to execute the update file provided by the present invention includes, for example, S1, after sending a request message for acquiring configuration file data to the server, receiving configuration file data returned by the server; wherein the configuration file is a pre-service And generating a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value For verifying whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, cancel the downloading of the file to be updated, and retain the local file.
  • the method, device and device for updating a file provided by the present invention obtain a partial reservation of a local file and a file to be updated by obtaining a name of the file to be updated and an MD5 value, and determining whether the file is the same as the local file.
  • the partial download saves the traffic consumed by the mobile terminal for file update, and releases the local storage space of the mobile terminal, so that the local file is consistent with the server.
  • FIG. 1 is a schematic flowchart of a method for updating a file according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a method for updating a file according to an embodiment of the present invention.
  • the method includes: S1, after receiving a request message for acquiring configuration file data from a server, receiving configuration file data returned by a server;
  • the configuration file is a text type file for storing the information of the file to be updated generated by the server in advance; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data.
  • the MD5 value is used to check whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, the file to be updated is cancelled and the local file is retained.
  • the configuration file is a text type file preset in the server; the file records the information of the file to be updated, and includes at least the name or ID of the file to be updated, the download link, and the MD5 value.
  • the mobile terminal may The data in the configuration file is obtained by sending a request message.
  • MD5 Message-Digest Algorithm 5
  • hash algorithms also known as abstract algorithm, hash algorithm
  • hash algorithm There are MD5 implementations; computing data (such as Chinese characters) to another fixed length value is the basic principle of the hash algorithm.
  • the predecessors of MD5 are MD2, MD3 and MD4.
  • the embodiment of the present invention selects the MD5 as a means for confirming whether the file information is the same, but the scope of protection of the embodiment of the present invention is not limited thereto.
  • step S1 the mobile terminal first sends a request message to the server, where the request message carries information requesting to acquire configuration file data; after receiving the request message, the server may return a sending configuration file to the mobile terminal according to the request message. data.
  • the file configuration interface function chaackCustomEmblemConfig is added on the mobile terminal, and the function is used to determine which files to be updated (compressed package files) are downloaded by the mobile terminal.
  • the mobile terminal may further parse the configuration file data, and obtain information carried in the configuration file, where the information includes at least one related information of the file to be updated, and the related information includes at least File name and MD5 value. For example, if the file to be updated is a compressed package file, the name of the compressed package and the MD5 value corresponding to the compressed package are included after parsing.
  • step S3 according to the name of the file to be updated and the MD5 value obtained in step S2, the name of the local file and the MD5 value are compared, as follows:
  • the MD5 value and the name of a local file and a file to be updated are the same, the information of the file to be updated and the information of the local file are not changed, and the local file does not need to be updated, then the file to be updated is cancelled. Similarly, The local file is reserved on the mobile side without deleting the local file.
  • the method for updating a file obtained by the embodiment of the present invention obtains a part of the local file and a partial download of the file to be updated by obtaining the name of the file to be updated and the MD5 value, and determining whether the file is the same as the local file.
  • the traffic consumed by the mobile terminal for file update is saved, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.
  • the step of sending the request message for acquiring the configuration file data to the server in the S1 further includes: S11: acquiring an address of the configuration file download link, and sending, according to the address, the server to the server The request message; S12, receiving an error code returned by the server, if the error code is 0, the request is successful, and receiving the configuration file data returned by the server.
  • step S11 the mobile terminal first obtains the address of the download link of the configuration file, and then takes the address to the server to request the data of the configuration file.
  • step S12 after requesting data in step S11, the server sends an error code to the mobile terminal to inform whether the network request is successful or not; if successful, the error code is 0, and the server returns configuration file data. .
  • the step S2 further includes: S21, parsing the profile data to obtain a data dictionary; S22, performing value processing on the data dictionary to obtain at least one element An array to be updated; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
  • the data dictionary refers to defining and describing data items, data structures, data streams, data storage, processing logic, external entities, and the like.
  • step S21 the mobile terminal parses the received profile data and parses it into a data dictionary; then performs a related processing operation on the data dictionary.
  • step S22 according to the data dictionary acquired in step S21, the data dictionary is subjected to a value operation, for example, using the objectForKey method to extract an array to be updated newListArray from the data dictionary; the array to be updated stores at least one element, each element The name of the file to be updated (the name of the ID or the compressed package) and the MD5 value are recorded; in addition, a download link of the file to be updated may be included.
  • a value operation for example, using the objectForKey method to extract an array to be updated newListArray from the data dictionary; the array to be updated stores at least one element, each element The name of the file to be updated (the name of the ID or the compressed package) and the MD5 value are recorded; in addition, a download link of the file to be updated may be included.
  • the method further includes: obtaining a name of the local file by looping through the traversal, and storing the name of the local file to a local array; acquiring the name corresponding to the local file
  • the path is obtained by performing MD5 encryption on the local file according to the path, and obtaining an MD5 value corresponding to the local file.
  • a local array localZipFile may be created in advance for storing information of a local file; a local file that has been stored on the mobile end may be traversed, a name of each local file (compressed package) is obtained, and each name is stored in In the local array.
  • the storage path filePath corresponding to the local file is obtained; the local file is MD5-encrypted according to the storage path, and the MD5 value corresponding to the local file is obtained; and the MD5 value can be stored in the local array.
  • the name file of the local file is obtained; the local file is MD5-encrypted according to the storage path, and the MD5 value corresponding to the local file is obtained; and the MD5 value can be stored in the local array.
  • the step S3 further includes: S31, traversing the array to be updated, comparing each file to be updated in the array to be updated with a local file in the local array If there are files to be updated and local files whose names and MD5 values are the same, the name of the local file is added to the pre-created cancel download array, and the local file is retained; S32, traversing the array to be updated, Determining, for each file to be updated, the file to be updated; if the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, according to the The download link downloads the file to be updated and deletes the local file whose name is not included in the cancel download array.
  • step S31 traversing the array to be updated, comparing the name of each file to be updated and the MD5 value to the name of the text file and the MD5 value; if the name of the file to be updated and the name of the local file and the MD5 value are the same, The description file information has not changed. The local file does not need to be updated. The same name is stored in the pre-created cancel download array doNotNeedDownLoadRoomIDArray. After traversing, canceling the download array saves the names of all files to be updated that do not need to be downloaded, and correspondingly, the names of all local files that need to be retained.
  • step S32 performing a traversal operation on the array to be updated, first determining whether each file name to be updated has a corresponding download link zipUrl, and if so, proving that the file to be updated is downloadable; Whether the name is included in the cancel download array. If it is not included, it means that there is no file to be updated locally, and the file to be updated needs to be downloaded; otherwise, no download is required. After traversing, it is possible to complete the download operation for all files that are not present locally.
  • the name of the local file that needs to be preserved is also saved in the cancel download array, and then the delete operation is performed on the local file that does not contain the name in the cancel download array.
  • Double-layer loop traversal through arrays can effectively save code and improve performance.
  • the step S22 further includes: S23, determining whether the array to be updated is an array type, and if not an array type, terminating the file update.
  • the step of obtaining the address of the configuration file download link in the step S11 further includes: acquiring a base address and a fixed address of the configuration file download link; and splicing the base address and the fixed address to obtain The address of the configuration file download link.
  • the address includes the base address (baseUrl) of the first half and the fixed address (Url) of the second half; wherein baseUrl is corresponding to various environments.
  • Address which is different in different environments (test environment or formal environment); Url is usually fixed; splicing baseUrl and Url into a complete download link address (requestStr), you can request configuration by requestStr to the server File data.
  • the method includes: a receiving module 201, configured to send a request message for obtaining configuration file data to a server, and receive a configuration returned by a server.
  • the file data wherein the configuration file is a text type file generated by the server in advance for storing the information of the file to be updated;
  • the obtaining module 202 is configured to parse the configuration file data, and obtain at least one of the configuration file data.
  • the receiving module 201 first sends a request message to the server, where the request message carries information requesting to acquire configuration file data; after receiving the request message, the server may return a sending configuration file to the receiving module 201 according to the request message. data.
  • the receiving module 201 can specifically determine which files to be updated (compressed file files) to be downloaded by adding a file configuration interface function function, cheackCustomEmblemConfig.
  • the obtaining module 202 may further parse the configuration file data, and obtain information carried in the configuration file, where the information includes at least one related information of the file to be updated, and related information.
  • the information includes at least the file name and the MD5 value. For example, if the file to be updated is a compressed package file, the name of the compressed package and the MD5 value corresponding to the compressed package are included after parsing.
  • the update module 203 compares the name of the file to be updated and the MD5 value obtained in the obtaining module 202 with the name of the local file and the MD5 value, as follows:
  • the update module 203 cancels downloading the file to be updated; Similarly, the update module 203 does not delete the local file and retains the local file.
  • the update module 203 should perform the download; for other local files than the reserved local file, the update module 203 should delete.
  • the device for updating the file obtained by the embodiment of the present invention obtains the partial reservation of the local file and the partial download of the file to be updated by obtaining the name of the file to be updated and the MD5 value, and determining whether the file is the same as the local file.
  • the traffic consumed by the mobile terminal for file update is saved, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.
  • the receiving module 201 further includes: an obtaining unit, configured to acquire an address of the configuration file download link, send the request message to the server according to the address, and receive a unit, configured to receive The error code returned by the server. If the error code is 0, the request is successful, and the configuration file data returned by the server is received.
  • the obtaining module 202 further includes: a parsing unit, configured to parse the configuration file data, and obtain a data dictionary; and a value unit, configured to perform value on the data dictionary Processing, obtaining an array to be updated that includes at least one element; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
  • a parsing unit configured to parse the configuration file data, and obtain a data dictionary
  • a value unit configured to perform value on the data dictionary Processing, obtaining an array to be updated that includes at least one element; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
  • the device further includes: a storage module, configured to obtain a name of the local file by looping through the traversal, and store the name of the local file to a local array; and an encryption module, configured to acquire The path corresponding to the name of the local file is performed; the local file is MD5-encrypted according to the path, and the MD5 value corresponding to the local file is obtained.
  • a storage module configured to obtain a name of the local file by looping through the traversal, and store the name of the local file to a local array
  • an encryption module configured to acquire The path corresponding to the name of the local file is performed; the local file is MD5-encrypted according to the path, and the MD5 value corresponding to the local file is obtained.
  • the updating module 203 further includes: a first traversing unit, configured to traverse the array to be updated, and each file to be updated in the array to be updated and the local array The local files in the comparison are compared; if there are files to be updated and local files whose names and MD5 values are the same, the name of the local file is added to the pre-created cancel download array; the second traversal unit is used to traverse the An array to be updated is determined for each file to be updated in the array to be updated; if the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, And downloading the file to be updated according to the download link, and deleting a local file whose name is not included in the cancel download array.
  • a first traversing unit configured to traverse the array to be updated, and each file to be updated in the array to be updated and the local array
  • the local files in the comparison are compared; if there are files to be updated and local files whose names and MD5 values are the same
  • the obtaining module 202 further includes: a terminating unit, configured to determine whether the array to be updated is an array type, and if not an array type, terminate the file update.
  • the obtaining unit further includes: an address obtaining subunit, configured to acquire a base address and a fixed address of the configuration file download link; and a splicing subunit, configured to splicing the base address and the Fixed address, the address of the configuration file download link.
  • FIG. 3 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention.
  • the apparatus includes: at least one processor 301; and at least one memory 302 communicatively coupled to the processor 301, where:
  • the memory 302 stores a program instruction that can be executed by the processor 301, and the processor 301 invokes the method that the program instruction can execute the update file provided by each embodiment, for example, including: S1, to the server After the request message for obtaining the configuration file data is sent, the configuration file data returned by the server is received; wherein the configuration file is a text type file generated by the server for storing the information of the file to be updated in advance; S2, the configuration file data is Performing a parsing to obtain a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value is used to check whether the file information is consistent; S3, if there is a file to be updated with the same name and MD5 value And the local file, the downloading of the file to
  • the embodiment of the present invention further provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium stores a computer instruction, and the computer instruction causes the computer to execute the method for updating the file provided by the corresponding embodiment, for example, including: S1, after sending the request message for obtaining the configuration file data to the server, receiving the configuration file data returned by the server; wherein the configuration file is a text type file generated by the server for storing the information of the file to be updated in advance; S2, The configuration file data is parsed, and the name and MD5 value of the at least one file to be updated in the configuration file data are obtained; wherein the MD5 value is used to check whether the file information is consistent; S3, if there is a name and an MD5 value If the same file to be updated and the local file are the same, the file to be updated is cancelled and the local file is retained.
  • S1 after sending the request message for obtaining the configuration file data to the server, receiving the configuration file data returned by the server
  • the configuration file is a
  • the embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer
  • the method for executing the update file provided by each of the foregoing method embodiments includes, for example, S1, after sending a request message for obtaining configuration file data to the server, receiving configuration file data returned by the server; wherein the configuration file is a pre-service And generating a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value For verifying whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, cancel the downloading of the file to be updated, and retain the local file.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • the method, the device and the device for updating the file provided by the embodiment of the present invention obtain the name of the file to be updated and the value of the MD5, and determine whether the file is the same as the local file, and then perform corresponding operations on the file, thereby realizing partial reservation and updating of the local file.
  • the partial download of the file saves the traffic consumed by the mobile terminal when the file is updated, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.

Abstract

A file update method, apparatus, and device, the method comprising: after sending a request message for acquiring file configuration data to a server, receiving file configuration data returned by the server (S1); parsing the file configuration data to acquire the name and MD5 value of at least one file to be updated in the file configuration data (S2); the MD5 value is used for checking whether the file information is consistent; if a file to be updated and a local file having the same name and MD5 value exist, cancelling the download of the file to be updated and keeping the local file (S3). Performing corresponding operations after acquiring the name and MD5 value of a file to be updated and determining whether a local file is the same enables partial retention of local files and partial download of files to be updated, saving traffic consumed by a mobile terminal during file updates, releasing local storage space in the mobile terminal, and ensuring consistency between local files and the server.

Description

一种更新文件的方法、装置和设备Method, device and device for updating files
交叉引用cross reference
本申请引用于2017年10月09日提交的专利名称为“一种更新文件的方法、装置和设备”的第2017109315250号中国专利申请,其通过引用被全部并入本申请。The present application is hereby incorporated by reference in its entirety in its entirety in its entirety in its entirety in the the the the the the the the the the the
技术领域Technical field
本发明涉及互联网技术领域,具体涉及一种更新文件的方法、装置和设备。The present invention relates to the field of Internet technologies, and in particular, to a method, an apparatus, and a device for updating a file.
背景技术Background technique
随着例如手机的移动端的快速发展,移动端经常需要下载或更新文件;而针对经下载后存储在移动端本地的文件,经过一段时间后,如果这个文件过期了,则需要删除;如果这个文件没有过期,则需要正常使用该文件,不应当删除;针对上述情况,由于移动端的存储容量是有限的,因此需要对这些文件进行管理。With the rapid development of mobile terminals such as mobile phones, mobile terminals often need to download or update files; for files stored locally on the mobile terminal after downloading, after a period of time, if the file expires, it needs to be deleted; if this file is deleted; If it has not expired, the file needs to be used normally and should not be deleted. For the above situation, since the storage capacity of the mobile terminal is limited, these files need to be managed.
例如,对于存储在移动端本地的N个文件,而N个文件中的M个文件是可用的,是不需要删除的;现有技术中,通常是对全部的N个文件都删除,或者都不删除。因此,现有技术至少存在以下技术缺陷:N个文件都不删除会占用移动端大量的存储空间,影响移动端的使用;而全部都删除,会导致可用的M个文件在下次使用时需要从服务端重新下载,浪费了流量。For example, for N files stored locally on the mobile terminal, and M files of the N files are available, deletion is not required; in the prior art, all N files are usually deleted, or both are deleted. Do not delete. Therefore, the prior art has at least the following technical defects: no deletion of N files will occupy a large amount of storage space on the mobile terminal, affecting the use of the mobile terminal; and all deletions will result in the available M files needing to be served from the next use. The end of the download again, wasting traffic.
发明内容Summary of the invention
针对现有技术中存在的上述缺陷,本发明提供一种更新文件的方法、装置和设备。In view of the above drawbacks existing in the prior art, the present invention provides a method, apparatus and apparatus for updating a file.
本发明的一方面提供一种更新文件的方法,包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。An aspect of the present invention provides a method for updating a file, including: S1, after sending a request message for acquiring configuration file data to a server, receiving configuration file data returned by the server; wherein the configuration file is generated in advance by the server. a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value is used for Whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, the file to be updated is cancelled and the local file is retained.
其中,所述S1中向服务端发送获取配置文件数据的请求消息的步骤进一步包括:S11,获取配置文件下载链接的地址,根据所述地址向服务端发送所述请求消息;S12,接收服务端返回的错误码,若所述错误码为0,则请求成功,并接收服务端返回的所述配置文件数据。The step of sending the request message for acquiring the configuration file data to the server in the S1 further includes: S11: acquiring an address of the configuration file download link, and sending the request message to the server according to the address; S12, receiving the server The returned error code, if the error code is 0, the request is successful, and the configuration file data returned by the server is received.
其中,所述步骤S2进一步包括:S21,对所述配置文件数据进行解析,获取数据字典;S22,对所述数据字典进行取值处理,获取包含至少一个元素的待更新数组;其中,每个所述元素至少记录一个待更新文件的名称和MD5值。The step S2 further includes: S21, parsing the configuration file data to obtain a data dictionary; S22, performing value processing on the data dictionary, and acquiring an array to be updated including at least one element; wherein each The element records at least one name of the file to be updated and an MD5 value.
其中,所述步骤S3前还包括:通过循环遍历获取本地文件的名称,并将所述本地文件的名称存储至本地数组;获取所述本地文件的名称所对应的路径;根据所述路径对所述本地文件进行MD5加密,获取所述本地文件对应的MD5值。The step S3 further includes: obtaining a name of the local file by looping through the traversal, and storing the name of the local file to a local array; acquiring a path corresponding to the name of the local file; The local file is MD5 encrypted, and the MD5 value corresponding to the local file is obtained.
其中,所述步骤S3进一步包括:S31,遍历所述待更新数组,将所述待更新数组中的每个待更新文件与所述本地数组中的本地文件进行比较;若存在名称及MD5值均相同的待更新文件和本地文件,则将所述本地文件的名称添加至预先创建的取消下载数组;S32,遍历所述待更新数组,对所述待更新数组中的每个待更新文件进行判断;若所述待更新文件具有对应的下载链接,且所述待更新文件的名称不包含 在所述取消下载数组中,则根据所述下载链接下载所述待更新文件,并删除名称不包含在所述取消下载数组中的本地文件。The step S3 further includes: S31, traversing the array to be updated, comparing each file to be updated in the array to be updated with a local file in the local array; if there is a name and an MD5 value The same file to be updated and the local file are added to the pre-created cancel download array; S32, traversing the array to be updated, and determining each file to be updated in the array to be updated If the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, the file to be updated is downloaded according to the download link, and the deleted name is not included in the file. The cancel downloading the local file in the array.
其中,所述步骤S22后还包括:S23,判断所述待更新数组是否为数组类型,若不是数组类型,则终止文件更新。The step S22 further includes: S23, determining whether the array to be updated is an array type, and if not an array type, terminating the file update.
其中,所述S11中获取配置文件下载链接的地址的步骤进一步包括:获取配置文件下载链接的基础地址和固定地址;拼接所述基础地址和所述固定地址,获取所述配置文件下载链接的地址。The step of obtaining the address of the configuration file download link in the step S11 further includes: acquiring a base address and a fixed address of the configuration file download link; splicing the base address and the fixed address to obtain an address of the configuration file download link .
本发明另一方面提供一种更新文件的装置,包括:接收模块,用于向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;获取模块,用于对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;更新模块,用于若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。Another aspect of the present invention provides an apparatus for updating a file, including: a receiving module, configured to: after receiving a request message for acquiring configuration file data from a server, receive configuration file data returned by a server; wherein the configuration file is a pre-service a text type file generated by the terminal for storing the file information to be updated; an obtaining module, configured to parse the configuration file data, and obtain a name and an MD5 value of at least one file to be updated in the configuration file data; The MD5 value is used to check whether the file information is consistent. The update module is configured to cancel downloading the file to be updated and retain the local file if there are files to be updated and local files whose names and MD5 values are the same.
本发明的又一方面提供一种更新文件的设备,包括:至少一个处理器;以及与所述处理器通信连接的至少一个存储器,其中:所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行本发明上述方面提供的更新文件的方法,例如包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。Yet another aspect of the present invention provides an apparatus for updating a file, comprising: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores a program executable by the processor The instruction, the processor, the method, the method, the method, the method, the method, the Wherein, the configuration file is a text type file for storing the information of the file to be updated generated by the server in advance; S2, parsing the configuration file data, obtaining a name of at least one file to be updated in the configuration file data, and An MD5 value, wherein the MD5 value is used to check whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, canceling downloading the file to be updated, and retaining the local file.
本发明的又一方面提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行本发明上述方面提供的更新文件的方法,例如包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。Yet another aspect of the present invention provides a non-transitory computer readable storage medium storing computer instructions that cause the computer to perform an update file provided by the above aspects of the present invention The method includes, for example, S1, after receiving a request message for obtaining configuration file data from the server, receiving configuration file data returned by the server; wherein the configuration file is a text type generated by the server in advance for storing the information of the file to be updated. a file; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value is used to verify whether the file information is consistent; S3, if present If the file to be updated and the local file have the same name and MD5 value, the file to be updated is cancelled and the local file is retained.
本发明又一方面提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本发明提供的更新文件的方法,例如包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。Yet another aspect of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer The method for causing the computer to execute the update file provided by the present invention includes, for example, S1, after sending a request message for acquiring configuration file data to the server, receiving configuration file data returned by the server; wherein the configuration file is a pre-service And generating a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value For verifying whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, cancel the downloading of the file to be updated, and retain the local file.
本发明提供的更新文件的方法、装置和设备,通过获取待更新文件的名称和MD5值,并判断与本地文件是否相同后进行相应地操作,实现了对本地文件的部分保留和对待更新文件的部分下载,节约了移动端进行文件更新时消耗的流量,释放了移动端本地的存储空间,使本地文件与服务端保持一致。The method, device and device for updating a file provided by the present invention obtain a partial reservation of a local file and a file to be updated by obtaining a name of the file to be updated and an MD5 value, and determining whether the file is the same as the local file. The partial download saves the traffic consumed by the mobile terminal for file update, and releases the local storage space of the mobile terminal, so that the local file is consistent with the server.
附图说明DRAWINGS
图1为本发明实施例提供的更新文件的方法的流程示意图;1 is a schematic flowchart of a method for updating a file according to an embodiment of the present invention;
图2为本发明实施例提供的更新文件的装置的结构示意图;2 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention;
图3为本发明实施例提供的更新文件的设备的结构示意图。FIG. 3 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific embodiments of the present invention are further described in detail below with reference to the drawings and embodiments. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
图1为本发明实施例提供的更新文件的方法的流程示意图,如图1所示,包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。FIG. 1 is a schematic flowchart of a method for updating a file according to an embodiment of the present invention. As shown in FIG. 1 , the method includes: S1, after receiving a request message for acquiring configuration file data from a server, receiving configuration file data returned by a server; The configuration file is a text type file for storing the information of the file to be updated generated by the server in advance; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data. The MD5 value is used to check whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, the file to be updated is cancelled and the local file is retained.
其中,配置文件为在服务端预先设置的文本类型文件;该文件记录了待更新文件的信息,至少包括待更新文件的名称或ID、下载链接和MD5值;本发明实施例中,移动端可以通过发送请求消息,获取到配置文件中的数据。The configuration file is a text type file preset in the server; the file records the information of the file to be updated, and includes at least the name or ID of the file to be updated, the download link, and the MD5 value. In the embodiment of the present invention, the mobile terminal may The data in the configuration file is obtained by sending a request message.
其中,MD5即Message-Digest Algorithm 5(信息-摘要算法5),用于确保信息传输完整一致;是计算机广泛使用的杂凑算法之一(又译摘要算法、哈希算法),主流编程语言普遍已有MD5实现;将数据(如汉字)运算为另一固定长度值,是杂凑算法的基础原理,MD5的前身有MD2、MD3和MD4。本发明实施例选择MD5作为确认文件信息是否相同的手段,但本发明实施例的保护范围不限于此。MD5, Message-Digest Algorithm 5, is used to ensure complete and consistent information transmission. It is one of the widely used hash algorithms (also known as abstract algorithm, hash algorithm). There are MD5 implementations; computing data (such as Chinese characters) to another fixed length value is the basic principle of the hash algorithm. The predecessors of MD5 are MD2, MD3 and MD4. The embodiment of the present invention selects the MD5 as a means for confirming whether the file information is the same, but the scope of protection of the embodiment of the present invention is not limited thereto.
在步骤S1中,移动端首先向服务端发送一个请求消息,该请求消 息中携带了请求获取配置文件数据的信息;服务端接收到请求消息后,可以根据该请求消息向移动端返回发送配置文件数据。In step S1, the mobile terminal first sends a request message to the server, where the request message carries information requesting to acquire configuration file data; after receiving the request message, the server may return a sending configuration file to the mobile terminal according to the request message. data.
具体可以通过在移动端增加文件配置接口功能函数cheackCustomEmblemConfig,通过该函数实现移动端判断下载哪些待更新文件(压缩包文件)。Specifically, the file configuration interface function chaackCustomEmblemConfig is added on the mobile terminal, and the function is used to determine which files to be updated (compressed package files) are downloaded by the mobile terminal.
在步骤S2中,根据步骤S1中得到的配置文件数据,移动端可以对配置文件数据进行进一步解析;获取配置文件中携带的信息,该信息包括至少一个待更新文件的相关信息,相关信息至少包括文件名称和MD5值。例如待更新文件为压缩包文件,则解析后包括该压缩包的名称和压缩包对应的MD5值。In step S2, according to the configuration file data obtained in step S1, the mobile terminal may further parse the configuration file data, and obtain information carried in the configuration file, where the information includes at least one related information of the file to be updated, and the related information includes at least File name and MD5 value. For example, if the file to be updated is a compressed package file, the name of the compressed package and the MD5 value corresponding to the compressed package are included after parsing.
在步骤S3中,根据步骤S2中得到的待更新文件的名称和MD5值,与本地文件的名称和MD5值进行比较,具体如下:In step S3, according to the name of the file to be updated and the MD5 value obtained in step S2, the name of the local file and the MD5 value are compared, as follows:
如果一个本地文件与一个待更新文件的MD5值和名称都相同,说明该待更新文件和该本地文件的信息没有改变,该本地文件不需要更新,那么就取消下载这个待更新文件;同样的,在移动端不用删除这个本地文件,对该本地文件进行保留。If the MD5 value and the name of a local file and a file to be updated are the same, the information of the file to be updated and the information of the local file are not changed, and the local file does not need to be updated, then the file to be updated is cancelled. Similarly, The local file is reserved on the mobile side without deleting the local file.
相应地,对于除了取消下载的待更新文件之外的其他待更新文件应当进行下载;对除了保留的本地文件之外的其他本地文件应当进行删除。Accordingly, other files to be updated other than the file to be updated that are canceled for downloading should be downloaded; other local files other than the reserved local file should be deleted.
本发明实施例提供的更新文件的方法,通过获取待更新文件的名称和MD5值,并判断与本地文件是否相同后进行相应地操作,实现了对本地文件的部分保留和对待更新文件的部分下载,节约了移动端进行文件更新时消耗的流量,释放了移动端本地的存储空间,使本地文件与服务端保持一致。The method for updating a file provided by the embodiment of the present invention obtains a part of the local file and a partial download of the file to be updated by obtaining the name of the file to be updated and the MD5 value, and determining whether the file is the same as the local file. The traffic consumed by the mobile terminal for file update is saved, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.
在上述任一实施例的基础上,所述S1中向服务端发送获取配置文 件数据的请求消息的步骤进一步包括:S11,获取配置文件下载链接的地址,根据所述地址向服务端发送所述请求消息;S12,接收服务端返回的错误码,若所述错误码为0,则请求成功,并接收服务端返回的所述配置文件数据。On the basis of any of the foregoing embodiments, the step of sending the request message for acquiring the configuration file data to the server in the S1 further includes: S11: acquiring an address of the configuration file download link, and sending, according to the address, the server to the server The request message; S12, receiving an error code returned by the server, if the error code is 0, the request is successful, and receiving the configuration file data returned by the server.
在步骤S11中,移动端首先获取到配置文件的下载链接的地址,再拿这个地址去服务端请求配置文件的数据。In step S11, the mobile terminal first obtains the address of the download link of the configuration file, and then takes the address to the server to request the data of the configuration file.
在步骤S12中,在步骤S11中请求数据后,服务端会向移动端发送一个错误码告知本次网络请求是成功还是失败;如果成功,则错误码为0,并且服务端会返回配置文件数据。In step S12, after requesting data in step S11, the server sends an error code to the mobile terminal to inform whether the network request is successful or not; if successful, the error code is 0, and the server returns configuration file data. .
在上述任一实施例的基础上,所述步骤S2进一步包括:S21,对所述配置文件数据进行解析,获取数据字典;S22,对所述数据字典进行取值处理,获取包含至少一个元素的待更新数组;其中,每个所述元素至少记录一个待更新文件的名称和MD5值。On the basis of any of the above embodiments, the step S2 further includes: S21, parsing the profile data to obtain a data dictionary; S22, performing value processing on the data dictionary to obtain at least one element An array to be updated; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
其中,数据字典是指对数据的数据项、数据结构、数据流、数据存储、处理逻辑、外部实体等进行定义和描述。The data dictionary refers to defining and describing data items, data structures, data streams, data storage, processing logic, external entities, and the like.
在步骤S21中,移动端对接收到的配置文件数据进行解析,解析后成为了数据字典;之后对数据字典执行相关的处理操作。In step S21, the mobile terminal parses the received profile data and parses it into a data dictionary; then performs a related processing operation on the data dictionary.
在步骤S22中,根据步骤S21中获取的数据字典,对数据字典进行取值操作,例如使用objectForKey方法从数据字典中取出一个待更新数组newListArray;这个待更新数组存储了至少一个元素,每个元素记录了一个待更新文件的名称(ID或压缩包的名称)和MD5值;另外,还可以包括待更新文件的下载链接。In step S22, according to the data dictionary acquired in step S21, the data dictionary is subjected to a value operation, for example, using the objectForKey method to extract an array to be updated newListArray from the data dictionary; the array to be updated stores at least one element, each element The name of the file to be updated (the name of the ID or the compressed package) and the MD5 value are recorded; in addition, a download link of the file to be updated may be included.
在上述任一实施例的基础上,所述步骤S3前还包括:通过循环遍历获取本地文件的名称,并将所述本地文件的名称存储至本地数组;获取所述本地文件的名称所对应的路径;根据所述路径对所述本地文 件进行MD5加密,获取所述本地文件对应的MD5值。On the basis of any of the foregoing embodiments, before the step S3, the method further includes: obtaining a name of the local file by looping through the traversal, and storing the name of the local file to a local array; acquiring the name corresponding to the local file The path is obtained by performing MD5 encryption on the local file according to the path, and obtaining an MD5 value corresponding to the local file.
具体地,可以预先创建一个本地数组localZipFile,用于存储本地文件的信息;可以使用一个循环遍历已经存储在移动端的本地文件,获取每个本地文件(压缩包)的名称,并且将各个名称存储在本地数组中。Specifically, a local array localZipFile may be created in advance for storing information of a local file; a local file that has been stored on the mobile end may be traversed, a name of each local file (compressed package) is obtained, and each name is stored in In the local array.
然后根据本地文件的名称file,获取本地文件对应的存储路径filePath;根据存储路径对本地文件进行MD5加密,获取到本地文件分别对应的MD5值;并且,可以将MD5值存储到本地数组中对应的本地文件的名称下。Then, according to the name file of the local file, the storage path filePath corresponding to the local file is obtained; the local file is MD5-encrypted according to the storage path, and the MD5 value corresponding to the local file is obtained; and the MD5 value can be stored in the local array. Under the name of the local file.
在上述任一实施例的基础上,所述步骤S3进一步包括:S31,遍历所述待更新数组,将所述待更新数组中的每个待更新文件与所述本地数组中的本地文件进行比较;若存在名称及MD5值均相同的待更新文件和本地文件,则将所述本地文件的名称添加至预先创建的取消下载数组,并保留所述本地文件;S32,遍历所述待更新数组,对所述待更新数组中的每个待更新文件进行判断;若所述待更新文件具有对应的下载链接,且所述待更新文件的名称不包含在所述取消下载数组中,则根据所述下载链接下载所述待更新文件,并删除名称不包含在所述取消下载数组中的本地文件。On the basis of any of the above embodiments, the step S3 further includes: S31, traversing the array to be updated, comparing each file to be updated in the array to be updated with a local file in the local array If there are files to be updated and local files whose names and MD5 values are the same, the name of the local file is added to the pre-created cancel download array, and the local file is retained; S32, traversing the array to be updated, Determining, for each file to be updated, the file to be updated; if the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, according to the The download link downloads the file to be updated and deletes the local file whose name is not included in the cancel download array.
在步骤S31中,遍历待更新数组,将每个待更新文件的名称和MD5值都比文本文件的名称和MD5值比较一遍;如果待更新文件和本地文件的名称和MD5值的名称都相同,说明文件信息没有改变,本地文件不需要更新,就把相同的名称存储在预先创建的取消下载数组doNotNeedDownLoadRoomIDArray。遍历后,取消下载数组就保存了所有不需要下载的待更新文件的名称,相应地,也是所有需要保留的本地文件的名称。In step S31, traversing the array to be updated, comparing the name of each file to be updated and the MD5 value to the name of the text file and the MD5 value; if the name of the file to be updated and the name of the local file and the MD5 value are the same, The description file information has not changed. The local file does not need to be updated. The same name is stored in the pre-created cancel download array doNotNeedDownLoadRoomIDArray. After traversing, canceling the download array saves the names of all files to be updated that do not need to be downloaded, and correspondingly, the names of all local files that need to be retained.
在步骤S32中,对待更新数组执行再执行一次遍历操作,首先判 断每个待更新文件名称是否有对应的下载链接zipUrl,如果存在,则证明该待更新文件是可下载的;再判断更新文件的名称是否包含在取消下载数组中,如果不包含,则说明本地没有该待更新文件,需要对该待更新文件进行下载;否则,无需下载。经过遍历后,就能够对所有本地不存在的待更新文件完成下载操作。In step S32, performing a traversal operation on the array to be updated, first determining whether each file name to be updated has a corresponding download link zipUrl, and if so, proving that the file to be updated is downloadable; Whether the name is included in the cancel download array. If it is not included, it means that there is no file to be updated locally, and the file to be updated needs to be downloaded; otherwise, no download is required. After traversing, it is possible to complete the download operation for all files that are not present locally.
另外,取消下载数组中同样保存了需要保留的本地文件的名称,那么对于取消下载数组中不包含名称的本地文件执行删除操作。In addition, the name of the local file that needs to be preserved is also saved in the cancel download array, and then the delete operation is performed on the local file that does not contain the name in the cancel download array.
通过数组的双层循环遍历能够有效节约代码量,提高性能。Double-layer loop traversal through arrays can effectively save code and improve performance.
在上述任一实施例的基础上,所述步骤S22后还包括:S23,判断所述待更新数组是否为数组类型,若不是数组类型,则终止文件更新。On the basis of any of the above embodiments, the step S22 further includes: S23, determining whether the array to be updated is an array type, and if not an array type, terminating the file update.
具体地,获取到待更新数组后,应当判断是否为数组类型,例如使用判断方法isKindOfClass,如果其真实类型不是数组类型,则应当终结更新方法,这样能够避免之后对数组的处理由于其并不是数组类型而造成运行时的崩溃。Specifically, after obtaining the array to be updated, it should be judged whether it is an array type, for example, using the judgment method isKindOfClass, if its real type is not an array type, the update method should be terminated, so that the processing of the array afterwards can be avoided because it is not an array. Type causes a runtime crash.
在上述任一实施例的基础上,所述S11中获取配置文件下载链接的地址的步骤进一步包括:获取配置文件下载链接的基础地址和固定地址;拼接所述基础地址和所述固定地址,获取所述配置文件下载链接的地址。On the basis of any of the foregoing embodiments, the step of obtaining the address of the configuration file download link in the step S11 further includes: acquiring a base address and a fixed address of the configuration file download link; and splicing the base address and the fixed address to obtain The address of the configuration file download link.
具体地,为了读取配置文件,需要获得配置文件的下载链接的地址;该地址包括前半部分的基础地址(baseUrl)和后半部分的固定地址(Url);其中,baseUrl是各种环境对应的地址,其在不同的环境(测试环境或者正式环境)不一样;Url通常是比较固定的;将baseUrl和Url拼接为一个完整的下载链接的地址(requestStr),就可以通过requestStr去服务端请求配置文件数据。Specifically, in order to read the configuration file, it is necessary to obtain the address of the download link of the configuration file; the address includes the base address (baseUrl) of the first half and the fixed address (Url) of the second half; wherein baseUrl is corresponding to various environments. Address, which is different in different environments (test environment or formal environment); Url is usually fixed; splicing baseUrl and Url into a complete download link address (requestStr), you can request configuration by requestStr to the server File data.
图2为本发明实施例提供的更新文件的装置的结构示意图,如图 2所示,包括:接收模块201,用于向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;获取模块202,用于对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;更新模块203,用于若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。2 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a receiving module 201, configured to send a request message for obtaining configuration file data to a server, and receive a configuration returned by a server. The file data; wherein the configuration file is a text type file generated by the server in advance for storing the information of the file to be updated; the obtaining module 202 is configured to parse the configuration file data, and obtain at least one of the configuration file data. The name of the file to be updated and the MD5 value; wherein the MD5 value is used to check whether the file information is consistent; the update module 203 is configured to cancel the download if there is a file to be updated and a local file whose names and MD5 values are the same The update file is mentioned and the local file is retained.
具体地,接收模块201首先向服务端发送一个请求消息,该请求消息中携带了请求获取配置文件数据的信息;服务端接收到请求消息后,可以根据该请求消息向接收模块201返回发送配置文件数据。Specifically, the receiving module 201 first sends a request message to the server, where the request message carries information requesting to acquire configuration file data; after receiving the request message, the server may return a sending configuration file to the receiving module 201 according to the request message. data.
接收模块201具体可以通过增加文件配置接口功能函数cheackCustomEmblemConfig,通过该函数实现判断下载哪些待更新文件(压缩包文件)。The receiving module 201 can specifically determine which files to be updated (compressed file files) to be downloaded by adding a file configuration interface function function, cheackCustomEmblemConfig.
具体地,获取模块202根据接收模块201中得到的配置文件数据,获取模块202可以对配置文件数据进行进一步解析;获取配置文件中携带的信息,该信息包括至少一个待更新文件的相关信息,相关信息至少包括文件名称和MD5值。例如待更新文件为压缩包文件,则解析后包括该压缩包的名称和压缩包对应的MD5值。Specifically, the obtaining module 202, according to the configuration file data obtained by the receiving module 201, the obtaining module 202 may further parse the configuration file data, and obtain information carried in the configuration file, where the information includes at least one related information of the file to be updated, and related information. The information includes at least the file name and the MD5 value. For example, if the file to be updated is a compressed package file, the name of the compressed package and the MD5 value corresponding to the compressed package are included after parsing.
具体地,更新模块203根据获取模块202中得到的待更新文件的名称和MD5值,与本地文件的名称和MD5值进行比较,具体如下:Specifically, the update module 203 compares the name of the file to be updated and the MD5 value obtained in the obtaining module 202 with the name of the local file and the MD5 value, as follows:
如果一个本地文件与一个待更新文件的MD5值和名称都相同,说明该待更新文件和该本地文件的信息没有改变,该本地文件不需要更新,那么更新模块203就取消下载这个待更新文件;同样的,更新模块203不用删除这个本地文件,对该本地文件进行保留。If the MD5 value and the name of a local file and a file to be updated are the same, indicating that the information of the file to be updated and the local file are not changed, and the local file does not need to be updated, the update module 203 cancels downloading the file to be updated; Similarly, the update module 203 does not delete the local file and retains the local file.
相应地,对于除了取消下载的待更新文件之外的其他待更新文件, 更新模块203应当进行下载;对除了保留的本地文件之外的其他本地文件,更新模块203应当进行删除。Accordingly, for other files to be updated other than the downloaded file to be updated, the update module 203 should perform the download; for other local files than the reserved local file, the update module 203 should delete.
本发明实施例提供的更新文件的装置,通过获取待更新文件的名称和MD5值,并判断与本地文件是否相同后进行相应地操作,实现了对本地文件的部分保留和对待更新文件的部分下载,节约了移动端进行文件更新时消耗的流量,释放了移动端本地的存储空间,使本地文件与服务端保持一致。The device for updating the file provided by the embodiment of the present invention obtains the partial reservation of the local file and the partial download of the file to be updated by obtaining the name of the file to be updated and the MD5 value, and determining whether the file is the same as the local file. The traffic consumed by the mobile terminal for file update is saved, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.
在上述任一实施例的基础上,所述接收模块201进一步包括:获取单元,用于获取配置文件下载链接的地址,根据所述地址向服务端发送所述请求消息;接收单元,用于接收服务端返回的错误码,若所述错误码为0,则请求成功,并接收服务端返回的所述配置文件数据。On the basis of any of the foregoing embodiments, the receiving module 201 further includes: an obtaining unit, configured to acquire an address of the configuration file download link, send the request message to the server according to the address, and receive a unit, configured to receive The error code returned by the server. If the error code is 0, the request is successful, and the configuration file data returned by the server is received.
在上述任一实施例的基础上,所述获取模块202进一步包括:解析单元,用于对所述配置文件数据进行解析,获取数据字典;取值单元,用于对所述数据字典进行取值处理,获取包含至少一个元素的待更新数组;其中,每个所述元素至少记录一个待更新文件的名称和MD5值。On the basis of any of the above embodiments, the obtaining module 202 further includes: a parsing unit, configured to parse the configuration file data, and obtain a data dictionary; and a value unit, configured to perform value on the data dictionary Processing, obtaining an array to be updated that includes at least one element; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
在上述任一实施例的基础上,所述装置还包括:存储模块,用于通过循环遍历获取本地文件的名称,并将所述本地文件的名称存储至本地数组;加密模块,用于获取所述本地文件的名称所对应的路径;根据所述路径对所述本地文件进行MD5加密,获取所述本地文件对应的MD5值。On the basis of any of the above embodiments, the device further includes: a storage module, configured to obtain a name of the local file by looping through the traversal, and store the name of the local file to a local array; and an encryption module, configured to acquire The path corresponding to the name of the local file is performed; the local file is MD5-encrypted according to the path, and the MD5 value corresponding to the local file is obtained.
在上述任一实施例的基础上,所述更新模块203进一步包括:第一遍历单元,用于遍历所述待更新数组,将所述待更新数组中的每个待更新文件与所述本地数组中的本地文件进行比较;若存在名称及MD5值均相同的待更新文件和本地文件,则将所述本地文件的名称添加至预先创建的取消下载数组;第二遍历单元,用于遍历所述待更新 数组,对所述待更新数组中的每个待更新文件进行判断;若所述待更新文件具有对应的下载链接,且所述待更新文件的名称不包含在所述取消下载数组中,则根据所述下载链接下载所述待更新文件,并删除名称不包含在所述取消下载数组中的本地文件。On the basis of any of the above embodiments, the updating module 203 further includes: a first traversing unit, configured to traverse the array to be updated, and each file to be updated in the array to be updated and the local array The local files in the comparison are compared; if there are files to be updated and local files whose names and MD5 values are the same, the name of the local file is added to the pre-created cancel download array; the second traversal unit is used to traverse the An array to be updated is determined for each file to be updated in the array to be updated; if the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, And downloading the file to be updated according to the download link, and deleting a local file whose name is not included in the cancel download array.
在上述任一实施例的基础上,所述获取模块202还包括:终止单元,用于判断所述待更新数组是否为数组类型,若不是数组类型,则终止文件更新。On the basis of any of the above embodiments, the obtaining module 202 further includes: a terminating unit, configured to determine whether the array to be updated is an array type, and if not an array type, terminate the file update.
在上述任一实施例的基础上,所述获取单元进一步包括:地址获取子单元,用于获取配置文件下载链接的基础地址和固定地址;拼接子单元,用于拼接所述基础地址和所述固定地址,获取所述配置文件下载链接的地址。On the basis of any of the above embodiments, the obtaining unit further includes: an address obtaining subunit, configured to acquire a base address and a fixed address of the configuration file download link; and a splicing subunit, configured to splicing the base address and the Fixed address, the address of the configuration file download link.
图3为本发明实施例提供的更新文件的设备的结构示意图,如图3所示,该设备包括:至少一个处理器301;以及与所述处理器301通信连接的至少一个存储器302,其中:所述存储器302存储有可被所述处理器301执行的程序指令,所述处理器301调用所述程序指令能够执行上述各实施例所提供的更新文件的方法,例如包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。FIG. 3 is a schematic structural diagram of an apparatus for updating a file according to an embodiment of the present invention. As shown in FIG. 3, the apparatus includes: at least one processor 301; and at least one memory 302 communicatively coupled to the processor 301, where: The memory 302 stores a program instruction that can be executed by the processor 301, and the processor 301 invokes the method that the program instruction can execute the update file provided by each embodiment, for example, including: S1, to the server After the request message for obtaining the configuration file data is sent, the configuration file data returned by the server is received; wherein the configuration file is a text type file generated by the server for storing the information of the file to be updated in advance; S2, the configuration file data is Performing a parsing to obtain a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value is used to check whether the file information is consistent; S3, if there is a file to be updated with the same name and MD5 value And the local file, the downloading of the file to be updated is cancelled, and the local file is retained.
本发明实施例还提供一种非暂态计算机可读存储介质,该非暂态计算机可读存储介质存储计算机指令,该计算机指令使计算机执行对应实施例所提供的更新文件的方法,例如包括:S1,向服务端发送获 取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。The embodiment of the present invention further provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium stores a computer instruction, and the computer instruction causes the computer to execute the method for updating the file provided by the corresponding embodiment, for example, including: S1, after sending the request message for obtaining the configuration file data to the server, receiving the configuration file data returned by the server; wherein the configuration file is a text type file generated by the server for storing the information of the file to be updated in advance; S2, The configuration file data is parsed, and the name and MD5 value of the at least one file to be updated in the configuration file data are obtained; wherein the MD5 value is used to check whether the file information is consistent; S3, if there is a name and an MD5 value If the same file to be updated and the local file are the same, the file to be updated is cancelled and the local file is retained.
本实施例公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的更新文件的方法,例如包括:S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。The embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer The method for executing the update file provided by each of the foregoing method embodiments includes, for example, S1, after sending a request message for obtaining configuration file data to the server, receiving configuration file data returned by the server; wherein the configuration file is a pre-service And generating a text type file for storing file information to be updated; S2, parsing the configuration file data, and obtaining a name and an MD5 value of at least one file to be updated in the configuration file data; wherein the MD5 value For verifying whether the file information is consistent; S3, if there are files to be updated and local files whose names and MD5 values are the same, cancel the downloading of the file to be updated, and retain the local file.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
以上所描述的更新文件的设备等实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技 术人员在不付出创造性的劳动的情况下,即可以理解并实施。The apparatus and the like of the above described update file are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units. , can be located in one place, or can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. One of ordinary skill in the art can understand and implement without any creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the various embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on such understanding, the above-described technical solutions may be embodied in the form of software products in essence or in the form of software products, which may be stored in a computer readable storage medium such as ROM/RAM, magnetic Discs, optical discs, etc., include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments or portions of the embodiments.
本发明实施例提供的更新文件的方法、装置和设备,通过获取待更新文件的名称和MD5值,并判断与本地文件是否相同后进行相应地操作,实现了对本地文件的部分保留和对待更新文件的部分下载,节约了移动端进行文件更新时消耗的流量,释放了移动端本地的存储空间,使本地文件与服务端保持一致。The method, the device and the device for updating the file provided by the embodiment of the present invention obtain the name of the file to be updated and the value of the MD5, and determine whether the file is the same as the local file, and then perform corresponding operations on the file, thereby realizing partial reservation and updating of the local file. The partial download of the file saves the traffic consumed by the mobile terminal when the file is updated, and the local storage space of the mobile terminal is released, so that the local file is consistent with the server.
最后,本申请的方法仅为较佳的实施方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims (11)

  1. 一种更新文件的方法,其特征在于,包括:A method for updating a file, comprising:
    S1,向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;S1, after sending the request message for obtaining the configuration file data to the server, receiving the configuration file data returned by the server; wherein the configuration file is a text type file generated by the server in advance for storing the information of the file to be updated;
    S2,对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;S2, parsing the configuration file data, and obtaining a name and an MD5 value of the at least one file to be updated in the configuration file data; wherein the MD5 value is used to verify whether the file information is consistent;
    S3,若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。S3. If there are files to be updated and local files whose names and MD5 values are the same, the file to be updated is cancelled and the local file is retained.
  2. 根据权利要求1所述的方法,其特征在于,所述S1中向服务端发送获取配置文件数据的请求消息的步骤进一步包括:The method according to claim 1, wherein the step of transmitting a request message for acquiring profile data to the server in the S1 further comprises:
    S11,获取配置文件下载链接的地址,根据所述地址向服务端发送所述请求消息;S11: Obtain an address of a configuration file download link, and send the request message to the server according to the address;
    S12,接收服务端返回的错误码,若所述错误码为0,则请求成功,并接收服务端返回的所述配置文件数据。S12. Receive an error code returned by the server. If the error code is 0, the request is successful, and receive the configuration file data returned by the server.
  3. 根据权利要求1所述的方法,其特征在于,所述步骤S2进一步包括:The method of claim 1, wherein the step S2 further comprises:
    S21,对所述配置文件数据进行解析,获取数据字典;S21: Parsing the configuration file data to obtain a data dictionary;
    S22,对所述数据字典进行取值处理,获取包含至少一个元素的待更新数组;其中,每个所述元素至少记录一个待更新文件的名称和MD5值。S22: Perform value processing on the data dictionary to obtain an array to be updated that includes at least one element; wherein each of the elements records at least one name of the file to be updated and an MD5 value.
  4. 根据权利要求1或3所述的方法,其特征在于,所述步骤S3前还包括:The method according to claim 1 or 3, wherein before the step S3, the method further comprises:
    通过循环遍历获取本地文件的名称,并将所述本地文件的名称存储至本地数组;Get the name of the local file by looping through and storing the name of the local file to a local array;
    获取所述本地文件的名称所对应的路径;根据所述路径对所述本地文件进行MD5加密,获取所述本地文件对应的MD5值。Obtaining a path corresponding to the name of the local file; performing MD5 encryption on the local file according to the path, and acquiring an MD5 value corresponding to the local file.
  5. 根据权利要求4所述的方法,其特征在于,所述步骤S3进一步包括:The method of claim 4, wherein the step S3 further comprises:
    S31,遍历所述待更新数组,将所述待更新数组中的每个待更新文件与所述本地数组中的本地文件进行比较;S31, traversing the array to be updated, comparing each file to be updated in the array to be updated with a local file in the local array;
    若存在名称及MD5值均相同的待更新文件和本地文件,则将所述本地文件的名称添加至预先创建的取消下载数组;If there are files to be updated and local files whose names and MD5 values are the same, the name of the local file is added to the pre-created cancel download array;
    S32,遍历所述待更新数组,对所述待更新数组中的每个待更新文件进行判断;S32, traversing the array to be updated, and determining, for each file to be updated in the array to be updated;
    若所述待更新文件具有对应的下载链接,且所述待更新文件的名称不包含在所述取消下载数组中,则根据所述下载链接下载所述待更新文件,并删除名称不包含在所述取消下载数组中的本地文件。If the file to be updated has a corresponding download link, and the name of the file to be updated is not included in the cancel download array, download the file to be updated according to the download link, and delete the name not included in the Cancel the download of local files in the array.
  6. 根据权利要求3所述的方法,其特征在于,所述步骤S22后还包括:The method according to claim 3, wherein the step S22 further comprises:
    S23,判断所述待更新数组是否为数组类型,若不是数组类型,则终止文件更新。S23. Determine whether the array to be updated is an array type. If it is not an array type, terminate the file update.
  7. 根据权利要求2所述的方法,其特征在于,所述S11中获取配置文件下载链接的地址的步骤进一步包括:The method according to claim 2, wherein the step of obtaining the address of the profile download link in the S11 further comprises:
    获取配置文件下载链接的基础地址和固定地址;Obtain the base address and fixed address of the configuration file download link;
    拼接所述基础地址和所述固定地址,获取所述配置文件下载链接的地址。The base address and the fixed address are spliced, and an address of the configuration file download link is obtained.
  8. 一种更新文件的装置,其特征在于,包括:An apparatus for updating a file, comprising:
    接收模块,用于向服务端发送获取配置文件数据的请求消息后,接收服务端返回的配置文件数据;其中,配置文件是预先通过服务端生成的用于存储待更新文件信息的文本类型文件;The receiving module is configured to: after receiving the request message for acquiring the configuration file data from the server, receive the configuration file data returned by the server; wherein the configuration file is a text type file generated by the server for storing the information of the file to be updated in advance;
    获取模块,用于对所述配置文件数据进行解析,获取所述配置文件数据中至少一个待更新文件的名称和MD5值;其中,所述MD5值用于校验文件信息是否一致;An obtaining module, configured to parse the configuration file data, and obtain a name and an MD5 value of the at least one file to be updated in the configuration file data, where the MD5 value is used to verify whether the file information is consistent;
    更新模块,用于若存在名称及MD5值均相同的待更新文件和本地文件,则取消下载所述待更新文件,并保留所述本地文件。The update module is configured to cancel downloading the file to be updated and retain the local file if there are files to be updated and local files whose names and MD5 values are the same.
  9. 一种更新文件的设备,其特征在于,包括:A device for updating a file, comprising:
    至少一个处理器;At least one processor;
    以及与所述处理器通信连接的至少一个存储器,其中:所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求1至7任一所述的方法。And at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform any of claims 1-7 Said method.
  10. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如权利要求1至7任一所述的方法。A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions, the computer instructions causing the computer to perform the method of any one of claims 1 to 7. .
  11. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如权利要求1至7任一所述的方法。A computer program product, comprising: a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer performs the method of any one of claims 1 to 7.
PCT/CN2017/120167 2017-10-09 2017-12-29 File update method, apparatus, and device WO2019071858A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710931525.0 2017-10-09
CN201710931525.0A CN107682436A (en) 2017-10-09 2017-10-09 A kind of method, apparatus and equipment of more new file

Publications (1)

Publication Number Publication Date
WO2019071858A1 true WO2019071858A1 (en) 2019-04-18

Family

ID=61139967

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120167 WO2019071858A1 (en) 2017-10-09 2017-12-29 File update method, apparatus, and device

Country Status (2)

Country Link
CN (1) CN107682436A (en)
WO (1) WO2019071858A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580884A (en) * 2020-04-30 2020-08-25 北京金山云网络技术有限公司 Configuration updating method and device, server and electronic equipment
CN112099831A (en) * 2020-09-28 2020-12-18 中国银行股份有限公司 Batch updating method and device for configuration files
CN112948389A (en) * 2021-03-05 2021-06-11 上海上讯信息技术股份有限公司 MD 5-based database table data comparison method and equipment
CN113157307A (en) * 2020-01-07 2021-07-23 普天信息技术有限公司 Software version upgrading method and device
CN113360169A (en) * 2021-06-08 2021-09-07 康佳集团股份有限公司 Image quality parameter upgrading system and method
CN113590155A (en) * 2021-07-29 2021-11-02 深圳锦弘霖科技有限公司 Method for updating self-developed RTOS in remote incremental mode
CN114595199A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium
CN114745268A (en) * 2022-03-31 2022-07-12 杭州视洞科技有限公司 Method for online updating and loading algorithm library of network camera
CN116680012A (en) * 2023-08-01 2023-09-01 浙江春风动力股份有限公司 Industrial software configuration management system and method
CN111580884B (en) * 2020-04-30 2024-04-19 北京金山云网络技术有限公司 Configuration updating method, device, server and electronic equipment

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109409933A (en) * 2018-09-26 2019-03-01 深圳壹账通智能科技有限公司 Intelligent fee counting method, computer readable storage medium and terminal device
CN109543155A (en) * 2018-10-18 2019-03-29 恒峰信息技术有限公司 A kind of data automatic update method and system
CN111324362A (en) * 2018-12-14 2020-06-23 北京宝沃汽车有限公司 Vehicle, and method and device for updating vehicle electronic control system program
CN109582350B (en) * 2018-12-24 2022-06-28 广东金赋科技股份有限公司 Method for automatically maintaining configuration file in self-service tax terminal
CN109999489A (en) * 2019-03-29 2019-07-12 北京金山安全软件有限公司 Resource updating method and device and electronic equipment
CN111090446A (en) * 2019-12-20 2020-05-01 北京海益同展信息科技有限公司 Configuration file updating method and system
CN111416863A (en) * 2020-03-20 2020-07-14 上海圣剑网络科技股份有限公司 Diversified download management method, terminal and medium based on client
CN111988296A (en) * 2020-08-12 2020-11-24 深圳杰微芯片科技有限公司 Computing power equipment overclocking method, server and storage medium
CN112988691A (en) * 2021-03-31 2021-06-18 深圳市优必选科技股份有限公司 File updating method and device based on embedded system and terminal equipment
CN113778997B (en) * 2021-09-26 2024-02-02 杭州安恒信息技术股份有限公司 Database version management method, system and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426924A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Method, apparatus, client, server and system for updating application software
CN104657170A (en) * 2013-11-25 2015-05-27 腾讯科技(上海)有限公司 Data updating method, device and system
CN105160253A (en) * 2015-09-29 2015-12-16 网易(杭州)网络有限公司 Client program restoration method, apparatus and system and server
CN105446829A (en) * 2015-09-29 2016-03-30 网易(杭州)网络有限公司 Client program repair method, device and system and server
CN106302592A (en) * 2015-05-28 2017-01-04 腾讯科技(深圳)有限公司 The update method of terminal applies, server and terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425931A (en) * 2008-12-08 2009-05-06 上海华为技术有限公司 Communication apparatus software updating method, related equipment and communication system
KR20120034550A (en) * 2010-07-20 2012-04-12 한국전자통신연구원 Apparatus and method for providing streaming contents
CN102456027A (en) * 2010-10-21 2012-05-16 北京市金蝶政务软件有限公司 Method, terminals and system for copying files in distributed system
CN102053853A (en) * 2010-12-30 2011-05-11 北京像素软件科技股份有限公司 Version updating method of online game
CN102833350A (en) * 2012-09-11 2012-12-19 优视科技有限公司 Processing method and processing device of WebApp updating
CN106326310B (en) * 2015-07-06 2021-05-14 北京壹平台科技有限公司 Resource encryption updating method for mobile phone client software
CN107040615B (en) * 2017-06-22 2021-07-02 深圳Tcl数字技术有限公司 Downloading method of media fragment, terminal and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426924A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Method, apparatus, client, server and system for updating application software
CN104657170A (en) * 2013-11-25 2015-05-27 腾讯科技(上海)有限公司 Data updating method, device and system
CN106302592A (en) * 2015-05-28 2017-01-04 腾讯科技(深圳)有限公司 The update method of terminal applies, server and terminal
CN105160253A (en) * 2015-09-29 2015-12-16 网易(杭州)网络有限公司 Client program restoration method, apparatus and system and server
CN105446829A (en) * 2015-09-29 2016-03-30 网易(杭州)网络有限公司 Client program repair method, device and system and server

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157307A (en) * 2020-01-07 2021-07-23 普天信息技术有限公司 Software version upgrading method and device
CN111580884A (en) * 2020-04-30 2020-08-25 北京金山云网络技术有限公司 Configuration updating method and device, server and electronic equipment
CN111580884B (en) * 2020-04-30 2024-04-19 北京金山云网络技术有限公司 Configuration updating method, device, server and electronic equipment
CN112099831A (en) * 2020-09-28 2020-12-18 中国银行股份有限公司 Batch updating method and device for configuration files
CN112948389A (en) * 2021-03-05 2021-06-11 上海上讯信息技术股份有限公司 MD 5-based database table data comparison method and equipment
CN113360169A (en) * 2021-06-08 2021-09-07 康佳集团股份有限公司 Image quality parameter upgrading system and method
CN113590155B (en) * 2021-07-29 2023-06-20 深圳锦弘霖科技有限公司 Remote incremental updating method for self-grinding RTOS
CN113590155A (en) * 2021-07-29 2021-11-02 深圳锦弘霖科技有限公司 Method for updating self-developed RTOS in remote incremental mode
CN114745268A (en) * 2022-03-31 2022-07-12 杭州视洞科技有限公司 Method for online updating and loading algorithm library of network camera
CN114595199B (en) * 2022-05-10 2022-09-02 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium
CN114595199A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium
CN116680012A (en) * 2023-08-01 2023-09-01 浙江春风动力股份有限公司 Industrial software configuration management system and method
CN116680012B (en) * 2023-08-01 2023-10-24 浙江春风动力股份有限公司 Industrial software configuration management system and method

Also Published As

Publication number Publication date
CN107682436A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
WO2019071858A1 (en) File update method, apparatus, and device
CN110058873B (en) Application page updating method, device, equipment and storage medium
CN106302337B (en) Vulnerability detection method and device
CN102663281B (en) Method and device for detecting malicious software
US9378370B2 (en) Scanning files for inappropriate content during synchronization
RU2538911C2 (en) Method and system for efficient download of data packet
CN102053853A (en) Version updating method of online game
WO2016155635A1 (en) Data processing method and device
US8549165B2 (en) Processing devices and methods for transmitting and receiving data
CN105740259A (en) Method and device for processing incremental data
CN106302595A (en) A kind of method and apparatus that server is carried out physical examination
CN111182060A (en) Message detection method and device
CN105471665A (en) Website function testing method, website function testing system and website server
CN109814889B (en) Method and apparatus for updating source code base
CN109725912A (en) Application program configuration method, device, terminal, server and readable storage medium storing program for executing
US20190149571A1 (en) Method and device for repairing page vulnerability
CN110928571A (en) Business program development method and device
CN111107133A (en) Generation method of difference packet, data updating method, device and storage medium
US10417212B1 (en) Database modification replay
US9686310B2 (en) Method and apparatus for repairing a file
US10904746B2 (en) Implementation method, apparatus and system for remote access
CN111818179A (en) User request processing method and device, computing equipment and medium
CN111131498B (en) URL information updating method, cache server, equipment and storage medium
CN110597462A (en) Data storage method, system, device and equipment in block chain type account book
CN111930696B (en) File transmission processing method and system based on small program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17928459

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17928459

Country of ref document: EP

Kind code of ref document: A1