Movatterモバイル変換


[0]ホーム

URL:


CN111538542A - System configuration method and related device - Google Patents

System configuration method and related device
Download PDF

Info

Publication number
CN111538542A
CN111538542ACN202010212322.8ACN202010212322ACN111538542ACN 111538542 ACN111538542 ACN 111538542ACN 202010212322 ACN202010212322 ACN 202010212322ACN 111538542 ACN111538542 ACN 111538542A
Authority
CN
China
Prior art keywords
configuration
information
component
environment
environment information
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010212322.8A
Other languages
Chinese (zh)
Other versions
CN111538542B (en
Inventor
庄家杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
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 Ping An Life Insurance Company of China LtdfiledCriticalPing An Life Insurance Company of China Ltd
Priority to CN202010212322.8ApriorityCriticalpatent/CN111538542B/en
Publication of CN111538542ApublicationCriticalpatent/CN111538542A/en
Application grantedgrantedCritical
Publication of CN111538542BpublicationCriticalpatent/CN111538542B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application provides a system configuration method, wherein codes of the system comprise preset configuration files, and the method comprises the following steps: receiving a configuration request of a terminal, wherein the configuration request carries component information of a component to be configured in at least one component and second environment information of the component to be configured, and the second environment information is used for indicating the operating environment of the component to be configured in the terminal; analyzing the configuration file to obtain first environment information and configuration information; determining target environment information matched with the component to be configured in the first environment information according to the component information; comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information; and sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information. According to the technical scheme of the embodiment of the application, the efficiency of configuring the system is improved.

Description

System configuration method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a system configuration method and a related apparatus.
Background
In the field of back-end development, in order to ensure that the system can normally operate, the operating environment of the system needs to be configured, and therefore, configuration items are indispensable elements of the system. As systems grow larger and split into multiple independent service components, the variety and number of configuration items also tend to grow rapidly.
At present, the configuration of a plurality of components of a system is often manual configuration, and when the system runs at a terminal, the configuration needs to be manually performed according to the running environment of each component. When the operating environment of the component changes, the manual reconfiguration is needed each time, and the latest configuration of the operating environment of the component is maintained, so that the normal operation of the system is ensured. When the number of components in the system is large, the configuration speed is slow due to manual configuration, and there is a possibility that a configuration error occurs, and reconfiguration is required, which results in low efficiency in configuring the system.
Disclosure of Invention
The embodiment of the application provides a system configuration method and a related device, and the efficiency of configuring the system is improved.
A first aspect of the present application provides a method for configuring a system, where the system includes at least one component, and the code of the system includes a preset configuration file, where the configuration file includes first environment information supporting operation of the system and configuration information configuring an operating environment of the system, and the method includes:
receiving a configuration request of a terminal, wherein the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured, and the second environment information is used for indicating an operating environment of the component to be configured in the terminal;
analyzing the configuration file to obtain the first environment information and the configuration information;
determining target environment information matched with the component to be configured in the first environment information according to the component information;
comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information;
and sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information.
A second aspect of the present application provides a system configuration apparatus, the system including at least one component, the code of the system including a preset configuration file, the configuration file including first environment information supporting operation of the system and configuration information configuring an operation environment of the system, the apparatus including:
a receiving unit, configured to receive a configuration request of a terminal, where the configuration request carries component information of a component to be configured in the at least one component and current second environment information of the component to be configured, where the second environment information is used to indicate an operating environment of the component to be configured in the terminal;
the analysis unit is used for analyzing the configuration file to obtain the first environment information and the configuration information;
the first determining unit is used for determining target environment information matched with the component to be configured in the first environment information according to the component information;
the second determining unit is used for comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information;
a sending unit, configured to send a configuration instruction carrying the target configuration information to the terminal, where the configuration instruction is used to instruct the terminal to configure the operating environment of the component to be configured according to the target configuration information.
A third aspect of the present application provides an electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps of the method of any of the first aspects of the present application.
A fourth aspect of the present application provides a computer readable storage medium having a computer program stored thereon for execution by a processor to perform some or all of the steps described in any of the methods of the first aspect of the present application.
It can be seen that, by the system configuration method and the related apparatus provided by the present application, the system includes at least one component, the code of the system includes a preset configuration file, and the configuration file includes first environment information supporting the operation of the system and configuration information configuring an operating environment of the system. When the system runs at a terminal, receiving a configuration request of the terminal, wherein the configuration request carries component information of a component to be configured and second environment information of the component to be configured, and the second environment information is used for indicating a running environment of the component to be configured at the terminal. Secondly, the configuration file is analyzed to obtain first environment information and configuration information. And secondly, determining target environment information matched with the component to be configured in the first environment information according to the component information. And secondly, comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information. And finally, sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information. Therefore, the configuration file is maintained in the code of the system in advance, and when the system runs at a terminal, the configuration file can be automatically analyzed to configure the running environment of the component to be configured of the system. When the running environment of the component to be configured changes, the current environment information of the component to be configured can be obtained, and then the configuration information for configuring the current running environment of the component to be configured is determined according to the configuration file, so that the latest configuration of the running environment of the component to be configured is maintained, the configuration speed is high, and the efficiency of configuring the system is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a system architecture diagram of a system configuration according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a system configuration method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of another system configuration method according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a process of determining whether a configuration request meets a preset rule according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a determination of difference information between second environment information and target environment information according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a system configuration apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present application.
Detailed Description
The system configuration method and the related device provided by the embodiment of the application improve the efficiency of configuring the system.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The following describes embodiments of the present application in detail.
Referring first to fig. 1, fig. 1 is a schematic system architecture diagram of a system configuration according to an embodiment of the present application. As shown in fig. 1, a system architecture of a system configuration includes a terminal 101 and a configuration management platform 102.
The terminal 101 may be a mobile phone, a tablet computer, a palm computer, a mobile internet device, or other types of terminals, and a user may log in the configuration management platform 102 through the terminal 101. When the terminal 101 runs, the system can configure the running environment of the system through the configuration management platform 102. Wherein the system comprises at least one component and the code of the system comprises a preset configuration file. The configuration management platform 102 is a web application, and includes a front-end part and a back-end part, wherein the front-end part is used for displaying an interactive interface on a browser and receiving a configuration request sent by a user through the terminal 101. Specifically, when a user logs in the configuration management platform 102, the user opens a browser, enters an interactive interface of the configuration management platform 102, can select a component to be configured in at least one component on the interactive interface, and then sends a configuration request.
Optionally, the configuration management platform 102 may also interface with a user management system, wherein the user management system is used for login authentication of a user. Specifically, when a user logs in the configuration management platform 102, a browser is opened, and a user name and a password of the user are input. The configuration management platform 102 sends the user name and the password to the user management system for authentication, and after the authentication is passed, the user is allowed to successfully log in the configuration management platform 102.
Specifically, when the terminal 101 runs, a user logs in the configuration management platform 102 through the terminal 101, the system includes at least one component, the code of the system includes a preset configuration file, and the configuration file includes first environment information supporting the system to run and configuration information configuring a running environment of the system. The configuration management platform 102 receives a configuration request of the terminal 101, where the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured, where the second environment information is used to indicate an operating environment of the component to be configured in the terminal 101; the configuration management platform 102 analyzes the configuration file to obtain the first environment information and the configuration information; the configuration management platform 102 determines target environment information matched with the component to be configured in the first environment information according to the component information; the configuration management platform 102 compares the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information; the configuration management platform 102 sends a configuration instruction carrying the target configuration information to the terminal 101, where the configuration instruction is used to instruct the terminal 101 to configure the operating environment of the component to be configured according to the target configuration information.
It can be seen that a configuration file is maintained in the code of the system in advance, and the configuration file comprises first environment information supporting the operation of the system and configuration information configuring the operation environment of the system. When the system runs at the terminal, the configuration management platform receives the configuration request of the terminal, and then the configuration management platform can automatically analyze the configuration file to obtain the configuration information, so that the running environment of the component to be configured of the system is configured. And when the running environment of the component to be configured changes, the configuration management platform can acquire the current environment information of the component to be configured and then determine the configuration information for configuring the current running environment of the component to be configured, so that the latest configuration of the running environment of the component to be configured is maintained, the configuration speed is high, and the efficiency of configuring the system is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a system configuration method according to an embodiment of the present application, where the system includes at least one component, and a code of the system includes a preset configuration file, where the configuration file includes first environment information supporting operation of the system and configuration information configuring an operating environment of the system. As shown in fig. 2, the system configuration method provided in this embodiment may include:
201. receiving a configuration request of a terminal, wherein the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured.
And the second environment information is used for indicating the operation environment of the component to be configured at the terminal.
Specifically, a user logs in the configuration management platform through a terminal, where the terminal may be a mobile phone, a tablet computer, a palm computer, a mobile internet device, or another type of terminal. The configuration management platform is a web application and comprises a front-end part and a back-end part, wherein the front-end part is used for displaying an interactive interface on a browser and receiving a configuration request sent by a user through a terminal. Specifically, when a user logs in the configuration management platform, the user opens a browser, enters an interactive interface of the configuration management platform, can select a component to be configured in at least one component on the interactive interface, and then sends a configuration request.
In one possible example, the configuration management platform may also interface with a user management system, where the user management system is used for login authentication of a user. Specifically, when a user logs in the configuration management platform, the browser is opened, and the user name and the password of the user are input. And the configuration management platform sends the user name and the password to the user management system for authentication, and the user is allowed to successfully log in the configuration management platform after the authentication is passed.
When the system runs at the terminal, the running environment of the system can be configured through the configuration management platform. The system comprises at least one component, and the code of the system comprises a preset configuration file, wherein the configuration file comprises first environment information supporting the operation of the system and configuration information configuring the operation environment of the system. The first environment information comprises environment information supporting the operation of all components in the system, and the configuration information is used for indicating the configuration of the current operation environment of all components in the system to ensure that the system can operate normally.
In one possible example, the configuration file is maintained in the code of the system in advance. When the configuration file is maintained, the configuration file is ensured to be consistent with the code version of the system, namely, each version of the code has a separate configuration file. In each version of configuration file, for a component of which the code is not updated, the environment information and the configuration information corresponding to the component can be multiplexed, so that the code writing amount of the configuration file can be reduced. Moreover, a version tool, such as Git and the like, is used for recording the configuration file of each version so as to ensure the tracing of the configuration file, the condition of confusion or conflict caused by excessive versions is avoided, and a correct format is provided for the subsequent unified configuration file.
A user logs in a configuration management platform, enters an interactive interface, can select a component to be configured in at least one component on the interactive interface, and then sends a configuration request. And the configuration management platform receives a configuration request of the terminal, wherein the configuration request carries the component information of the component to be configured and the second environment information of the component to be configured. Wherein the component information is used to distinguish between different components as the system comprises at least one component. After the component to be configured is determined, the terminal automatically identifies current second environment information of the component to be configured, the second environment information includes main environment information and sub-environment information, the main environment can be a development environment, a test environment or a production environment, for example, and the sub-environment is a specific environment in the main environment.
202. And analyzing the configuration file to obtain the first environment information and the configuration information.
Specifically, the configuration management platform receives the configuration request, and obtains component information of the component to be configured and second environment information of the component to be configured, which are carried by the configuration request. The configuration management platform analyzes the configuration file to obtain the first environment information and the configuration information.
In one possible example, before parsing the configuration file, the configuration management platform determines whether the received configuration request conforms to a preset rule; if the configuration request conforms to the preset rule, the configuration management platform acquires component information and second environment information carried by the configuration request, and analyzes the configuration file; and if the configuration request does not accord with the preset rule, the configuration management platform sends a configuration failure message to the terminal, wherein the configuration failure message is used for prompting the terminal to resend the configuration request.
Specifically, after receiving the configuration request, the configuration management platform first determines whether the configuration request meets a preset rule. If the configuration request conforms to the preset rule, the configuration management platform can acquire the information carried by the configuration request; if the configuration request does not conform to the preset rule, the configuration management platform cannot acquire information carried by the configuration request, and further needs to send a configuration failure message to the terminal, where the configuration failure message carries a specific configuration failure reason, for example, a component to be configured is not selected, and the configuration failure message is used to prompt the terminal to resend the configuration request. For example, when the terminal receives the configuration failure message, a popup window or an interface is generated, a specific configuration failure reason is displayed on the generated popup window or interface, and a configuration request is prompted to be resubmitted.
Based on the foregoing example, in a possible example, the configuration request further carries identification information of the terminal, and the determining, by the configuration management platform, whether the configuration request meets the preset rule includes: judging whether the identification information of the terminal passes the verification, if not, determining that the configuration request does not conform to the preset rule; if the identification information of the terminal passes the verification, acquiring at least one parameter in the configuration request, judging whether a null parameter exists in the at least one parameter, and if the null parameter exists in the at least one parameter, determining that the configuration request does not conform to a preset rule; if the at least one parameter does not have the empty parameter, acquiring the format of each parameter in the at least one parameter, checking the format of each parameter in the at least one parameter, and if the at least one parameter has the parameter with the wrong format, determining that the configuration request does not conform to the preset rule; and if the at least one parameter has no parameter with a format error, determining that the configuration request conforms to a preset rule.
Specifically, the configuration request carries identification information of the terminal, and the configuration management platform judges whether the identification information of the terminal passes verification. For example, token verification is adopted, a user sends a login request to a configuration management platform through a user name and a password, the configuration management platform verifies the login request, and a signed token is returned to the terminal. And the terminal receives and stores the token, and the identification information of the terminal is the token. When the terminal sends a configuration request to the configuration management platform, the token is carried in the configuration request, the configuration management platform obtains the token and carries out verification, if the verification is not passed, the configuration request is determined not to be in accordance with the preset rule, and the configuration management platform cannot return data.
And if the token carried by the configuration request passes the verification, the configuration management platform performs parameter non-empty verification on the configuration request. Specifically, the configuration management platform obtains at least one parameter in the configuration request, where the at least one parameter is, for example, a required parameter, then determines whether there is an empty parameter in the at least one parameter, and if there is an empty parameter in the at least one parameter, it is determined that the configuration request does not conform to a preset rule, and the configuration management platform cannot accurately obtain information carried by the configuration request.
And if the at least one parameter does not have the empty parameter, the configuration management platform performs format verification on the configuration request. Specifically, the configuration management platform obtains a format of each parameter in the at least one parameter, then, the format of each parameter is verified, and if a parameter with a wrong format exists in the at least one parameter, it is determined that the configuration request does not conform to a preset rule, and the configuration management platform cannot accurately analyze information carried by the configuration request.
If the at least one parameter does not have a parameter with a wrong format, determining that the configuration request conforms to a preset rule, acquiring component information and second environment information carried by the configuration request by the configuration management platform, and analyzing a configuration file by the configuration management platform to obtain first environment information and configuration information.
203. And determining target environment information matched with the component to be configured in the first environment information according to the component information.
Wherein the first environment information comprises environment information supporting the operation of all components in the system.
After obtaining the component information of the component to be configured, the configuration management platform may determine target environment information in the first environment information according to the component information, where the target environment information is environment information supporting operation of the component to be configured.
204. And comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information.
The second environment information indicates an operation environment of the component to be configured at the terminal, that is, the second environment information is current environment information of the component to be configured, and the target environment information is environment information supporting operation of the component to be configured. The configuration information is used for indicating the configuration of the current operating environment of all the components in the system so as to ensure that the system can operate normally.
The configuration management platform compares the second environment information with the target environment information, can determine the difference between the current environment of the component to be configured and the environment supporting the operation of the component to be configured, and can then determine the target configuration information matched with the component to be configured in the configuration information. The target configuration information is used for configuring the current environment of the component to be configured, so that the current environment of the component to be configured can support the running of the component to be configured.
205. And sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information.
And after determining the target configuration information, the configuration management platform sends a configuration instruction to the terminal, wherein the configuration instruction carries the target configuration information. The terminal receives the configuration instruction, acquires the target configuration information carried by the configuration instruction, and then configures the operating environment of the component to be configured according to the target configuration information, so that the operating environment of the component to be configured can support the component to be configured to operate.
When other components of the system are configured, the steps are repeated, and the other components of the system can be configured, so that the latest configuration of the system operation environment is maintained, and the normal operation of the system is ensured.
It can be seen that, with the system configuration method provided by the present application, when a system runs on a terminal, a configuration request of the terminal is received, where the configuration request carries component information of a component to be configured and second environment information of the component to be configured, where the second environment information is used to indicate an operating environment of the component to be configured on the terminal. Secondly, the configuration file is analyzed to obtain first environment information and configuration information. And secondly, determining target environment information matched with the component to be configured in the first environment information according to the component information. And secondly, comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information. And finally, sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information. Therefore, the configuration file is maintained in the code of the system in advance, and when the system runs at a terminal, the configuration file can be automatically analyzed to configure the running environment of the component to be configured of the system. When the running environment of the component to be configured changes, the current environment information of the component to be configured can be obtained, and then the configuration information for configuring the current running environment of the component to be configured is determined according to the configuration file, so that the latest configuration of the running environment of the component to be configured is maintained, the configuration speed is high, and the efficiency of configuring the system is improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating another system configuration method according to an embodiment of the present application, where the system includes at least one component, and a code of the system includes a preset configuration file, where the configuration file includes first environment information that supports operation of the system and configuration information that configures an operating environment of the system. As shown in fig. 3, another system configuration method provided in this embodiment may include:
301. and the user logs in the configuration management platform through the terminal.
Specifically, a user logs in the configuration management platform through a terminal, where the terminal may be a mobile phone, a tablet computer, a palm computer, a mobile internet device, or another type of terminal. The configuration management platform is a web application and comprises a front-end part and a back-end part, wherein the front-end part is used for displaying an interactive interface on a browser and receiving a configuration request sent by a user through a terminal.
In one possible example, the configuration management platform may also interface with a user management system, where the user management system is used for login authentication of a user. Specifically, when a user logs in the configuration management platform, the browser is opened, and the user name and the password of the user are input. And the configuration management platform sends the user name and the password to the user management system for authentication, and the user is allowed to successfully log in the configuration management platform after the authentication is passed.
302. And the configuration management platform receives the configuration request of the terminal.
When the system runs at the terminal, the running environment of the system can be configured through the configuration management platform. The system comprises at least one component, and the code of the system comprises a preset configuration file, wherein the configuration file comprises first environment information supporting the operation of the system and configuration information configuring the operation environment of the system. The first environment information comprises environment information supporting the operation of all components in the system, and the configuration information is used for indicating the configuration of the current operation environment of all components in the system to ensure that the system can operate normally.
Specifically, a configuration file is maintained in the code of the system in advance. When the configuration file is maintained, the configuration file is ensured to be consistent with the code version of the system, namely, each version of the code has a separate configuration file. In each version of configuration file, for a component of which the code is not updated, the environment information and the configuration information corresponding to the component can be multiplexed, so that the code writing amount of the configuration file can be reduced. Moreover, a version tool, such as Git and the like, is used for recording the configuration file of each version so as to ensure the tracing of the configuration file, the condition of confusion or conflict caused by excessive versions is avoided, and a correct format is provided for the subsequent unified configuration file.
A user logs in a configuration management platform, enters an interactive interface, can select a component to be configured in at least one component on the interactive interface, and then sends a configuration request. The configuration management platform receives a configuration request of a terminal, wherein the configuration request carries component information of the component to be configured and second environment information of the component to be configured, and the second environment information is used for indicating the running environment of the component to be configured at the terminal. Wherein the component information is used to distinguish between different components as the system comprises at least one component. After the component to be configured is determined, the terminal automatically identifies current second environment information of the component to be configured, the second environment information includes main environment information and sub-environment information, the main environment can be a development environment, a test environment or a production environment, for example, and the sub-environment is a specific environment in the main environment.
303. The configuration management platform judges whether the configuration request conforms to a preset rule.
After receiving the configuration request, the configuration management platform first determines whether the configuration request meets a preset rule. If the configuration request conforms to the preset rule, the configuration management platform can acquire the information carried by the configuration request; if the configuration request does not conform to the preset rule, the configuration management platform cannot acquire the information carried by the configuration request.
Wherein, the configuration request carries the identification information of the terminal, and the step of judging whether the configuration request accords with the preset rule by the configuration management platform comprises the following steps: judging whether the identification information of the terminal passes the verification, if not, determining that the configuration request does not conform to the preset rule; if the identification information of the terminal passes the verification, acquiring at least one parameter in the configuration request, judging whether a null parameter exists in the at least one parameter, and if the null parameter exists in the at least one parameter, determining that the configuration request does not conform to a preset rule; if the at least one parameter does not have the empty parameter, acquiring the format of each parameter in the at least one parameter, checking the format of each parameter in the at least one parameter, and if the at least one parameter has the parameter with the wrong format, determining that the configuration request does not conform to the preset rule; and if the at least one parameter has no parameter with a format error, determining that the configuration request conforms to a preset rule.
Specifically, the configuration request carries identification information of the terminal, and the configuration management platform judges whether the identification information of the terminal passes verification. For example, token verification is adopted, a user sends a login request to a configuration management platform through a user name and a password, the configuration management platform verifies the login request, and a signed token is returned to the terminal. And the terminal receives and stores the token, and the identification information of the terminal is the token. When the terminal sends a configuration request to the configuration management platform, the token is carried in the configuration request, the configuration management platform obtains the token and carries out verification, if the verification is not passed, the configuration request is determined not to be in accordance with the preset rule, and the configuration management platform cannot return data.
And if the token carried by the configuration request passes the verification, the configuration management platform performs parameter non-empty verification on the configuration request. Specifically, the configuration management platform obtains at least one parameter in the configuration request, where the at least one parameter is, for example, a required parameter, then determines whether there is an empty parameter in the at least one parameter, and if there is an empty parameter in the at least one parameter, it is determined that the configuration request does not conform to a preset rule, and the configuration management platform cannot accurately obtain information carried by the configuration request.
And if the at least one parameter does not have the empty parameter, the configuration management platform performs format verification on the configuration request. Specifically, the configuration management platform obtains a format of each parameter in the at least one parameter, then, the format of each parameter is verified, and if a parameter with a wrong format exists in the at least one parameter, it is determined that the configuration request does not conform to a preset rule, and the configuration management platform cannot accurately analyze information carried by the configuration request.
And if the at least one parameter does not have the parameter with the format error, determining that the configuration request conforms to a preset rule.
304. If the configuration request does not conform to the preset rule, the configuration management platform sends a configuration failure message to the terminal.
If the configuration request does not conform to the preset rule, the configuration management platform cannot acquire information carried by the configuration request, and further needs to send a configuration failure message to the terminal, where the configuration failure message carries a specific configuration failure reason, for example, a component to be configured is not selected, and the configuration failure message is used to prompt the terminal to resend the configuration request. For example, when the terminal receives the configuration failure message, a popup window or an interface is generated, a specific configuration failure reason is displayed on the generated popup window or interface, and a configuration request is prompted to be resubmitted.
305. And if the configuration request conforms to the preset rule, the configuration management platform acquires the component information of the component to be configured and the second environment information of the component to be configured, which are carried by the configuration request.
The component information is used for distinguishing the component to be configured, and the second environment information is the current environment information of the component to be configured.
306. And the configuration management platform analyzes the configuration file to obtain first environment information and configuration information.
The configuration file comprises a json file, and the analyzing of the configuration file by the configuration management platform to obtain the first environment information and the configuration information comprises: performing deserialization processing on the json file to obtain at least one object; acquiring the attribute of each object in the at least one object, and determining the first environment information according to the attribute of each object, wherein the first environment information comprises environment information supporting the operation of each component in the at least one component; and acquiring a configuration item in each object, and determining the configuration information according to the configuration item in each object, wherein the configuration information is used for configuring the operating environment of each component in the at least one component.
Specifically, the configuration file is a json file, that is, the json file is maintained in the code of the system in advance. And the configuration management platform carries out deserialization processing on the json file to obtain at least one object. The attributes of the objects respectively identify environment information supporting system operation, for example, the environment supporting system operation may be a development environment, a test environment, or a production environment, and the first environment information may be determined according to the attributes of the objects. And, the configuration management platform acquires the configuration items in the object, thereby determining configuration information, which includes a plurality of configuration operations, such as add (add), update (update), delete (delete), release (release), and the like.
In a possible example, the configuration information includes a plurality of configuration operations, and after determining the configuration information, the configuration management platform further includes: the method comprises the steps that a configuration management platform obtains an operation type corresponding to each configuration operation in a plurality of configuration operations; classifying the plurality of configuration operations according to operation types to obtain a first type configuration operation, a second type configuration operation and a third type configuration operation, wherein the operation type corresponding to each configuration operation in the first type configuration operation is an addition type, the operation type corresponding to each configuration operation in the second type configuration operation is a deletion type, and the operation type corresponding to each configuration operation in the third type configuration operation is an update type.
Specifically, the configuration management platform determines configuration information, the configuration information includes a plurality of configuration operations, and the configuration management platform obtains an operation type corresponding to each configuration operation and classifies the plurality of configuration operations according to CRUD. Among them, CRUD refers to initials of several words of addition (create), reading (read), update (update), and deletion (delete) at the time of calculation processing. The configuration management platform classifies the determined configuration operations according to addition (create), deletion (delete) and update (update) to obtain a first type of configuration operation, a second type of configuration operation and a third type of configuration operation. The operation type corresponding to each configuration operation in the first type of configuration operation is an add (create) type, the operation type corresponding to each configuration operation in the second type of configuration operation is a delete (delete) type, and the operation type corresponding to each configuration operation in the third type of configuration operation is an update (update) type.
307. And the configuration management platform determines target environment information matched with the component to be configured in the first environment information according to the component information.
Specifically, the configuration management platform determines the identification information of the component to be configured according to the component information; the configuration management platform determines a target component matched with the identification information of the component to be configured in the at least one component; the configuration management platform determines target environment information supporting the target component to run in the first environment information.
308. And the configuration management platform compares the second environment information with the target environment information to determine the difference information between the second environment information and the target environment information.
The second environment information is the current environment information of the component to be configured, and the target environment information is the environment information supporting the operation of the configuration component.
The configuration management platform compares the second environment information with the target environment information, and can determine the difference between the current environment of the component to be configured and the environment supporting the operation of the component to be configured, that is, determine the difference information between the second environment information and the target environment information.
Wherein the difference information includes at least one of the first information, the second information, and the third information. The first information is information of the second environment information less than the target environment information, the second information is information of the second environment information more than the target environment information, and the third information is information of the second environment information different from the target environment information.
309. The configuration management platform determines target configuration information according to the difference information.
The target configuration information is used for configuring the current environment of the component to be configured, so that the current environment of the component to be configured can support the running of the component to be configured.
Wherein the target configuration information includes at least one of first configuration information, second configuration information, and third configuration information. The first configuration information comprises at least one configuration operation in the first type of configuration operation, and the first configuration information is used for adding first information in the second environment information; the second configuration information comprises at least one configuration operation in a second type of configuration operation, and the second configuration information is used for deleting second information in the second environment information; the third configuration information includes at least one configuration operation of a third class of configuration operations, the third configuration information for updating third information in the second environment information.
310. And the configuration management platform sends a configuration instruction carrying the target configuration information to the terminal.
311. And the terminal configures the operating environment of the component to be configured according to the target configuration information.
Specifically, the terminal receives the configuration instruction, acquires the target configuration information carried by the configuration instruction, and then configures the operating environment of the component to be configured according to the target configuration information, so that the operating environment of the component to be configured can support the component to be configured to operate.
When other components of the system are configured, the steps are repeated, and the other components of the system can be configured, so that the latest configuration of the system operation environment is maintained, and the normal operation of the system is ensured.
It can be seen that, by the system configuration method provided by the present application, the configuration file is maintained in the code of the system in advance, and when the system runs at the terminal, the configuration file can be automatically analyzed to configure the running environment of the component to be configured of the system. When the running environment of the component to be configured changes, the current environment information of the component to be configured can be obtained, and then the configuration information for configuring the current running environment of the component to be configured is determined according to the configuration file, so that the latest configuration of the running environment of the component to be configured is maintained, the configuration speed is high, and the efficiency of configuring the system is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a process of determining whether a configuration request meets a preset rule according to an embodiment of the present application. As shown in fig. 4, where the configuration request carries identification information of a terminal, and the determining, by the configuration management platform, whether the configuration request meets a preset rule includes: judging whether the identification information of the terminal passes the verification, if not, determining that the configuration request does not conform to the preset rule; if the identification information of the terminal passes the verification, acquiring at least one parameter in the configuration request, judging whether a null parameter exists in the at least one parameter, and if the null parameter exists in the at least one parameter, determining that the configuration request does not conform to a preset rule; if the at least one parameter does not have the empty parameter, acquiring the format of each parameter in the at least one parameter, checking the format of each parameter in the at least one parameter, and if the at least one parameter has the parameter with the wrong format, determining that the configuration request does not conform to the preset rule; and if the at least one parameter has no parameter with a format error, determining that the configuration request conforms to a preset rule.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating determining difference information between second environment information and target environment information according to an embodiment of the present application. As shown in fig. 5, the second environment information includes three pieces of information, which are AAA, BB, and CCC, respectively, the target environment information includes three pieces of information, which are BBB, CCC, and DDD, respectively, information included in the second environment information and the target environment information shown in fig. 5 is only an example, and may also include other information, and information included in the second environment information and the target environment information shown in fig. 5 is only an illustration, and may be other information. Comparing the second environment information with the target environment information, it can be seen that the DDD information is less in the second environment information than the target environment information, the AAA information is more in the second environment information than the target environment information, and BB information different from the target environment information exists in the second environment information, so that difference information can be determined, the difference information including the first information (DDD), the second information (AAA), and the third information (BB).
Referring to fig. 6, fig. 6 is a schematic diagram of a system configuration apparatus according to an embodiment of the present application, where the system includes at least one component, and the code of the system includes a preset configuration file, where the configuration file includes first environment information that supports operation of the system and configuration information that configures an operating environment of the system. As shown in fig. 6, a system configuration apparatus provided in an embodiment of the present application may include:
a receivingunit 601, configured to receive a configuration request of a terminal, where the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured, where the second environment information is used to indicate an operating environment of the component to be configured in the terminal;
an analyzingunit 602, configured to analyze the configuration file to obtain the first environment information and the configuration information;
a first determiningunit 603, configured to determine, according to the component information, target environment information that is matched with the component to be configured in the first environment information;
a second determiningunit 604, configured to compare the second environment information with the target environment information, so as to determine target configuration information, which is matched with the component to be configured, in the configuration information;
a sendingunit 605, configured to send a configuration instruction carrying the target configuration information to the terminal, where the configuration instruction is used to instruct the terminal to configure the operating environment of the component to be configured according to the target configuration information.
For specific implementation of the system configuration apparatus in the present application, reference may be made to the embodiments of the system configuration method, which are not described herein again.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present application. As shown in fig. 7, an electronic device of a hardware operating environment according to an embodiment of the present application may include:
aprocessor 701, such as a CPU.
Thememory 702, which may optionally be a high speed RAM memory, may also be a stable memory, such as a disk memory.
Acommunication interface 703 for implementing connection communication between theprocessor 701 and thememory 702.
Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 7, thememory 702 may include an operating system, a network communication module, and a system configuration program. An operating system is a program that manages and controls the hardware and software resources of an electronic device, supporting the operation of system configuration programs and other software or programs. The network communication module is used to enable communication between the components within thememory 702, as well as with other hardware and software in the electronic device.
In the electronic device shown in fig. 7, theprocessor 701 is configured to execute the system configuration program stored in thememory 702, and implement the following steps:
receiving a configuration request of a terminal, wherein the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured, and the second environment information is used for indicating an operating environment of the component to be configured in the terminal;
analyzing the configuration file to obtain the first environment information and the configuration information;
determining target environment information matched with the component to be configured in the first environment information according to the component information;
comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information;
and sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information.
For specific implementation of the electronic device of the present application, reference may be made to various embodiments of the system configuration method, which are not described herein again.
Another embodiment of the present application provides a computer-readable storage medium storing a computer program for execution by a processor to perform the steps of:
receiving a configuration request of a terminal, wherein the configuration request carries component information of a component to be configured in the at least one component and second environment information of the component to be configured, and the second environment information is used for indicating an operating environment of the component to be configured in the terminal;
analyzing the configuration file to obtain the first environment information and the configuration information;
determining target environment information matched with the component to be configured in the first environment information according to the component information;
comparing the second environment information with the target environment information to determine target configuration information matched with the component to be configured in the configuration information;
and sending a configuration instruction carrying the target configuration information to the terminal, wherein the configuration instruction is used for indicating the terminal to configure the operating environment of the component to be configured according to the target configuration information.
For specific implementation of the computer-readable storage medium of the present application, reference may be made to the embodiments of the system configuration method, which are not described herein again.
It is also noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application. In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

determining the target configuration information according to the difference information, where the target configuration information includes at least one of first configuration information, second configuration information, and third configuration information, where the first configuration information includes at least one of the first type of configuration operation, the first configuration information is used to add the first information to the second environment information, the second configuration information includes at least one of the second type of configuration operation, the second configuration information is used to delete the second information from the second environment information, the third configuration information includes at least one of the third type of configuration operation, and the third configuration information is used to update the third information in the second environment information.
CN202010212322.8A2020-03-242020-03-24System configuration method and related deviceActiveCN111538542B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010212322.8ACN111538542B (en)2020-03-242020-03-24System configuration method and related device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010212322.8ACN111538542B (en)2020-03-242020-03-24System configuration method and related device

Publications (2)

Publication NumberPublication Date
CN111538542Atrue CN111538542A (en)2020-08-14
CN111538542B CN111538542B (en)2023-10-24

Family

ID=71978739

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010212322.8AActiveCN111538542B (en)2020-03-242020-03-24System configuration method and related device

Country Status (1)

CountryLink
CN (1)CN111538542B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112817652A (en)*2021-01-222021-05-18平安普惠企业管理有限公司Configuration method and device of computer environment, computer equipment and storage medium
CN114356926A (en)*2021-12-302022-04-15广州趣丸网络科技有限公司Cross-environment flow form configuration method and system
CN115529237A (en)*2022-10-082022-12-27中国农业银行股份有限公司Configuration information loading method, device and equipment
CN119211370A (en)*2024-09-272024-12-27中国民航信息网络股份有限公司 A service flow switching method and related device

Citations (17)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20060037016A1 (en)*2004-07-282006-02-16Oracle International CorporationMethods and systems for modifying nodes in a cluster environment
US20070168965A1 (en)*2005-12-302007-07-19Ingo ZenzConfiguration inheritance in system configuration
CN101221499A (en)*2006-11-292008-07-16Sap股份公司 Method and device for configuring application software
US20100077393A1 (en)*2008-09-222010-03-25Sun Microsystems, Inc.Method and system for automatically generating software and configuring application installation
CN103026337A (en)*2010-05-262013-04-03泰必高软件公司Distillation and reconstruction of provisioning components
US20140281471A1 (en)*2013-03-142014-09-18Majd BakarSystems, methods, and media for managing an entertainment system
CN104320387A (en)*2014-10-112015-01-28广东欧珀移动通信有限公司Local module customizing method, terminal and server
US20150074644A1 (en)*2013-09-102015-03-12Duo Security, Inc.System and method for determining component version compatibility across a device ecosystem
CN104539458A (en)*2014-12-302015-04-22深圳市兰丁科技有限公司Operating environment self-adapting method and device
CN104636165A (en)*2015-02-022015-05-20广东小天才科技有限公司Mobile equipment starting method and device
CN107092502A (en)*2017-03-202017-08-25国家电网公司A kind of application method of automatic configuration and device based on cloud operating system
CN107861863A (en)*2017-08-242018-03-30平安普惠企业管理有限公司Running environment switching method, equipment and computer-readable recording medium
CN107908432A (en)*2017-11-172018-04-13深圳泉眼体育运营管理有限公司Collocation method and device, the terminal device and readable storage medium storing program for executing of application program
CN108762937A (en)*2018-03-132018-11-06Oppo广东移动通信有限公司Configuration information transmitting method, acquisition methods, device and terminal
CN109766121A (en)*2018-12-202019-05-17平安信托有限责任公司Environment profile generation method, device, computer equipment and storage medium
CN109828779A (en)*2018-12-262019-05-31中国平安人寿保险股份有限公司Environment changing method, apparatus, terminal installation and storage medium
CN110263305A (en)*2019-05-222019-09-20中国平安财产保险股份有限公司Configuration file control methods, device, equipment and storage medium

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20060037016A1 (en)*2004-07-282006-02-16Oracle International CorporationMethods and systems for modifying nodes in a cluster environment
US20070168965A1 (en)*2005-12-302007-07-19Ingo ZenzConfiguration inheritance in system configuration
CN101221499A (en)*2006-11-292008-07-16Sap股份公司 Method and device for configuring application software
US20100077393A1 (en)*2008-09-222010-03-25Sun Microsystems, Inc.Method and system for automatically generating software and configuring application installation
CN103026337A (en)*2010-05-262013-04-03泰必高软件公司Distillation and reconstruction of provisioning components
US20140281471A1 (en)*2013-03-142014-09-18Majd BakarSystems, methods, and media for managing an entertainment system
US20150074644A1 (en)*2013-09-102015-03-12Duo Security, Inc.System and method for determining component version compatibility across a device ecosystem
CN104320387A (en)*2014-10-112015-01-28广东欧珀移动通信有限公司Local module customizing method, terminal and server
CN104539458A (en)*2014-12-302015-04-22深圳市兰丁科技有限公司Operating environment self-adapting method and device
CN104636165A (en)*2015-02-022015-05-20广东小天才科技有限公司Mobile equipment starting method and device
CN107092502A (en)*2017-03-202017-08-25国家电网公司A kind of application method of automatic configuration and device based on cloud operating system
CN107861863A (en)*2017-08-242018-03-30平安普惠企业管理有限公司Running environment switching method, equipment and computer-readable recording medium
CN107908432A (en)*2017-11-172018-04-13深圳泉眼体育运营管理有限公司Collocation method and device, the terminal device and readable storage medium storing program for executing of application program
CN108762937A (en)*2018-03-132018-11-06Oppo广东移动通信有限公司Configuration information transmitting method, acquisition methods, device and terminal
CN109766121A (en)*2018-12-202019-05-17平安信托有限责任公司Environment profile generation method, device, computer equipment and storage medium
CN109828779A (en)*2018-12-262019-05-31中国平安人寿保险股份有限公司Environment changing method, apparatus, terminal installation and storage medium
CN110263305A (en)*2019-05-222019-09-20中国平安财产保险股份有限公司Configuration file control methods, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112817652A (en)*2021-01-222021-05-18平安普惠企业管理有限公司Configuration method and device of computer environment, computer equipment and storage medium
CN112817652B (en)*2021-01-222024-05-24北京神州数码云科信息技术有限公司 Computer environment configuration method, device, computer equipment and storage medium
CN114356926A (en)*2021-12-302022-04-15广州趣丸网络科技有限公司Cross-environment flow form configuration method and system
CN115529237A (en)*2022-10-082022-12-27中国农业银行股份有限公司Configuration information loading method, device and equipment
CN119211370A (en)*2024-09-272024-12-27中国民航信息网络股份有限公司 A service flow switching method and related device

Also Published As

Publication numberPublication date
CN111538542B (en)2023-10-24

Similar Documents

PublicationPublication DateTitle
CN111538542B (en)System configuration method and related device
CN109634837B (en)Automatic test method, device, equipment and storage medium
CN109450771B (en)Method and device for adding friends, computer equipment and storage medium
CN107453960B (en)Method, device and system for processing test data in service test
CN111651347B (en)Jump verification method, device, equipment and storage medium of test system
CN113110995A (en)System migration test method and device
CN116644035B (en)File batch warehousing method, device, equipment and storage medium
CN112114866A (en)Data conversion loading method and device of JSON file and storage medium
CN115617780A (en) Data import method, device, equipment and storage medium
CN113419738A (en)Interface document generation method and device and interface management equipment
CN112905451A (en)Automatic testing method and device for application program
CN115525534A (en)Test case generation method and platform based on swagger interface test
CN112698883A (en)Configuration data processing method, device, terminal and storage medium
CN112882937A (en)Test case processing method and device, computer equipment and storage medium
CN116755719A (en)Data processing method, device and data processing system of application component
CN117453265A (en)Resource calling method, device and equipment based on algorithm platform
CN118503075A (en)Test case generation method, device, equipment and medium
WO2023151397A1 (en)Application program deployment method and apparatus, device, and medium
CN115145827A (en)Test method of application program interface and related device
KR101582420B1 (en)Method and apparatus for checking integrity of processing module
CN110704483A (en)User routing process positioning method, device, storage medium and device
CN111427791A (en) A test method, device, electronic device and storage medium
CN111151008A (en)Game operation data verification method, device, configuration background and medium
CN114741274B (en)Abnormality testing method and device
CN113032473B (en) Data interface generation method, device, storage medium and mobile terminal

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp