Method and system for achieving timely updating of client configuration
The invention discloses a method and a system for achieving timely updating of client configuration. The method includes steps: after the client initiates any request to the server, receiving a response message fed back by the server; and obtaining a response header data containing client configuration information from the response message. The response header data includes configuration header data and version header data. Based on the configuration header data, it is determined whether there is an update in the client configuration stored at the server. If there is an update, the configuration at the client is updated based on the version header data. The invention can achieve timely updating of important configurations of the client based on frequent HTTP requests between the client and the server.
1 . A method for achieving timely updating of client configuration, comprising:
receiving a response message fed back by a server after a client initiates any request to the server;
characterized by further comprising steps:
obtaining a response header data containing client configuration update information from the response message, wherein the response header data includes a configuration header data and a version header data; and,
determining an update to a client configuration is stored at the server based on the configuration header data; and,
updating a corresponding configuration at the client according to the version header data;
wherein the response header data is generated by the server according to rules of response header data agreed with the client, and the method comprises steps:
initializing the configuration header data to a set of fixed digits, wherein a digit count of the configuration header data is determined by a count number of modules of the client configuration stored at the server, and each digit of the configuration header data represents one functional module of the client configuration stored at the server; and,
setting a value of a corresponding digit in the response header data to an agreed value representing an update; and,
setting the version header data, which consists of configuration version numbers that correspond to the functional modules of the client configuration stored at the server respectively, and a discrete request time of the client: wherein each configuration version number represents a version number of the corresponding functional module of the client configuration stored at the server; and,
updating a value of the corresponding configuration version number, when the version number of any one of the functional modules of the client configuration stored at the server is updated; and setting the discrete request time; and,
combining the configuration header data and the version header data to generate the response header data.
2 . The method for achieving timely updating of client configuration according to claim 1 , characterized in that,
the step, determining an update to a client configuration is stored at the server based on the configuration header data, comprises:
determining whether the configuration header data contains the agreed value representing an update.
3 . The method for achieving timely updating of client configuration according to claim 1 , characterized in that,
the step, updating a corresponding configuration at the client according to the version header data, comprises:
comparing the response header data that is newly obtained with a local response header data stored at the client to detect functional modules that need to be updated; and,
obtaining a corresponding URL to update a corresponding functional module based on the detected functional modules that need to be updated; and updating the local response header data to the response header data newly obtained.
4 . The method for achieving timely updating of client configuration according to claim 1 , characterized in that,
the functional modules of the client configuration stored at the server includes a switch module and a positioning module.