WO2017193765A1 - Parameter configuration method and device - Google Patents

Parameter configuration method and device Download PDF

Info

Publication number
WO2017193765A1
WO2017193765A1 PCT/CN2017/080609 CN2017080609W WO2017193765A1 WO 2017193765 A1 WO2017193765 A1 WO 2017193765A1 CN 2017080609 W CN2017080609 W CN 2017080609W WO 2017193765 A1 WO2017193765 A1 WO 2017193765A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration parameter
configuration
parameter
refresh
key
Prior art date
Application number
PCT/CN2017/080609
Other languages
French (fr)
Chinese (zh)
Inventor
夏松
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017193765A1 publication Critical patent/WO2017193765A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to the field of communication technologies and Internet technologies, and in particular, to a parameter configuration method and apparatus.
  • the technical solution of the parameter configuration is: when the system is started, the parameter configuration is read out from the storage file such as the configuration file, the database, etc., and stored in the memory, and then, when the system is running, the memory is read from the memory as needed.
  • the configuration parameters of the configuration items are used. If the user changes the configuration file and the configuration parameters in the database while the system program is running, the entire system must be restarted for the parameter configuration modification to take effect. The entire system needs to be restarted, and the configuration parameters are read from the storage area such as the configuration file and database. The process of saving into memory. The risk and cost of doing so can be very large. On the one hand, restarting the entire system may cause some system failures. On the other hand, restarting the entire system may result in some data loss, which is fatal for commercial systems.
  • the database is accessed each time the parameter configuration is needed, and the configuration parameters in the database are read.
  • this method has better real-time performance, the system has a large burden, performance is degraded, and operation is slow.
  • the main technical problem to be solved by the embodiments of the present invention is to provide a parameter configuration method and device, which solves the problem that the system cannot know in time whether the configuration parameters are modified, and the configuration parameter modification effective method is complicated, and system resources are wasted.
  • an embodiment of the present invention provides a parameter configuration method, including:
  • the configuration parameter refresh interface is used to obtain the configuration information corresponding to the configuration parameter refresh request, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request.
  • the configuration information includes configuration information that is required to be used when the program is started or run.
  • the method before obtaining the configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refresh interface, the method further includes: performing security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request, and if the security authentication is passed, Obtain the configuration information corresponding to the configuration parameter refresh request. If not, the configuration information is not obtained.
  • the configuration parameter refresh interface includes: an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
  • the configuration parameter refresh interface specifically includes: a representational state delivery interface or a network service interface.
  • the configuration information includes a key name and a key value of the configuration parameter
  • the configuration information corresponding to the configuration parameter refresh request is obtained by using the configuration parameter refresh interface, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request.
  • Configuration parameter refresh interface acquisition and matching Set the key name and key value of the configuration parameter corresponding to the parameter refresh request, delete the configuration parameter corresponding to the key name in the memory, and write the obtained configuration parameter.
  • the configuration parameter refresh request includes: a request that does not include the configuration parameter; or a request that includes a key name of the configuration parameter to be updated; or a request that includes a key name and a key value of the configuration parameter to be updated;
  • the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory, and the acquired configuration parameter includes : Using the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, deleting the key name and key value of the configuration parameter in the memory, and writing the key name and key value of the obtained configuration parameter;
  • the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, deletes the configuration parameter corresponding to the key name in the memory, and writes
  • the obtained configuration parameters include: using the configuration parameter refresh interface to obtain a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing Enter the key name and key value of the obtained configuration parameter;
  • the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory.
  • the configuration parameters obtained by the write include: deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the configuration parameter in the configuration parameter refresh request into the memory.
  • the present invention further provides a parameter configuration apparatus, including: an acquisition module and a configuration parameter refresh module;
  • the obtaining module is configured to use the configuration parameter refresh interface to obtain a configuration parameter refresh request
  • the configuration parameter refreshing module is configured to: after obtaining the configuration parameter refresh request, use the configuration parameter refresh interface to obtain configuration information corresponding to the configuration parameter refresh request, and update the configuration information in the memory with the configuration information corresponding to the configuration parameter refresh request.
  • the configuration information includes configuration information that is required to be used when the program is started or run.
  • the method further includes: a security authentication module, configured to perform security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request before obtaining the configuration information corresponding to the configuration parameter refresh request by the configuration parameter refreshing module; If the security authentication is passed, the configuration parameter refresh module obtains the configuration information corresponding to the configuration parameter refresh request, otherwise, it does not acquire.
  • a security authentication module configured to perform security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request before obtaining the configuration information corresponding to the configuration parameter refresh request by the configuration parameter refreshing module.
  • the configuration parameter refresh interface includes: an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
  • the configuration parameter refresh interface specifically includes: a representational state delivery interface or a network service interface.
  • the configuration information includes a key name and a key value of the configuration parameter
  • the configuration parameter refreshing module is configured to: after obtaining the configuration parameter refresh request, use the configuration parameter refresh interface to obtain a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request. , delete the configuration parameter corresponding to the key name in the memory, and write the obtained configuration parameter.
  • the configuration parameter refresh request obtained by the obtaining module includes: a request that does not include the configuration parameter; or a request that includes a key name of the configuration parameter to be updated; or a key name and a key value that include the configuration parameter to be updated. request;
  • the first refresh submodule is configured to: when the configuration parameter refresh request does not include the configuration parameter, use the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, and delete the key name and key of the configuration parameter in the memory. Value, the key value and key name of the obtained configuration parameter;
  • the second refresh sub-module is configured to: when the configuration parameter refresh request includes the key name of the configuration parameter to be updated, use the configuration parameter refresh interface to obtain a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, Deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the key name and key value of the obtained configuration parameter;
  • the third refresh submodule is configured to: when the configuration parameter refresh request includes the key name and the key value of the configuration parameter to be updated, delete the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and the configuration parameter refresh request is The configuration parameters are written to the memory.
  • a storage medium is also provided.
  • the storage medium is arranged to store program code for performing the following steps:
  • the configuration parameter refreshing interface is used to obtain a configuration parameter refresh request. After the configuration parameter refresh request is obtained, the configuration parameter refreshing interface is used to obtain configuration information corresponding to the configuration parameter refresh request, and the configuration parameter is The configuration information corresponding to the refresh request updates the configuration information in the memory.
  • the storage medium is further arranged to store program code for performing the following steps:
  • the configuration parameter refreshing interface Before obtaining the configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refreshing interface, performing security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request, and if the security authentication is passed, Then, the configuration information corresponding to the configuration parameter refresh request is obtained, otherwise, the configuration information is not acquired.
  • the storage medium is further arranged to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the following steps:
  • the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes a memory corresponding to the key name.
  • the configuration parameter, the obtained configuration parameter is obtained by: using the configuration parameter refresh interface to obtain a key name and a key value of a configuration parameter stored in the original storage medium, deleting a key name and a key value of the configuration parameter in the memory, and writing the obtained key The key name and key value of the configuration parameter;
  • the configuration parameter refresh interface acquires a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory corresponding to the The configuration parameter of the key name, the write configuration parameter obtained by using the configuration parameter refresh interface, obtains a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, and deletes the memory. Refresh with the configuration parameters The configuration parameter corresponding to the key name in the request, and the key name and key value of the obtained configuration parameter are written;
  • the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory.
  • the configuration parameter corresponding to the key name the configuration parameter that is acquired by the configuration includes: deleting a configuration parameter in the memory corresponding to the key name in the configuration parameter refresh request, and configuring the configuration parameter refresh request Parameters are written to the memory.
  • the configuration parameter refreshing interface can be used to obtain a configuration parameter refresh request, and it is determined when the configuration parameter needs to be refreshed. After the request is obtained, the configuration parameter refresh interface can be used to obtain the corresponding request. Configuration information to update the configuration information in memory with this configuration information.
  • the method of the invention can quickly know that the configuration parameters have been modified and then refresh the configuration information in the memory according to the configuration parameter refresh request, and has the advantages of being simple and easy to use, safe and reliable, ensuring timely modification of configuration information, and improving system performance.
  • FIG. 1 is a flowchart of a parameter configuration method according to Embodiment 1 of the present invention.
  • FIG. 3 is a schematic block diagram of a parameter configuration apparatus according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic block diagram of another parameter configuration apparatus according to Embodiment 3 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • This embodiment proposes a parameter configuration method, which can be applied to parameter configuration of any application, and is particularly suitable for parameter configuration of a distributed enterprise application of a service oriented architecture (SOA).
  • SOA service oriented architecture
  • the process of the parameter configuration method in this embodiment is as follows:
  • the type of the configuration parameter refresh interface may be set according to actual needs, and the configuration parameter request obtained by the configuration parameter refresh interface may be sent by different functional units of the system, for different functional units in the system.
  • the unified and common way of interaction can be used.
  • the preferred setting method is to make the configuration parameter refresh interface independent of the hardware platform, operating system and programming language that implement the configuration parameter refresh service.
  • the type of the configuration parameter refresh interface may be a representational state delivery interface (REST interface) or a network service interface (Web Service interface), and REST is an abbreviation of Representational State Transfer, which means expression state delivery.
  • the configuration parameter refresh interface may also be an interface that is independent of the hardware platform, operating system, and programming language that implements the refresh service to obtain the configuration parameter refresh request.
  • the type of the configuration parameter refresh request includes a REST request or a web service request.
  • the configuration parameter refreshing interface in this embodiment may be understood as an interface formed by packaging a parameter refreshing method.
  • the parameter refreshing method includes obtaining current configuration information, and updating configuration information in the memory with current configuration information.
  • the configuration parameter refreshing interface receives the configuration parameter refresh request from the client, the code corresponding to the parameter refreshing method is triggered, and the configuration information corresponding to the configuration parameter refresh request is obtained, and the configuration parameter refresh interface is used to obtain the configuration parameter refresh request. Configuration information.
  • the client mentioned above refers to the client that invokes the configuration parameter refresh interface service, that is, the sender that sent the configuration parameter refresh request.
  • the configuration parameter refresh request is a request sent by the user interface to the configuration parameter refresh interface automatically after the user changes the configuration information in the user interface
  • the user interface is the client.
  • the command line refreshes the request sent by the interface to the configuration parameter. At this point, the command line is the client.
  • the configuration information in S102 includes essential configuration information for realizing the functions of the program itself, and may be configuration information that the program itself needs to use at startup, or configuration information that needs to be used during the running of the program. For example, if a program implements the function of video playback, and the user changes the resolution of the screen played by the video screen, the resolution here can be regarded as the configuration information of the program.
  • the configuration parameter refresh interface obtains the current configuration information. If the security authentication fails, the configuration parameter refresh interface is not allowed to obtain the current configuration information.
  • the configuration parameter refresh request may be securely authenticated according to the identity of the sender of the configuration parameter refresh request.
  • the security authentication in this embodiment can be implemented by using the OAuth method.
  • the corresponding implementation manner is that an authorization layer is set between the client (that is, the sender of the configuration parameter refresh request) and the configuration parameter refresh interface.
  • the client cannot directly communicate with the configuration parameter refresh interface, and can only log in to the authorization layer.
  • After the client logs in to the authorization layer it can send a parameter configuration refresh request to the configuration parameter refresh interface, which is equivalent to verifying the identity of the client before allowing the client to send.
  • it can also be carried in the configuration parameter refresh request.
  • the identity information of the client is obtained by using the configuration parameter refresh interface to obtain the request, and then extracting the identity information for verification, and then obtaining the configuration information after the verification is passed.
  • the original storage medium of the configuration information obtained in this embodiment may be in different storage media, for example, stored in a certain configuration file and stored in a database, and the types of files specifically storing the configuration information may also be different.
  • the way to read configuration information can be Can be different, for example, the configuration information in the XML (Extensible Markup Language) file, you can use dom4j to read the configuration information in the XML file; configuration information in the properties file, you can use the system property class (java.
  • the configuration information is stored in the database, and the configuration information in the database can be read by jdbc (Java Data Base Connectivity). Therefore, in this embodiment, the configuration information can be read by selecting a corresponding reading manner according to the type of the original storage medium of the configuration information.
  • the system needs to be configured to use the key value of the configuration parameter to be opened or run.
  • the key value is generally obtained from the memory, so the configuration information corresponding to the configuration parameter refresh request is obtained by using the configuration parameter refresh interface. After that, the old configuration information in the memory can be updated by using the configuration information corresponding to the configuration parameter refresh request to ensure the validity of the configuration information in the memory.
  • the configuration information stored in the memory may include a key name and a key value of the configuration parameter, and correspondingly, the configuration information corresponding to the configuration parameter refresh request obtained in this embodiment may include a key of the configuration parameter.
  • the name and the key value are used to acquire the configuration information corresponding to the configuration parameter refresh request, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request.
  • the configuration parameter refreshing interface obtains the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, deletes the configuration parameter corresponding to the key name in the memory, and writes the acquired configuration parameter.
  • the configuration parameter refresh request may carry the configuration parameter, and the configuration parameter refresh request in this embodiment may include the following types, the first type: the request that does not include the configuration parameter, and the second type includes: The request for the key name of the configuration parameter to be updated; the third: the request containing the key name and key value of the configuration parameter to be updated.
  • the embodiment uses the configuration parameter to refresh the connection.
  • the port obtains the key name and the key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory.
  • the specific update method corresponding to the obtained configuration parameter may include:
  • the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, deleting the key name and key value of the configuration parameter in the memory, and writing the key name and key of the obtained configuration parameter. value. It is conceivable that, when acquiring the key value and the key name of the configuration parameter stored in the original storage medium, only the configuration parameter of the user update corresponding to the configuration parameter refresh request stored in the original storage medium may be acquired. Key values and key names. In this case, only some configuration parameters in the memory need to be updated; all configuration parameters can also be obtained, and all configuration parameters in the memory are updated.
  • the obtained configuration parameter when only the key value and the key name of the configuration parameter of the user update corresponding to the configuration parameter refresh request stored in the original storage medium are obtained, in the update method, when the configuration parameter in the memory is updated, the obtained configuration parameter may be obtained according to the acquired
  • the key name of the configuration parameter determines the configuration parameter that needs to be updated in the memory, deletes the key name and key value of the configuration parameter that needs to be updated in the memory, and writes the key name and key value of the obtained configuration parameter.
  • the configuration parameter that needs to be updated in the memory may be determined according to the key name of the obtained configuration parameter, and the key value of the configuration parameter that needs to be updated in the memory is replaced with the corresponding key value in the configuration parameter.
  • the configuration parameters in the memory are updated, and only The key value in the memory corresponding to the key name in the configuration parameter refresh request is replaced with the key value in the configuration parameter refresh request.
  • the configuration parameter in the configuration parameter refresh request may be extracted first, and the configuration parameter corresponding to the key name in the memory is deleted according to the key name of the configuration parameter, and the configuration parameter is written. Refresh the configuration parameters contained in the request.
  • the key name and the key value of the current configuration parameter need to be retrieved from the original storage medium, and the key name and the key value are configuration information corresponding to the configuration parameter refresh request.
  • the configuration parameters in the memory There are many data that need to be reacquired, but updating the configuration parameters in the memory can be very simple.
  • the key names and key values of the configuration parameters in the memory are deleted, and the key names and key values of the current configuration parameters can be written.
  • the configuration parameter refresh request includes the key name of the configuration parameter to be updated, and the configuration parameter to be updated here should be understood as the configuration parameter that needs to be updated in the memory, that is, in the original Configuration parameters that have been updated on the storage medium but not updated in memory.
  • the key name of the configuration parameter to be updated may be extracted from the configuration parameter refresh request, and then the configuration parameter refresh interface reads the key value corresponding to the key name from the original storage medium according to the key name, and then refreshes according to the configuration parameter. Updates the in-memory configuration parameters by requesting the included key name and the read key value corresponding to the key name. Although the update method needs to read the configuration parameters, when updating, only the configuration parameters to be updated in the memory are updated, which saves time for obtaining configuration parameters and updating configuration parameters.
  • the configuration parameter refresh request is the third type of request
  • the key name and the key value of the configuration parameter to be updated can be extracted directly from the configuration parameter refresh request, and the configuration parameter in the original storage medium is not required to be read, which can be effective. Reduce the time required to update the configuration parameters in the memory, and achieve the purpose of quickly and accurately updating the configuration information in the memory.
  • the configuration information carried in the configuration parameter refresh request may be automatically added by the client when the request is sent, for example, after the user completes the operation of changing the configuration information in the user interface.
  • the user interface writes the configuration information changed by the user to the configuration parameter refresh request and sends it to the configuration parameter refresh interface before sending the configuration parameter refresh request to the configuration parameter refresh interface.
  • the first configuration parameter refresh request does not pass the specific configuration information, but only plays the role of triggering the memory refresh.
  • the third configuration parameter refresh request can simultaneously pass the key name and key value of the configuration parameter.
  • the key value can be obtained from the memory according to the key name of the configuration parameter, and the specific value can be The key name of the configuration parameter is matched with the key name in the memory, and the key value corresponding to the matching key name is read.
  • the configuration information in the memory may be the configuration information acquired for the first time after the system program is run, or may be the configuration information that has been refreshed.
  • the initial configuration information is stored in the memory, and the configuration information includes the key name and key value of the configuration parameter.
  • the use of the singleton mode allows the initial configuration parameters to be acquired only once, and only once in the memory, that is, only one copy of the configuration parameters stored in the memory, to avoid the existence of multiple configuration parameters in the system. Use space, waste system resources, and interference with the system to obtain configuration parameters from memory.
  • the key name and the key value of the configuration parameter of the embodiment may be a thread-safe global static variable Map in a specific storage location in the memory, that is, the configuration parameter is stored in a ConcurrentHashMap in the memory, and is stored in the form of a key-value pair.
  • the configuration parameters in the ConcurrentHashMap retain the key-value mapping.
  • the system can read the key value from the ConcurrentHashMap according to the key name of a configuration parameter, and use the key value for system configuration.
  • the configuration parameter refresh request can be obtained by using the configuration parameter refresh interface; afterwards, the configuration parameter refresh interface can be used to obtain configuration information corresponding to the configuration parameter refresh request, and the configuration information is updated in the memory with the configuration information. information.
  • the invention can refresh the parameter information in the memory according to the need, in particular, after the actual configuration information is changed, the configuration information refreshing interface obtains the configuration parameter refresh request, and the configuration information in the memory can be refreshed in time.
  • the refresh method is simple and easy to use, safe and reliable, and can ensure that the parameter configuration modification takes effect in time to improve the performance of the system.
  • the configuration information of the present invention is configuration information that the program needs to use when starting or running, which can avoid reading unnecessary data and avoid wasting system resources.
  • the security authentication of the configuration parameter refresh request is performed before the refreshing, and the reliability of the configuration parameter refresh request can be ensured, thereby avoiding a security risk to the system.
  • the configuration information includes a key name and a key value of the configuration parameter, so that the system can quickly determine the required key value according to the key name, reduce the time required for the system to obtain the key value from the memory, and improve system performance and configuration parameter refresh efficiency.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the embodiment provides a refinement process of a parameter configuration method.
  • the system program or the configuration information required for the operation is stored in a original storage medium such as a database or a configuration file.
  • This embodiment describes in detail the process of acquiring the configuration information of the system program for the first time and the process of refreshing the configuration information during the running of the system.
  • the configuration of this embodiment Set the parameter refresh interface to select the REST interface.
  • the single-case mode is used to read configuration information required for running the program from a original storage medium such as a configuration file or a database;
  • the configuration information includes a key name and a key value of the configuration parameter;
  • the configuration information may be read from other locations where the configuration information is stored, and the reading of the configuration parameters may be performed by selecting different reading modes according to different storage areas of the configuration parameters.
  • the configuration parameter is not limited to use the singleton mode, as long as the configuration parameter saved in the ConcurrentHashMap is only one copy, that is, the key names in the memory are not repeated.
  • the embodiment is not limited to the ConcurrentHashMap in which configuration parameters are written into the memory.
  • a table may be generated that generates a correspondence between a key name and a key value of the configuration parameter according to the configuration parameter, and stores the table in the memory.
  • the system reads, according to the key name of the configuration parameter to be used, a key value corresponding to the key name from the ConcurrentHashMap for use by itself;
  • the parameter configuration refresh RSET interface receives the RSET request sent by the client.
  • S205 Perform security authentication on the RSET request according to the identity of the client, and determine whether the security authentication is passed. If yes, the process proceeds to S206. If not, the current refresh is stopped.
  • the REST request in step S204 of this embodiment does not include the configuration parameter information, so In step S206, the key value and the key name of the configuration parameter are obtained from the original storage medium.
  • the REST request includes the key name of the configuration parameter, only the key name corresponding to the key name in the REST request needs to be obtained from the original storage medium in step S206. The key value is sufficient.
  • the REST request includes the key name and the key value of the configuration parameter, in step S206, only the key name and the key value of the configuration parameter need to be extracted from the REST request.
  • the step S207 may be performed by deleting the key values of all the configuration parameters in the ConcurrentHashMap, and correspondingly writing the key values of the configuration parameters acquired in S206 according to the key names of the configuration parameters.
  • the system reads the corresponding key value from the ConcurrentHashMap for use by itself according to the key name corresponding to the configuration parameter to be used.
  • the configuration parameters can be read into the ConcurrentHashMap in the memory and stored in the form of key-value pairs.
  • the system reads the key value of the configuration parameter from the ConcurrentHashMap according to the key name of the configuration parameter.
  • the system program can be quickly and efficiently obtained the latest parameter configuration during operation, thereby controlling the correct operation of the program.
  • the parameter configuration method of this embodiment has the advantages of simple convenience, strong practicability, and small occupation of system resources.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • This embodiment proposes a parameter configuration apparatus suitable for parameter configuration of any application, and is particularly suitable for parameter configuration of a distributed enterprise application of a service oriented architecture (SOA).
  • SOA service oriented architecture
  • the parameter configuration apparatus 1 includes: an obtaining module 11 and a configuration parameter refreshing module 12, the obtaining module 11 is configured to obtain a configuration parameter refresh request by using a configuration parameter refreshing interface; and the configuration parameter refreshing module 12 is configured to refresh the configured configuration parameter.
  • the configuration parameter refresh interface is used to obtain configuration information corresponding to the configuration parameter refresh request, and is refreshed with the configuration parameter. Request the corresponding configuration information to update the configuration information in the memory.
  • the configuration parameter refresh interface type can be set according to the actual needs. Considering that the configuration parameter request obtained by the configuration parameter refresh interface may be sent by different functional units of the system, a unified function may be used for different functional units in the system.
  • the common way to interact, the preferred setting is to make the configuration parameter refresh interface independent of the hardware platform, operating system and programming language that implements the configuration parameter refresh service.
  • the type of the configuration parameter refresh interface may be a representational state delivery interface (REST interface) or a network service interface (Web Service interface), and REST is an abbreviation of Representational State Transfer, which means expression state delivery.
  • the configuration parameter refresh interface of this embodiment may also be another interface that can obtain the configuration parameter refresh request independently of the hardware platform, the operating system, and the programming language that implements the refresh service.
  • the type of the configuration parameter refresh interface in this embodiment includes a REST request or a web service request.
  • the configuration parameter refreshing interface in this embodiment may be understood as an interface formed by packaging a parameter refreshing method.
  • the parameter refreshing method includes obtaining current configuration information, and updating configuration information in the memory with current configuration information.
  • the configuration parameter refreshing interface receives the configuration parameter refresh request from the client, the code corresponding to the parameter refreshing method is triggered, and the configuration information corresponding to the configuration parameter refresh request is obtained, and the configuration parameter refresh interface is used to obtain the configuration parameter refresh request. Configuration information.
  • the client mentioned above refers to the client that invokes the configuration parameter refresh interface service, that is, the sender that sent the configuration parameter refresh request.
  • the configuration parameter refresh request is a request sent by the user interface to the configuration parameter refresh interface automatically after the user changes the configuration information in the user interface
  • the user interface is the client.
  • the command line refreshes the request sent by the interface to the configuration parameter. At this point, the command line is the client.
  • the configuration information of this embodiment includes configuration parameters for implementing the function of the program, and may be configuration information that the program itself needs to use at startup, or configuration information that needs to be used during the running of the program. For example, if a program implements the function of video playback, and the user changes the resolution of the video played by the video screen, then the resolution here can be considered as the matching of the program. Set the parameters.
  • the parameter configuration apparatus 1 of the present embodiment may further include a security authentication module 13, and the security authentication module 13 may be configured to: before the configuration parameter refreshing module 12 acquires configuration information corresponding to the configuration parameter refresh request, according to If the identity of the sender of the parameter refresh request is configured, the configuration parameter refresh request is securely authenticated. If the security authentication is passed, the configuration parameter refresh module obtains the configuration information corresponding to the configuration parameter refresh request. Otherwise, the configuration information is not obtained.
  • the identity information of the client may be carried in the configuration parameter refresh request, and the security authentication module 13 extracts the identity information for verification. After the verification is passed, the configuration parameter refreshing module 12 obtains the configuration information, otherwise it does not acquire.
  • the configuration information when the storage file types of the configuration information are different, the configuration information may be read by using different reading methods.
  • the configuration information is in the XML file, you can use dom4j to read the configuration information in the file; the configuration information in the properties file, you can use the system property class (java.util.Properties) to read the configuration information in the file; configuration information Stored in the database, you can use jdbc to read the configuration information in the database and so on.
  • the configuration information of the embodiment includes a key name and a key value of the configuration parameter
  • the configuration parameter refreshing module 12 is configured to acquire the configuration parameter corresponding to the configuration parameter refresh request by using the configuration parameter refresh interface after obtaining the configuration parameter refresh request.
  • the key name and key value delete the configuration parameters corresponding to the key name in the memory, and write the obtained configuration parameters.
  • the configuration parameter refresh request received by the obtaining module 11 of the present embodiment includes: a request not including the configuration parameter; or a key name including the configuration parameter to be updated. Request; or, a request containing the key name and key value of the configuration parameter to be updated.
  • the configuration parameter refreshing module 12 includes a first refresh submodule 121 or a second refresh submodule 122 or a third refresh submodule 123;
  • the first refresh submodule 121 is configured to acquire a key name of the configuration parameter stored in the original storage medium by using the configuration parameter refresh interface when the configuration parameter refresh request does not include the configuration parameter. Key value, delete the key name and key value of the configuration parameter in the memory, and write the key value and key name of the obtained configuration parameter;
  • the second refresh sub-module 122 is configured to: when the configuration parameter refresh request includes the key name of the configuration parameter to be updated, use the configuration parameter refresh interface to obtain the key value corresponding to the key name in the configuration parameter refresh request from the original storage medium. , deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the key name and key value of the obtained configuration parameter;
  • the third refresh sub-module 123 is configured to: when the configuration parameter refresh request includes the key name and the key value of the configuration parameter to be updated, delete the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and configure the parameter refresh request
  • the configuration parameters in are written to memory.
  • first refresh sub-module 121 and the second refresh sub-module 122 and the third refresh sub-module 123 of the present embodiment can exist in the configuration parameter refresh module 12 at the same time.
  • the configuration parameter includes a configuration parameter that implements a function of the program, and may be a configuration parameter that the program itself needs to use at startup, or a configuration parameter that the program needs to use during the running process.
  • the parameter configuration apparatus 1 of the embodiment may include a parameter configuration loading module 14 configured to read the initial configuration parameters from the original storage medium and write them into the memory when the system starts or needs to use the program. save.
  • the parameter configuration loading module 14 When the parameter configuration loading module 14 reads the configuration parameters, it can be read in the singleton mode to ensure that only one copy of the configuration parameters in the memory.
  • the configuration parameters of the original storage medium stored in the configuration file, database, etc. may exist in the form of key-value pairs, the "key” is the key name of the configuration parameter, and the "value” is the key value of the configuration parameter.
  • a configuration parameter exists in the form of a key-value pair in memory, it can be stored in a thread-safe global static variable Map in memory, that is, stored in a ConcurrentHashMap in memory, stored in a ConcurrentHashMap as a key-value pair.
  • the configuration information in the key retains the mapping between the key name and the key value.
  • the system can read the corresponding key value from the ConcurrentHashMap according to the key name of a certain configuration parameter.
  • the parameter configuration apparatus of this embodiment may further include a configuration parameter calling module 15 configured to read the corresponding key from the ConcurrentHashMap of the memory according to the key name of the configuration parameter to be used when the system is running.
  • the value may be specifically configured by the configuration parameter calling module 15 to match the key name of the configuration parameter to be used with all the key names in the ConcurrentHashMap, and read the key value corresponding to the matching key name in the ConcurrentHashMap.
  • the parameter configuration device of the embodiment can use the configuration parameter refresh interface to obtain a configuration parameter refresh request, determine when to perform refreshing, and then obtain configuration information corresponding to the configuration parameter refresh request, and update the configuration information in the memory with the configuration information. Therefore, the parameter configuration apparatus of the embodiment can update the configuration information in the memory at any time according to the needs of the user, and in particular, when the configuration information is changed, the configuration information in the memory can be quickly updated to ensure the effective configuration information in the memory.
  • the parameter configuration device of the present embodiment has the advantages of simple and convenient use and strong practicability.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices.
  • they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases
  • the steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.
  • the configuration parameter refresh interface is used to obtain the configuration.
  • the parameter refresh request determines when the configuration parameter needs to be refreshed.
  • the configuration parameter refresh interface can be used to obtain the configuration information corresponding to the request, and the configuration information is used to update the configuration information in the memory.
  • the method of the invention can quickly know that the configuration parameters have been modified and then refresh the configuration information in the memory according to the configuration parameter refresh request, and has the advantages of being simple and easy to use, safe and reliable, ensuring timely modification of configuration information, and improving system performance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Dram (AREA)

Abstract

Disclosed are a parameter configuration method and device. The method comprises: obtaining a configuration parameter refresh request by means of a configuration parameter refresh interface; and obtaining configuration information corresponding to the configuration parameter refresh request by means of the configuration parameter refresh interface after obtaining the configuration parameter refresh request, and updating configuration information in a memory according to the configuration information corresponding to the configuration parameter refresh request. According to the present invention, the fact that configuration information has been modified can be quickly learned according to a configuration parameter refresh request, and then configuration information in a memory can be refreshed. The present invention is simple and easy to use, safe and reliable, and can ensure that a configuration information modification would timely become effective, and can improve the performance of a system.

Description

一种参数配置方法和装置Parameter configuration method and device 技术领域Technical field
本发明涉及通讯技术和互联网技术领域,具体涉及一种参数配置方法和装置。The present invention relates to the field of communication technologies and Internet technologies, and in particular, to a parameter configuration method and apparatus.
背景技术Background technique
随着通信技术和互联网技术的不断发展,系统的功能越来越多,也越来越完善,为了实现更多的功能,需要的参数配置也越来越多。尤其是面向服务的体系架构(SOA)的流行,更是需要进行更多的参数配置。With the continuous development of communication technology and Internet technology, the functions of the system are more and more perfect, and more and more parameters are required in order to realize more functions. In particular, the popularity of Service-Oriented Architecture (SOA) requires more parameter configuration.
当系统程序在运行时候,需要动态地得到用户定义的配置参数来控制程序正确运行。因此,如何高效地使用参数配置,如何使得参数配置修改能及时生效,就显得至关重要了。When the system program is running, you need to dynamically get the user-defined configuration parameters to control the program to run correctly. Therefore, how to use the parameter configuration efficiently, how to make the parameter configuration modification can take effect in time, it is very important.
参数配置的技术方案是:系统在启动的时候,一次性的将参数配置从配置文件,数据库等存储区域读取出来存储在内存中,然后在系统运行时,再根据需要从内存中读取某个配置项的配置参数来使用。如果用户在系统程序运行时,修改了配置文件、数据库中的配置参数,为了参数配置修改生效必须重启整个系统,需要重启整个系统,再进行一次从配置文件、数据库等存储区域读取配置参数,存进内存的过程。这样做的风险和代价会很大,一方面重启整个系统可能会引起系统某些故障,另一方面重启整个系统可能会导致某些数据丢失,这对商用系统来说是致命的。The technical solution of the parameter configuration is: when the system is started, the parameter configuration is read out from the storage file such as the configuration file, the database, etc., and stored in the memory, and then, when the system is running, the memory is read from the memory as needed. The configuration parameters of the configuration items are used. If the user changes the configuration file and the configuration parameters in the database while the system program is running, the entire system must be restarted for the parameter configuration modification to take effect. The entire system needs to be restarted, and the configuration parameters are read from the storage area such as the configuration file and database. The process of saving into memory. The risk and cost of doing so can be very large. On the one hand, restarting the entire system may cause some system failures. On the other hand, restarting the entire system may result in some data loss, which is fatal for commercial systems.
为了使得参数配置修改能及时生效,传统方法有两种:一种是采用定时器,定时获取配置文件、数据库等存储区域的配置参数,利用这些信息将内存中的配置参数刷新一遍。缺点是实时性与定时器周期相关,定时器周期越长实时性越差。定时器周期越短,实时性虽然越好,却会增加系统负担。另一种方式是直接从配置文件、数据库等存储区域读取配置参数。比如配置参数在文件中,则每次需要使用配置参数时候访问该配置文件, 读取配置文件中的参数配置的值。比如参数配置在数据库中,则每次需要使用参数配置时候访问数据库,读取数据库中的配置参数。这种方法虽然实时性较好,但是系统负担较大,性能降低,运行缓慢。In order to make parameter configuration changes take effect in time, there are two traditional methods: one is to use timers to periodically obtain configuration parameters of configuration files, databases, and other storage areas, and use this information to refresh the configuration parameters in memory. The disadvantage is that real-time is related to the timer period, and the longer the timer period, the worse the real-time performance. The shorter the timer period, the better the real-time performance, but it will increase the system load. Another way is to read the configuration parameters directly from the storage area such as configuration files and databases. For example, if the configuration parameter is in the file, the configuration file is accessed each time the configuration parameter is needed. Read the value of the parameter configuration in the configuration file. For example, if the parameter is configured in the database, the database is accessed each time the parameter configuration is needed, and the configuration parameters in the database are read. Although this method has better real-time performance, the system has a large burden, performance is degraded, and operation is slow.
所以,如何使得参数配置修改后即时生效,且生效方法简单易用、安全可靠是现有技术中急需解决的问题。Therefore, how to make the parameter configuration be effective immediately after modification, and the effective method is simple and easy to use, safe and reliable is an urgent problem to be solved in the prior art.
发明内容Summary of the invention
本发明实施例要解决的主要技术问题是,提供一种参数配置方法和装置,解决现有技术中系统不能及时获知配置参数是否被修改,且配置参数修改生效方法复杂、浪费系统资源的问题。The main technical problem to be solved by the embodiments of the present invention is to provide a parameter configuration method and device, which solves the problem that the system cannot know in time whether the configuration parameters are modified, and the configuration parameter modification effective method is complicated, and system resources are wasted.
为解决上述技术问题,本发明实施例提供一种参数配置方法,包括:To solve the above technical problem, an embodiment of the present invention provides a parameter configuration method, including:
利用配置参数刷新接口获取配置参数刷新请求;Using the configuration parameter refresh interface to obtain a configuration parameter refresh request;
在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新请求对应的配置信息更新内存中的配置信息。After the configuration parameter refresh request is obtained, the configuration parameter refresh interface is used to obtain the configuration information corresponding to the configuration parameter refresh request, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request.
可选地,配置信息包括程序启动或运行时需要使用的配置信息。Optionally, the configuration information includes configuration information that is required to be used when the program is started or run.
可选地,在利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息前,还包括,根据配置参数刷新请求的发送方的身份对配置参数刷新请求进行安全认证,若安全认证通过,则获取与配置参数刷新请求对应的配置信息,否,则不获取。Optionally, before obtaining the configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refresh interface, the method further includes: performing security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request, and if the security authentication is passed, Obtain the configuration information corresponding to the configuration parameter refresh request. If not, the configuration information is not obtained.
可选地,配置参数刷新接口包括:独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言的接口。Optionally, the configuration parameter refresh interface includes: an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
可选地,配置参数刷新接口具体包括:表述性状态传递接口或网络服务接口。Optionally, the configuration parameter refresh interface specifically includes: a representational state delivery interface or a network service interface.
可选地,配置信息包括配置参数的键名和键值,利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新请求对应的配置信息更新内存中的配置信息包括:利用配置参数刷新接口获取与配 置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数。Optionally, the configuration information includes a key name and a key value of the configuration parameter, and the configuration information corresponding to the configuration parameter refresh request is obtained by using the configuration parameter refresh interface, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request. Configuration parameter refresh interface acquisition and matching Set the key name and key value of the configuration parameter corresponding to the parameter refresh request, delete the configuration parameter corresponding to the key name in the memory, and write the obtained configuration parameter.
可选地,配置参数刷新请求包括:不包含配置参数的请求;或者,包含待更新的配置参数的键名的请求;或者,包含待更新的配置参数的键名和键值的请求;Optionally, the configuration parameter refresh request includes: a request that does not include the configuration parameter; or a request that includes a key name of the configuration parameter to be updated; or a request that includes a key name and a key value of the configuration parameter to be updated;
当配置参数刷新请求不包含配置参数时,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数包括:利用配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键名和键值;When the configuration parameter refresh request does not include the configuration parameter, the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory, and the acquired configuration parameter includes : Using the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, deleting the key name and key value of the configuration parameter in the memory, and writing the key name and key value of the obtained configuration parameter;
当配置参数刷新请求包含待更新的配置参数的键名时,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数包括:利用配置参数刷新接口从原始存储介质中,获取与配置参数刷新请求中的键名对应的键值,删除内存中与配置参数刷新请求中的键名对应的配置参数,写入获取的配置参数的键名和键值;When the configuration parameter refresh request includes the key name of the configuration parameter to be updated, the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, deletes the configuration parameter corresponding to the key name in the memory, and writes The obtained configuration parameters include: using the configuration parameter refresh interface to obtain a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing Enter the key name and key value of the obtained configuration parameter;
当配置参数刷新请求包含待更新的配置参数的键名与键值时,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数包括:删除内存中与配置参数刷新请求中的键名对应的配置参数,将配置参数刷新请求中的配置参数写入内存中。When the configuration parameter refresh request includes the key name and the key value of the configuration parameter to be updated, the configuration parameter refresh interface acquires the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory. The configuration parameters obtained by the write include: deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the configuration parameter in the configuration parameter refresh request into the memory.
为解决上述的技术问题,本发明还提供一种参数配置装置,包括,获取模块和配置参数刷新模块;To solve the above technical problem, the present invention further provides a parameter configuration apparatus, including: an acquisition module and a configuration parameter refresh module;
获取模块设置为利用配置参数刷新接口获取配置参数刷新请求;The obtaining module is configured to use the configuration parameter refresh interface to obtain a configuration parameter refresh request;
配置参数刷新模块设置为在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新请求对应的配置信息更新内存中的配置信息。 The configuration parameter refreshing module is configured to: after obtaining the configuration parameter refresh request, use the configuration parameter refresh interface to obtain configuration information corresponding to the configuration parameter refresh request, and update the configuration information in the memory with the configuration information corresponding to the configuration parameter refresh request.
可选地,配置信息包括程序启动或运行时需要使用的配置信息。Optionally, the configuration information includes configuration information that is required to be used when the program is started or run.
可选地,还包括:安全认证模块,设置为在配置参数刷新模块获取与配置参数刷新请求对应的配置信息前,根据配置参数刷新请求的发送方的身份对配置参数刷新请求进行安全认证;若安全认证通过,则配置参数刷新模块获取与配置参数刷新请求对应的配置信息,否,则不获取。Optionally, the method further includes: a security authentication module, configured to perform security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request before obtaining the configuration information corresponding to the configuration parameter refresh request by the configuration parameter refreshing module; If the security authentication is passed, the configuration parameter refresh module obtains the configuration information corresponding to the configuration parameter refresh request, otherwise, it does not acquire.
可选地,配置参数刷新接口包括:独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言的接口。Optionally, the configuration parameter refresh interface includes: an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
可选地,配置参数刷新接口具体包括:表述性状态传递接口或网络服务接口。Optionally, the configuration parameter refresh interface specifically includes: a representational state delivery interface or a network service interface.
可选地,配置信息包括配置参数的键名和键值,配置参数刷新模块设置为在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数。Optionally, the configuration information includes a key name and a key value of the configuration parameter, and the configuration parameter refreshing module is configured to: after obtaining the configuration parameter refresh request, use the configuration parameter refresh interface to obtain a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request. , delete the configuration parameter corresponding to the key name in the memory, and write the obtained configuration parameter.
可选地,获取模块获取的配置参数刷新请求包括:不包含配置参数的请求;或者,包含待更新的配置参数的键名的请求;或者,包含待更新的配置参数的键名与键值的请求;Optionally, the configuration parameter refresh request obtained by the obtaining module includes: a request that does not include the configuration parameter; or a request that includes a key name of the configuration parameter to be updated; or a key name and a key value that include the configuration parameter to be updated. request;
第一刷新子模块设置为,当配置参数刷新请求不包含配置参数时,利用配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键值和键名;The first refresh submodule is configured to: when the configuration parameter refresh request does not include the configuration parameter, use the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, and delete the key name and key of the configuration parameter in the memory. Value, the key value and key name of the obtained configuration parameter;
第二刷新子模块设置为,当配置参数刷新请求包含待更新的配置参数的键名时,利用配置参数刷新接口从原始存储介质中,获取与配置参数刷新请求中的键名对应的键值,删除内存中与配置参数刷新请求中的键名对应的配置参数,写入获取的配置参数的键名和键值;The second refresh sub-module is configured to: when the configuration parameter refresh request includes the key name of the configuration parameter to be updated, use the configuration parameter refresh interface to obtain a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, Deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the key name and key value of the obtained configuration parameter;
第三刷新子模块设置为,当配置参数刷新请求包含待更新的配置参数的键名与键值时,删除内存中与配置参数刷新请求中的键名对应的配置参数,将配置参数刷新请求中的配置参数写入内存中。 The third refresh submodule is configured to: when the configuration parameter refresh request includes the key name and the key value of the configuration parameter to be updated, delete the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and the configuration parameter refresh request is The configuration parameters are written to the memory.
根据本发明的又一个实施例,还提供了一种存储介质。该存储介质设置为存储用于执行以下步骤的程序代码:According to still another embodiment of the present invention, a storage medium is also provided. The storage medium is arranged to store program code for performing the following steps:
利用配置参数刷新接口获取配置参数刷新请求;在获取到所述配置参数刷新请求后,利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息,以所述与所述配置参数刷新请求对应的配置信息更新内存中的配置信息。The configuration parameter refreshing interface is used to obtain a configuration parameter refresh request. After the configuration parameter refresh request is obtained, the configuration parameter refreshing interface is used to obtain configuration information corresponding to the configuration parameter refresh request, and the configuration parameter is The configuration information corresponding to the refresh request updates the configuration information in the memory.
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
在利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息前,根据所述配置参数刷新请求的发送方的身份对所述配置参数刷新请求进行安全认证,若安全认证通过,则获取与所述配置参数刷新请求对应的配置信息,否,则不获取。Before obtaining the configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refreshing interface, performing security authentication on the configuration parameter refresh request according to the identity of the sender of the configuration parameter refresh request, and if the security authentication is passed, Then, the configuration information corresponding to the configuration parameter refresh request is obtained, otherwise, the configuration information is not acquired.
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数。And obtaining, by using the configuration parameter refreshing interface, a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request, deleting a configuration parameter corresponding to the key name in the memory, and writing the acquired configuration parameter.
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
当所述配置参数刷新请求不包含配置参数时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:利用所述配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键名和键值;When the configuration parameter refresh request does not include a configuration parameter, the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes a memory corresponding to the key name. The configuration parameter, the obtained configuration parameter is obtained by: using the configuration parameter refresh interface to obtain a key name and a key value of a configuration parameter stored in the original storage medium, deleting a key name and a key value of the configuration parameter in the memory, and writing the obtained key The key name and key value of the configuration parameter;
当所述配置参数刷新请求包含待更新的配置参数的键名时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:利用所述配置参数刷新接口从原始存储介质中,获取与所述配置参数刷新请求中的所述键名对应的键值,删除内存中与所述配置参数刷新 请求中的所述键名对应的配置参数,写入获取的配置参数的键名和键值;When the configuration parameter refresh request includes a key name of the configuration parameter to be updated, the configuration parameter refresh interface acquires a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory corresponding to the The configuration parameter of the key name, the write configuration parameter obtained by using the configuration parameter refresh interface, obtains a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, and deletes the memory. Refresh with the configuration parameters The configuration parameter corresponding to the key name in the request, and the key name and key value of the obtained configuration parameter are written;
当所述配置参数刷新请求包含待更新的配置参数的键名与键值时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:删除内存中与所述配置参数刷新请求中的所述键名对应的配置参数,将所述配置参数刷新请求中的配置参数写入所述内存中。When the configuration parameter refresh request includes a key name and a key value of the configuration parameter to be updated, the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory. In the configuration parameter corresponding to the key name, the configuration parameter that is acquired by the configuration includes: deleting a configuration parameter in the memory corresponding to the key name in the configuration parameter refresh request, and configuring the configuration parameter refresh request Parameters are written to the memory.
有益效果:Beneficial effects:
采用本发明实施例的参数配置方法,可以利用配置参数刷新接口获取配置参数刷新请求,确定何时需要进行配置参数的刷新,在获取该请求之后,可以利用配置参数刷新接口获取与该请求对应的配置信息,以此配置信息更新内存中的配置信息。本发明的方法可以根据配置参数刷新请求快速地得知配置参数已修改然后刷新内存中的配置信息,具有简单易用,安全可靠,能确保配置信息修改及时生效,提高系统的性能的优点。With the parameter configuration method of the embodiment of the present invention, the configuration parameter refreshing interface can be used to obtain a configuration parameter refresh request, and it is determined when the configuration parameter needs to be refreshed. After the request is obtained, the configuration parameter refresh interface can be used to obtain the corresponding request. Configuration information to update the configuration information in memory with this configuration information. The method of the invention can quickly know that the configuration parameters have been modified and then refresh the configuration information in the memory according to the configuration parameter refresh request, and has the advantages of being simple and easy to use, safe and reliable, ensuring timely modification of configuration information, and improving system performance.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1为本发明实施例一提供的一种参数配置方法的流程图;FIG. 1 is a flowchart of a parameter configuration method according to Embodiment 1 of the present invention;
图2为本发明实施例二提供的一种参数配置方法的细化流程图;2 is a detailed flowchart of a parameter configuration method according to Embodiment 2 of the present invention;
图3为本发明实施例三提供的一种参数配置装置的模块示意图;3 is a schematic block diagram of a parameter configuration apparatus according to Embodiment 3 of the present invention;
图4为本发明实施例三提供的另一种参数配置装置的模块示意图。FIG. 4 is a schematic block diagram of another parameter configuration apparatus according to Embodiment 3 of the present invention.
具体实施方式detailed description
下面通过具体实施方式结合附图对本发明作进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings.
实施例一: Embodiment 1:
本实施例提出了一种参数配置方法,该参数配置方法可以适用于任何应用程序的参数配置,尤其适用于面向服务的体系架构(SOA)的分布式企业应用的参数配置。利用本实施例的参数配置方法可以确定何时需要进行参数配置刷新,然后实现配置参数的刷新,以便系统的参数配置更新能及时生效。This embodiment proposes a parameter configuration method, which can be applied to parameter configuration of any application, and is particularly suitable for parameter configuration of a distributed enterprise application of a service oriented architecture (SOA). With the parameter configuration method of this embodiment, it can be determined when the parameter configuration refresh is needed, and then the configuration parameter is refreshed, so that the parameter configuration update of the system can take effect in time.
参见图1,本实施例的参数配置方法的过程如下:Referring to FIG. 1, the process of the parameter configuration method in this embodiment is as follows:
S101、利用配置参数刷新接口获取配置参数刷新请求;S101. Acquire a configuration parameter refresh request by using a configuration parameter refresh interface.
S102、在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新请求对应的配置信息更新内存中的配置信息。S102. After obtaining the configuration parameter refresh request, obtain the configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refresh interface, and update the configuration information in the memory with the configuration information corresponding to the configuration parameter refresh request.
在本实施例中,配置参数刷新接口的类型可以根据实际的需要进行设置,考虑到通过配置参数刷新接口获取的配置参数请求可能是系统的不同功能单元发送来的,为了系统中的不同功能单元之间可以使用统一的通用的方式进行交互,比较优选的设置方式是使配置参数刷新接口独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言。优选地,配置参数刷新接口的类型可以是表述性状态传递接口(REST接口)或网络服务接口(Web Service接口),REST是Representational State Transfer的缩写,意为表述性状态传递。当然,配置参数刷新接口也可以是其他可以获取配置参数刷新请求的独立于实现刷新服务的硬件平台、操作系统和编程语言的接口。对应于本实施例中的配置参数刷新接口的类型,配置参数刷新请求的类型包括REST请求或Web Service请求。In this embodiment, the type of the configuration parameter refresh interface may be set according to actual needs, and the configuration parameter request obtained by the configuration parameter refresh interface may be sent by different functional units of the system, for different functional units in the system. The unified and common way of interaction can be used. The preferred setting method is to make the configuration parameter refresh interface independent of the hardware platform, operating system and programming language that implement the configuration parameter refresh service. Preferably, the type of the configuration parameter refresh interface may be a representational state delivery interface (REST interface) or a network service interface (Web Service interface), and REST is an abbreviation of Representational State Transfer, which means expression state delivery. Of course, the configuration parameter refresh interface may also be an interface that is independent of the hardware platform, operating system, and programming language that implements the refresh service to obtain the configuration parameter refresh request. Corresponding to the type of the configuration parameter refresh interface in this embodiment, the type of the configuration parameter refresh request includes a REST request or a web service request.
本实施例的配置参数刷新接口可以理解为对参数刷新方法进行包装形成的接口,参数刷新方法包括获取当前的配置信息,以当前的配置信息更新内存中的配置信息。当配置参数刷新接口接收到客户端的配置参数刷新请求后,触发参数刷新方法对应的代码的运行,获取与配置参数刷新请求对应的配置信息可以理解为利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息。 The configuration parameter refreshing interface in this embodiment may be understood as an interface formed by packaging a parameter refreshing method. The parameter refreshing method includes obtaining current configuration information, and updating configuration information in the memory with current configuration information. After the configuration parameter refreshing interface receives the configuration parameter refresh request from the client, the code corresponding to the parameter refreshing method is triggered, and the configuration information corresponding to the configuration parameter refresh request is obtained, and the configuration parameter refresh interface is used to obtain the configuration parameter refresh request. Configuration information.
上述的客户端泛指调用配置参数刷新接口的服务的用户端,也即发送了配置参数刷新请求的发送方。例如,当配置参数刷新请求是用户在用户界面更改配置信息后,由用户界面自动向配置参数刷新接口发送的请求时,用户界面就是客户端。又例如,用户使用命令行对配置信息进行修改后,命令行向配置参数刷新接口发送的请求。此时,命令行就是客户端。The client mentioned above refers to the client that invokes the configuration parameter refresh interface service, that is, the sender that sent the configuration parameter refresh request. For example, when the configuration parameter refresh request is a request sent by the user interface to the configuration parameter refresh interface automatically after the user changes the configuration information in the user interface, the user interface is the client. For another example, after the user modifies the configuration information by using the command line, the command line refreshes the request sent by the interface to the configuration parameter. At this point, the command line is the client.
在S102中的配置信息包括了实现程序自身的功能的必不可少的配置信息,可以是程序自身在启动时需要使用的配置信息,也可以程序在运行的过程中需要使用的配置信息。例如,如果某个程序实现的是视屏播放的功能,用户改变的是视屏播放的画面的分辨率,那么,这里的分辨率可以认为是该程序的配置信息。The configuration information in S102 includes essential configuration information for realizing the functions of the program itself, and may be configuration information that the program itself needs to use at startup, or configuration information that needs to be used during the running of the program. For example, if a program implements the function of video playback, and the user changes the resolution of the screen played by the video screen, the resolution here can be regarded as the configuration information of the program.
为了保证配置参数刷新接口服务的安全性,避免非法刷新配置参数,可以在配置参数刷新接口获取当前的配置信息前,对配置参数刷新请求进行安全认证,如果配置参数刷新请求通过安全认证,才允许配置参数刷新接口获取当前的配置信息,如果安全认证不通过,则不允许配置参数刷新接口获取当前的配置信息。优选的,可以是根据配置参数刷新请求的发送方的身份对配置参数刷新请求进行安全认证。To ensure that the configuration parameters are refreshed and the configuration parameters are refreshed, you can perform the security authentication on the configuration parameter refresh request before the configuration parameter refreshing interface obtains the current configuration information. The configuration parameter refresh interface obtains the current configuration information. If the security authentication fails, the configuration parameter refresh interface is not allowed to obtain the current configuration information. Preferably, the configuration parameter refresh request may be securely authenticated according to the identity of the sender of the configuration parameter refresh request.
本实施例的安全认证可以通过OAuth方式来实现,对应的实现方式是在客户端(即配置参数刷新请求的发送方)与配置参数刷新接口之间,设置了一个授权层。客户端不能直接与配置参数刷新接口通信,只能登录授权层。客户端登录授权层以后,才可以向配置参数刷新接口发送参数配置刷新请求,相当于先验证了客户端的身份,然后才允许客户端发送,除此之外,还可以在配置参数刷新请求中携带客户端的身份信息,利用配置参数刷新接口获取到该请求后,先提取身份信息进行验证,验证通过后,才获取配置信息。The security authentication in this embodiment can be implemented by using the OAuth method. The corresponding implementation manner is that an authorization layer is set between the client (that is, the sender of the configuration parameter refresh request) and the configuration parameter refresh interface. The client cannot directly communicate with the configuration parameter refresh interface, and can only log in to the authorization layer. After the client logs in to the authorization layer, it can send a parameter configuration refresh request to the configuration parameter refresh interface, which is equivalent to verifying the identity of the client before allowing the client to send. In addition, it can also be carried in the configuration parameter refresh request. The identity information of the client is obtained by using the configuration parameter refresh interface to obtain the request, and then extracting the identity information for verification, and then obtaining the configuration information after the verification is passed.
本实施例获取的配置信息的原始存储介质可能是不同的存储介质中,例如存储在某个配置文件里,存储在数据库中,而具体存储配置信息的文件的类型也可能会不同。对不同的存储文件类型,读取配置信息的方式可 能会不同,例如配置信息在XML(Extensible Markup Language,可扩展标记语言)文件中,可以使用dom4j来读取XML文件中的配置信息;配置信息在properties文件中,可以使用系统属性类(java.util.Properties)来读取文件中的配置信息,properties文件是一种配置文件,主要用于表达配置信息,文件内容的格式是“键=值”格式,“键”表示配置参数的键名,“值”表示配置参数的键值;配置信息储存在数据库中,可以用jdbc(Java Data Base Connectivity,java数据库连接)来读取数据库中的配置信息等等。所以,本实施例可以根据配置信息的原始存储介质的类型,选择相应的读取方式读取配置信息。The original storage medium of the configuration information obtained in this embodiment may be in different storage media, for example, stored in a certain configuration file and stored in a database, and the types of files specifically storing the configuration information may also be different. For different storage file types, the way to read configuration information can be Can be different, for example, the configuration information in the XML (Extensible Markup Language) file, you can use dom4j to read the configuration information in the XML file; configuration information in the properties file, you can use the system property class (java. util.Properties) to read the configuration information in the file, the properties file is a configuration file, mainly used to express configuration information, the format of the file content is "key = value" format, "key" means the key name of the configuration parameter, "Value" means the key value of the configuration parameter; the configuration information is stored in the database, and the configuration information in the database can be read by jdbc (Java Data Base Connectivity). Therefore, in this embodiment, the configuration information can be read by selecting a corresponding reading manner according to the type of the original storage medium of the configuration information.
在本实施例中,系统开启或运行需要使用配置参数的键值进行配置,该键值一般是从内存中直接获取的,所以在利用配置参数刷新接口获取了与配置参数刷新请求对应的配置信息之后,可以利用与配置参数刷新请求对应的配置信息更新内存中的旧的配置信息,保证内存中的配置信息的有效性。In this embodiment, the system needs to be configured to use the key value of the configuration parameter to be opened or run. The key value is generally obtained from the memory, so the configuration information corresponding to the configuration parameter refresh request is obtained by using the configuration parameter refresh interface. After that, the old configuration information in the memory can be updated by using the configuration information corresponding to the configuration parameter refresh request to ensure the validity of the configuration information in the memory.
为了便于系统提取配置参数的键值,存储在内存中的配置信息可以包括配置参数的键名和键值,对应的,本实施例获取的与配置参数刷新请求对应的配置信息可以包括配置参数的键名和键值,此时,本实施例步骤S102中“利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新请求对应的配置信息更新内存中的配置信息”的更新方式可以是,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数。The configuration information stored in the memory may include a key name and a key value of the configuration parameter, and correspondingly, the configuration information corresponding to the configuration parameter refresh request obtained in this embodiment may include a key of the configuration parameter. The name and the key value. At this time, in the step S102 of the embodiment, the configuration information of the configuration parameter refreshing interface is used to acquire the configuration information corresponding to the configuration parameter refresh request, and the configuration information in the memory is updated with the configuration information corresponding to the configuration parameter refresh request. The configuration parameter refreshing interface obtains the key name and key value of the configuration parameter corresponding to the configuration parameter refresh request, deletes the configuration parameter corresponding to the key name in the memory, and writes the acquired configuration parameter.
考虑到配置参数刷新请求可以携带配置参数,为了适合不同的用户需求,本实施例中的配置参数刷新请求可以包括以下几种类型,第一种:不包含配置参数的请求;第二种:包含待更新的配置参数的键名的请求;第三种:包含待更新的配置参数的键名和键值的请求。The configuration parameter refresh request may carry the configuration parameter, and the configuration parameter refresh request in this embodiment may include the following types, the first type: the request that does not include the configuration parameter, and the second type includes: The request for the key name of the configuration parameter to be updated; the third: the request containing the key name and key value of the configuration parameter to be updated.
对应于上述的三种配置参数刷新请求,本实施例利用配置参数刷新接 口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数对应的具体更新方法可以包括:Corresponding to the three configuration parameter refresh requests described above, the embodiment uses the configuration parameter to refresh the connection. The port obtains the key name and the key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the configuration parameter corresponding to the key name in the memory. The specific update method corresponding to the obtained configuration parameter may include:
对应于第一种请求:利用配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键名和键值。可以想到的是,在获取存储于原始存储介质中的配置参数的键值和键名时,可以只获取存储于原始存储介质中的,对应于本次配置参数刷新请求的用户更新的配置参数的键值和键名,此时,只需要更新内存中的部分配置参数;也可以获取全部的配置参数,更新内存中的全部配置参数。Corresponding to the first type of request: using the configuration parameter refresh interface to obtain the key name and key value of the configuration parameter stored in the original storage medium, deleting the key name and key value of the configuration parameter in the memory, and writing the key name and key of the obtained configuration parameter. value. It is conceivable that, when acquiring the key value and the key name of the configuration parameter stored in the original storage medium, only the configuration parameter of the user update corresponding to the configuration parameter refresh request stored in the original storage medium may be acquired. Key values and key names. In this case, only some configuration parameters in the memory need to be updated; all configuration parameters can also be obtained, and all configuration parameters in the memory are updated.
当只获取存储于原始存储介质中的,对应于本次配置参数刷新请求的用户更新的配置参数的键值和键名,在该更新方法中,更新内存中的配置参数时,可以根据获取的配置参数的键名确定内存中需要更新的配置参数,将内存中需要更新的配置参数的键名和键值全部删除,写入获取的配置参数的键名和键值。也可以根据获取的配置参数的键名确定内存中需要更新的配置参数,将内存中需要更新的配置参数的键值替换为获取配置参数中对应的键值。When only the key value and the key name of the configuration parameter of the user update corresponding to the configuration parameter refresh request stored in the original storage medium are obtained, in the update method, when the configuration parameter in the memory is updated, the obtained configuration parameter may be obtained according to the acquired The key name of the configuration parameter determines the configuration parameter that needs to be updated in the memory, deletes the key name and key value of the configuration parameter that needs to be updated in the memory, and writes the key name and key value of the obtained configuration parameter. The configuration parameter that needs to be updated in the memory may be determined according to the key name of the obtained configuration parameter, and the key value of the configuration parameter that needs to be updated in the memory is replaced with the corresponding key value in the configuration parameter.
对应于第二种请求:利用配置参数刷新接口从原始存储介质中,获取与配置参数刷新请求中的键名对应的键值,删除内存中与配置参数刷新请求中的键名对应的配置参数,写入获取的配置参数的键名和键值。Corresponding to the second request: using the configuration parameter refresh interface to obtain the key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, and deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, Write the key name and key value of the obtained configuration parameter.
在该更新方法中,除了以删除内存中与配置参数刷新请求中的键名对应的配置参数,写入获取的配置参数的键名和键值的方式更新内存中的配置参数外,还可以只将内存中对应于配置参数刷新请求中的键名的键值替换为配置参数刷新请求中的键值。In the update method, in addition to deleting the configuration parameters corresponding to the key names in the configuration parameter refresh request in the memory, and writing the key names and key values of the acquired configuration parameters, the configuration parameters in the memory are updated, and only The key value in the memory corresponding to the key name in the configuration parameter refresh request is replaced with the key value in the configuration parameter refresh request.
对应于第三种请求:删除内存中与配置参数刷新请求中的键名对应的配置参数,将配置参数刷新请求中的配置参数写入内存中。Corresponding to the third request: deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the configuration parameter in the configuration parameter refresh request into the memory.
在该更新方法中,可以先将配置参数刷新请求中的配置参数提取出来,根据配置参数的键名删除内存中对应于该键名的配置参数,写入配置参数 刷新请求中包含的配置参数。In the update method, the configuration parameter in the configuration parameter refresh request may be extracted first, and the configuration parameter corresponding to the key name in the memory is deleted according to the key name of the configuration parameter, and the configuration parameter is written. Refresh the configuration parameters contained in the request.
当配置参数刷新请求为第一种请求时,需要重新从原始存储介质中获取当前的配置参数的键名和键值,该键名和键值是与配置参数刷新请求对应的配置信息,此时,虽然需要重新获取的数据比较多,但是更新内存中的配置参数的更新方式可以很简单,将内存中的配置参数的键名和键值全部删除,写入当前的配置参数的键名和键值即可。除此之外,还可以只删除内存中的配置参数的键值,根据删除的键值对应的键名写入新获取的对应于该键名的键值。When the configuration parameter refresh request is the first type of request, the key name and the key value of the current configuration parameter need to be retrieved from the original storage medium, and the key name and the key value are configuration information corresponding to the configuration parameter refresh request. There are many data that need to be reacquired, but updating the configuration parameters in the memory can be very simple. The key names and key values of the configuration parameters in the memory are deleted, and the key names and key values of the current configuration parameters can be written. In addition, it is also possible to delete only the key value of the configuration parameter in the memory, and write the newly acquired key value corresponding to the key name according to the key name corresponding to the deleted key value.
当配置参数刷新请求为第二种请求时,配置参数刷新请求中包含了待更新的配置参数的键名,这里的待更新的配置参数应理解为内存中需要更新的配置参数,也即在原始存储介质中已更新,但在内存中未更新的配置参数。从该配置参数刷新请求中可以提取出待更新的配置参数的键名,然后利用配置参数刷新接口根据该键名从原始存储介质中读取对应于该键名的键值,再根据配置参数刷新请求包含的键名和读取的对应于该键名的键值,更新内存中的配置参数。此种更新方法虽然需要读取配置参数,但是更新的时候,只更新内存中待更新的配置参数,节约了获取配置参数和更新配置参数的时间。When the configuration parameter refresh request is the second type request, the configuration parameter refresh request includes the key name of the configuration parameter to be updated, and the configuration parameter to be updated here should be understood as the configuration parameter that needs to be updated in the memory, that is, in the original Configuration parameters that have been updated on the storage medium but not updated in memory. The key name of the configuration parameter to be updated may be extracted from the configuration parameter refresh request, and then the configuration parameter refresh interface reads the key value corresponding to the key name from the original storage medium according to the key name, and then refreshes according to the configuration parameter. Updates the in-memory configuration parameters by requesting the included key name and the read key value corresponding to the key name. Although the update method needs to read the configuration parameters, when updating, only the configuration parameters to be updated in the memory are updated, which saves time for obtaining configuration parameters and updating configuration parameters.
当配置参数刷新请求为第三种请求时,直接从配置参数刷新请求中就可以提取出待更新的配置参数的键名和键值,不需要进行原始存储介质中的配置参数的读取,可以有效地降低更新内存中的配置参数所需的时间,达到快速准确更新内存中的配置信息的目的。When the configuration parameter refresh request is the third type of request, the key name and the key value of the configuration parameter to be updated can be extracted directly from the configuration parameter refresh request, and the configuration parameter in the original storage medium is not required to be read, which can be effective. Reduce the time required to update the configuration parameters in the memory, and achieve the purpose of quickly and accurately updating the configuration information in the memory.
考虑到本实施例中发送配置参数刷新请求的是客户端,配置参数刷新请求携带的配置信息可以是客户端在发送该请求时自动添加的,例如当用户在用户界面完成更改配置信息的操作后,用户界面在自动向配置参数刷新接口发送配置参数刷新请求前,将用户更改的配置信息写入配置参数刷新请求中,发送给配置参数刷新接口。Considering that the configuration parameter refresh request is sent by the client in this embodiment, the configuration information carried in the configuration parameter refresh request may be automatically added by the client when the request is sent, for example, after the user completes the operation of changing the configuration information in the user interface. The user interface writes the configuration information changed by the user to the configuration parameter refresh request and sends it to the configuration parameter refresh interface before sending the configuration parameter refresh request to the configuration parameter refresh interface.
下面举例说明上述三种请求和对应的内存中的配置信息的更新过程。 The following describes the update process of the above three requests and the corresponding configuration information in the memory.
假设用户在原始存储介质中将配置信息:电视尺寸=14寸改为了电视尺寸=17寸;Suppose the user changes the configuration information in the original storage medium: TV size = 14 inches to TV size = 17 inches;
第一种配置参数刷新请求不传递具体的配置信息,只起到触发内存刷新的作用,这时,需要从原始存储介质中读取“电视尺寸=17寸”这一键-值对,将内存中的“电视尺寸=14寸”删除,写入“电视尺寸=17寸”。The first configuration parameter refresh request does not pass the specific configuration information, but only plays the role of triggering the memory refresh. At this time, the key value-value pair of "TV size=17 inch" needs to be read from the original storage medium, and the memory is read. In the "TV size = 14 inch" delete, write "TV size = 17 inch".
第二种配置参数刷新请求以传递具体的配置参数的键名,例如请求消息内容包含键名“电视尺寸”,不包含键值“17寸”。此时,需要根据该键名“电视尺寸”从存储介质中读取其对应的键值“17寸”,根据键名“电视尺寸”删除内存中的键值“14寸”,对应写入“17寸”,使得内存中的配置参数“电视尺寸=14寸”更新为“电视尺寸=17寸”。The second configuration parameter refresh request is to pass the key name of the specific configuration parameter, for example, the content of the request message includes the key name "TV size", and does not include the key value "17 inch". At this time, it is necessary to read the corresponding key value "17 inch" from the storage medium according to the key name "TV size", and delete the key value "14 inch" in the memory according to the key name "TV size", correspondingly write " 17"", the memory configuration parameter "TV size = 14" is updated to "TV size = 17".
第三种配置参数刷新请求可以同时传递配置参数的键名和键值,例如配置参数刷新请求中包含配置参数“电视尺寸=17寸”。此时,不需要查找原始存储介质中的配置参数,直接根据配置参数刷新请求中的“电视尺寸”这一键名将内存中的键值“14寸”删除,对应写入“17寸”即可。The third configuration parameter refresh request can simultaneously pass the key name and key value of the configuration parameter. For example, the configuration parameter refresh request includes the configuration parameter "TV size = 17 inches". At this time, it is not necessary to find the configuration parameter in the original storage medium, and directly delete the key value "14 inch" in the memory according to the "TV size" key name in the configuration parameter refresh request, and correspondingly write "17 inch". .
本实施例中,当内存中的配置参数更新完成后,若系统需要使用某个配置参数的键值时,只要根据该配置参数的键名就可以从内存中获取键值,具体的可以将该配置参数的键名与内存中的键名进行匹配,读取匹配的键名对应的键值,在上述的例子中,系统只要根据“电视尺寸”这一键名,就可以从内存中找到“电视尺寸=17寸”这一配置参数,然后读取键值“17寸”,就可以进行后续的配置操作。In this embodiment, after the configuration parameter update in the memory is completed, if the system needs to use the key value of a certain configuration parameter, the key value can be obtained from the memory according to the key name of the configuration parameter, and the specific value can be The key name of the configuration parameter is matched with the key name in the memory, and the key value corresponding to the matching key name is read. In the above example, the system can find "from the memory according to the "TV size" key name. The TV size = 17 inch" configuration parameter, and then read the key value "17 inch", you can carry out subsequent configuration operations.
在本实施例中,内存中的配置信息可以是系统程序运行后初次获取的配置信息,也可以是已经刷新过的配置信息。In this embodiment, the configuration information in the memory may be the configuration information acquired for the first time after the system program is run, or may be the configuration information that has been refreshed.
当系统启动时或系统程序需要时,获取初始的配置信息存到内存中,配置信息包括配置参数的键名和键值。可以采用单例模式从配置文件或数据库等原始存储介质中读取配置参数,然后写入内存中。单例模式的使用可以使得对初始的配置参数的获取只有一次,写入内存也只有一次,即存储在内存中的配置参数只有一份,避免系统中存在多份配置参数带来的占 用空间,浪费系统资源,以及对系统从内存获取配置参数带来的干扰等问题。When the system starts or when the system program needs it, the initial configuration information is stored in the memory, and the configuration information includes the key name and key value of the configuration parameter. You can use singleton mode to read configuration parameters from raw storage media such as configuration files or databases and then write them to memory. The use of the singleton mode allows the initial configuration parameters to be acquired only once, and only once in the memory, that is, only one copy of the configuration parameters stored in the memory, to avoid the existence of multiple configuration parameters in the system. Use space, waste system resources, and interference with the system to obtain configuration parameters from memory.
优选的,本实施例的配置参数的键名和键值在内存中的具体存储位置可以线程安全的全局静态变量Map,即将配置参数存储在内存中的ConcurrentHashMap中,以键-值对的形式存储于ConcurrentHashMap中的配置参数保留了键-值映射关系,系统可以根据某个配置参数的键名从ConcurrentHashMap中读取到键值,利用该键值进行系统配置。Preferably, the key name and the key value of the configuration parameter of the embodiment may be a thread-safe global static variable Map in a specific storage location in the memory, that is, the configuration parameter is stored in a ConcurrentHashMap in the memory, and is stored in the form of a key-value pair. The configuration parameters in the ConcurrentHashMap retain the key-value mapping. The system can read the key value from the ConcurrentHashMap according to the key name of a configuration parameter, and use the key value for system configuration.
采用本实施例的参数配置方法,利用配置参数刷新接口可以获取到配置参数刷新请求;之后,可以利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以该配置信息更新内存中的配置信息。采用本发明可以根据需要对内存中的参数信息进行刷新,尤其是实际的配置信息被更改后,只要配置参数刷新接口获取了配置参数刷新请求,就可以及时刷新内存中的配置信息,本发明的刷新方法简单易用,安全可靠,能确保参数配置修改及时生效,提高系统的性能。With the parameter configuration method of the embodiment, the configuration parameter refresh request can be obtained by using the configuration parameter refresh interface; afterwards, the configuration parameter refresh interface can be used to obtain configuration information corresponding to the configuration parameter refresh request, and the configuration information is updated in the memory with the configuration information. information. The invention can refresh the parameter information in the memory according to the need, in particular, after the actual configuration information is changed, the configuration information refreshing interface obtains the configuration parameter refresh request, and the configuration information in the memory can be refreshed in time. The refresh method is simple and easy to use, safe and reliable, and can ensure that the parameter configuration modification takes effect in time to improve the performance of the system.
可选地,本发明的配置信息是程序在启动或运行时需要使用的配置信息,可以避免读取不需要的数据,避免浪费系统资源。Optionally, the configuration information of the present invention is configuration information that the program needs to use when starting or running, which can avoid reading unnecessary data and avoid wasting system resources.
可选地,本实施例在刷新之前对配置参数刷新请求进行安全认证,可以保证配置参数刷新请求的可靠性,避免给系统带来安全隐患。Optionally, the security authentication of the configuration parameter refresh request is performed before the refreshing, and the reliability of the configuration parameter refresh request can be ensured, thereby avoiding a security risk to the system.
可选地,配置信息包括配置参数的键名和键值,可以使得系统能根据键名快速地确定需要键值,降低系统从内存获取键值需要的时间,提高系统的性能和配置参数刷新效率。Optionally, the configuration information includes a key name and a key value of the configuration parameter, so that the system can quickly determine the required key value according to the key name, reduce the time required for the system to obtain the key value from the memory, and improve system performance and configuration parameter refresh efficiency.
实施例二:Embodiment 2:
参见图2,本实施例提供了一种参数配置方法的细化流程,在本实施例中,在系统启动前,系统程序或运行需要的配置信息存储于数据库或配置文件等原始存储介质中,本实施例详细介绍了初次获取系统程序的配置信息的过程以及在系统运行过程中,刷新配置信息的过程。本实施例的配 置参数刷新接口选取REST接口。Referring to FIG. 2, the embodiment provides a refinement process of a parameter configuration method. In this embodiment, before the system is started, the system program or the configuration information required for the operation is stored in a original storage medium such as a database or a configuration file. This embodiment describes in detail the process of acquiring the configuration information of the system program for the first time and the process of refreshing the configuration information during the running of the system. The configuration of this embodiment Set the parameter refresh interface to select the REST interface.
本实施例的细化流程如下:The refinement process of this embodiment is as follows:
S201、在系统启动时,采用单例模式从配置文件或数据库等原始存储介质中,读取程序运行需要的配置信息;该配置信息包括配置参数的键名和键值;S201. When the system is started, the single-case mode is used to read configuration information required for running the program from a original storage medium such as a configuration file or a database; the configuration information includes a key name and a key value of the configuration parameter;
在S201中,除了配置文件或数据库,也可以从其他存储配置信息的位置读取配置信息,对配置参数的读取可以根据配置参数的存储区域的不同,选择不同的读取方式进行读取。在S201中,也可以只读取配置参数的键值,不读取对应的键名,只是采用此种方式,内存中存储的只有配置参数的键值,当系统需要从内存中获取键值时,需要采用更复杂的方式才能获取到正确的键值。In S201, in addition to the configuration file or the database, the configuration information may be read from other locations where the configuration information is stored, and the reading of the configuration parameters may be performed by selecting different reading modes according to different storage areas of the configuration parameters. In S201, it is also possible to read only the key value of the configuration parameter, and not to read the corresponding key name. In this way, only the key value of the configuration parameter is stored in the memory, when the system needs to obtain the key value from the memory. , you need to take a more complicated way to get the correct key value.
S202、将配置参数的键名和键值写入内存中的ConcurrentHashMap中;S202. Write a key name and a key value of the configuration parameter into a ConcurrentHashMap in the memory;
步骤201中也不局限于采用单例模式获取配置参数,只要保证最后保存在ConcurrentHashMap中的配置参数只有一份即可,即内存中的键名不重复。In step 201, the configuration parameter is not limited to use the singleton mode, as long as the configuration parameter saved in the ConcurrentHashMap is only one copy, that is, the key names in the memory are not repeated.
而且本实施例不局限于将配置参数写入内存中的ConcurrentHashMap。可以是根据配置参数生成一个含有配置参数的键名和键值的对应关系的表格,将该表格存储于内存中。Moreover, the embodiment is not limited to the ConcurrentHashMap in which configuration parameters are written into the memory. A table may be generated that generates a correspondence between a key name and a key value of the configuration parameter according to the configuration parameter, and stores the table in the memory.
S203、系统根据待使用的配置参数的键名,从ConcurrentHashMap中读取对应于该键名的键值供自身使用;S203. The system reads, according to the key name of the configuration parameter to be used, a key value corresponding to the key name from the ConcurrentHashMap for use by itself;
S204、参数配置刷新RSET接口接收客户端发送的RSET请求;S204. The parameter configuration refresh RSET interface receives the RSET request sent by the client.
S205、根据客户端的身份对RSET请求进行安全认证,判断是否通过安全认证,若通过,则进入S206、若不通过,则停止本次刷新。S205. Perform security authentication on the RSET request according to the identity of the client, and determine whether the security authentication is passed. If yes, the process proceeds to S206. If not, the current refresh is stopped.
S206、从配置参数的原始存储介质中,读取与配置参数刷新请求对应的配置参数的键名和键值;S206. Read, from the original storage medium of the configuration parameter, a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request.
本实施例的步骤S204中的REST请求不包含配置参数的信息,所以 步骤S206中需要从原始存储介质中获取配置参数的键值和键名,当REST请求包含配置参数的键名时,步骤S206中只需要从原始存储介质中获取与REST请求中的键名对应的键值即可,当REST请求包含配置参数的键名和键值时,步骤S206中,只需要从REST请求中提取配置参数的键名和键值即可。The REST request in step S204 of this embodiment does not include the configuration parameter information, so In step S206, the key value and the key name of the configuration parameter are obtained from the original storage medium. When the REST request includes the key name of the configuration parameter, only the key name corresponding to the key name in the REST request needs to be obtained from the original storage medium in step S206. The key value is sufficient. When the REST request includes the key name and the key value of the configuration parameter, in step S206, only the key name and the key value of the configuration parameter need to be extracted from the REST request.
S207、删除ConcurrentHashMap中的所有的配置参数,写入获取的与配置参数刷新请求对应的配置参数;S207. Delete all configuration parameters in the ConcurrentHashMap, and write the obtained configuration parameters corresponding to the configuration parameter refresh request.
步骤S207的做法还可以是,删除ConcurrentHashMap中的所有配置参数的键值,根据配置参数的键名对应写入S206中获取的配置参数的键值。The step S207 may be performed by deleting the key values of all the configuration parameters in the ConcurrentHashMap, and correspondingly writing the key values of the configuration parameters acquired in S206 according to the key names of the configuration parameters.
S208、系统根据待使用的配置参数对应的键名,从ConcurrentHashMap中读取对应的键值供自身使用。S208. The system reads the corresponding key value from the ConcurrentHashMap for use by itself according to the key name corresponding to the configuration parameter to be used.
有益效果:Beneficial effects:
采用本实施例的参数配置方法,可以将配置参数读取到内存当中的ConcurrentHashMap中,以键-值对的形式存储。系统根据配置参数的键名从ConcurrentHashMap读取到配置参数的键值。使用本实施例的参数配置方法,可以帮助系统程序在运行时候,快速高效地得到最新的参数配置,从而来控制程序正确运行。本实施例参数配置方法具有简单方便、实用性强、系统资源占用小的优点。With the parameter configuration method of this embodiment, the configuration parameters can be read into the ConcurrentHashMap in the memory and stored in the form of key-value pairs. The system reads the key value of the configuration parameter from the ConcurrentHashMap according to the key name of the configuration parameter. By using the parameter configuration method of the embodiment, the system program can be quickly and efficiently obtained the latest parameter configuration during operation, thereby controlling the correct operation of the program. The parameter configuration method of this embodiment has the advantages of simple convenience, strong practicability, and small occupation of system resources.
实施例三:Embodiment 3:
本实施例提出一种参数配置装置,适用于任何应用程序的参数配置,尤其适用于面向服务的体系架构(SOA)的分布式企业应用的参数配置。This embodiment proposes a parameter configuration apparatus suitable for parameter configuration of any application, and is particularly suitable for parameter configuration of a distributed enterprise application of a service oriented architecture (SOA).
参见图3,该参数配置装置1包括:获取模块11和配置参数刷新模块12,获取模块11设置为利用配置参数刷新接口获取配置参数刷新请求;配置参数刷新模块12设置为在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息,以与配置参数刷新 请求对应的配置信息更新内存中的配置信息。Referring to FIG. 3, the parameter configuration apparatus 1 includes: an obtaining module 11 and a configuration parameter refreshing module 12, the obtaining module 11 is configured to obtain a configuration parameter refresh request by using a configuration parameter refreshing interface; and the configuration parameter refreshing module 12 is configured to refresh the configured configuration parameter. After the request is configured, the configuration parameter refresh interface is used to obtain configuration information corresponding to the configuration parameter refresh request, and is refreshed with the configuration parameter. Request the corresponding configuration information to update the configuration information in the memory.
配置参数刷新接口的类型可以根据实际的需要进行设置,考虑到通过配置参数刷新接口获取的配置参数请求可能是系统的不同功能单元发送来的,为了系统中的不同功能单元之间可以使用统一的通用的方式进行交互,比较优选的设置方式是使配置参数刷新接口独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言。优选地,配置参数刷新接口的类型可以是表述性状态传递接口(REST接口)或网络服务接口(Web Service接口),REST是Representational State Transfer的缩写,意为表述性状态传递。当然,本实施例的配置参数刷新接口也可以是其他可以获取配置参数刷新请求的独立于实现刷新服务的硬件平台、操作系统和编程语言的接口。对应于本实施例中的配置参数刷新接口的类型,配置参数刷新请求的类型包括REST请求或Web Service请求。The configuration parameter refresh interface type can be set according to the actual needs. Considering that the configuration parameter request obtained by the configuration parameter refresh interface may be sent by different functional units of the system, a unified function may be used for different functional units in the system. The common way to interact, the preferred setting is to make the configuration parameter refresh interface independent of the hardware platform, operating system and programming language that implements the configuration parameter refresh service. Preferably, the type of the configuration parameter refresh interface may be a representational state delivery interface (REST interface) or a network service interface (Web Service interface), and REST is an abbreviation of Representational State Transfer, which means expression state delivery. Certainly, the configuration parameter refresh interface of this embodiment may also be another interface that can obtain the configuration parameter refresh request independently of the hardware platform, the operating system, and the programming language that implements the refresh service. Corresponding to the type of the configuration parameter refresh interface in this embodiment, the type of the configuration parameter refresh request includes a REST request or a web service request.
本实施例的配置参数刷新接口可以理解为对参数刷新方法进行包装形成的接口,参数刷新方法包括获取当前的配置信息,以当前的配置信息更新内存中的配置信息。当配置参数刷新接口接收到客户端的配置参数刷新请求后,触发参数刷新方法对应的代码的运行,获取与配置参数刷新请求对应的配置信息可以理解为利用配置参数刷新接口获取与配置参数刷新请求对应的配置信息。The configuration parameter refreshing interface in this embodiment may be understood as an interface formed by packaging a parameter refreshing method. The parameter refreshing method includes obtaining current configuration information, and updating configuration information in the memory with current configuration information. After the configuration parameter refreshing interface receives the configuration parameter refresh request from the client, the code corresponding to the parameter refreshing method is triggered, and the configuration information corresponding to the configuration parameter refresh request is obtained, and the configuration parameter refresh interface is used to obtain the configuration parameter refresh request. Configuration information.
上述的客户端泛指调用配置参数刷新接口的服务的用户端,也即发送了配置参数刷新请求的发送方。例如,当配置参数刷新请求是用户在用户界面更改配置信息后,由用户界面自动向配置参数刷新接口发送的请求时,用户界面就是客户端。又例如,用户使用命令行对配置信息进行修改后,命令行向配置参数刷新接口发送的请求。此时,命令行就是客户端。The client mentioned above refers to the client that invokes the configuration parameter refresh interface service, that is, the sender that sent the configuration parameter refresh request. For example, when the configuration parameter refresh request is a request sent by the user interface to the configuration parameter refresh interface automatically after the user changes the configuration information in the user interface, the user interface is the client. For another example, after the user modifies the configuration information by using the command line, the command line refreshes the request sent by the interface to the configuration parameter. At this point, the command line is the client.
本实施例的配置信息包括了实现程序的功能的配置参数,可以是程序自身在启动时需要使用的配置信息,也可以程序在运行的过程中需要使用的配置信息。例如,如果某个程序实现的是视屏播放的功能,用户改变的是视屏播放的画面的分辨率,那么,这里的分辨率可以认为是该程序的配 置参数。The configuration information of this embodiment includes configuration parameters for implementing the function of the program, and may be configuration information that the program itself needs to use at startup, or configuration information that needs to be used during the running of the program. For example, if a program implements the function of video playback, and the user changes the resolution of the video played by the video screen, then the resolution here can be considered as the matching of the program. Set the parameters.
为了保证配置参数刷新接口服务的安全性,避免非法刷新配置参数。优选的,参见图4,本实施例的参数配置装置1还可以包括安全认证模块13,该安全认证模块13可以设置为在配置参数刷新模块12获取与配置参数刷新请求对应的配置信息前,根据配置参数刷新请求的发送方的身份对配置参数刷新请求进行安全认证;若安全认证通过,则配置参数刷新模块获取与配置参数刷新请求对应的配置信息,否,则不获取。To ensure that the configuration parameters refresh the security of the interface service, you can avoid illegally refreshing configuration parameters. Preferably, referring to FIG. 4, the parameter configuration apparatus 1 of the present embodiment may further include a security authentication module 13, and the security authentication module 13 may be configured to: before the configuration parameter refreshing module 12 acquires configuration information corresponding to the configuration parameter refresh request, according to If the identity of the sender of the parameter refresh request is configured, the configuration parameter refresh request is securely authenticated. If the security authentication is passed, the configuration parameter refresh module obtains the configuration information corresponding to the configuration parameter refresh request. Otherwise, the configuration information is not obtained.
在本实施例中,可以在配置参数刷新请求中携带客户端的身份信息,安全认证模块13提取该身份信息进行验证,验证通过后,配置参数刷新模块12才获取配置信息,否则就不获取。In this embodiment, the identity information of the client may be carried in the configuration parameter refresh request, and the security authentication module 13 extracts the identity information for verification. After the verification is passed, the configuration parameter refreshing module 12 obtains the configuration information, otherwise it does not acquire.
在本实施例中,当配置信息的存储文件类型不同时,可以采用不同的读取方式读取配置信息。例如配置信息在XML文件中,可以使用dom4j来读取文件中的配置信息;配置信息在properties文件中,可以使用系统属性类(java.util.Properties)来读取文件中的配置信息;配置信息储存在数据库中,可以用jdbc来读取数据库中的配置信息等等。In this embodiment, when the storage file types of the configuration information are different, the configuration information may be read by using different reading methods. For example, the configuration information is in the XML file, you can use dom4j to read the configuration information in the file; the configuration information in the properties file, you can use the system property class (java.util.Properties) to read the configuration information in the file; configuration information Stored in the database, you can use jdbc to read the configuration information in the database and so on.
优选的,本实施例的配置信息包括配置参数的键名和键值,配置参数刷新模块12设置为在获取到配置参数刷新请求后,利用配置参数刷新接口获取与配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于键名的配置参数,写入获取的配置参数。Preferably, the configuration information of the embodiment includes a key name and a key value of the configuration parameter, and the configuration parameter refreshing module 12 is configured to acquire the configuration parameter corresponding to the configuration parameter refresh request by using the configuration parameter refresh interface after obtaining the configuration parameter refresh request. The key name and key value, delete the configuration parameters corresponding to the key name in the memory, and write the obtained configuration parameters.
考虑到接收的配置参数刷新请求可以携带配置信息,优选的,本实施例的获取模块11获取的配置参数刷新请求包括:不包含配置参数的请求;或者,包含待更新的配置参数的键名的请求;或者,包含待更新的配置参数的键名和键值的请求。The configuration parameter refresh request received by the obtaining module 11 of the present embodiment includes: a request not including the configuration parameter; or a key name including the configuration parameter to be updated. Request; or, a request containing the key name and key value of the configuration parameter to be updated.
对应的,配置参数刷新模块12包括第一刷新子模块121或第二刷新子模块122或第三刷新子模块123;Correspondingly, the configuration parameter refreshing module 12 includes a first refresh submodule 121 or a second refresh submodule 122 or a third refresh submodule 123;
第一刷新子模块121设置为,当配置参数刷新请求不包含配置参数时,利用配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和 键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键值和键名;The first refresh submodule 121 is configured to acquire a key name of the configuration parameter stored in the original storage medium by using the configuration parameter refresh interface when the configuration parameter refresh request does not include the configuration parameter. Key value, delete the key name and key value of the configuration parameter in the memory, and write the key value and key name of the obtained configuration parameter;
第二刷新子模块122设置为,当配置参数刷新请求包含待更新的配置参数的键名时,利用配置参数刷新接口从原始存储介质中,获取与配置参数刷新请求中的键名对应的键值,删除内存中与配置参数刷新请求中的键名对应的配置参数,写入获取的配置参数的键名和键值;The second refresh sub-module 122 is configured to: when the configuration parameter refresh request includes the key name of the configuration parameter to be updated, use the configuration parameter refresh interface to obtain the key value corresponding to the key name in the configuration parameter refresh request from the original storage medium. , deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the key name and key value of the obtained configuration parameter;
第三刷新子模块123设置为,当配置参数刷新请求包含待更新的配置参数的键名与键值时,删除内存中与配置参数刷新请求中的键名对应的配置参数,将配置参数刷新请求中的配置参数写入内存中。The third refresh sub-module 123 is configured to: when the configuration parameter refresh request includes the key name and the key value of the configuration parameter to be updated, delete the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and configure the parameter refresh request The configuration parameters in are written to memory.
可以理解的是,本实施例的第一刷新子模块121和第二刷新子模块122以及第三刷新子模块123是可以同时存在于配置参数刷新模块12中的。It can be understood that the first refresh sub-module 121 and the second refresh sub-module 122 and the third refresh sub-module 123 of the present embodiment can exist in the configuration parameter refresh module 12 at the same time.
优选的,配置参数包括了实现程序的功能的配置参数,可以是程序自身在启动时需要使用的配置参数,也可以程序在运行的过程中需要使用的配置参数。Preferably, the configuration parameter includes a configuration parameter that implements a function of the program, and may be a configuration parameter that the program itself needs to use at startup, or a configuration parameter that the program needs to use during the running process.
在系统启动或者是需要使用程序的时候,需要从内存中读取初始的配置参数的键值,即未更新的配置参数的键值。优选的,本实施例的参数配置装置1可以包括参数配置载入模块14,设置为在系统启动或是需要使用程序的时候,从原始存储介质中读取初始的配置参数,并写入内存中保存。When the system starts or needs to use the program, the key value of the initial configuration parameter, that is, the key value of the unupdated configuration parameter, needs to be read from the memory. Preferably, the parameter configuration apparatus 1 of the embodiment may include a parameter configuration loading module 14 configured to read the initial configuration parameters from the original storage medium and write them into the memory when the system starts or needs to use the program. save.
参数配置载入模块14在读取配置参数的时候,可以采用单例模式进行读取,保证内存中的配置参数只有一份。When the parameter configuration loading module 14 reads the configuration parameters, it can be read in the singleton mode to ensure that only one copy of the configuration parameters in the memory.
在实际中,存储在配置文件中、数据库等原始存储介质的配置参数可以以键-值对的形式存在,“键”是配置参数的键名,“值”是配置参数的键值。当配置参数在内存中以键-值对的形式存在时,可以存储于内存中的线程安全的全局静态变量Map中,即存储在内存中的ConcurrentHashMap中,以键-值对的形式存储于ConcurrentHashMap中的配置信息保留了键名和键值的映射关系,系统可以根据某个配置参数的键名从ConcurrentHashMap中读取到对应的键值。 In practice, the configuration parameters of the original storage medium stored in the configuration file, database, etc. may exist in the form of key-value pairs, the "key" is the key name of the configuration parameter, and the "value" is the key value of the configuration parameter. When a configuration parameter exists in the form of a key-value pair in memory, it can be stored in a thread-safe global static variable Map in memory, that is, stored in a ConcurrentHashMap in memory, stored in a ConcurrentHashMap as a key-value pair. The configuration information in the key retains the mapping between the key name and the key value. The system can read the corresponding key value from the ConcurrentHashMap according to the key name of a certain configuration parameter.
优选的,参见图4,本实施例的参数配置装置还可以包括配置参数调用模块15,设置为在系统运行的时候,根据待使用的配置参数的键名从内存的ConcurrentHashMap中读取对应的键值,具体可以是配置参数调用模块15将待使用的配置参数的键名与ConcurrentHashMap中的所有键名进行匹配,读取ConcurrentHashMap中匹配的键名对应的键值。Preferably, referring to FIG. 4, the parameter configuration apparatus of this embodiment may further include a configuration parameter calling module 15 configured to read the corresponding key from the ConcurrentHashMap of the memory according to the key name of the configuration parameter to be used when the system is running. The value may be specifically configured by the configuration parameter calling module 15 to match the key name of the configuration parameter to be used with all the key names in the ConcurrentHashMap, and read the key value corresponding to the matching key name in the ConcurrentHashMap.
有益效果:Beneficial effects:
采用本实施例的参数配置装置可以利用配置参数刷新接口获取配置参数刷新请求,确定何时进行刷新,之后可以获取与配置参数刷新请求对应的配置信息,以该配置信息更新内存中的配置信息。所以本实施例的参数配置装置可以根据用户的需要随时更新内存中的配置信息,尤其是在配置信息被更改的情况下,可以快速的更新内存中的配置信息,保证内存中的配置信息的有效性,保证系统的性能,除此之外,利用本实施例的参数配置装置还具有使用简单方便、实用性强的优点。The parameter configuration device of the embodiment can use the configuration parameter refresh interface to obtain a configuration parameter refresh request, determine when to perform refreshing, and then obtain configuration information corresponding to the configuration parameter refresh request, and update the configuration information in the memory with the configuration information. Therefore, the parameter configuration apparatus of the embodiment can update the configuration information in the memory at any time according to the needs of the user, and in particular, when the configuration information is changed, the configuration information in the memory can be quickly updated to ensure the effective configuration information in the memory. In addition, the parameter configuration device of the present embodiment has the advantages of simple and convenient use and strong practicability.
显然,本领域的技术人员应该明白,上述本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储介质(ROM/RAM、磁碟、光盘)中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。所以,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases The steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. It will be apparent to those skilled in the art that the present invention may be made without departing from the spirit and scope of the invention.
工业实用性Industrial applicability
在本发明实施例的参数配置过程中,利用配置参数刷新接口获取配置 参数刷新请求,确定何时需要进行配置参数的刷新,在获取该请求之后,可以利用配置参数刷新接口获取与该请求对应的配置信息,以此配置信息更新内存中的配置信息。本发明的方法可以根据配置参数刷新请求快速地得知配置参数已修改然后刷新内存中的配置信息,具有简单易用,安全可靠,能确保配置信息修改及时生效,提高系统的性能的优点。 In the parameter configuration process of the embodiment of the present invention, the configuration parameter refresh interface is used to obtain the configuration. The parameter refresh request determines when the configuration parameter needs to be refreshed. After obtaining the request, the configuration parameter refresh interface can be used to obtain the configuration information corresponding to the request, and the configuration information is used to update the configuration information in the memory. The method of the invention can quickly know that the configuration parameters have been modified and then refresh the configuration information in the memory according to the configuration parameter refresh request, and has the advantages of being simple and easy to use, safe and reliable, ensuring timely modification of configuration information, and improving system performance.

Claims (14)

  1. 一种参数配置方法,包括:A parameter configuration method includes:
    利用配置参数刷新接口获取配置参数刷新请求;Using the configuration parameter refresh interface to obtain a configuration parameter refresh request;
    在获取到所述配置参数刷新请求后,利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息,以所述与所述配置参数刷新请求对应的配置信息更新内存中的配置信息。After obtaining the configuration parameter refresh request, the configuration parameter refreshing interface is used to obtain configuration information corresponding to the configuration parameter refresh request, and the configuration in the memory is updated by using the configuration information corresponding to the configuration parameter refresh request. information.
  2. 如权利要求1所述的参数配置方法,其中,所述配置信息包括程序启动或运行时需要使用的配置信息。The parameter configuration method according to claim 1, wherein said configuration information includes configuration information that is required to be used when the program is started or run.
  3. 如权利要求1所述的参数配置方法,其中,在利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息前,还包括,根据所述配置参数刷新请求的发送方的身份对所述配置参数刷新请求进行安全认证,若安全认证通过,则获取与所述配置参数刷新请求对应的配置信息,否,则不获取。The parameter configuration method according to claim 1, wherein before the configuration information corresponding to the configuration parameter refresh request is acquired by using the configuration parameter refresh interface, the method further includes: refreshing the identity of the sender according to the configuration parameter Performing security authentication on the configuration parameter refresh request. If the security authentication is passed, the configuration information corresponding to the configuration parameter refresh request is obtained, otherwise, the configuration is not obtained.
  4. 如权利要求1所述的参数配置方法,其中,所述配置参数刷新接口包括:独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言的接口。The parameter configuration method of claim 1, wherein the configuration parameter refresh interface comprises an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
  5. 如权利要求4所述的参数配置方法,其中,所述配置参数刷新接口具体包括:表述性状态传递接口或网络服务接口。The parameter configuration method according to claim 4, wherein the configuration parameter refresh interface specifically comprises: a representational state delivery interface or a network service interface.
  6. 如权利要求1-5任一项所述的参数配置方法,其中,所述配置信息包括配置参数的键名和键值,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息,以所述与所述配置参数刷新请求对应的配置信息更新内存中的配置信息包括:利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数。 The parameter configuration method according to any one of claims 1 to 5, wherein the configuration information includes a key name and a key value of a configuration parameter, and the configuration parameter refresh interface acquires a corresponding to the configuration parameter refresh request. The configuration information, the updating the configuration information in the memory by using the configuration information corresponding to the configuration parameter refresh request includes: acquiring, by using the configuration parameter refresh interface, a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, The configuration parameter corresponding to the key name in the memory is deleted, and the obtained configuration parameter is written.
  7. 如权利要求6所述的参数配置方法,其中,所述配置参数刷新请求包括:不包含配置参数的请求;或者,包含待更新的配置参数的键名的请求;或者,包含待更新的配置参数的键名和键值的请求;The parameter configuration method according to claim 6, wherein the configuration parameter refresh request comprises: a request that does not include a configuration parameter; or a request that includes a key name of a configuration parameter to be updated; or, includes a configuration parameter to be updated Request for key name and key value;
    当所述配置参数刷新请求不包含配置参数时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:利用所述配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键名和键值;When the configuration parameter refresh request does not include a configuration parameter, the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes a memory corresponding to the key name. The configuration parameter, the obtained configuration parameter is obtained by: using the configuration parameter refresh interface to obtain a key name and a key value of a configuration parameter stored in the original storage medium, deleting a key name and a key value of the configuration parameter in the memory, and writing the obtained key The key name and key value of the configuration parameter;
    当所述配置参数刷新请求包含待更新的配置参数的键名时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:利用所述配置参数刷新接口从原始存储介质中,获取与所述配置参数刷新请求中的所述键名对应的键值,删除内存中与所述配置参数刷新请求中的所述键名对应的配置参数,写入获取的配置参数的键名和键值;When the configuration parameter refresh request includes a key name of the configuration parameter to be updated, the configuration parameter refresh interface acquires a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory corresponding to the The configuration parameter of the key name, the write configuration parameter obtained by using the configuration parameter refresh interface, obtains a key value corresponding to the key name in the configuration parameter refresh request from the original storage medium, and deletes the memory. a configuration parameter corresponding to the key name in the configuration parameter refresh request, and a key name and a key value of the obtained configuration parameter are written;
    当所述配置参数刷新请求包含待更新的配置参数的键名与键值时,所述利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数包括:删除内存中与所述配置参数刷新请求中的所述键名对应的配置参数,将所述配置参数刷新请求中的配置参数写入所述内存中。When the configuration parameter refresh request includes a key name and a key value of the configuration parameter to be updated, the configuration parameter refresh interface acquires a key name and a key value of a configuration parameter corresponding to the configuration parameter refresh request, and deletes the memory. In the configuration parameter corresponding to the key name, the configuration parameter that is acquired by the configuration includes: deleting a configuration parameter in the memory corresponding to the key name in the configuration parameter refresh request, and configuring the configuration parameter refresh request Parameters are written to the memory.
  8. 一种参数配置装置,包括,获取模块和配置参数刷新模块;A parameter configuration device includes: an acquisition module and a configuration parameter refresh module;
    所述获取模块设置为利用配置参数刷新接口获取配置参数刷新请求; The obtaining module is configured to acquire a configuration parameter refresh request by using a configuration parameter refresh interface;
    所述配置参数刷新模块设置为在获取到所述配置参数刷新请求后,利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置信息,以所述与所述配置参数刷新请求对应的配置信息更新内存中的配置信息。The configuration parameter refreshing module is configured to acquire configuration information corresponding to the configuration parameter refresh request by using the configuration parameter refreshing interface, after the configuration parameter refresh request is obtained, to correspond to the configuration parameter refresh request. The configuration information updates the configuration information in memory.
  9. 如权利要求8所述的参数配置装置,其中,所述配置信息包括程序启动或运行时需要使用的配置信息。The parameter configuration apparatus according to claim 8, wherein said configuration information includes configuration information that is required to be used when the program is started or run.
  10. 如权利要求8所述的参数配置装置,其中,还包括:安全认证模块,设置为在所述配置参数刷新模块获取与所述配置参数刷新请求对应的配置信息前,根据所述配置参数刷新请求的发送方的身份对所述配置参数刷新请求进行安全认证;若安全认证通过,则配置参数刷新模块获取与所述配置参数刷新请求对应的配置信息,否,则不获取。The parameter configuration device according to claim 8, further comprising: a security authentication module, configured to refresh the request according to the configuration parameter before the configuration parameter refreshing module acquires configuration information corresponding to the configuration parameter refresh request The identity of the sender is used to perform security authentication on the configuration parameter refresh request. If the security authentication is passed, the configuration parameter refreshing module obtains configuration information corresponding to the configuration parameter refresh request, and if not, does not acquire.
  11. 如权利要求8所述的参数配置装置,其中,所述配置参数刷新接口包括:独立于实现配置参数刷新服务的硬件平台、操作系统和编程语言的接口。The parameter configuration apparatus of claim 8, wherein the configuration parameter refresh interface comprises an interface independent of a hardware platform, an operating system, and a programming language that implements the configuration parameter refresh service.
  12. 如权利要求11所述的参数配置装置,其中,所述配置参数刷新接口具体包括:表述性状态传递接口或网络服务接口。The parameter configuration device of claim 11, wherein the configuration parameter refresh interface comprises: a representational state delivery interface or a network service interface.
  13. 如权利要求8-12任一项所述的参数配置装置,其中,所述配置信息包括配置参数的键名和键值,所述配置参数刷新模块设置为在获取到所述配置参数刷新请求后,利用所述配置参数刷新接口获取与所述配置参数刷新请求对应的配置参数的键名和键值,删除内存中对应于所述键名的配置参数,写入获取的配置参数。The parameter configuration device according to any one of claims 8 to 12, wherein the configuration information includes a key name and a key value of a configuration parameter, and the configuration parameter refreshing module is configured to: after obtaining the configuration parameter refresh request, And obtaining, by using the configuration parameter refreshing interface, a key name and a key value of the configuration parameter corresponding to the configuration parameter refresh request, deleting a configuration parameter corresponding to the key name in the memory, and writing the acquired configuration parameter.
  14. 如权利要求13所述的参数配置装置,其中,所述获取模块获取的配置参数刷新请求包括:不包含配置参数的请求;或者,包含待更新的配置参数的键名的请求;或者,包含待更新的配置参数的键 名与键值的请求;The parameter configuration device according to claim 13, wherein the configuration parameter refresh request acquired by the obtaining module comprises: a request that does not include a configuration parameter; or a request that includes a key name of a configuration parameter to be updated; or Updated configuration parameter key a request with a name and a key value;
    所述配置参数刷新模块包括第一刷新子模块或第二刷新子模块或第三刷新子模块;The configuration parameter refreshing module includes a first refresh submodule or a second refresh submodule or a third refresh submodule;
    所述第一刷新子模块设置为,当所述配置参数刷新请求不包含配置参数时,利用所述配置参数刷新接口获取存储于原始存储介质中的配置参数的键名和键值,删除内存中的配置参数的键名和键值,写入获取的配置参数的键值和键名;The first refresh sub-module is configured to: when the configuration parameter refresh request does not include the configuration parameter, use the configuration parameter refresh interface to obtain a key name and a key value of a configuration parameter stored in the original storage medium, and delete the in-memory The key name and key value of the configuration parameter, and the key value and key name of the obtained configuration parameter are written;
    所述第二刷新子模块设置为,当所述配置参数刷新请求包含待更新的配置参数的键名时,利用所述配置参数刷新接口从原始存储介质中,获取与所述配置参数刷新请求中的所述键名对应的键值,删除内存中与所述配置参数刷新请求中的所述键名对应的配置参数,写入获取的配置参数的键名和键值;The second refresh sub-module is configured to: when the configuration parameter refresh request includes a key name of the configuration parameter to be updated, use the configuration parameter refresh interface to obtain the configuration parameter refresh request from the original storage medium. The key value corresponding to the key name, deleting the configuration parameter corresponding to the key name in the configuration parameter refresh request in the memory, and writing the key name and the key value of the obtained configuration parameter;
    所述第三刷新子模块设置为,当所述配置参数刷新请求包含待更新的配置参数的键名与键值时,删除内存中与所述配置参数刷新请求中的所述键名对应的配置参数,将所述配置参数刷新请求中的配置参数写入所述内存中。 The third refresh submodule is configured to: when the configuration parameter refresh request includes a key name and a key value of the configuration parameter to be updated, delete a configuration in the memory corresponding to the key name in the configuration parameter refresh request a parameter that writes the configuration parameter in the configuration parameter refresh request into the memory.
PCT/CN2017/080609 2016-05-09 2017-04-14 Parameter configuration method and device WO2017193765A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610303756.2A CN107357598A (en) 2016-05-09 2016-05-09 One parameter configuration method and device
CN201610303756.2 2016-05-09

Publications (1)

Publication Number Publication Date
WO2017193765A1 true WO2017193765A1 (en) 2017-11-16

Family

ID=60267200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/080609 WO2017193765A1 (en) 2016-05-09 2017-04-14 Parameter configuration method and device

Country Status (2)

Country Link
CN (1) CN107357598A (en)
WO (1) WO2017193765A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196764A (en) * 2017-11-30 2018-06-22 银联商务股份有限公司 Application architecture dispositions method, device, system and cloud platform
CN108228300B (en) * 2018-01-02 2021-03-16 武汉斗鱼网络科技有限公司 Method and device for controlling real-time refreshing of content
CN108984219B (en) * 2018-08-29 2021-03-26 迈普通信技术股份有限公司 Memory parameter configuration method and electronic equipment
CN109614139A (en) * 2018-12-13 2019-04-12 浪潮(北京)电子信息产业有限公司 A kind of system service configuration method, device, equipment and medium
CN110187928A (en) * 2019-04-25 2019-08-30 平安科技(深圳)有限公司 Method, apparatus, equipment and the storage medium that JAVA cluster configuration item comes into force in real time
CN114003295B (en) * 2021-10-15 2023-08-25 苏州浪潮智能科技有限公司 Method, system and device for setting memory parameters
CN116155730A (en) * 2022-09-26 2023-05-23 马上消费金融股份有限公司 Configuration updating method and device, electronic equipment and computer readable storage medium
CN115941779B (en) * 2022-11-17 2024-04-19 中国平安人寿保险股份有限公司 Interface management method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120047118A1 (en) * 2010-08-20 2012-02-23 Hon Hai Precision Industry Co., Ltd. Network device and method for updating data of the network device
CN103186401A (en) * 2011-12-31 2013-07-03 北京新媒传信科技有限公司 Method for updating software system and configuration thereof
CN103777969A (en) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 Server parameter deploying method and device with no need for restarting
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100371900C (en) * 2006-01-19 2008-02-27 华为技术有限公司 Method and system for synchronizing data
RU2629441C2 (en) * 2012-10-19 2017-08-29 Халлибертон Энерджи Сервисез, Инк. Device for self-determination of configuration, and also corresponding method and system
CN105511913B (en) * 2015-11-30 2019-03-29 联想(北京)有限公司 Method for parameter configuration and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120047118A1 (en) * 2010-08-20 2012-02-23 Hon Hai Precision Industry Co., Ltd. Network device and method for updating data of the network device
CN103186401A (en) * 2011-12-31 2013-07-03 北京新媒传信科技有限公司 Method for updating software system and configuration thereof
CN103777969A (en) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 Server parameter deploying method and device with no need for restarting
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation

Also Published As

Publication number Publication date
CN107357598A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
WO2017193765A1 (en) Parameter configuration method and device
US10911518B2 (en) Network folder synchronization
US10387383B2 (en) Systems and methods for providing access to a data file stored at a data storage system
KR102313476B1 (en) System and method for providing an end-to-end lifecycle in a multitenant application server environment
US9165031B2 (en) Retrieving stored data using a web service
US10819701B2 (en) Autonomous secrets management for a managed service identity
US9116728B2 (en) Providing a persona-based application experience
US20150370505A1 (en) Performing Online Data Migration With Concurrent Active User Access to the Data
WO2017054543A1 (en) Method and device for accessing resource of cloud storage
US10691790B2 (en) Autonomous secrets management for a temporary shared access signature service
US8578460B2 (en) Automating cloud service reconnections
US20160048377A1 (en) System and method for controlling the on and off state of features ofe business logic at runtime
CN103514298A (en) Method for achieving file lock and metadata server
WO2020001162A1 (en) Container management method, apparatus, and device
US11500812B2 (en) Intermediate file processing method, client, server, and system
TWI640885B (en) Data uniqueness control method, information storage method and device
WO2016023372A1 (en) Data storage processing method and device
US20150379296A1 (en) Large Scale Network System Upgrade
WO2023197862A1 (en) Mirror image management methods, apparatus, server, terminal, and storage medium
CN114928620B (en) User information synchronization method, apparatus, device, storage medium, and program product
US11683161B2 (en) Managing encryption keys under group-level encryption
CN107194238B (en) Method and device for managing access authority and computer readable storage medium
US10713121B1 (en) Dynamic migration of a cloud based distributed file system metadata server
US20240193146A1 (en) Serverless code service
US11853560B2 (en) Conditional role decision based on source environments

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17795383

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17795383

Country of ref document: EP

Kind code of ref document: A1