Configuration data updating method and device, computer equipment, readable storage medium and program product
Through the collaborative work of the management configuration unit and the message agent, monitoring and pushing configuration data updates solves the problem of low configuration data update efficiency caused by competition for access by business sub-modules, improves the efficiency and pertinence of configuration data updates, and saves computer resources.
Patent Information
- Application Number
- CN202411068885.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-09-17
AI Technical Summary
In traditional technology, configuration data update efficiency is low due to business sub-modules competing for access to configuration files.
Obtain the current configuration file of the target application through the management configuration unit, monitor the subscription configuration parameter set fed back by the message agent to produce a changed configuration data set, and publish it to the message agent. The message agent pushes the configuration data according to the subscription configuration parameters of each business unit. to the appropriate business unit.
It avoids multiple business sub-modules competing for access to configuration files, reduces the amount of data monitored, pushed and transmitted, improves the pertinence and efficiency of configuration data updates, and saves computer resources.
Smart Images

Figure CN118656098A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a configuration data updating method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, applications contain more and more business submodules, and each business submodule has its own required configuration parameters. The configuration parameters of each business submodule can be configured through a configuration file, and the business submodule can obtain the required change parameters by monitoring the configuration file.
[0003] In the conventional technology, each business submodule monitors the changes in the configuration file at the same time, which results in low configuration data update efficiency due to contention access. Summary of the invention
[0004] Based on this, it is necessary to provide a configuration data updating method, apparatus, computer device, computer readable storage medium and computer program product that can improve the configuration data updating efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a configuration data updating method, comprising:
[0006] Obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that generates changes to the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of multiple configuration parameters;
[0007] The configuration data in the configuration data set is pushed to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data.
[0008] In one embodiment, the configuration data updating method further includes:
[0009] When a new business unit appears in the target application, the subscription configuration parameters corresponding to the new business unit are obtained through the management configuration unit, and the subscription configuration parameters corresponding to the new business unit are added to the subscription configuration parameter set to obtain an updated subscription configuration parameter set; the current configuration file and the historical configuration file corresponding to the target application are compared through the management configuration unit to obtain the new configuration data, and the new configuration data is transmitted to the new business unit so that the new business unit can enable the new configuration data.
[0010] In one embodiment, the configuration data updating method further includes:
[0011] By comparing the configuration data corresponding to the subscription configuration parameters in the subscription configuration parameter set in the historical configuration file and the current configuration file corresponding to the target application through the management configuration unit, a configuration data set of the target application for the subscription keyword set is obtained; after the configuration data in the configuration data set is transmitted to the business unit corresponding to the subscription configuration parameters, the method also includes: updating the historical configuration file based on the current configuration file through the management configuration unit to obtain an updated historical configuration file.
[0012] In one embodiment, the business unit is used to:
[0013] Obtain the parameter enabling type corresponding to the received configuration data; when the parameter enabling type is an immediate enabling type, enable the received configuration data; when the parameter enabling type is a delayed enabling type, enable the received configuration data according to the delayed enabling condition corresponding to the received configuration data.
[0014] In one embodiment, the configuration data updating method further includes:
[0015] The parameter activation type corresponding to the received configuration data is determined through the management configuration unit according to the business logic corresponding to the business unit; when the parameter activation type is the delayed activation type, the delayed activation condition corresponding to the received configuration data is determined through the management configuration unit according to the business requirements corresponding to the target application and the business logic corresponding to the business unit; the delayed activation condition is reaching the delay interval or triggering an activation event.
[0016] In one embodiment, monitoring a configuration data set for generating changes to a subscription configuration parameter set fed back by a message agent in a target application includes:
[0017] Through the management configuration unit, statistics are collected on the change frequencies corresponding to the respective configuration parameters in the subscription configuration parameter set. In the subscription configuration parameter set, the configuration parameter whose change frequency is greater than the frequency threshold is determined as the first configuration parameter, and the configuration parameter whose change frequency is less than or equal to the frequency threshold is determined as the second configuration parameter; through the management configuration unit, the first monitoring period corresponding to each first configuration parameter is calculated according to the change frequency corresponding to each first configuration parameter; the change frequency is negatively correlated with the first monitoring period; through the management configuration unit, based on the first monitoring period, the configuration data that has changed with respect to the first configuration parameter is monitored to obtain a first data set; based on the preset monitoring period, the configuration data that has changed with respect to the second configuration parameter is monitored to obtain a second data set; based on at least one of the first data set or the second data set, a configuration data set is obtained.
[0018] In a second aspect, the present application also provides a configuration data updating device, comprising:
[0019] The management configuration module is used to obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that generates changes to the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of multiple configuration parameters;
[0020] The message proxy module is used to push the configuration data in the configuration data set to the corresponding business unit through the message proxy according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data.
[0021] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned configuration data updating method when executing the computer program.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above-mentioned configuration data updating method when executed by a processor.
[0023] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned configuration data updating method when executed by a processor.
[0024] The configuration data updating method, device, computer equipment, computer-readable storage medium and computer program product obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that has changed in the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent. Then, the configuration data in the configuration data set is pushed to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data. In this way, the configuration data set that has changed in the current configuration file is detected according to the subscription configuration parameter set fed back by the message agent through the management configuration unit in the target application, which can avoid the problem of low configuration data update efficiency caused by multiple business submodules competing to access the configuration file, and only monitor the changes generated by the subscription configuration parameter set, which can reduce the amount of data monitored, pushed and transmitted, improve the pertinence of the actual configuration data update, and thus save computer resources. Then, the message agent can push the configuration data in the configuration data set to the corresponding business unit according to the subscription configuration parameters subscribed by each business unit. Each configuration data can be sent to the corresponding business unit in a targeted manner, which can not only improve the targeted nature of data sending, avoid unnecessary data transmission, and save computer resources, but also improve the efficiency of configuration data updating. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0026] FIG1 is a diagram of an application environment of a configuration data updating method in one embodiment;
[0027] FIG2 is a schematic diagram of a flow chart of a configuration data updating method in one embodiment;
[0028] FIG3 is a schematic diagram of the architecture of a target application in one embodiment;
[0029] FIG4 is a schematic diagram of a flow chart of steps for monitoring and configuring a data set in one embodiment;
[0030] FIG5 is a flow chart of configuration data updating in another embodiment;
[0031] FIG6 is a structural block diagram of a configuration data updating device in one embodiment;
[0032] FIG7 is a diagram showing the internal structure of a computer device in one embodiment;
[0033] FIG. 8 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] The configuration data updating method provided in the embodiment of the present application can be applied to the application environment shown in FIG. 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The target application can be installed on the terminal 102. The server 104 sends the latest version of the configuration file corresponding to the target application, that is, the current configuration file, to the terminal 102. The terminal 102 obtains the current configuration file corresponding to the target application sent by the server 104 through the management configuration unit in the target application, and monitors the configuration data set that generates changes to the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publishes the configuration data set to the message agent. The current configuration file contains the configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include the configuration data of each of the multiple configuration parameters. The terminal 102 pushes the configuration data in the configuration data set to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0036] In an exemplary embodiment, as shown in FIG2 , a configuration data updating method is provided, and the method is applied to a computer device as an example for explanation. The computer device may be a terminal or a server, and the method may be executed by the terminal or the server itself alone, or may be implemented through interaction between the terminal and the server. The configuration data updating method includes the following steps 202 to 204. Among them:
[0037] Step 202, obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that generates changes in the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of multiple configuration parameters.
[0038] The target application refers to an application that needs to update configuration data and contains multiple functional modules. For example, the target application can be an embedded system application, a foreground application, a background application, a console application, and other types of applications. An embedded system application is software designed specifically for an embedded system. For example, in an automated production line, an embedded system application is responsible for controlling the operation of the machine, monitoring the production process, and optimizing production efficiency. A foreground application refers to an application used to interact directly with it, usually with a graphical user interface, such as office software for writing documents and making spreadsheets. Background applications usually run without direct user interaction and perform background tasks, such as data backup, virus scanning, system updates, and so on. Console applications are applications that interact with users through a command line interface and usually do not have a graphical interface.
[0039] The configuration management unit refers to a functional module in the target application used to monitor the change data generated in the configuration file. The message agent refers to a functional module in the target application used to provide message delivery services. The business unit refers to a functional module contained in the target application used to perform other specific business functions. For example, when the target application is an embedded system application, the target application may include business units such as carrier acquisition module, remote communication module, and data processing module while including the configuration management unit and the message agent. For example, the system architecture of the target application is shown in Figure 3. The target application includes multiple business units, a message agent, a management configuration unit, and a centralized configuration file (i.e., the current configuration file). The management configuration unit is used to detect parameter changes generated in the configuration file and publish parameter change information (i.e., configuration data set) to the message agent, and the message agent transmits the configuration data in the configuration data set to the corresponding business unit.
[0040] Configuration parameters refer to a series of parameters set to optimize and customize the operating environment, performance, behavior, etc. of an application, and configuration data refers to the specific parameter values corresponding to the configuration parameters.
[0041] The subscription configuration parameter set refers to a set of configuration parameters subscribed by each business unit. The current configuration file refers to the latest configuration file corresponding to the target application at the current moment. The configuration subfile corresponding to the business unit refers to a data set containing configuration data corresponding to each configuration parameter corresponding to the business unit. The configuration data set refers to a set of configuration data corresponding to each configuration parameter that has changed in the subscription configuration parameter set.
[0042] Exemplarily, when the target application is started, the computer device reads the configuration file of the target application through the management configuration unit in the target application as a historical configuration file. During the operation of the target application, based on the subscription configuration parameter set fed back by the message agent in the target application, in the configuration file, it is monitored in real time whether the configuration data corresponding to the subscription configuration parameters in the subscription configuration parameter set has changed. When it is detected that the configuration data corresponding to the subscription configuration parameter has changed, the current configuration file and the historical configuration file corresponding to the target application are compared to obtain the configuration data set for the subscription configuration parameter set that has changed. The configuration data set is published to the message agent.
[0043] Step 204: Push the configuration data in the configuration data set to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit activates the received configuration data.
[0044] The subscription configuration parameters refer to the configuration parameters subscribed by the business unit in the configuration file.
[0045] Exemplarily, the computer device pushes each configuration data in the configuration data set to the business unit that has subscribed to the configuration parameters corresponding to the configuration data through the message agent in the target application according to the subscription configuration parameters subscribed by each business unit, so that each business unit that has received the configuration data enables the received configuration data.
[0046] In the above configuration data updating method, the current configuration file corresponding to the target application is obtained through the management configuration unit in the target application, and the configuration data set that generates changes in the subscription configuration parameter set fed back by the message agent in the target application is monitored from the current configuration file, and the configuration data set is published to the message agent. Then, the configuration data in the configuration data set is pushed to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data. In this way, the configuration data set that generates changes in the current configuration file is detected according to the subscription configuration parameter set fed back by the message agent through the management configuration unit in the target application, which can avoid the problem of low configuration data update efficiency caused by multiple business submodules competing to access the configuration file, and only monitor the changes generated by the subscription configuration parameter set, which can reduce the amount of data monitored, pushed and transmitted, improve the pertinence of the actual configuration data update, and thus save computer resources. Then, the configuration data in the configuration data set is pushed to the corresponding business unit according to the subscription configuration parameters subscribed by each business unit through the message agent, and each configuration data can be sent to the corresponding business unit in a targeted manner, which can not only improve the pertinence of data transmission, avoid unnecessary data transmission, save computer resources, but also improve the efficiency of configuration data update.
[0047] In an exemplary embodiment, the configuration data updating method further includes:
[0048] When a new business unit appears in the target application, the subscription configuration parameters corresponding to the new business unit are obtained through the management configuration unit, and the subscription configuration parameters corresponding to the new business unit are added to the subscription configuration parameter set to obtain an updated subscription configuration parameter set;
[0049] The management configuration unit compares the current configuration file and the historical configuration file corresponding to the target application to obtain new configuration data, and transmits the new configuration data to the new business unit so that the new business unit enables the new configuration data.
[0050] The newly added business unit refers to a functional module added to the target application for executing a specific business function. The newly added configuration data refers to configuration data corresponding to the configuration parameters added to the configuration file.
[0051] Exemplarily, when a new business unit appears in the target application, the subscription configuration parameters subscribed to the message broker when the new business unit is started are obtained through the management configuration unit. The subscription configuration parameters corresponding to the new business unit are added to the subscription configuration parameter set to obtain an updated subscription configuration parameter set. The current configuration file and the historical configuration file corresponding to the target application are compared through the management configuration unit, and the configuration data corresponding to the configuration parameters added to the configuration file are used as the new configuration data. The new configuration data is transmitted to the corresponding new business unit so that the new business unit enables the new configuration data.
[0052] In the above embodiment, when a new business unit appears in the target application, the new business unit subscribes to the message proxy for subscription configuration parameters that need to be monitored for changes when it is started. The management configuration unit promptly adds the subscription configuration parameters corresponding to the new business unit fed back by the message proxy to the subscription configuration parameter set, without the need to manually update the subscription configuration parameter set, which can improve the efficiency of configuration data processing. By comparing the current configuration file and the historical configuration file corresponding to the target application by the management configuration unit, the new configuration data can be quickly obtained, so that the new business unit can quickly enable the corresponding new configuration data, thereby improving the efficiency of configuration data update.
[0053] In an exemplary embodiment, monitoring a configuration data set for generating a change in a subscription configuration parameter set fed back by a message agent in a target application from a current configuration file includes:
[0054] By comparing the configuration data corresponding to the subscription configuration parameters in the subscription configuration parameter set in the historical configuration file and the current configuration file corresponding to the target application program through the management configuration unit, a configuration data set for the subscription keyword set of the target application program is obtained;
[0055] After transmitting the configuration data in the configuration data set to the business unit corresponding to the subscription configuration parameter, the method further includes:
[0056] The historical configuration file is updated based on the current configuration file by the management configuration unit to obtain an updated historical configuration file.
[0057] Exemplarily, the computer device monitors in real time whether the subscription configuration parameters in the subscription configuration parameter set in the current configuration file are changed through the management configuration unit. When the configuration data corresponding to the same subscription configuration parameter in the current configuration file and the configuration data corresponding to the historical configuration file are inconsistent, the configuration data corresponding to the subscription configuration parameter in the current configuration file is added to the configuration data set of the target application for the subscription keyword set. After each configuration data in the configuration data set is transmitted to the business unit corresponding to the corresponding subscription configuration parameter, the current configuration file is overwritten with the historical configuration file through the management configuration unit to obtain an updated historical configuration file.
[0058] In the above embodiment, the current configuration file is compared with the historical configuration file to quickly determine the configuration parameters that have been changed, thereby obtaining a configuration data set. After the configuration data in the configuration data set is transmitted to the corresponding business unit, the historical configuration file is updated through the current configuration file, so that the historical configuration file can be updated in time to ensure the accuracy and real-time nature of the configuration data update.
[0059] In an exemplary embodiment, the business unit is used to:
[0060] Get the parameter activation type corresponding to the received configuration data;
[0061] When the parameter enabling type is the immediate enabling type, the received configuration data is enabled;
[0062] When the parameter enabling type is a delayed enabling type, the received configuration data is enabled according to the delayed enabling condition corresponding to the received configuration data.
[0063] Among them, the parameter enablement type includes immediate enablement type and delayed enablement type. The immediate enablement type means that the new configuration data is enabled immediately after receiving the configuration data. The delayed enablement type means that after receiving the configuration data, it is necessary to wait for a period of time before enabling the new configuration data. Delayed enablement is to ensure the consistency and integrity of the data, so that the target application can transition to the new configuration state more smoothly and reduce system jitter or failure caused by configuration changes. The delayed enablement condition is a judgment condition used to indicate whether the configuration data can be enabled.
[0064] Exemplarily, when the business unit in the target application receives the configuration data, the parameter activation type corresponding to the configuration parameter to which the configuration data belongs is obtained. When the parameter activation type is an immediate activation type, the received configuration data is directly activated. When the parameter activation type is a delayed activation type, the delayed activation condition corresponding to the received configuration data is obtained, and when the delayed activation condition is met, the received configuration data is activated.
[0065] In the above embodiment, corresponding parameter activation types are set for each configuration parameter. The business unit activates the configuration parameter at an appropriate time according to the parameter activation type corresponding to the configuration parameter, and ensures the consistency and integrity of the data while ensuring the real-time and timeliness of the configuration parameter update, so that the target application can transition to the new configuration state more smoothly, reducing system jitter or failure caused by configuration changes.
[0066] In an exemplary embodiment, the configuration data updating method further includes:
[0067] Determine, by the management configuration unit, the parameter activation type corresponding to the received configuration data according to the business logic corresponding to the business unit;
[0068] When the parameter enablement type is the delayed enablement type, the delayed enablement condition corresponding to the received configuration data is determined by the management configuration unit according to the business requirements corresponding to the target application and the business logic corresponding to the business unit; the delayed enablement condition is reaching the delay interval or triggering an enablement event.
[0069] Business logic refers to the data processing flow and processing mechanism followed by business units to complete business functions. Business logic defines how business units receive input data, process input data, perform corresponding operations, and ultimately generate corresponding outputs. Data processing according to business logic can ensure data accuracy, consistency, and security, while improving the efficiency and reliability of business processing.
[0070] Business requirements include the requirements of the target application in terms of functionality, performance, security, user interface, scalability, etc. By meeting business requirements, the target application can effectively support the business operations of the enterprise and bring a good user experience to users.
[0071] Exemplarily, the computer device obtains the business logic corresponding to the business unit, analyzes and processes the business logic corresponding to the business unit through the management configuration unit, and obtains the parameter activation type corresponding to the configuration parameter to which each configuration data belongs. Specifically, according to the data processing node where the configuration parameter to which the configuration data belongs is located in the business logic corresponding to the business unit, the dependency relationship between the configuration parameter and other business units in the target application is determined based on the data processing node where the configuration parameter is located, and the parameter activation type corresponding to the configuration data is determined based on the dependency relationship. When the parameter activation type corresponding to the configuration data is a delayed activation type, the delayed activation condition corresponding to the configuration parameter to which the configuration data belongs is determined through the management configuration unit according to the business requirements corresponding to the target application and the business logic corresponding to the business unit. The delayed activation condition is to reach the delay interval or trigger an activation event. The delay interval is a pre-set time interval for the configuration parameter whose parameter activation type is a delayed activation type. After the business unit receives the configuration data corresponding to the configuration parameter, it waits for the delay interval to end and then activates the configuration data. A triggering and enabling event refers to an operation that triggers the enabling of configuration data. In the actual implementation process, the triggering and enabling event can be the restart of the target application or recovery from a failure, or it can be the monitoring of key indicators exceeding a preset threshold, it can be the user manually triggering the update of configuration parameters through the user operation interface of the application or the command line tool, or it can be the monitoring of the completion of scheduled tasks running in the system (such as data backup, log cleaning, etc.).
[0072] In the above embodiment, the parameter activation type corresponding to the configuration data is determined according to the business logic of the business unit corresponding to the configuration parameters to which the configuration data belongs, which can ensure the accuracy, consistency and security of the data, while improving the efficiency and reliability of business processing. When it is determined that the parameter activation type corresponding to the configuration data is a delayed activation type, the delayed activation condition corresponding to the configuration data is further determined according to the business requirements corresponding to the target application and the business logic corresponding to the business unit. In this way, by comprehensively analyzing the business requirements and business logic to determine the delayed activation condition, while ensuring the accuracy, consistency and security of the data, the target application can effectively support the business operations of the target application and bring a good user experience to the user.
[0073] In an exemplary embodiment, as shown in FIG4 , monitoring the configuration data set that generates changes to the subscription configuration parameter set fed back by the message agent in the target application includes steps 402 to 406. Among them:
[0074] Step 402, through the management configuration unit, count the change frequencies corresponding to each configuration parameter in the subscription configuration parameter set, and in the subscription configuration parameter set, determine the configuration parameter with a change frequency greater than the frequency threshold as the first configuration parameter, and determine the configuration parameter with a change frequency less than or equal to the frequency threshold as the second configuration parameter.
[0075] Step 404: Calculate the first monitoring period corresponding to each first configuration parameter according to the change frequency corresponding to each first configuration parameter through the management configuration unit; the change frequency is negatively correlated with the first monitoring period.
[0076] Step 406, by managing the configuration unit, based on a first monitoring period, monitors the configuration data that has changed with respect to the first configuration parameter to obtain a first data set; based on a preset monitoring period, monitors the configuration data that has changed with respect to the second configuration parameter to obtain a second data set; based on at least one of the first data set or the second data set, obtains a configuration data set.
[0077] The change frequency refers to the number of times the configuration parameter is updated within the statistical period. The frequency threshold can be set according to actual needs. The first monitoring period refers to the time interval for monitoring the first configuration parameter in the current configuration file. The preset monitoring period refers to the preset time interval for monitoring the subscription configuration parameter.
[0078] Exemplarily, the computer device counts the change frequencies corresponding to each configuration parameter in the subscription configuration parameter set through the management configuration unit. The configuration parameter whose change frequency is greater than the frequency threshold is determined as the first configuration parameter, and the configuration parameter whose change frequency is less than or equal to the frequency threshold is determined as the second configuration parameter. Through the management configuration unit, according to the change frequency corresponding to the first configuration parameter, the first monitoring period corresponding to the first configuration parameter is calculated. Specifically, the ratio between the change frequency corresponding to the first configuration parameter and the frequency threshold can be calculated, and the product of the ratio and the preset monitoring period is used as the first monitoring period, so that the first monitoring period obtained is negatively correlated with the change frequency and can accurately match the change frequency of the first configuration parameter. Through the management configuration unit, based on the first monitoring period, the configuration data generated for the first configuration parameter in the subscription configuration parameter set is monitored to obtain a first data set. Based on the preset monitoring period, the configuration data generated for the second configuration parameter is monitored to obtain a second data set. The first data set and the second data set are merged to obtain a configuration data set. If only the first data set or the second data set is monitored at the current moment, the first data set or the second data set is directly used as the configuration data set.
[0079] In the above embodiment, during the configuration data update process, the monitoring period corresponding to the subscription configuration parameter is timely adjusted according to the change frequency of each subscription configuration parameter. For a first configuration parameter with a low change frequency, the monitoring period corresponding to the first configuration parameter can be appropriately extended according to the change frequency corresponding to the first configuration parameter, thereby reducing the number of real-time monitoring, saving computer resources, and improving the efficiency of configuration parameter update.
[0080] In a specific embodiment, the configuration data processing method proposed in this application can be applied to embedded system applications. The configuration data processing method includes the following steps:
[0081] 1. Subscription change parameters
[0082] As shown in Figure 5, when the embedded system application is started, the management configuration unit in the embedded system application reads all the contents in the centralized configuration file corresponding to the embedded system application as the historical configuration file. When the business unit in the embedded system application is started, it subscribes to the message broker for the subscription configuration parameters that need to be monitored for changes, and the management configuration unit obtains the subscription configuration parameters fed back by the message broker to obtain the subscription configuration parameter set.
[0083] 2. Real-time monitoring of changed parameters
[0084] As shown in FIG5 , the management configuration unit in the embedded system application monitors parameter changes generated in the centralized configuration file for the subscription configuration parameter set in real time, extracts parameter change content, and obtains a configuration data set for the subscription configuration parameter set.
[0085] 3. Release the changed parameters
[0086] As shown in FIG5 , the embedded system application publishes the configuration data set to the message broker, and the message broker transmits the configuration data in the configuration data set to the corresponding business unit, so that the business unit can enable the received configuration data in a timely manner.
[0087] In the above embodiment, by storing the configuration data corresponding to each business unit in a centralized configuration file, the problem of management confusion and difficulty in configuration file maintenance caused by too many configuration files can be avoided. Through the publish / subscribe function, after the management configuration unit monitors the changes in the centralized configuration file, the parameter change information is pushed to all business units that have subscribed to the configuration parameters, which can effectively avoid the problem of multiple business units competing to monitor the configuration file at the same time, and fully utilize the parameter change information in the monitored centralized configuration file to achieve accurate and efficient push of the change content.
[0088] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0089] Based on the same inventive concept, the embodiment of the present application also provides a configuration data updating device for implementing the configuration data updating method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more configuration data updating device embodiments provided below can refer to the limitations on the configuration data updating method above, and will not be repeated here.
[0090] In an exemplary embodiment, as shown in FIG6 , a configuration data updating device is provided, including: a configuration management module 602 and a message agent module 604, wherein:
[0091] The management configuration module 602 is used to obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that generates changes in the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of multiple configuration parameters.
[0092] The message proxy module 604 is used to push the configuration data in the configuration data set to the corresponding business unit through the message proxy according to the subscription configuration parameters subscribed by each business unit, so that the business unit activates the received configuration data.
[0093] In one embodiment, the management configuration module 602 is further configured to:
[0094] When a new business unit appears in the target application, the subscription configuration parameters corresponding to the new business unit are obtained through the management configuration unit, and the subscription configuration parameters corresponding to the new business unit are added to the subscription configuration parameter set to obtain an updated subscription configuration parameter set; the current configuration file and the historical configuration file corresponding to the target application are compared through the management configuration unit to obtain the new configuration data, and the new configuration data is transmitted to the new business unit so that the new business unit can enable the new configuration data.
[0095] In one embodiment, the management configuration module 602 is further configured to:
[0096] The parameter activation type corresponding to the received configuration data is determined through the management configuration unit according to the business logic corresponding to the business unit; when the parameter activation type is the delayed activation type, the delayed activation condition corresponding to the received configuration data is determined through the management configuration unit according to the business requirements corresponding to the target application and the business logic corresponding to the business unit; the delayed activation condition is reaching the delay interval or triggering an activation event.
[0097] In one embodiment, the configuration data updating device further includes:
[0098] The business module is used to obtain the parameter activation type corresponding to the received configuration data; when the parameter activation type is an immediate activation type, the received configuration data is activated; when the parameter activation type is a delayed activation type, the received configuration data is activated according to the delayed activation condition corresponding to the received configuration data.
[0099] In one embodiment, the management configuration module 602 is further configured to:
[0100] The parameter activation type corresponding to the received configuration data is determined through the management configuration unit according to the business logic corresponding to the business unit and the business requirements corresponding to the target application. When the parameter activation type is a delayed activation type, the delayed activation condition corresponding to the received configuration data is determined through the management configuration unit according to the business requirements corresponding to the target application. The delayed activation condition is reaching the delay interval or triggering an activation event.
[0101] In one embodiment, the management configuration module 602 is further configured to:
[0102] Through the management configuration unit, statistics are collected on the change frequencies corresponding to the respective configuration parameters in the subscription configuration parameter set. In the subscription configuration parameter set, the configuration parameter whose change frequency is greater than the frequency threshold is determined as the first configuration parameter, and the configuration parameter whose change frequency is less than or equal to the frequency threshold is determined as the second configuration parameter; through the management configuration unit, the first monitoring period corresponding to each first configuration parameter is calculated according to the change frequency corresponding to each first configuration parameter; the change frequency is negatively correlated with the first monitoring period; through the management configuration unit, based on the first monitoring period, the configuration data that has changed with respect to the first configuration parameter is monitored to obtain a first data set; based on the preset monitoring period, the configuration data that has changed with respect to the second configuration parameter is monitored to obtain a second data set; based on at least one of the first data set or the second data set, a configuration data set is obtained.
[0103] Each module in the above configuration data updating device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0104] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a configuration data set and a subscription configuration parameter set. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a configuration data update method is implemented.
[0105] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a configuration data update method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0106] Those skilled in the art will understand that the structures shown in FIGS. 7 and 8 are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components.
[0107] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0108] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0109] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0110] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0112] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A configuration data updating method, characterized in that: The method comprises: Obtain the current configuration file corresponding to the target application through the management configuration unit in the target application, monitor the configuration data set that generates changes to the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of each of the multiple configuration parameters; The configuration data in the configuration data set is pushed to the corresponding business unit through the message agent according to the subscription configuration parameters subscribed by each business unit, so that the business unit enables the received configuration data.
2. The method according to claim 1, characterized in that The method further comprises: When a new business unit appears in the target application, the subscription configuration parameters corresponding to the new business unit are obtained through the management configuration unit, and the subscription configuration parameters corresponding to the new business unit are added to the subscription configuration parameter set to obtain an updated subscription configuration parameter set; The management configuration unit compares the current configuration file and the historical configuration file corresponding to the target application to obtain new configuration data, and transmits the new configuration data to the new business unit so that the new business unit enables the new configuration data.
3. The method according to claim 1, characterized in that The monitoring of the configuration data set for the subscription configuration parameter set fed back by the message agent in the target application from the current configuration file includes: By comparing the configuration data corresponding to the subscription configuration parameters in the subscription configuration parameter set in the historical configuration file and the current configuration file corresponding to the target application program, the configuration data set of the target application program for the subscription keyword set is obtained; After the configuration data in the configuration data set is transmitted to the business unit corresponding to the subscription configuration parameter, the method further includes: The management configuration unit updates the historical configuration file based on the current configuration file to obtain an updated historical configuration file.
4. The method according to claim 1, characterized in that: The business unit is used to: Get the parameter activation type corresponding to the received configuration data; When the parameter activation type is an immediate activation type, enabling the received configuration data; When the parameter enabling type is a delayed enabling type, the received configuration data is enabled according to the delayed enabling condition corresponding to the received configuration data.
5. The method according to claim 4, characterized in that The method further comprises: Determining, by the management configuration unit, a parameter activation type corresponding to the received configuration data according to the business logic corresponding to the business unit; When the parameter activation type is a delayed activation type, the management configuration unit determines the delayed activation condition corresponding to the received configuration data according to the business requirements corresponding to the target application and the business logic corresponding to the business unit; the delayed activation condition is reaching the delay interval or triggering an activation event.
6. The method according to claim 1, characterized in that The monitoring of the configuration data set for generating changes in the subscription configuration parameter set fed back by the message agent in the target application comprises: By means of the management configuration unit, statistics are given on the change frequencies of the respective configuration parameters in the subscription configuration parameter set, and in the subscription configuration parameter set, the configuration parameter whose change frequency is greater than the frequency threshold is determined as the first configuration parameter, and the configuration parameter whose change frequency is less than or equal to the frequency threshold is determined as the second configuration parameter; By means of the management configuration unit, according to the change frequency corresponding to each of the first configuration parameters, the first monitoring period corresponding to each of the first configuration parameters is calculated; the change frequency is negatively correlated with the first monitoring period; Through the management configuration unit, based on the first monitoring period, the configuration data generated by the changes in the first configuration parameter is monitored to obtain a first data set; based on the preset monitoring period, the configuration data generated by the changes in the second configuration parameter is monitored to obtain a second data set; based on at least one of the first data set or the second data set, the configuration data set is obtained.
7. A configuration data updating device, characterized in that: The device comprises: A management configuration module is used to obtain a current configuration file corresponding to the target application through a management configuration unit in the target application, monitor a configuration data set that generates changes to a subscription configuration parameter set fed back by a message agent in the target application from the current configuration file, and publish the configuration data set to the message agent; the current configuration file contains configuration sub-files corresponding to each business unit in the target application, and the configuration sub-files include configuration data of each of a plurality of configuration parameters; The message proxy module is used to push the configuration data in the configuration data set to the corresponding business unit through the message proxy according to the subscription configuration parameters subscribed by each business unit, so that the business unit activates the received configuration data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
