A method and system for implementing client configuration and time update
Patent Information
- Application Number
- CN202111012080.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2041-08-31
AI Technical Summary
[0006]以上这几种用于客户端配置更新的方法都有一个明显的缺点,那就是不够及时
[0026]本发明基于客户端与服务端频繁的通信请求的基础上,通过服务器与客户端约定的一种响应头数据规则实现客户端配置的及时更新,客户端向服务器任意发送一个请求,服务器均可在检测到配置有更新的情况下直接将更新的信息通过响应头发送至客户端,设计简单,执行效率高;
Smart Images

Figure CN115729583B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a method and system for enabling timely updates of client configurations. Background Technology
[0002] Most applications or hardware devices store important configurations (such as function switches) on a server. If these configurations need to be updated, there are usually several methods:
[0003] (1) Restart the application or device. This method usually involves rewriting the code of the application corresponding to the client and then restarting the application launcher corresponding to the client to complete the update of the client configuration information.
[0004] (2) Triggered by specific front-end operations. This method usually occurs when a user performs an operation while using the app corresponding to the client, which causes the client configuration to be updated.
[0005] (3) Scheduled task triggering: This method usually involves setting a request interval on the client side. At the set time, the client sends a request to the server to inquire whether the server configuration items have changed. The server can only update the configuration after it responds to the client.
[0006] All of the methods described above for client configuration updates have a significant drawback: they are not timely enough. When major online issues occur (such as crashes in functional modules), they cannot be addressed promptly, thus impacting user experience and damaging the product's reputation. Summary of the Invention
[0007] To address the aforementioned issue of untimely client configuration updates, this invention discloses a method and system for timely client configuration updates. This system can promptly update important client configurations based on frequent HTTP requests between the client and server. Specifically, the technical solution of this invention is as follows:
[0008] On one hand, this application discloses a method for timely updating client configuration, comprising: receiving a response message from the server after the client initiates any request to the server; obtaining response header data carrying client configuration update information from the response message, the response header data including configuration response header data and version response header data; determining whether the client configuration stored on the server has been updated based on the configuration response header data; if an update exists, updating the corresponding configuration of the client based on the version response header data.
[0009] Preferably, the response header data is generated by the server according to the response header data rules agreed upon with the client, and mainly includes:
[0010] The initial data of the configuration response header is set to a fixed number. The number of bits in the configuration response header data is determined by the number of modules stored in the client configuration on the server. Each bit in the configuration response header data represents a functional module stored in the client configuration on the server.
[0011] When the functional modules in the client configuration stored on the server are updated, the value of the corresponding bit in the response header data is set to the agreed-upon value representing the update.
[0012] The version response header data is set, which consists of the "configuration version number" and the corresponding "discrete request time" of each functional module in the client configuration stored on the server; each digit of the configuration version number represents the version number of the corresponding functional module in the client configuration stored on the server; when the version of any functional module in the client configuration stored on the server is updated, the value of the corresponding digit in the configuration version number is updated, and the discrete time of the functional module in the client configuration stored on the server that experienced the version update is set;
[0013] The configuration response header data and the version response header data are combined to generate response header data.
[0014] Preferably, determining whether the client configuration stored on the server has been updated based on the configuration response header data includes: determining whether the configuration response header data contains an agreed-upon value representing an update; if so, then determining that the client configuration stored on the server has been updated.
[0015] Preferably, if an update exists, updating the corresponding configuration of the client based on the version response header data includes: comparing the obtained current version response header data with the local response header data stored on the client, and filtering out the functional modules that need to be updated; based on the filtered functional modules that need to be updated, obtaining the corresponding URLs and updating the configuration of the corresponding functional modules; and updating the local response header data to the current version response header data, wherein in subsequent updates, the new version response header data continuously replaces the previous version response header data.
[0016] Preferably, the method for timely updating client configuration further includes: the functional modules of the client configuration stored on the server include a switch module and a positioning module.
[0017] On the other hand, the present invention also discloses a system for timely updating client configuration, comprising: an information receiving unit, configured to receive a response message from the server after the client initiates any request to the server; an information extraction unit, configured to extract response header data carrying client configuration update information from the response message, the response header data including configuration response header data and version response header data; an update judgment unit, configured to determine whether the client configuration stored on the server has been updated based on the configuration response header data; and an operation processing unit, configured to update the corresponding configuration of the client based on the version response header data when it is determined that the client configuration stored on the server has been updated.
[0018] Preferably, the system for timely updating client configuration further includes: a message setting unit configured on the server; the message setting unit is used to set the response header of the response message according to the response header data rules agreed upon with the client; the message setting unit mainly includes:
[0019] The first setting subunit is used to set the configuration response header data. The initial data of the configuration response header is a fixed set of numbers. The number of bits in the response header data is determined by the number of modules stored in the client configuration on the server. Each bit in the configuration response header data represents a functional module stored in the client configuration on the server. When the functional modules stored in the client configuration on the server are updated, the first setting subunit sets the value of the corresponding bit in the response header data to an agreed value representing the update.
[0020] The second setting subunit is used to set version response header data, which consists of the "configuration version number" and the corresponding "discrete request time" of each functional module in the client configuration stored on the server; each digit of the configuration version number represents the version number of the corresponding functional module in the client configuration stored on the server; when the version of any functional module in the client configuration stored on the server is updated, the second setting subunit updates the value of the corresponding digit in the configuration version number and sets the discrete time of the functional module in the client configuration stored on the server that has undergone version update;
[0021] The response header generation subunit is used to merge the configuration response header data and the version response header data to generate response header data.
[0022] More preferably, the update determination unit includes: an update determination subunit, used to determine whether the configuration response header data contains an agreed value representing an update; if so, it is determined that the client configuration stored on the server has been updated.
[0023] Further preferably, the operation processing unit includes: a data comparison subunit, used to compare the obtained current version response header data with the local response header data stored on the client, and filter out the functional modules that need to be updated; a module update subunit, used to obtain the corresponding URL and perform configuration updates for the corresponding functional modules based on the filtered functional modules that need to be updated; and a data replacement subunit, used to update the local response header data with the current version response header data.
[0024] More preferably, the system for timely updating client configuration further includes: various functional modules of the client configuration stored on the server, including a switch module and a positioning module.
[0025] This invention includes at least one of the following technical effects:
[0026] Based on frequent communication requests between the client and the server, this invention enables timely updates to the client's configuration through a response header data rule agreed upon by the server and the client. The client can send any request to the server, and the server can directly send the updated information to the client through the response header if it detects an update in the configuration. The design is simple and the execution efficiency is high.
[0027] This invention enables updates without restarting the device or application, enhancing the user experience.
[0028] The response header data defined in this invention includes a configuration response header and a version response header. The configuration response header can be used to determine whether the client's configuration has been updated. If there is an update, the changes in the version response header data can be used to determine which module needs to be updated. If there is no update, no further steps are required, thus avoiding unnecessary and cumbersome steps.
[0029] This invention specifies in the response header data rules that each bit of the data corresponds to a module. This design allows the system to quickly determine which module has been updated based on data changes, and thus allows the client to quickly obtain the updated URL of that module. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 A flowchart illustrating Embodiment 1 of the method for timely updating client configuration according to the present invention;
[0032] Figure 2 A flowchart illustrating Embodiment 2 of the method for timely updating client configuration according to the present invention;
[0033] Figure 3 A flowchart illustrating Embodiment 3 of the method for timely updating client configuration according to the present invention;
[0034] Figure 4 A flowchart illustrating Embodiment 4 of the method for timely updating client configuration according to the present invention;
[0035] Figure 5 This is a schematic diagram illustrating the implementation process of the client's initial configuration update in Example 5;
[0036] Figure 6 This is a schematic diagram illustrating the implementation process of subsequent configuration updates for the client in Example 5;
[0037] Figure 7 This is a structural block diagram of embodiment 6 of the system for timely updating client configuration according to the present invention;
[0038] Figure 8 This is a structural block diagram of embodiment 7 of the system for timely updating client configuration according to the present invention;
[0039] Figure 9 This is a structural block diagram of embodiment 8 of the system for timely updating client configuration according to the present invention. Detailed Implementation
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the following description and drawings are exemplary for the present invention and should not be construed as limiting the present invention. The following description describes numerous specific details to facilitate understanding of the present invention. However, in some instances, well-known or conventional details are not described to meet the requirement of brevity in the specification.
[0041] Example 1
[0042] Embodiment 1 of the present invention is as follows Figure 1 As shown, a method for implementing timely updates of client configuration includes:
[0043] S101, after the client initiates any request to the server, receive the response message from the server;
[0044] Specifically, in this embodiment, the request sent by the client to the server does not specify the content of the request. Since HTTP requests between the client and the server are quite frequent—for example, when a user clicks on an app on the client, the client will send an HTTP request to the server—this HTTP request is not limited to configuration update requests. More likely, it does not contain configuration update requests but is simply a frequent communication request between the client and the server.
[0045] S102, obtain response header data carrying client configuration update information from the response message, the response header data including configuration response header data and version response header data;
[0046] Specifically, during the HTTP request process between the client and server, whenever the client's configuration is updated, the server can include response headers containing this configuration update information in its response message. This ensures that any configuration updates are promptly communicated to the client. The configuration response headers determine if the client's configuration has been updated, while the version response headers identify which module's configuration has been updated. For example, if network maintenance personnel discover a location discrepancy in the software and update the location, but the user hasn't yet triggered the location service, and the client's HTTP request to the server doesn't include a location update request, the server can still send the location update information back to the software client, allowing the client to update its location accordingly based on the response headers.
[0047] S103, determine whether the client configuration stored on the server has been updated based on the configuration response header data;
[0048] Specifically, the system first checks whether the configuration response header data has changed in the obtained response header data. If it has changed, it then determines whether the client configuration stored on the server has been updated based on the changed data.
[0049] S104, If an update exists, update the corresponding configuration of the client according to the version response header data.
[0050] Specifically, after determining that the client configuration has been updated, the changes in the version response header data determine which module on the client has been updated, thereby updating the client configuration.
[0051] This embodiment 1 discloses a method for timely client configuration updates. First, after the client initiates any request to the server, a response message is received from the server. Response header data carrying client configuration update information is obtained from the response message. The response header data includes configuration response header data and version response header data. Based on the configuration response header data, it is determined whether the client configuration stored on the server has been updated. If an update exists, the corresponding client configuration is updated according to the version response header data. Compared to current methods that typically require restarting the application server corresponding to the client, triggering specific front-end operations, or scheduled tasks when adjusting client configuration information, this embodiment, based on frequent HTTP requests between the client and server, uses response header data rules agreed upon between the server and client to provide real-time feedback of client configuration update information to the client, improving the efficiency and timeliness of client configuration updates.
[0052] Example 2
[0053] Embodiment 2 of the present invention, based on Embodiment 1 above, provides a specific method for generating response header data, such as... Figure 2 As shown, specifically, the response header data is determined by the server according to the response header data rules agreed upon with the client, including:
[0054] S201, the initial data of the configuration response header is set to a fixed number. The fixed number may include binary or decimal form, such as "00000" or "2222222", etc., which are not limited in this embodiment of the invention. The number of bits in the configuration response header data is determined by the number of modules stored in the client configuration on the server. For example, if the number of modules stored in the client configuration on the server is 10, then the initial data can be "0000000000" or "2222222222". Each bit in the configuration response header data represents a functional module stored in the client configuration on the server.
[0055] S202, set a convention to represent the updated value. When the functional module stored in the client configuration on the server is updated, the value of the corresponding number of bits in the response header data is set as the convention to represent the updated value. The convention to represent the updated value can take many forms, including numbers, letters, and symbols, such as 1, 1+, a, etc. This embodiment of the invention does not limit the form.
[0056] S203, Set version response header data, which consists of the "configuration version number" and the corresponding "discrete request time" of each functional module in the client configuration stored on the server; each digit of the configuration version number represents the version number of the corresponding functional module in the client configuration stored on the server, therefore, the number of digits of the configuration version number is the same as the number of digits of the configuration response header data and corresponds one-to-one; the configuration version number can be in various forms, including a set of numbers, a set of letters, and a set of symbols.
[0057] S204, Set the method for updating the version response header data. When the version of any functional module stored in the client configuration on the server is updated, update the value of the corresponding bit in the configuration version number. The method of updating the value is varied, but the principle is that it should not be repeated with the previous version number. For example, when a module is updated, the number of the corresponding bit is increased by 2. This embodiment of the invention does not limit the method.
[0058] S205, Set the discrete time of the functional modules stored in the client configuration on the server when a version update occurs;
[0059] S206, merge the configuration response header data and the version response header data to generate response header data.
[0060] For example, if the initial configuration response header data is set to "22222222", and the version response header data is "2,2,2,2,2,2,2,2,1", when the configuration module corresponding to each bit in the configuration response header is updated, it is agreed that the value representing the update in the configuration response header data is 1, and the number in the corresponding bit of the configuration version number in the version response header is increased by 2. Therefore, the configuration response header data becomes "22222221", and the version response header data becomes "2,2,2,2,2,2,2,4,10".
[0061] Generate a set of response header data as "22222221"
[0062] 2,2,2,2,2,2,2,4,10.
[0063] After the client sends any request to the server, the server generates the response header data according to the aforementioned response header data rules. The response message sent back by the server carries the aforementioned response header data. Based on the obtained response header data carrying configuration update information, it can be determined that the client configuration has been updated. The version response header data is compared with the local response header data stored on the client to determine the module that needs to be updated, and the client obtains the corresponding URL to update the configuration.
[0064] Example 3
[0065] Embodiment 3 of the present invention, based on Embodiment 2 above, provides a detailed explanation of how to determine whether the client configuration has been updated. The client configuration update implementation method in this embodiment is as follows: Figure 3 As shown, specifically, including:
[0066] S301, after receiving a request from the client to the server, the server first checks whether there is an update in the client configuration stored on the server. If there is an update, the server generates response header data according to the rules agreed upon with the client. The response header data includes configuration response header data and version response header data. Specifically, the generation of response header data has been described in detail in Example 2, and will not be repeated here.
[0067] S302, The server sends a response message containing the above response header data to the client;
[0068] S303, the client receives the response message and obtains the response header data from the response message;
[0069] S304, the client determines whether the configuration response header data in the received response header contains the agreed-upon value representing the update. For example, if the agreed-upon value representing the update is 1, it needs to determine whether the configuration response header contains 1;
[0070] S305. If the configuration response header data contains a predefined value, it can be determined that the client configuration stored on the server has been updated. For example, if the configuration response header data contains 1, then the client configuration stored on the server has been updated.
[0071] S306, If an update exists, update the corresponding configuration of the client according to the version response header data.
[0072] In this embodiment, if multiple configuration modules are updated, the configuration response header data contains multiple 1s, indicating that multiple modules in the client configuration stored on the server have been updated.
[0073] Example 4
[0074] Embodiment 4 of the present invention, based on Embodiment 1 above, provides a detailed description of the corresponding configuration of the client according to the version response header data. Specifically, as follows... Figure 4 As shown, it includes:
[0075] S401, after the client initiates any request to the server, it receives the response message from the server.
[0076] S402, obtain response header data carrying client configuration update information from the response message, the response header data including configuration response header data and version response header data;
[0077] S403, determine whether the client configuration stored on the server has been updated based on the configuration response header data; if so, proceed to the next step;
[0078] S404, retrieve the local response header data stored on the client, compare the obtained current version response header data with the local response header data stored on the client, and filter out the modules that need to be configured and updated;
[0079] S405: Based on the selected functional modules that need to be updated, the client obtains the corresponding module update URL and then performs the configuration update for the corresponding functional module.
[0080] S406 Replace the locally stored version response header data with the current version response header data.
[0081] For example, when a user clicks on a client application, the client sends an HTTP request to the server. Before responding, the server checks if there are any updates to the client's configuration stored on the server. For instance, if an update is detected to the client's on / off module configuration, the server generates the response header data "Configuration Response Header: 11111112" according to the agreed-upon response header data rules.
[0082] The version response header is "1,1,1,1,1,1,1,1,2,1", which is sent to the client. After receiving this response header data, the client first determines whether the client configuration has been updated based on the configuration response header data. Then, it pulls the local version response header data "1,1,1,1,1,1,1,1,1" stored on the client and compares it with the current version response header data "1,1,1,1,1,1,1,1,2,1". It finds that the units digit of the configuration version number is incremented by 1. The module corresponding to this units digit is the switch module. Therefore, the configuration module that needs to be updated is the switch module. The client can then obtain the update URL of the switch module, update it, and save "1,1,1,1,1,1,1,1,2,1" in local storage to replace "1,1,1,1,1,1,1,1,1,1".
[0083] Example 5
[0084] A schematic diagram of the implementation process of the initial configuration update of the client in Embodiment 5 of the present invention is shown below. Figure 5 As shown, it includes:
[0085] (1) After the client initiates any request to the server, receive the response message sent back by the server;
[0086] In this embodiment, the client is a smartwatch. The smartwatch sends a request to the server, and the server sends a response message.
[0087] (2) Obtain response header data carrying client configuration update information from the response message, wherein the response header data includes configuration response header data and version response header data;
[0088] In this embodiment, specifically, the response header data is generated according to a response header data rule agreed upon by the server and the client. The response header data rule is specifically as follows:
[0089] Configure the response header Conf-Updates: Set the initial data to 16-bit binary form of 0000000000000000, with each bit corresponding to a configuration module. A value of 1 indicates that the data of that module has been updated, and 0 indicates that no update is needed.
[0090] The Conf-Updates-V version response header consists of 16 sets of "configuration version numbers" and 1 set of "discrete request times", separated by commas. Each set corresponds to a module. The initial data is set to "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1". When the module configuration needs to be updated, the configuration version number of the corresponding set is incremented by 1, and the discrete time is reset.
[0091] The table below shows the correspondence between the number of bits and modules (the order of the number of bits is from right to left, and the corresponding module data is tentative):
[0092] Table 1: Correspondence between bit length and module
[0093] 1 switch https: / / getSwitchConfig 2 position https: / / getLocationConfig 3 ...
[0094] When the configuration of the switch module needs to be updated for the user:
[0095] The current configuration response header Conf-Updates = 0000000000000000. Set the value of the corresponding bit of the switch module to 1, which is 0000000000000001. That is, the new response header is Conf-Updates = 0000000000000001.
[0096] The current configuration version response header Conf-Updates-V = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1".
[0097] Increment the configuration version number of the corresponding group of the switch by 1, and then set the discrete time. The final value is "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1".
[0098] The response header data received was: "0000000000000001"
[0099] 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1”
[0100] (3) Determine whether the client configuration stored on the server has been updated based on the configuration response header data;
[0101] Specifically, in an embodiment of the present invention, it may include: determining whether the configuration response header data contains a 1;
[0102] In specific embodiments of the present invention, it may also include: if the configuration response header data contains 1, it can be determined that the client configuration stored on the server has been updated.
[0103] (4) If an update exists, the corresponding configuration of the client is updated according to the version response header data.
[0104] Specifically, in this embodiment of the invention, the following steps are taken: the configuration version number and discrete request time of the version response header data are separated, and the module for configuration update is determined to be the switch module by combining the correspondence between the configuration version number and the module stored on the client in the server.
[0105] Furthermore, the client obtains the update URL of the switch module and updates it, while saving the current version response header data.
[0106] Figure 6 This is a schematic diagram illustrating the implementation process of subsequent client configuration updates in Example 5, including:
[0107] (1) After the client initiates any request to the server, receive the response message sent back by the server;
[0108] In this embodiment, the client is a smartwatch. The smartwatch sends a request to the server, and the server sends a response message.
[0109] (2) Obtain response header data carrying client configuration update information from the response message, wherein the response header data includes configuration response header data and version response header data;
[0110] In this embodiment, specifically, the response header data is generated according to a response header data rule agreed upon by the server and the client. The response header data rule is specifically as follows:
[0111] Configure the response header Conf-Updates: Set the initial data to 16-bit binary form of 0000000000000000, with each bit corresponding to a configuration module. A value of 1 indicates that the data of that module has been updated, and 0 indicates that no update is needed.
[0112] The Conf-Updates-V version response header consists of 16 sets of "configuration version numbers" and 1 set of "discrete request times", separated by commas. Each set corresponds to a module. The initial data is set to "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1". When the module configuration needs to be updated, the configuration version number of the corresponding set is incremented by 1, and the discrete time is reset.
[0113] The correspondence between bit length and module is shown in Table 1.
[0114] When the configuration of the switch and positioning module needs to be updated for the user:
[0115] The current configuration response header Conf-Updates = 00000000000000000. Set the corresponding bit values of the switch and positioning module to 1, which is 0000000000000011. That is, the new response header is Conf-Updates = 0000000000000011.
[0116] The current configuration version response header Conf-Updates-V = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1".
[0117] Increment the configuration version number of the corresponding group of switch and positioning by 1, and then set the discrete time. The final value is "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1".
[0118] The response header data received was: "0000000000000011"
[0119] 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1”
[0120] (3) Determine whether the client configuration stored on the server has been updated based on the configuration response header data;
[0121] Specifically, in an embodiment of the present invention, it may include: determining whether the configuration response header data contains a 1;
[0122] In specific embodiments of the present invention, it may also include: if the configuration response header data contains 1, it can be determined that the client configuration stored on the server has been updated.
[0123] (4) If an update exists, update the corresponding configuration of the client according to the version response header data.
[0124] Specifically, this includes: retrieving local response header data stored on the client and comparing the obtained current version response header data with the local response header data stored on the client;
[0125] The modules that need to be updated are the switch module and the location module. The client obtains the corresponding update URL and updates the configuration of the corresponding module. At the same time, the local version response header data is replaced with the current version response header data.
[0126] Example 6
[0127] Based on the same technical concept, Embodiment 6 of this invention discloses a system for timely updating client configurations, such as... Figure 7 As shown, it includes:
[0128] The information receiving unit 110 is used to receive the response message from the server after the client initiates any request to the server. Specifically, since HTTP requests between the client and the server are relatively frequent, after the client sends a request to the server, the server needs to respond to the request, and the information received by the information receiving unit is received.
[0129] The information extraction unit 120 is used to obtain response header data carrying client configuration update information from the response message. The response header data includes configuration response header data and version response header data. Specifically, the response message returned by the server contains not only client configuration update information, but also a lot of other important information. Therefore, the information extraction unit needs to extract the client configuration update information. For example, if a user wants to delete certain information, the client sends a request to the server to delete the information. If the client's positioning module configuration happens to be updated, the response message returned by the server to the client contains both the positioning module update information response header and the response to the request to delete the information. The information extraction unit only needs to obtain the response header data containing the positioning module update information.
[0130] The update judgment unit 130 is used to determine whether the client configuration stored on the server has been updated based on the configuration response header data. Specifically, after obtaining the configuration response header data, it can be determined whether the configuration response header data contains a pre-defined value representing an update. If it is determined that the configuration response header data contains a pre-defined value representing an update, it is determined that the client configuration stored on the server has been updated.
[0131] The operation processing unit 140 is used to update the corresponding configuration of the client according to the version response header data when it is determined that the client configuration stored on the server has been updated; specifically, after determining that the client configuration has been updated, the obtained version response header data is used to determine which module needs to be updated, and then the client obtains the update URL of this module to update it.
[0132] Example 7
[0133] Embodiment 7 of the present invention is as follows Figure 8 As shown, based on the above embodiment 6, it further includes a message setting unit 100 disposed on the server; the message setting unit 100 is used to set the response header of the response message according to the response header data rules agreed with the client; the message setting unit 100 mainly includes:
[0134] The first setting subunit 101 is used to set configuration response header data and agreed-upon values to facilitate subsequent client determination of whether their configuration stored on the server has been updated. Specifically, it first sets a set of initial data for the configuration response header. This initial data can include binary or decimal forms, such as "00000" or "2222222", which is not limited in this embodiment. The number of digits in the configuration response header data corresponds to the number of modules in the client configuration stored on the server; that is, the initial data of the response header has the same number of digits as the number of modules. For example, if the number of modules in the client configuration stored on the server is 10, the initial data can be "0000000000" or "2222222222". Simultaneously, it sets an agreed-upon value to represent the update, which can be in the form of numbers, letters, or symbols. When the functional modules in the client configuration stored on the server are updated, the first setting subunit sets the corresponding number of digits in the response header data to the agreed-upon value representing the update.
[0135] The second setting subunit 102 is used to set the version response header data and the method of updating the version response header data. Specifically, the version response header data consists of two parts: "configuration version number" and "discrete request time". The number of digits in the configuration version number is the same as the number of functional modules stored in the client configuration on the server. Each digit represents the version number of the corresponding functional module stored in the client configuration on the server. The configuration version number includes a set of numbers, a set of letters, and a set of symbols.
[0136] Simultaneously, the update method for the version response header data is defined. When the version of any functional module in the client configuration stored on the server is updated, the value of the corresponding bit in the version response header data will be updated. For example, when a module is updated, the number of the corresponding bit is incremented by 2. When the version of any functional module in the client configuration stored on the server is updated, the second setting subunit updates the value of the corresponding bit in the configuration version number and sets the discrete time of the functional module in the client configuration stored on the server that experienced the version update.
[0137] The response header generation subunit 103 is used to merge the configuration response header data and the version response header data to generate response header data. Specifically, it merges the response header data set by the first setting subunit and the version response header data set by the second setting subunit into two lines of response header data.
[0138] The first setting subunit 101 and the second setting subunit 102 are connected to the response header generation subunit 103, and the message setting unit 100 is connected to the information receiving unit 110.
[0139] Example 8
[0140] Embodiment 8 of the present invention Figure 9 As shown, based on the above embodiments 6 or 7, the operation processing unit 140 further includes:
[0141] The data comparison subunit 141 is used to compare the obtained current version response header data with the local version response header data stored on the client; specifically, the locally stored version response header data is retrieved and compared with the current version response header data to determine which digit value has changed.
[0142] The module update subunit 142 is used to filter out the functional modules that need to be configured, so that the client can obtain the corresponding URL to update the configuration of the corresponding functional module; specifically, if the specific number of bits of the changed data is obtained, the specific module that needs to be updated can be determined according to the correspondence between the number of bits and the module, and the client can obtain the update URL of this module to update the corresponding configuration.
[0143] The data replacement subunit 143 is used to update the local response header data to the current version of the response header data; specifically, it directly stores the current response header data locally to replace the old local response header data.
[0144] The system embodiments and method embodiments of the present invention correspond to each other. The technical details of the method embodiments in this application are also applicable to the system embodiments in this application. To reduce repetition, they will not be repeated.
[0145] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0146] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for enabling timely updates of client configuration, characterized in that, include: After the client initiates any request to the server, it receives the response message from the server. Obtain response header data carrying client configuration update information from the response message; the response header data includes configuration response header data and version response header data. Based on the configuration response header data, determine whether the client configuration stored on the server has been updated; If an update exists, the corresponding configuration of the client is updated according to the version response header data; The response header data is generated by the server according to the response header data rules agreed upon with the client, and mainly includes: The initial data of the configuration response header is set to a fixed number. The number of bits in the configuration response header data is determined by the number of functional modules stored in the client configuration on the server. Each bit in the configuration response header data represents a functional module stored in the client configuration on the server. When the functional modules in the client configuration stored on the server are updated, the value of the corresponding bit in the configuration response header data is set to the agreed value representing the update. The version response header data is set, which consists of the "configuration version number" of each functional module in the client configuration stored on the server and the corresponding "discrete request time"; each digit of the configuration version number represents the version number of the corresponding functional module in the client configuration stored on the server. When the version of any functional module in the client configuration stored on the server is updated, update the value of the corresponding bit in the configuration version number, and set the discrete time of the functional module in the client configuration stored on the server that has been updated. The configuration response header data and the version response header data are combined to generate response header data.
2. The method for timely updating client configuration according to claim 1, characterized in that, The step of determining whether the client configuration stored on the server has been updated based on the configuration response header data includes: Determine whether the configuration response header data contains a pre-defined value representing an update; if so, determine that the client configuration stored on the server has been updated.
3. The method for timely updating client configuration according to claim 1, characterized in that, The step of updating the client's corresponding configuration based on the version response header data includes: The obtained current version response header data is compared with the local response header data stored on the client to filter out the functional modules that need to be updated; Based on the selected functional modules that need to be updated, obtain the corresponding URLs and update the configuration of the corresponding functional modules; and update the local response header data to the current version response header data.
4. The method for timely updating client configuration according to claim 1, characterized in that, The functional modules stored in the client configuration on the server include a switch module and a positioning module.
5. A system for enabling timely updates of client configurations, characterized in that, include: The information receiving unit is used to receive the response message sent back by the server after the client initiates any request to the server; An information extraction unit is used to obtain response header data carrying client configuration update information from the response message, wherein the response header data includes configuration response header data and version response header data; An update judgment unit is used to determine whether the client configuration stored on the server has been updated based on the configuration response header data. An operation processing unit is used to update the corresponding configuration of the client according to the version response header data when it is determined that the client configuration stored on the server has been updated. The message setting unit is configured on the server; The message setting unit is used to set the response header of the response message according to the response header data rules agreed upon with the client; The message setting unit mainly includes: The first setting subunit is used to set the configuration response header data. The initial data of the configuration response header is a fixed set of numbers. The number of bits in the configuration response header data is determined by the number of functional modules stored in the client configuration on the server. Each bit in the configuration response header data represents a functional module stored in the client configuration on the server. When the functional modules stored in the client configuration on the server are updated, the first setting subunit sets the value of the corresponding bit in the configuration response header data to an agreed value representing the update. The second setting subunit is used to set the version response header data, which consists of the "configuration version number" and the corresponding "discrete request time" of each functional module in the client configuration stored on the server; each digit of the configuration version number represents the version number of the corresponding functional module in the client configuration stored on the server; when the version of any functional module in the client configuration stored on the server is updated, the second setting subunit updates the value of the corresponding digit in the configuration version number and sets the discrete time of the functional module in the client configuration stored on the server that has undergone the version update; The response header generation subunit is used to merge the configuration response header data and the version response header data to generate response header data.
6. The system for timely updating client configuration according to claim 5, characterized in that, The update determination unit includes: An update determination subunit is used to determine whether the configuration response header data contains a pre-defined value representing an update; if so, it is determined that the client configuration stored on the server has been updated.
7. The system for timely updating client configuration according to claim 5, characterized in that, The operation processing unit includes: The data comparison subunit is used to compare the obtained current version response header data with the local response header data stored on the client, and to filter out the functional modules that need to be updated; The module update subunit is used to obtain the corresponding URL and update the configuration of the selected functional modules based on the selected functional modules that need to be updated. The data replacement subunit is used to update the local response header data with the current version of the response header data.
8. The system for timely updating client configuration according to claim 5, characterized in that, The functional modules stored in the client configuration on the server include a switch module and a positioning module.
Citation Information
Patent Citations
Data updating method and device of client, electronic equipment and readable medium
CN111510466A