Embodiment 1:
Fig. 1 shows the implementation process of the method for the management update file of one embodiment of the present of invention offer, processDetails are as follows:
In step s101, the update request that request end is sent is received, the information that request includes target side is updated.
In the present embodiment, terminal device can receive request end update request, for example, terminal device be router orPerson's teacher computer.
In the present embodiment, the update request that request end is sent is received, request end and terminal device carry out wirelessly or non-wirelesslyCommunication.
In the present embodiment, the information of target side it is practical be target side mark, can be target side Internet protocolAddress (Internet Protocol Address, IP) or for target side MAC Address (Media Access Control,Hardware address).
Preferably, the operating system of request end and target side is iOS system (iPhone Operation System, appleThe Mobile operating system of company).
In one embodiment, include: before step S101
1) authentication information that request end is sent is received, and authentication is carried out to request end according to verification information, it is rawAt verification result.
If 2) verification result is authentication success, the update request of request end transmission is received.
If 3) verification result is authentication failure, authentication failure information is sent to request end, if continuous defaultThe authentication result of number is authentication failure, then it is whole to third party associated with terminal device to send warning messageEnd.
Wherein, authentication information includes account number and password.
Wherein, authentication failure information is used to indicate request end and continues to send authentication information.
Wherein, warning message includes the information and authentication failure information of the request end of authentication failure.Alarm signalBreath is used to indicate whether third party's terminal inquiry request end allows to download in list and the corresponding body in inquiry request end defaultPart verification information.
Wherein, the information of request end includes the IP address and/or MAC Address of request end.
In the present embodiment, when request end is the terminal device in the department relatively high to confidentiality requirement, for example, grindingStudy carefully the terminal device in mechanism, needs to download request the request end progress authentication for updating file, if authentication success,Then request end can carry out the step of subsequent download updates file, be updated to application program.
In the present embodiment, if verification result is authentication failure, authentication failure information is sent to request end,Authentication failure information can be authentication failed reason, for example, password mistake, unsuccessfully believes when request end receives authenticationAfter breath, continue to send authentication information to terminal device so that terminal device continues authentication, if authentication is lostThe number lost has been more than preset times, then terminal device sends warning message extremely third party's terminal associated with terminal device,After third party's terminal device receives warning message, whether default allow to download name according to the information inquiring request end of request endDan Zhong, if request end allows to download in list default, the corresponding authentication information in inquiry request end, and by correct bodyPart verification information is sent to corresponding request end, and authentication information is re-transmitted to terminal device by request end.
By taking a concrete application scene as an example, preset times 2, request end A transmission authentication information to terminal device,Terminal device verifies the authentication information, generates verification result, when verification result is that authentication fails, then sends outSend authentication information to request end A, A corresponding user in request end re-enters authentication information, and request end A is by new bodyPart verification information is sent to terminal device, and terminal device verifies the authentication information, generates verification result, works as verifyingWhen as a result for authentication failure, terminal device sends warning message to third party's terminal, third party's terminal according to warning message,Whether inquiry request end A allows to download in list default, if request end A allows to download in list default, sends requestThe corresponding correct authentication information of A is held, correct authentication information is sent to terminal device by request end A, and terminal is setIt is standby that authentication is carried out to correct authentication information, the successful verification result of authentication is generated, if request end A is not pre-If allowing to download in list, then it is assumed that request end A is illegal user's terminal, and generation forbids download instruction to terminal device, terminalEquipment according to forbid download instruction inhibition request end A downloading update file.
In the present embodiment, by needing to carry out authentication to request end, avoid before request end sending and updates requestThere is the case where high update file of confidentiality is downloaded by illegal terminal, improves the safety that downloading updates file.
In step s 102, file download address is updated according to update request.
In one embodiment of the invention, updating request includes attribute list file downloading request, updates file downloadAddress includes application program installation kit download address.
In one embodiment of the invention, step S102 includes:
1) request attribute list file download address is downloaded according to attribute list file.
2) detection is local whether there is the corresponding attribute list file of attribute list file download address.
3) attribute list file if it exists, then parse attribute list file, obtains corresponding application program installation kit downloadingAddress.
4) attribute list file if it does not exist then downloads corresponding attribute list text according to attribute list file download addressPart, and the attribute list file of downloading is parsed, obtain corresponding application program installation kit download address.
In the present embodiment, updating file includes application program installation kit and resource file, and application program installation kit can be withFor IPA (iPhone Application, apple application file format) installation kit.
In the present embodiment, it when request end more new application, needs first to download IPA installation kit, when under IPA installation kitAfter carrying and being installed, when user opens the application program, start request downloading resource file.Wherein resource file can be figurePiece, JS (JavaScript) static resource file and CSS (Cascading Style Sheets, cascading style sheets) static resourceFile, sequence frame resource file, DAE file and SCN file etc..
In the present embodiment, attribute list (Property List, PList) file download request can be attribute listFile download address when request end selects some application program of online updating, needs to download by the inclusion of the network address of plist characterAttribute list file calls code detection tool to parse attribute list file, the program that is applied installation kit download address, exampleSuch as, when online updating application program is wanted in request end, request end leads to itms-services: //? action=download-Manifest&url=https: //dn-ipa-ideamake.qbox.me/plists/__2681693444.plist this netThe attribute list file of the application program is downloaded in location, includes by call code detection tool detection attribute list fileCode, the program that is applied installation kit download address can download application program peace by application program installation kit download addressDress packet.Wherein, application program installation kit download address is terminated with .ipa, such as http://myserver.com/Apps.ipa。
Wherein, attribute list file is a kind of file for storing the object after serialization, is usually used in iOS exploitationStore user setting, can be also used for often using in storage program and the data infrequently changed, be essentially an XML(Extensible Markup Language, extensible markup language) file.
Preferably, when the quantity when request end is more, when being greater than preset quantity, attribute list is sent in order to save request endThe time of file download request, solicited message can be downloaded for attribute list file by updating request, and attribute list file downloading is askedSeeking information includes the attribute list file title for needing to download, and terminal device receives attribute list file downloading solicited messageAfterwards, online is carried out automatically according to attribute list file title and search corresponding attribute list file download address, thus request endWithout carrying out searching attribute list file download address, attribute list file downloading solicited message to terminal can be directly transmitted and setStandby, according to attribute list file name acquiring attribute list file download address, avoid the occurrence of every request end needs terminal deviceThe case where first voluntarily searching attribute list file download address, improves integrity attribute listing file download address and obtains effectRate.
It in one embodiment, locally can be local hard drive, in order to improve the speed of data interaction, local is preferably thisGround caching.
In one embodiment of the invention, updating request further includes resource file downloading request, with updating file downloadLocation further includes resource file download address.
In one embodiment of the invention, step S102 further include:
The corresponding resource file download address of request is downloaded according to resource file.
In the present embodiment, after the application program installation package file of downloading is installed successfully, resource file is just sent automaticallyTerminal device is downloaded request to, so that the resource file that terminal device downloading needs to download, resource file downloading request can be straightIt connects including resource file download address.
In step s 103, detection is local with the presence or absence of the corresponding update file in update file download address.
In the present embodiment, detection is local with the presence or absence of the corresponding application program installation of application program installation kit download addressPacket or the corresponding resource file of resource file download address.
In step S104, file is updated if it exists, then will update file and be sent to target side.
In the present embodiment, request end and target side may be the same or different, the quantity of target side with no restrictions,It can be one, or multiple.
In the present embodiment, if locally there are the update files of request end request, file will be updated and be sent at least oneA target side, target side are the corresponding terminal device of information of target side.
In the present embodiment, by making to update the information in request comprising target side, terminal device can be according to target sideInformation by update file be sent to the target side for needing to carry out application program update, without one by one to premises equipment requests updateFile improves the acquisition efficiency for updating file.
By taking one is specifically used for scene as an example, request end A, target side is B and C, and terminal device receives the update that A is sentRequest, and corresponding update file is sent to B and C according to request is updated.
In one embodiment, record updates the transmission frequency of file, if sending the frequency is greater than the default frequency, under sendingInformation carrying is ceased to associated terminal.
Wherein, sending the frequency is to update the transmission times of file in the first preset time, for example, in 1 month, eventuallyEnd equipment sends 30 A files to target side, then transmission times is 30.
Wherein, associated terminal refers to did not received the update file in the first preset time, and passed through terminalEquipment is surfed the Internet, for example, in the first preset time, terminal device is not transmitted across A file to B terminal, and terminal deviceControl B terminal is surfed the Internet, and B terminal is terminal associated with terminal device.
Wherein, download information is used to indicate associated terminal and chooses whether to download the update file.
By taking an application scenarios as an example, the transmission frequency of C file is 20, and it is big to preset the transmission frequency that the frequency is 21, C fileIn the default frequency, then download information is sent to associated terminal a and terminal b, when terminal a and terminal b receive download informationAfterwards, terminal a and the corresponding user of terminal b choose whether to download the update file, if terminal a selection updates, send selection moreThe update file is sent to terminal a by new information to terminal device, terminal device, if terminal b selection does not update, sends selectionFor more new information to terminal device, terminal device does not send the update file to terminal b.
In the present embodiment, by record update file the transmission frequency, according to judge transmission the frequency whether be greater than it is defaultNumber, to judge whether the update file is file needed for user, the automatic download information that sends is to terminal, according to terminalIt chooses whether to send the update file, realizes the automatic recommendation for updating file, improve the Experience Degree of user.
In one embodiment of the invention, file is updated if it does not exist, then according to the downloading pair of update file download addressThe update file of downloading is saved to local, and is sent to target side by the update file answered.
In the present embodiment, if the local update file that request end request is not present, according to update file download addressCorresponding update file is downloaded, and the update file of downloading is saved to local, and be sent to target side.
Preferably, it updates file and is only stored in local cache, thus, it is only required to search whether that there are this in local cache moreNew file.
In one embodiment of the invention, the file name for forbidding downloading that terminal device is sent is obtained, by the tabooThe file name only downloaded, which is added to preset, forbids downloading list.
In the present embodiment, when a file name be added into it is default forbid downloading list when, terminal device no longer underThis document is carried, target side is also no longer sent the file to, to realize remote control terminal equipment.
By taking a concrete application scene as an example, a file name is A, obtains the filename for forbidding downloading that terminal is sentClaim, discovery is forbidden comprising A in the file name of downloading, then presets A add value and forbid downloading in list, if being stored in localFile A then forbids sending file A to target side, if endemic species are not stored with file A, no longer downloading file A.
In one embodiment of the invention, the update file for obtaining latest edition protects the update file of latest editionIt deposits into local predetermined directory, and deletes the update file of the old version in predetermined directory.
Wherein, the entitled application program identification (Bundle Identifie, Bundle ID) of predetermined directory, BundleID is that application program uniquely identifies, and application program and Bundle ID are only one-to-one correspondences, when application program creates successfullyAfterwards, Bundle ID just cannot modify
In the present embodiment, update file divide version, when detect in local update file current version withLatest edition is different, then the update file that the update file or receiving terminal apparatus of downloading latest edition are sent automatically, and will mostThe update file of new version is saved into local predetermined directory, and latest edition is updated file as the update of current version textPart deletes the update file of the old version in predetermined directory, so as to complete the local update for updating file, and by automaticExtra file is deleted, memory space has been saved, improves the effective rate of utilization of resource.
By taking a concrete application scene as an example, some update file current version be V1.0, latest edition V2.0,Then judge that updating the current version of file is not latest edition, downloads the update file of latest edition into predetermined directory, and deleteExcept the update file for the old version that the version number in goal-selling is V1.0, to save memory space.
In one embodiment, the update file for the latest edition that third party's terminal is sent is received, more by latest editionNew file is saved into local predetermined directory, and deletes the update file of the old version in predetermined directory, is realized and is updated fileActive update, avoiding the occurrence of leads to information delay because of network-caching, can not get latest edition update file feelingsCondition.
In the present embodiment, it is requested by the update that terminal device receives request end, if detecting local presence and updateCorresponding update file is requested, file just will be updated and is sent to target side, terminal device without receiving update request every timeAfterwards, all the update file is downloaded, avoids the occurrence of when more terminals while when downloading same update file, is both needed to from serviceThe case where leading to network congestion is downloaded in device, terminal device only needs once to be downloaded, and can realize multiple distribution, improvesThe speed of download of file and the distribution efficiency of file ensure that the stability of network, reduce the occupancy to bandwidth, improveThe utilization rate of Internet resources.
As shown in Fig. 2, in one embodiment of the invention, step S103 is specifically included in embodiment corresponding to Fig. 1:
In step 201, the check value for updating file is obtained.
In the present embodiment, check value can be MD5 (Message Digest Algorithm 5, Message Digest 55th edition) value.
In one embodiment, the quantity for updating file without limitation, updates file to specified clothes when research staff uploadsIt when business device, needs to carry out md5 encryption to each update file, obtains corresponding MD5 value, and back up more to corresponding with MD5 valueNew file is named, and is obtained new update file, is then uploaded to new update file in given server, due to eachUnique when MD5 value, therefore, the check value for updating file is the title for updating file, and title is unique, to avoid the occurrence ofWhen uploading update file, causes to repeat to send the case where updating file since update file name is identical, ensure that updateThe integrality of file, while effectively avoiding repeating to upload or repeated downloads updating file and make since sub- update file name is identicalAt Internet resources waste.
By taking a concrete application scene as an example, entitled the 11 of a update file script, the update file name of backupAlso it is 11, md5 encryption is carried out to the update file, obtaining MD5 value is aa, then the title of the update file of the backup replaces with pairThe MD5 value answered, becomes aa, and the title for obtaining new update file is aa, and new update file is uploaded in given server.
In the present embodiment, according to the name for searching the corresponding update file in update file download address in the default table of comparisonsClaim, that is, updates the check value of file.
Wherein, the default table of comparisons is the table of comparisons of the title for updating file download address and updating file pre-established,When downloading updates file to terminal device for the first time, it just will update file download address and remember with the title corresponding relationship for updating fileRecord downloading, and be stored in the table of comparisons.
In the present embodiment, it presets in the table of comparisons and is stored in local, it is preferable that, will be pre- in order to reduce the occupancy to cachingIf the table of comparisons is stored in local hard drive.
In step S202, the local check value with the presence or absence of file of detection is identical as the check value of file is updated.
In the present embodiment, the local check value with the presence or absence of file of detection is identical as the check value of file is updated, that is, inspectionIt is identical as the title of file is updated to survey the local title with the presence or absence of file, to judge local with the presence or absence of update textPart.
In step S203, the check value of file is identical as the check value of file is updated if it exists, it is determined that local to existUpdate file.
In step S204, the check value of file is identical as the check value of file is updated if it does not exist, it is determined that locally notIn the presence of update file.
In the present embodiment, the check value for the file being locally stored if it exists is identical as the check value of file is updated, then reallySurely update file has been locally stored, conversely, if the check value for the file being locally stored is all different from file is updated, it is determined that localThere is no the update files of request end request, need to be downloaded from server.
In one embodiment, user is received to refer in the file deletion that exterior terminal associated with terminal device inputsIt enables, corresponding file is deleted, realizes the long-range management of file.
In the present embodiment, pass through the check value phase in local detection with the presence or absence of the check value and update file of fileTogether, to effectively determine locally with the presence or absence of the update file, and since check value is uniquely, to avoid the occurrence of fileThe identical situation of title, thus effectively avoid transmission file error the case where appearance, improve file transmission accuracy withAnd efficiency of transmission.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each processExecution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limitIt is fixed.
Embodiment 2:
Fig. 3 shows the system 100 of the management update file of one embodiment of the present of invention offer, for executing Fig. 1 instituteMethod and step in corresponding embodiment comprising:
Request receiving module 110 is updated, for receiving the update request of request end transmission, updating request includes target sideInformation.
Download address obtains module 120, for updating file download address according to update request.
File detection module 130 is updated, it is local literary with the presence or absence of the corresponding update in file download address is updated for detectingPart.
File sending module 140 is updated, for updating file if it exists, then file will be updated and is sent to target side.
In one embodiment of the invention, the system 100 of the management update file further include:
File download module is updated, for the update file if it does not exist, then according to the update file download addressDownload corresponding update file;
Document processing module being updated, for saving the update file of downloading to local, and being sent to the target side.
In one embodiment of the invention, updating request includes attribute list file downloading request, updates file downloadAddress includes application program installation kit download address.
In one embodiment of the invention, download address acquisition module 120 includes:
First file download address acquisition unit, for downloading request attribute list file according to attribute list fileDownload address.
Judging unit, it is local with the presence or absence of the corresponding attribute list file of attribute list file download address for detecting.
First installation kit download address acquiring unit then parses attribute list file for attribute list file if it exists,Obtain corresponding application program installation kit download address.
Second installation kit download address acquiring unit, attribute list file if it does not exist, then according under attribute list fileSet address downloads corresponding attribute list file, and parses the attribute list file of downloading, obtains corresponding application program installationPacket download address.
In one embodiment of the invention, updating request further includes resource file downloading request, with updating file downloadLocation further includes resource file download address.
In one embodiment of the invention, download address acquisition module 120 includes:
Resource file download address obtains module, for being downloaded under the corresponding resource file of request according to resource fileSet address.
In one embodiment of the invention, the system 100 of the management update file further include:
File acquisition module is updated, for obtaining the update file of latest edition;
File storage module is updated, for saving the update file of the latest edition into local predetermined directory, andDelete the update file of the old version in the predetermined directory.
In one embodiment of the invention, the system 100 of the management update file further include:
Forbid downloading name acquiring module, for obtaining the file name for forbidding downloading of terminal device transmission.
Forbid downloading title adding module, forbids downloading name for the file name for forbidding downloading to be added to presetIt is single.
As shown in figure 4, in one embodiment of the invention, file detection module is updated in embodiment corresponding to Fig. 4130 specifically include:
Check value acquiring unit 131, for obtaining the check value for updating file;
Check value detection unit 132, for detecting the local check value with the presence or absence of file and updating the check value of fileIt is identical;
First processing units 133, the check value for file if it exists are identical as the check value of file is updated, it is determined that thisGround, which exists, updates file;
The second processing unit 134, the check value for file if it does not exist are identical as the check value of file is updated, it is determined thatIt is local that there is no update file.
In one embodiment, the system 100 of management update file further includes other function module/unit, for realizingMethod and step in embodiment 1 in each embodiment.