Summary of the invention
Can't in time upgrade for the menu that solves software in the prior art and to cause the problem of user experience sense difference, the embodiment of the invention to propose a kind of menu update method and device.Described technical scheme is as follows:
The embodiment of the invention has proposed a kind of menu update method, comprising:
The inquiry far-end server judges whether that according to Query Result needs carry out updating menu, if download menu new configuration file more then, otherwise step finishes;
According to the menu item and the update rule that preset in the described updating menu configuration file, the menu of update software.
Preferred as technique scheme, described method also comprises:
When the user clicks menu, begin to carry out menu and upgrade.
Preferred as technique scheme, described inquiry far-end server judges whether to carry out updating menu and is specially:
Read in the described far-end server and described updating menu configuration file corresponding server end timestamp;
The local time stamp that described server end timestamp is corresponding with the body menu compares, and when time of the described server end timestamp of the time ratio of described local time stamp early the time, downloads described updating menu configuration file from described far-end server.
Preferred as technique scheme comprises in the described updating menu configuration file at least:
Menu item;
Indicating with corresponding being used to of each menu item that the identifier of action type, described action type comprise at least increases menu item, reduces menu item, revises menu item;
Indicate menu item position and key assignments in proper order with corresponding being used to of each menu item.
Preferred as technique scheme, described menu according to described updating menu configuration file update software is specially:
Read default menu; According to described updating menu configuration file, described default menu is upgraded; Amended default menu is resequenced according to key assignments.
Preferred as technique scheme, described described default menu is upgraded is specially:
Described default menu is increased and/or deletes and/or revise;
The method of described increase is specially:
According to the key assignments of the menu item in the described updating menu configuration file, obtain the residing position of described menu item, then described menu item is added in his father's menu;
The method of described deletion is specially: from described default menu, find out with described updating menu configuration file in the identical menu item of key assignments of menu item, and described menu item deleted in his father's menu;
The method of described modification is specially:
From default menu, find out with described updating menu configuration file in the identical menu item of key assignments of menu item, and the menu item in the described default menu is made amendment according to the menu item in the described more new configuration file.
Preferred as technique scheme, described menu according to described updating menu configuration file update software is specially:
Generate menu according to the updating menu configuration file that receives; Be pre-stored with complete menu in the wherein said updating menu configuration file.
Preferred as technique scheme, described method also comprises:
Upgrade menu according to the internet address that is formed on menu item correspondence in the described updating menu configuration file in advance.
Simultaneously, the embodiment of the invention has also proposed a kind of menu updating device, comprising:
A kind of menu updating device is characterized in that, comprising:
The status poll module, the inquiry far-end server judges whether to carry out updating menu;
Update module is used for more new configuration file of download menu, and according to the menu item and the update rule that preset in the described updating menu configuration file, the menu of update software.
Preferred as technique scheme, when the user clicked menu, described device begins to carry out menu to be upgraded.
Preferred as technique scheme, the status poll module comprises:
The timestamp download unit is used for when the user clicks menu, downloads the server end timestamp of far-end server; Wherein, described server end timestamp is corresponding with described updating menu configuration file;
Timestamp contrast unit, be used to extract described server end, and the local time stamp that described server end timestamp is corresponding with the body menu compares, when time of the described server end timestamp of the time ratio of described local time stamp early the time, make described update module download described updating menu configuration file from described far-end server.
Preferred as technique scheme, described updating menu configuration file comprises:
Menu item;
Indicating with corresponding being used to of each menu item that the identifier of action type, described action type comprise at least increases menu item, reduces menu item, revises menu item;
Indicate menu item position and key assignments in proper order with corresponding being used to of each menu item.
Preferred as technique scheme, described update module comprises:
Download unit is used to download described updating menu configuration file;
The default menu reading unit is used to read default menu;
Revise the unit, be used for described default menu being upgraded according to described updating menu configuration file;
Sequencing unit is resequenced according to described key assignments to amended default menu.
Preferred as technique scheme, the renewal of described modification unit comprise to be increased and/or deletes and/or revise described default menu;
The method of described increase is specially:
According to the key assignments of the menu item in the described updating menu configuration file, obtain the residing position of described menu item, then described menu item is added in his father's menu;
The method of described deletion is specially: from described default menu, find out with described updating menu configuration file in the identical menu item of key assignments of menu item, and described menu item deleted in his father's menu;
The method of described modification is specially:
From default menu, find out with described updating menu configuration file in the identical menu item of key assignments of menu item, and the menu item in the described default menu is made amendment according to the menu item in the described updating menu configuration file.
Preferred as technique scheme, described update module comprises:
Download unit is used to download described updating menu configuration file;
The menu generation unit is used for generating menu according to the described updating menu configuration file of downloading; Be pre-stored with complete menu in the wherein said updating menu configuration file.
Preferred as technique scheme also comprises:
The address update module is used for upgrading menu according to the internet address that is formed on described updating menu configuration file menu item correspondence in advance.
The beneficial effect of the technical scheme that the embodiment of the invention provides is: can carry out the menu upgrading in the embodiment of the invention separately, and be no longer dependent on software release upgrade.It is fast so both can to satisfy updating software function, and the requirement that the renewal frequency of menu is high can not need frequently to carry out software release upgrade again.The embodiment of the invention can increase the dirigibility of system under the prerequisite that does not reduce the user experience sense.Pass through at the prefabricated upgrade file of server end in the embodiment of the invention, and, can guarantee that all clients in time obtain upgrade information by the mode that client is inquired about.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
First embodiment of the invention has proposed a kind of menu update method, and its flow process comprises as shown in Figure 1:
Step 101, inquiry far-end server judge whether to carry out updating menu, if download menu new configuration file more then, otherwise step finishes;
Step 102, according to menu item that presets in the updating menu configuration file and update rule, the menu of update software.
In the embodiment of the invention, can carry out the menu upgrading separately, and be no longer dependent on software release upgrade.It is fast so both can to satisfy updating software function, and the requirement that the renewal frequency of menu is high can not need frequently to carry out software release upgrade again.The embodiment of the invention can increase the dirigibility of system under the prerequisite that does not reduce the user experience sense.Pass through at the prefabricated upgrade file of server end in the embodiment of the invention, and, can guarantee that all clients in time obtain upgrade information by the mode that client is inquired about.
Embodiment 2
Second embodiment of the invention has proposed a kind of menu update method, as shown in Figure 2, comprising:
Step 201, when the user clicks menu, begin to carry out menu upgrading;
Step 202, read in the far-end server and updating menu configuration file corresponding server end timestamp;
Wherein, the server end timestamp generates when generating the updating menu configuration file, and is corresponding with the updating menu configuration file; Client download menu more during new configuration file also download time stab, and be kept at local inquiry when upgrading later on;
Step 203, the local time stamp that the server end timestamp is corresponding with local menu compare, and when time of the time ratio server end timestamp of local time stamp early the time, expression has new menu to need to upgrade;
Step 204, read required renewal menu version, and judge whether with the version of local software suitable, if then jump to step 205; Otherwise step finishes;
Step 205, from far-end server download menu new configuration file more; Certainly, can also adopt when software signs in to server, by server to the software pushing menu mode of new configuration file more;
Step 206, menu is upgraded according to the updating menu configuration file;
Update method can for:
Generate default menu; According to the updating menu configuration file, default menu is upgraded; Default menu after upgrading is resequenced according to key assignments;
Wherein, comprise at least in the updating menu configuration file: menu item; Indicating with corresponding being used to of each menu item that the identifier of action type, action type comprise at least increases menu item, reduces menu item, revises menu item; Indicate menu item position and key assignments in proper order with corresponding being used to of each menu item;
Default menu can be to create according to the description in the local xml file; This step is a prior art, and the menu generating mode gets final product in the employing prior art;
Update method can also for:
Generate menu according to the updating menu configuration file that receives; Be pre-stored with complete menu in the wherein said updating menu configuration file;
The URL that step 207, basis are formed on menu item correspondence in the updating menu configuration file in advance upgrades menu, and upgrades picture resource; This is because menu is changed the URL change on the internet that can also comprise the menu item correspondence, therefore carries out the URL renewal again and can more comprehensively upgrade menu after menu is upgraded; And the embodiment of the invention can check also whether the picture resource of each the menu item correspondence described in this configuration file has existed this locality, if do not find in this locality, then IM software also will remove to download required picture resource to the server of having placed picture resource according to the URL address described in the configuration file;
Step 208, the menu after will upgrading are shown to the user.
Wherein, the step 201 of increase is to carry out the updating menu operation when the user clicks menu, can better improve sense of experience of users like this.Need take subnetwork and system resource owing to carry out the backstage upgrading, and be not that all users often use the interior menu item of menu.Therefore the embodiment of the invention is just upgraded when the user clicks menu, and the obsolete function of user that can prevent from frequently to upgrade improves sense of experience of users.Simultaneously, this mode of just carrying out the updating menu operation when the user clicks menu can prevent a large number of users and upgrade operation at one time simultaneously, the problem that the network of the server end that brings and system load sharply increase.
Wherein, step 202~203rd is to the concrete refinement of the step 101 among above-mentioned first embodiment.This employing timestamp is distinguished the mode of updating menu configuration file, can prevent a plurality of loaded down with trivial details version number that frequent upgrading brings, the unnecessary loss that version number's mistake that also can prevent to cause owing to human error causes.Certainly, the embodiment of the invention adopts the mode of timestamp only to be a kind of illustrating not as limit, and the embodiment of the invention also can adopt the mode of version number to judge whether to carry out updating menu.
The step 204 that increases be in order to prevent since the version of software and server-side menu more the version of new configuration file be not inconsistent and cause upgrading to fail, cause the disabled problem of software.Can make the menu upgrading of software have better reliability like this.
Wherein, above-mentioned steps 205~206th is to the concrete refinement of the step 102 among first embodiment.Can realize sending simultaneously the mode of operation of menu item and respective menu items like this by simple mode, reduce the complexity of updating menu configuration file, to reduce transmission volume.Adopt this mode can cooperate aforesaid updating menu configuration file format, the realization client is known menu item that will upgrade and the operation of the renewal that will carry out by simple identification, can upgrade the menu of client and resequence by simple mode, to reduce the system overhead of client.Simultaneously, disclose mode of initiatively being downloaded by client and the mode that is pushed by server end in the step 205, this dual mode can well be realized the renewal to menu.
In above-mentioned steps 206,, default menu is carried out updating steps specifically comprise: default menu is increased and/or deletes and/or revise according to the updating menu configuration file;
The method that increases is specially:
According to the key assignments of the menu item in the updating menu configuration file, obtain the residing position of menu item, menu item is added in his father's menu then;
The method of deletion is specially: from default menu, find out with the updating menu configuration file in the identical menu item of key assignments of menu item, and menu item deleted in his father's menu;
The method of revising is specially:
From default menu, find out with the updating menu configuration file in the identical menu item of key assignments of menu item, and the menu item in the default menu is made amendment according to the menu item in the updating menu configuration file.
Can realize that like this client knows the operation of the menu item that will upgrade and the renewal that will carry out by simple identification, can upgrade the menu of client and resequence by simple mode, with the system overhead of reduction client.
Wherein, in above-mentioned steps 206, also comprised according to the updating menu configuration file that receives generating menu; Be pre-stored with complete menu in the wherein said updating menu configuration file.This mode can directly send to client with complete menu, so that menu is upgraded.This mode can reduce the system load of client, and client need not to operate can finish the menu upgrading.
Embodiment 3
Third embodiment of the invention has proposed a kind of updating menu device of Instant Messenger (IM) software, and its structure comprises as shown in Figure 3:
Status poll module 1, the inquiry far-end server judges whether to carry out updating menu;
Update module 2 is used for more new configuration file of download menu, and according to the menu item and the update rule that preset in the described updating menu configuration file, the menu of update software.
In the embodiment of the invention, can carry out the menu upgrading separately, and be no longer dependent on software release upgrade.It is fast so both can to satisfy updating software function, and the requirement that the renewal frequency of menu is high can not need frequently to carry out software release upgrade again.The embodiment of the invention can increase the dirigibility of system under the prerequisite that does not reduce the user experience sense.Pass through at the prefabricated upgrade file of server end in the embodiment of the invention, and, can guarantee that all clients in time obtain upgrade information by the mode that client is inquired about.
Embodiment 4
Fourth embodiment of the invention has proposed a kind of menu updating device, and its structure comprises as shown in Figure 4:
Status poll module 1 and updatemodule 2.
Status poll module 1 connects far-end server, judges whether to carry out updating menu.
Further, the menu updating device that the embodiment of the invention proposes can carry out the updating menu operation when the user clicks menu.
Status poll module 1 can be specially:
Timestamp download unit 11 is used for when the user clicks menu, downloads the server end timestamp of far-end server; Wherein, the server end timestamp is corresponding with the updating menu configuration file; Client download menu more during new configuration file also download time stab, and be kept at local inquiry when upgrading later on;
Timestamp contrast unit 12, be used to extract server end, and the local time stamp that the server end timestamp is corresponding with the body menu compares, and when time of the time ratio server end timestamp of local time stamp early the time, makes update module from far-end server download menu new configuration file more.
Wherein, comprise at least in the updating menu configuration file:
Menu item;
Indicating with corresponding being used to of each menu item that the identifier of action type, action type comprise at least increases menu item, reduces menu item, revises menu item;
Indicate menu item position and key assignments in proper order with corresponding being used to of each menu item.
The updating menu configuration file of this mode, can be in a file storage menu item, and the action type corresponding, and the key assignments of indicating menu item position and order with this menu item.Can realize modification by simple mode like this, reduce the complexity of updating menu configuration file, to reduce transmission volume client.
Also compriseupdate module 2, be used for more new configuration file of download menu, and according to the menu of updating menu configuration file updatesoftware.Update module 2 can be specially:
Download unit 21 is used to download described updating menu configuration file;
Default menu reading unit 22 is used to read default menu; Wherein, default menu can be to create according to the description in the local xml file;
Reviseunit 23, be used for default menu being upgraded according to the updating menu configuration file;
Sequencing unit 24 is resequenced according to key assignments to amended default menu;
Wherein, the renewal of revising the unit comprises increases and/or deletes and/or revise institute's default menu;
The method that increases is specially:
According to the key assignments of the menu item in the updating menu configuration file, obtain the residing position of menu item, menu item is added in his father's menu then;
The method of deletion is specially: from default menu, find out with the updating menu configuration file in the identical menu item of key assignments of menu item, and menu item deleted in his father's menu;
The method of revising is specially:
From default menu, find out with the updating menu configuration file in the identical menu item of key assignments of menu item, and the menu item in the default menu is made amendment according to the menu item in the updating menu configuration file.
Update module 2 can also be specially:
Download unit is used to download described updating menu configuration file;
The menu generation unit is used for generating menu according to the described updating menu configuration file of downloading; Be pre-stored with complete menu in the wherein said updating menu configuration file.
Also comprise:
The address update module is used for upgrading menu according to the URL address, internet that is formed on updating menu configuration file menu item correspondence in advance;
The picture update module is used to judge whether the image resource of each menu item after the renewal has been stored in this locality, if not then the download pictures resource.
This is because menu is changed the URL change on the internet that can also comprise the menu item correspondence, therefore carries out the URL renewal again and can more comprehensively upgrade menu after menu is upgraded; And the embodiment of the invention can check also whether the picture resource of each the menu item correspondence described in this configuration file has existed this locality, if do not find in this locality, then IM software also will remove to download required picture resource to the server of having placed picture resource according to the URL address described in the configuration file.
Wherein, the software among above-mentioned each embodiment can be Instant Messenger (IM) software; Menu can be the menu of Instant Messenger (IM) software.
All or part of content in the technical scheme that above embodiment provides can realize that its software program is stored in the storage medium that can read by software programming, storage medium for example: the hard disk in the computing machine, CD or floppy disk.
By the above-mentioned embodiment of the invention as can be seen, the method and apparatus of the embodiment of the invention can be applied to Instant Messenger (IM) software (IM), for example applicant's QQ software.In the embodiment of the invention, can carry out the menu upgrading separately, and be no longer dependent on software release upgrade.It is fast so both can to satisfy updating software function, and the requirement that the renewal frequency of menu is high can not need frequently to carry out software release upgrade again.The embodiment of the invention can increase the dirigibility of system under the prerequisite that does not reduce the user experience sense.Pass through at the prefabricated upgrade file of server end in the embodiment of the invention, and, can guarantee that all clients in time obtain upgrade information by the mode that client is inquired about.
By when the user clicks menu, carrying out the updating menu operation, can better improve sense of experience of users like this.Need take subnetwork and system resource owing to carry out the backstage upgrading, and be not that all users often use the interior menu item of menu.Therefore the embodiment of the invention is just upgraded when the user clicks menu, and the obsolete function of user that can prevent from frequently to upgrade improves sense of experience of users.Simultaneously, this mode of just carrying out the updating menu operation when the user clicks menu can prevent a large number of users and upgrade operation at one time simultaneously, the problem that the network of the server end that brings and system load sharply increase.Owing to the online service time of the Instant Messenger (IM) software that is similar to QQ is very long, if adopt the mode of real-time upgrading, might be when the new updating menu configuration file of firm issue, mass users receives upgrade information simultaneously, and system load and the offered load that causes server end of upgrading simultaneously can't bear the heavy load.Adopt this mode can also improve the experience sense that the user uses, prevent from seldom to use the user of menu frequently to upgrade.Certainly this is preferred embodiment a kind of, and the embodiment of the invention is not once exceeded.
Also disclose method and apparatus in the embodiment of the invention, can prevent a plurality of loaded down with trivial details version number that frequent upgrading brings, the unnecessary loss that version number's mistake that also can prevent to cause owing to human error causes by update of time stamp.Certainly, the embodiment of the invention adopts the mode of timestamp only to be a kind of illustrating not as limit, and the embodiment of the invention also can adopt the mode of version number to judge whether to carry out updating menu.
In order to prevent since the version of software and server-side menu more the version of new configuration file be not inconsistent and cause upgrading to fail, cause the disabled problem of software, the embodiment of the invention has also increased the step of version match inquiry, can make the menu upgrading of software have better reliability like this.
Simultaneously, the invention also discloses client downloads updating menu configuration file and server push dual mode, this dual mode can well be realized the renewal to menu.
The updating menu configuration file of the embodiment of the invention can comprise menu item and operation mark, can realize sending simultaneously the mode of operation of menu item and respective menu items like this by simple mode, reduce the complexity of updating menu configuration file, to reduce transmission volume.Adopt this mode can cooperate aforesaid updating menu configuration file format, the realization client is known menu item that will upgrade and the operation of the renewal that will carry out by simple identification, can upgrade the menu of client and resequence by simple mode, to reduce the system overhead of client.Client is upgraded menu by menu item and sign, can realize that like this client knows the operation of the menu item that will upgrade and the renewal that will carry out by simple identification, can upgrade the menu of client and resequence by simple mode, to reduce the system overhead of client.
The updating menu configuration file of the embodiment of the invention can also comprise complete menu.This mode can directly send to client with complete menu, so that menu is upgraded.This mode can reduce the system load of client, and client need not to operate can finish the menu upgrading.
After menu item is upgraded, can also the URL address, internet and the picture of each menu item correspondence be upgraded.
Below only be preferred embodiment of the present invention, or not within the spirit and principles in the present invention not all in order to restriction the present invention, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.