A kind of general game version incremental update system and method
Technical field
The present invention relates to a kind of general game version incremental update system and method, belong to computer game more frontier.
Background technology
Distributor is called as content distributing network.Its basic ideas avoid internet likely affects bottleneck and the link of data rate and stability as far as possible, make content delivery sooner, more stable.By placing one deck intelligent virtual network on existing Internet basic that node server is formed everywhere at network, Distributor system can in real time according to the connection of network traffics and each node, load state and the request of user again to be led from the nearest service node of user to the integrated information such as Distance geometry response time of user.Its objective is and make user can obtain required content nearby, solve the situation that Internet network is crowded, improve the response speed of user's access websites.
MD5 and Message-Digest Algorithm 5, for guaranteeing that information transmission is unanimously complete.It has various features, the data of random length, and the MD5 value length calculated is all fixing.Easy calculating: calculate MD5 value from former data and be easy to.Anti-amendment: make any change to former data, even only revise 1 byte, the MD5 value obtained has very large difference.Strong impact resistant: known former data and its MD5 value, wants to find data (i.e. data falsification) with identical MD5 value to be very difficult.
There is following problem in prior art: game version upgrades a system most important system in games system often, because staying of player is lost up to 10 multiple spots before entering game entry interface according to game retention related data statistics, be exactly often because or game does not upgrade system and causes player to need consumption plenty of time and flow to go to download whole game package getting off installations, or in renewal process the single and another player's heart of mistake consuming time interface of a specified duration performance raw be tired of feel and exit game.
The scheme that general game adopts usually is or does not do version incremental update system, or is adopt the comparison of MD5 resource to upgrade system.
The comparison of MD5 resource upgrades system: all for latest edition uploading resource are generated MD5 file corresponding to resource to server end, client safeguards the MD5 file of current version equally, by client MD5 file and the comparison of server end MD5 file being generated the Resources list needing to download when game starts, then download resource in this Resources list and cover in the local persistence path of client, if game starts rear persistence path corresponding resource, loading into game.As above be MD5 file part content, the MD5 of every a line resource is as major key, and by picture relative path, whether MD5 value is folder identifier, and server download address synthesizes a list as value.The defect adopting the comparison of MD5 resource to upgrade system has the defect of following 1-4:
1. client needs to preserve a MD5 file, general commercial game resource up to up to ten thousand, an a line, so a MD5 file just needs to occupy installation kit about size 4M space;
2. startup of playing needs server list MD5 file download, and travels through each resource MD5, if not this MD5 value in client MD5 file, then this resource listed in the list needing download, this process can cause about one minute consuming time;
3. to play downloaded resources list as required, download corresponding resource one by one, often download a resource due to this process all to need to set up HTTP linking request, this process is huge key bottleneck point consuming time, if need the resource upgraded to reach hundreds of generally just need more than ten minutes;
4. in game, downloading process is interrupted, and in order to support to enter next time game breakpoint transmission function, game also needs to record and have updated which file last time and enter client, brings inconvenience, easily loses and cause bug.
Summary of the invention
For the problem of prior art, technical scheme of the present invention proposes a kind of general game version incremental update system and method, the present situation general game version being upgraded to system realization is analysed in depth with the reason caused, analyze user player to the real needs of game renewal, summarize a set of general game version incremental update system, to reach the construction cycle substantially reducing version incremental update system, strengthen code maintainability and reusability, the object of the experience of enhancing game and performance retention ratio and minimizing meaningless time and the mistake of flow consumption thus increase is played.
Technical scheme technical scheme of the present invention comprises a kind of general game version incremental update system, comprise publishing side, client, Distributor, it is characterized in that, this system comprises: upgrade preparation module, for creating renewal version list, game version message file and lastest imformation file being carried out being stored to version list, also then changing into scripted code for resolving into byte stream to game resource procedure set; Upgrade interface module, script for described renewal preparation module being transformed is packaged into renewal resource file, and generating configuration file is for configuring corresponding renewal resource file, and created interactive interface is used for the self-defined renewal resource file arranging required issue, and required renewal resource file is uploaded to Distributor; Version updating module, for obtaining the renewal resource file of described Distributor, resolving and obtaining more new resources version information, performs corresponding resource file replace and install according to version information; Code reflecting module, after performing replacement and installation to described version to described version updating module, carries out dynamic load and Dynamic Execution and use to the program code under games.
According to described general game version incremental update system, wherein upgrade preparation module to comprise: more new directory submodule, creating and upgrade version info Directory listings, for storing different version information file, comprising lastest imformation file, incremental update message file, history updating file; More rebaptism submodule, for creating the naming rule of the version information file to described more new directory submodule, comprising and using the Digital ID code increased progressively successively to identify to the updating file of version information increment; Resource consolidation submodule, for needing the renewal resource file issued to integrate, comprising and the video needed for game, audio frequency, picture, games code is resolved into byte stream and are converted into scripted code and put into corresponding version information file.
According to described general game version incremental update system, wherein upgrade interface module to comprise: interactive interface submodule, use can carry out self-defined selection for transferring version information file to the renewal resource file of issue by interactive interface, and provide compilation script way selection, platform published method to select and upgrade resource file package way selection, and by the game renewal files passe that finally encapsulates to Distributor; Backstage configuration submodule, for being configured according to the renewal resource file of the self-defined selection of described interactive interface submodule, comprising the configuration file creating updating file, also comprising and creating new version information file and incremental update version information file; Backstage encapsulation submodule, is packaged into file publishing for the renewal resource file configured described backstage configuration submodule.
According to described general game version incremental update system, wherein version updating module comprises: upgrade contrast submodule, for downloading corresponding renewal resource file from described Distributor, resolve described renewal resource file and obtain the Reconfigurations file upgrading version information file and correspondence, version information file and upgrade version information file and perform contrast under pre-service client; Upgrading submodule, for obtaining the described comparing result upgrading contrast module, replacement and the installation that renewal resource file carries out correspondence being transferred to the file under client.
According to described general game version incremental update system, wherein code reflecting module also comprises: load for carrying out reflection to the more new resources replaced and install, comprise dynamic reflective and load game identification code, also comprise and use scripted code make an explanation and perform to the games code under more new resources.
Technical scheme of the present invention also comprises a kind of general game version increment updating method, it is characterized in that, the method comprises: create and upgrade version list, game version message file and lastest imformation file being carried out being stored to version list, also then changing into scripted code for resolving into byte stream to game resource procedure set; The script that described renewal preparation module transforms is packaged into renewal resource file, and generating configuration file is for configuring corresponding renewal resource file, and created interactive interface is used for the self-defined renewal resource file arranging required issue, and required renewal resource file is uploaded to Distributor; Obtain the renewal resource file of described Distributor, resolve and obtain more new resources version information, perform corresponding resource file according to version information and replace and install; After replacement and installation are performed to described version updating module to described version, dynamic load is carried out and Dynamic Execution and use to the program code under games.
Further, the method also comprises: creating and upgrade version info Directory listings, for storing different version information file, comprising lastest imformation file, incremental update message file, history updating file; Create the naming rule to the version information file of described more new directory submodule, comprise and use the Digital ID code increased progressively successively to identify to the updating file of version information increment; To needing the renewal resource file issued to integrate, comprising and the video needed for game, audio frequency, picture, games code are resolved into byte stream and are converted into scripted code and put into corresponding version information file.
Further, the method also comprises: can carry out self-defined selection for transferring version information file to the renewal resource file of issue by interactive interface, and provide compilation script way selection, platform published method to select and upgrade resource file package way selection, and by the game renewal files passe that finally encapsulates to Distributor; Renewal resource file according to the self-defined selection of described interactive interface submodule is configured, and comprises the configuration file creating updating file, also comprises and creates new version information file and incremental update version information file; File publishing is packaged into the renewal resource file that described backstage configuration submodule has configured.
Further, the method also comprises: download corresponding renewal resource file from described Distributor, resolve described renewal resource file and obtain the Reconfigurations file upgrading version information file and correspondence, version information file and upgrade version information file and perform contrast under pre-service client; Obtain the described comparing result upgrading contrast module and replacement and the installation that renewal resource file carries out correspondence is transferred to the file under client.
Further, the method also comprises: load for carrying out reflection to the more new resources replaced and install, comprise dynamic reflective and load game identification code, also comprise and use scripted code make an explanation and perform to the games code under more new resources.
Beneficial effect of the present invention is: version interface is sent out in (1) visual resource packing, a keyization operation, and interface is easy to operation and provides check messagewindow, and version is sent out in convenient planning directly packing, substantially reduces the construction cycle of version incremental update system.(2) version incremental update system can be conveniently transplanted in different game item, and also convenient other functions of expansion, strengthen code maintainability and reusability.(3) strengthen game experience and performance thus increase game retention ratio and reduce the meaningless time and flow consumption lose.
Accompanying drawing explanation
Figure 1 shows that the overall construction drawing according to embodiment of the present invention;
Figure 2 shows that the process flow diagram according to embodiment of the present invention.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, describe the present invention below in conjunction with the drawings and specific embodiments.The renewal of a kind of game such as the general mobile phone games of game version incremental update system and method, web game etc. of the present invention.
Figure 1 shows that the overall construction drawing according to embodiment of the present invention, it totally comprises publishing side, client and Distributor.Wherein, upgrade preparation module, for creating renewal version list, game version message file and lastest imformation file being carried out being stored to version list, also then changing into scripted code for resolving into byte stream to game resource procedure set; Upgrade interface module, script for described renewal preparation module being transformed is packaged into renewal resource file, and generating configuration file is for configuring corresponding renewal resource file, and created interactive interface is used for the self-defined renewal resource file arranging required issue, and required renewal resource file is uploaded to Distributor; Version updating module, for obtaining the renewal resource file of described Distributor, resolving and obtaining more new resources version information, performs corresponding resource file replace and install according to version information; Code reflecting module, after performing replacement and installation to described version to described version updating module, carries out dynamic load and Dynamic Execution and use to the program code under games.
Figure 2 shows that according to the operation steps in a process flow diagram resource packing version management process of embodiment of the present invention, write a visualization resource packing and issuing interface, can click to issue immediately just to complete above in steps and by uploading resource on the Distributor server of correspondence, and then performs flow process according to incremental update system and goes to upgrade the resource needed.This part directly performs incremental update flow process, and this system core thinking is exactly more directly downloaded the compression delta patch of current version needs renewal by version number, preferentially calls under being decompressed to persistence path.Process flow diagram according to Fig. 2, wherein version information file have recorded installation kit version number and resource version number.Ji Shi mobile terminal, persistence path can carry out reading and writing the path stored, like this can by the Resource Storage in online or installation kit under this path, for heat more demand.Concrete execution step also comprises following 1-6 step:
1. the version information file on download distribution server, loads the version information file in installation kit and under persistence path.
2. enter the resource version number under the game current installation kit of first comparison and persistence path, if installation kit resource version number is large, then the resource under StreamingAsset in installation kit is all override the resource (separate resources) under persistence path;
3. the installation kit version number on then comparison persistence path and Distributor, if persistence path installation kit version number is large, then without the need to update contruction bag, otherwise downloads and installs and wrap and exit game installation;
4. the resource version number secondly on comparison persistence path and Distributor, if persistence path resources version number is large, then without the need to more new resources, otherwise download corresponding delta patch, covers old resource under being decompressed to persistence path;
5. download and install and wrap or delta patch employing network request, support breakpoint transmission function, download interrupts entering game next time can continue the download of original progress;
6., after service packs has downloaded covering, for game resource, the resource under game preferential reading persistence path, if do not read the resource in installation kit again; For game identification code, need reflection to load dynamic load in game for procedure set DLL and use (in Android), because ios system does not allow to reflect loading code, so lua language development game logic can be used, and as resource updates, then load and directly to explain into game and perform.
The above, just preferred embodiment of the present invention, the present invention is not limited to above-mentioned embodiment, as long as it reaches technique effect of the present invention with identical means, all should belong to protection scope of the present invention.In protection scope of the present invention, its technical scheme and/or embodiment can have various different modifications and variations.