Service configuration method, device, equipment, medium and program product
By generating configuration pages and generating configuration subpages on the web page, the service configuration process is simplified, the problems of low configuration efficiency and maintenance difficulties in the existing technology are solved, and efficient service configuration and monitoring are achieved.
Patent Information
- Application Number
- CN202411435761.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-07
AI Technical Summary
The existing service configuration method requires professionals to configure, which is inefficient and difficult to maintain, especially script-based configuration is low, which is not conducive to later maintenance.
Provide a service configuration method, by generating configuration pages on the web page, reading and writing configuration information, including detecting the legality of configuration files, generating configuration subpages for updates, loading configuration files using the application program interface, and using the hook program and baseline algorithms to monitor the service operation status.
The service configuration process is simplified, professional capability requirements are reduced, configuration efficiency is improved, service configuration files are managed and maintained, and non-professional personnel are facilitated to configure and monitor.
Smart Images

Figure CN119271243A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of Internet of Things, and more specifically to a service configuration method, apparatus, device, medium and program product. Background Art
[0002] Service configuration refers to configuring the system environment of the server operating system according to the actual needs of the enterprise, so as to achieve the business needs of the enterprise. This process is usually completed by professionals writing configuration scripts and loading them into the operating system that needs to be configured.
[0003] In the process of realizing the concept of the present disclosure, the inventors found that the service configuration method in the related art requires the configuration personnel to have corresponding professional capabilities, and the script-based configuration efficiency is low, which is not conducive to later maintenance. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a service configuration method, apparatus, device, medium and program product.
[0005] According to one aspect of the present disclosure, a service configuration method is provided, comprising: in response to configuration information for a target service having been added to a configuration page on a web page, reading the configuration information, wherein the configuration information includes service configuration parameters of the target service; writing the service configuration parameters into a predefined configuration file template to obtain an intermediate configuration file; in response to determining that a legitimacy check for the intermediate configuration file fails, generating a configuration sub-page on the web page for modifying the configuration information based on information indicating the failure; and in response to update information having been added to the configuration sub-page, writing the update information into the intermediate configuration file according to the configuration file template to obtain a service configuration file for configuring the target service.
[0006] According to an embodiment of the present disclosure, the configuration information includes field class information, the configuration file template includes the field class template, and the field class template includes the template field name; writing the service configuration parameters into the predefined configuration file template includes: in response to detecting that the configuration information is field class information, obtaining the parameter field name for locating the service configuration parameter from the configuration page, the parameter field name and the template field name having a mapping relationship; and writing the service configuration parameter into the field class template as the field value of the template field name having a mapping relationship with the parameter field name of the service configuration parameter.
[0007] According to an embodiment of the present disclosure, generating a configuration sub-page on a web page for changing configuration information based on information representing a failure includes: in response to determining that the information representing a failure includes only information about a target field name that failed verification, generating a configuration sub-page for adding a field value based on the target field name; and in response to determining that the information representing a failure includes information about a target field name-field value that failed verification, generating a configuration sub-page on the configuration page for updating the field value in the target field name-field value based on the target field name-field value.
[0008] According to an embodiment of the present disclosure, writing update information into an intermediate configuration file according to a configuration file template includes: obtaining target position information in the configuration file template of a template field name that has a mapping relationship with the update field name of the update information; generating a conditional insertion instruction according to the target position information; and writing the update information to a preset position of the intermediate configuration file in response to the conditional insertion instruction.
[0009] According to an embodiment of the present disclosure, the configuration information includes script class information, the service configuration parameters include script configuration parameters, and the configuration file template includes a script class template; writing the service configuration parameters into a predefined configuration file template includes: in response to detecting that the configuration information is script class information, parsing the script class template, obtaining a target script segment in the script class template that matches the script configuration parameters; and integrating the script configuration parameters into the target script segment.
[0010] According to an embodiment of the present disclosure, the configuration information also includes a service address of the target service; the service configuration method also includes: calling an application program interface, and loading the service configuration file into the target service according to the service address.
[0011] According to an embodiment of the present disclosure, the configuration information in the service configuration file is stored in a database; the service configuration method also includes: calling a hook program to read the log information of the target service; obtaining first configuration information related to the log information from the database; based on a baseline algorithm, calculating the log information and the first configuration information to obtain benchmark information characterizing the benchmark operating status of the target service; and displaying the comparison results of the operating status information of the target service with the benchmark information in real time on the web page.
[0012] According to an embodiment of the present disclosure, the service configuration method also includes: reading the network service data information of the target service; obtaining second configuration information related to the network service data information from a database; constructing a network service detection list of the target service based on the network service data information and the second configuration information; and displaying the network service detection list in real time on the web page.
[0013] Another aspect of the present disclosure provides a service configuration device, including: a configuration information reading module, for reading configuration information in response to the configuration information for a target service being added to a configuration page on a web page, wherein the configuration information includes service configuration parameters of the target service; a configuration parameter writing module, for writing the service configuration parameters into a predefined configuration file template to obtain an intermediate configuration file; a configuration sub-page generating module, for generating a configuration sub-page for modifying the configuration information on a web page according to information indicating the failure in response to determining that the legitimacy check for the intermediate configuration file fails; and a configuration file obtaining module, for writing the update information into the intermediate configuration file according to the configuration file template in response to the update information being added to the configuration sub-page, to obtain a service configuration file for configuring the target service.
[0014] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the service configuration method of the present disclosure.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the service configuration method of the present disclosure are implemented.
[0016] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the service configuration method of the present disclosure when the computer program or instructions are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 The application scenario diagram of the service configuration method according to the embodiment of the present disclosure is schematically shown;
[0019] Figure 2 A flowchart of a service configuration method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3A A schematic diagram schematically shows a method of generating and loading a service configuration file based on a WEB terminal according to an embodiment of the present disclosure;
[0021] Figure 3B The following schematically shows a framework diagram for realizing data link display based on a WEB terminal according to an embodiment of the present disclosure;
[0022] Figure 4A structural block diagram schematically shows a service configuration device according to an embodiment of the present disclosure; and
[0023] Figure 5 A block diagram of an electronic device suitable for implementing a service configuration method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0027] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0029] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] Figure 1 The application scenario diagram of the service configuration method according to an embodiment of the present disclosure is schematically shown.
[0031] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0032] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0034] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0035] It should be noted that the service configuration method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the service configuration device provided in the embodiment of the present disclosure can generally be set in the server 105. The service configuration method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the service configuration device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0037] The following will be based on Figure 1 The scene described by Figure 2~Figure 3A , Figure 3B The service configuration method of the disclosed embodiment is described in detail.
[0038] Figure 2 The flowchart of the service configuration method according to the embodiment of the present disclosure is schematically shown.
[0039] like Figure 2 As shown, the service configuration method of this embodiment includes operations S210 to S240, and the transaction processing method can be executed by the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0040] In operation S210, in response to the configuration information for the target service being added to the configuration page of the web page, the configuration information is read, wherein the configuration information includes service configuration parameters of the target service.
[0041] According to an embodiment of the present disclosure, the target service may refer to services of various virtual servers, such as Nginx (a reverse proxy web server), Apache (a web server software) and other services in HTTP (HyperText Transfer Protocol) servers, as well as services of application servers written in Python (a computer programming language), Java (an object-oriented programming language), Nodejs (a Java scripting language), Ruby (an object-oriented scripting language), PHP (Personal Home Page, hypertext preprocessor) and many other programming languages, etc., and may not be limited to these.
[0042] According to an embodiment of the present disclosure, the configuration page may be pre-designed with configuration items of service configuration parameters that need to be configured when configuring the target service, such as the project name of the target service, the service address, the path of the configuration file to be updated, the attribute information of the parameter to be updated, etc., and may not be limited thereto. Among them, the update may include multiple situations such as adding, modifying, and deleting. The configuration information may represent the information filled in by the user for each configuration item in the configuration page.
[0043] According to an embodiment of the present disclosure, "added completed" may represent a state in which the user has filled in the information and clicked to confirm completion.
[0044] According to an embodiment of the present disclosure, when it is necessary to configure the target service, the user can log in to the configuration page of the web page, and fill in the configuration parameters in one or more configuration items of the configuration page according to business needs. After confirming that the filling is completed, the web page backend can read the index information in the configuration page to obtain the configuration information of the target service.
[0045] In operation S220, the service configuration parameters are written into a predefined configuration file template to obtain an intermediate configuration file.
[0046] According to an embodiment of the present disclosure, the configuration file template may have a standard format of a configuration file required to configure a target service, wherein the configuration items may be consistent with the content of the configuration items displayed in the configuration page, wherein the configuration content may be empty or pre-filled. After obtaining the service configuration parameters in the configuration information based on the aforementioned method, the service configuration parameters of each configuration item may be written as the configuration content of the corresponding configuration item in the configuration file template according to the configuration items displayed in the configuration page, thereby obtaining an intermediate configuration file.
[0047] In operation S230, in response to determining that the validity check on the intermediate configuration file fails, a configuration subpage for modifying the configuration information is generated on the web page according to information indicating the failure.
[0048] According to the embodiments of the present disclosure, the legality check can be used to determine the format errors of service configuration parameters, the omission of necessary configuration items, etc., and may not be limited to this. In the case where the check fails, you can jump to the configuration subpage on the web page to support the user to further modify the configured information. The configuration subpage can be consistent with the content in the configuration page, except that the configuration items and configuration contents that need to be modified by the user can be displayed in different display modes in the configuration subpage for the user to identify and modify.
[0049] In operation S240, in response to the update information being added to the configuration subpage, the update information is written into the intermediate configuration file according to the configuration file template to obtain a service configuration file for configuring the target service.
[0050] According to an embodiment of the present disclosure, the update information may represent the information added by the user in the configuration subpage for the configuration item to be modified. When the update information is obtained, the update information may be written into the intermediate configuration file based on the configuration file template and in combination with the aforementioned method of writing the service configuration parameters into the configuration file template to obtain the service configuration file. The service configuration file may be sent to the target service to implement the configuration.
[0051] It should be noted that, when it is determined that the validity check on the intermediate configuration file has passed, the intermediate configuration file can be directly determined as the service configuration file.
[0052] Through the above-mentioned embodiments of the present disclosure, since a configuration page for adding configuration information is constructed on the web page, and combined with the configuration file template and the legality verification operation, a configuration sub-page can be generated to prompt the user to update the configuration information when the added configuration information fails the verification, and finally a service configuration file for configuring the target service is generated. The implementation of page-based configuration on the web page can be beneficial to the management of the configuration process of generating the service configuration file. Compared with the traditional configuration method of manually writing scripts, the configuration difficulty is reduced, so that people who lack professional ability can also implement service configuration based on the page-based configuration, thereby improving configuration efficiency.
[0053] In conjunction with specific embodiments, Figure 2 The method shown is described in further detail.
[0054] According to an embodiment of the present disclosure, the configuration information may include field class information, the configuration file template may include a field class template, and the field class template may include a template field name. The above operation S220 may include: in response to detecting that the configuration information is field class information, obtaining a parameter field name for locating a service configuration parameter from a configuration page, the parameter field name and the template field name having a mapping relationship. The service configuration parameter is written into the field class template as a field value of a template field name having a mapping relationship with the parameter field name of the service configuration parameter.
[0055] According to an embodiment of the present disclosure, the above configuration items may include field type configuration items for configuring field class information. The field class template may include information in the key-value type. Among them, the key can be used to record the template field name, and the value can be empty or pre-filled with content, which is used to finally record the field value determined for the template field name. The field class template may also include other predefined information, which is not limited here.
[0056] According to an embodiment of the present disclosure, the template field name may be different from the parameter field name of the pre-designed field type configuration item in the configuration page. In this case, a mapping relationship between the template field name and the parameter field name may be established first. Then, when the service configuration parameters after the parameter field name are obtained by reading the configuration information that has been added in the configuration page, the service configuration parameters may be written after the template field name that has a mapping relationship with the parameter field name of the service configuration parameter according to the mapping relationship, as the field value of the template field name. By writing each service configuration parameter into the corresponding template field name in the field class template based on the mapping relationship, a preliminarily generated intermediate configuration file may be obtained.
[0057] Through the above-mentioned embodiments of the present disclosure, by constructing a mapping relationship between parameter field names in a configuration page and template field names in a configuration file template, automatic injection of configuration information into a configuration file template can be achieved, thereby simplifying configuration operations and improving configuration efficiency.
[0058] According to an embodiment of the present disclosure, the above operation S230 may include: in response to determining that the information representing the failure includes only information of the target field name that failed the verification, generating a configuration subpage for adding a field value according to the target field name. In response to determining that the information representing the failure includes information of the target field name-field value that failed the verification, generating a configuration subpage for updating the field value in the target field name-field value on the configuration page according to the target field name-field value.
[0059] For example, based on business needs, it is determined that content should be configured under the first field name, but during the legality verification process it is detected that no content is configured under the first field name, that is, the configuration content of the first field name is empty, then the first field name can be determined as the target field name that fails the verification, and the generated configuration sub-page may include the first field name and a configuration box for filling in the configuration content for the first field name, so that the user can supplement the configuration content for the first field name in the configuration library.
[0060] For example, according to business needs, it is determined that path-type content should be configured under the second field name, but during the performance verification process, it is detected that the content format configured under the second field name does not belong to the path type, or it is detected that the path of the path-type content configured under the second field name is an inaccessible error path, then the second field name can be determined as the target field name that fails the verification, and the generated configuration sub-page may include information about the second field name and its field value, and display the field value information as information that needs to be modified, so that the user can modify the field value of the second field name.
[0061] Through the above-mentioned embodiments of the present disclosure, by generating a configuration sub-page, a convenient modification window can be provided for the user, which is convenient for operation and convenient for maintenance and management of the configuration file.
[0062] According to an embodiment of the present disclosure, the above operation S240 may include: obtaining target position information of a template field name having a mapping relationship with the update field name of the update information in the configuration file template. According to the target position information, generating a conditional insertion instruction. In response to the conditional insertion instruction, writing the update information to a preset position of the intermediate configuration file.
[0063] According to an embodiment of the present disclosure, the target location information may be embodied in the form of a path or in the form of a field name position, which is not limited here. The conditional insertion instruction may include, for example, a readfile instruction for locating the target location information, but may not be limited thereto. By running the readfile instruction, the update information may be written to a preset position of the intermediate configuration file.
[0064] It should be noted that the process of writing the update information into the intermediate configuration file can also be implemented in combination with the mapping relationship between the parameter field name and the template field name. The process of writing the service configuration parameters into the predefined configuration file template can also be implemented by determining the corresponding location information and responding to the readfile instruction, which is not limited here.
[0065] Through the above-mentioned embodiments of the present disclosure, conditional insertion instructions can be combined to realize automatic updating of intermediate configuration files, thereby improving updating efficiency and reducing updating difficulty.
[0066] According to an embodiment of the present disclosure, after obtaining a service configuration file, an application program interface may be called to load the service configuration file into a target service according to a service address of the target service, thereby realizing automatic configuration of the target service.
[0067] According to an embodiment of the present disclosure, the configuration information in the service configuration file and / or the configuration information in the verified intermediate configuration file may be stored in a database for recording to facilitate subsequent management.
[0068] According to an embodiment of the present disclosure, the configuration information may further include script class information, the service configuration parameters may include script configuration parameters, and the configuration file template may further include a script class template. The above operation S220 may include: in response to detecting that the configuration information is script class information, parsing the script class template, obtaining a target script segment in the script class template that matches the script configuration parameters, and integrating the script configuration parameters into the target script segment.
[0069] According to an embodiment of the present disclosure, in actual configuration, the configuration of some services needs to be completed using script configuration. To adapt to the needs of such scenarios, a script-type configuration item can also be preset in the configuration page, and its configuration box is used to fill in script information. The script information can include, for example, LUA (a concise, lightweight, and extensible programming language) forwarding configuration information, but is not limited to this.
[0070] According to an embodiment of the present disclosure, due to differences in user business levels, there may be differences in format when writing scripts. Script information may include script information that is written in a standard or non-standard manner. Script configuration parameters may be obtained by parsing the script information, including: when parsing to determine that the script information is written in a standard manner, the script information may be determined as a script configuration parameter; when parsing to determine that the script information is written in a non-standard manner, key field information of the script information may be extracted as a script configuration parameter. The limitation on script configuration parameters may not be limited to this.
[0071] According to an embodiment of the present disclosure, the script class template may be in a standardized script form. After obtaining the script configuration parameters through parsing, the target script section that matches the script configuration parameters may be determined from the script class template according to the standard script information or key field information represented by the script configuration parameters. Then, the standard script information or key field information may be merged into the target script section to obtain an intermediate configuration file.
[0072] According to an embodiment of the present disclosure, the above method of integrating script configuration parameters into a target script segment may also be applied to the above operation S240 to finally obtain a service configuration file.
[0073] Through the above embodiments of the present disclosure, the above automatic injection process can be applied to script configuration scenarios, thereby achieving compatibility with special configurations such as scripts.
[0074] Figure 3A The schematic diagram schematically shows the generation and loading of a service configuration file based on a WEB terminal according to an embodiment of the present disclosure.
[0075] like Figure 3A As shown, the WEB terminal 300 is preset with a configuration page 310 and a configuration subpage 311 for service configuration. MySQL 320 can be connected to the WEB terminal 300 for communication. The WEB terminal 300 can also be configured with an API (Application Programming Interface) 340 for interacting with external servers such as Nginx 330. The method for generating and loading a service configuration file based on the WEB terminal 300 can include operations S301 to S309.
[0076] In operation S301 , configuration information is written in the configuration page 310 .
[0077] According to an embodiment of the present disclosure, the configuration information may include at least one of the above-mentioned field type information and script type information, which is not limited here.
[0078] In operation S302, configuration information is read, parameter parsing is performed, service configuration parameters are copied, and a configuration file template is written to obtain an intermediate configuration file.
[0079] According to the embodiments of the present disclosure, parsing tools such as formdata (form data) and ajax (Asynchronous JavaScript and XML, web page asynchronous update technology) can be used for parsing to obtain service configuration parameters, including at least one of field configuration parameters and script configuration parameters. The configuration file template may include at least one of a field class template and a script class template. The method of writing service configuration parameters into the configuration file template has been described in the aforementioned embodiments and will not be repeated here.
[0080] In operation S303, the readfile instruction is used to specify the next step of configuration information to be inserted into the intermediate configuration file to obtain the service configuration file.
[0081] According to an embodiment of the present disclosure, the configuration information filled in the configuration page can be part of the information. After the configuration information in the configuration page is filled in, it can automatically jump to the configuration sub-page to fill in the other part of the configuration information that needs to be configured, and obtain the service configuration file by parsing and inserting the intermediate configuration file. The configuration information filled in the configuration page can be complete configuration information. When it is determined that the legality check for the intermediate configuration file fails, it can jump to the configuration sub-page to update the configuration information originally written to the configuration page, and obtain the service configuration file by parsing and inserting the intermediate configuration file.
[0082] In operation S304, the validity of the service configuration file is verified.
[0083] According to an embodiment of the present disclosure, the validity of the service configuration file can be verified using command line statements such as test nginx.
[0084] In operation S305, it is determined whether the verification is passed. If so, operations S306 and S307 are performed; if not, operation S308 is performed.
[0085] In operation S306, the configuration information in the service configuration file is recorded.
[0086] According to an embodiment of the present disclosure, for example, the configuration information in the service configuration file may be written into MySQL 320 to implement recording.
[0087] In operation S307, the service configuration file is automatically sent to the corresponding server according to the service address in the configuration information, and the server is configured and reloaded.
[0088] According to an embodiment of the present disclosure, ansible (an automated operation and maintenance tool) can be used to achieve automatic distribution. After the distribution is completed, an Nginx reload instruction can be sent to Nginx 330 to achieve configuration and reload, so as to finally achieve service configuration in Nginx 330.
[0089] In operation S308, a write failure is returned to the WEB terminal 300, and operations S301 to S304 are repeatedly performed.
[0090] In operation S309, uniqueness is verified.
[0091] According to an embodiment of the present disclosure, when Nginx 330 is reloaded, API 340 may be called to read Nginx service configuration information from Nginx 330 by regular matching or the like, and perform a uniqueness check on the Nginx service configuration information that has been written into MySQL 320. The Nginx service configuration information that has not been written into MySQL 320 is written into MySQL 320, and the Nginx service configuration information that is duplicated with the configuration information that has been written into MySQL 320 is filtered out.
[0092] It should be noted that the service address filled in the configuration page 310 or the configuration subpage 311 can be a service address that has been recorded in MySQL 320, representing an existing service address, or a newly created service address, which is not limited here. In the case where the service address is a newly created service address, or the service address is an existing service address, but the configuration information is configuration information that has not been recorded in MySQL, the above operations S301 to S308 can be performed. In the case where the service address and the configuration information are both configuration information that has been recorded in MySQL, the API 340 can be directly called to read the relevant information from MySQL and load it into Nginx 330.
[0093] The inventors also discovered during the process of implementing the concept of the present disclosure that when data monitoring is required, the direction of the data flow is unclear and monitoring is difficult to achieve.
[0094] According to an embodiment of the present disclosure, based on Figure 3A The framework shown can also associate at least one of a log module and a network service module with the WEB terminal 300 .
[0095] Figure 3BThe following schematically shows a framework diagram for implementing data link display based on a WEB terminal according to an embodiment of the present disclosure.
[0096] like Figure 3B As shown, a data display page 350 may also be provided in the WEB terminal 300. A log module 360 and a network service module 370 may be associated with the WEB terminal 300. The log module 360 may be configured with information such as Hook (hook program), baseline algorithm, transaction volume, etc., and may realize the acquisition and display of data chain information in the log dimension.
[0097] According to an embodiment of the present disclosure, on the basis of configuring a log module 360 for the WEB terminal 300, the above-mentioned service configuration method may also include: calling a hook program to read the log information of the target service. Obtaining first configuration information related to the log information from a database. Based on a baseline algorithm, the log information and the first configuration information are calculated to obtain benchmark information characterizing the benchmark operating state of the target service. The comparison result of the operating state information of the target service and the benchmark information is displayed in real time on the web page.
[0098] According to an embodiment of the present disclosure, a Hook (hook program) can be pre-configured in a log module, and can read the log information of the target service from the Nginx server in real time, and read the first configuration information related to the log information from MySQL, so as to obtain a more complete first data chain information related to the log information. For example, the read log information includes: a message is sent from A to B, then the first configuration information may include: A's configuration information, B's configuration information, configuration information related to "sending from A to B", etc., and may not be limited to this. So far, based on the hook program, by reading the log information and the first configuration information, the complete data chain information characterized as "a message is sent from A to B" can be read.
[0099] According to the embodiments of the present disclosure, the baseline algorithm is used to perform calculations based on the complete data link information to determine the benchmark information under the corresponding link environment. The comparison results of the collected running status information of the target service and the benchmark information can be displayed in real time based on the data display page, and it is not limited to this. For example, the data display page can also display information such as the transaction volume of the target service, which is not limited here.
[0100] For example, a hook is constructed through Hook to match the forwarding configuration in MySQL to the log of nginx request forwarding, and all the request volume and forwarding volume, including error request and error return data, are taken out. A link can be formed through the probability baseline algorithm. If the forwarding or request volume decreases in a certain period of time, it can be discovered and resolved in time. If a node returns an error, it can also respond quickly.
[0101] like Figure 3BAs shown, the network service module 370 can intercept sendmsg (send type information), recvmsg (receive type information), sockets, etc., and is not limited to this, and can realize the acquisition and display of data link information in the host dimension.
[0102] According to an embodiment of the present disclosure, on the basis of configuring a network service module 370 for the WEB terminal 300, the service configuration method may further include: reading network service data information of the target service. Obtaining second configuration information related to the network service data information from a database. Constructing a network service detection list of the target service according to the network service data information and the second configuration information. Displaying the network service detection list in real time on the web page.
[0103] According to an embodiment of the present disclosure, the network service data information may include at least one of the following: sendmsg, recvmsg, sockets, etc., and may not be limited thereto. For each network service data information (such as socket), the second configuration information related to the socket may be read from MySQL to obtain more complete second data link information related to the socket.
[0104] According to an embodiment of the present disclosure, the network service detection list may represent a list obtained by performing a standardized conversion on the second data link information. The network service detection list may be displayed in real time on a data display page of a web page.
[0105] For example, the eBPF technology can be combined to construct a network service module to implement statistics on the access status of the entire network, the network status of specific access nodes, network fluctuations, etc., to reflect the operation status of the entire application service, and the call status of the entire data chain can be displayed in combination with the configuration information.
[0106] Through the above-mentioned embodiments of the present disclosure, it is possible to combine the target service, capture configuration information, find the direction of data flow, and obtain relatively complete data chain information, thereby realizing real-time monitoring of configured services, which is conducive to timely discovery and troubleshooting.
[0107] Based on the above service configuration method, the present disclosure also provides a service configuration device. Figure 4 The device is described in detail.
[0108] Figure 4 The structural block diagram of the service configuration device according to an embodiment of the present disclosure is schematically shown.
[0109] like Figure 4As shown, the service configuration device 400 of this embodiment includes a configuration information reading module 410 , a configuration parameter writing module 420 , a configuration sub-page generating module 430 and a configuration file obtaining module 440 .
[0110] The configuration information reading module 410 is used to read the configuration information for the target service in response to the configuration page on the web page having added the configuration information for the target service, wherein the configuration information includes the service configuration parameters of the target service. In one embodiment, the configuration information reading module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0111] The configuration parameter writing module 420 is used to write the service configuration parameters into a predefined configuration file template to obtain an intermediate configuration file. In one embodiment, the configuration parameter writing module 420 can be used to perform the operation S220 described above, which will not be described in detail here.
[0112] The configuration sub-page generation module 430 is used to generate a configuration sub-page for modifying the configuration information on the web page according to information indicating the failure in response to determining that the validity check for the intermediate configuration file fails. In one embodiment, the configuration sub-page generation module 430 can be used to perform the operation S230 described above, which will not be described in detail here.
[0113] The configuration file acquisition module 440 is used to write the update information into the intermediate configuration file according to the configuration file template in response to the update information being added to the configuration subpage, and obtain the service configuration file for configuring the target service. In one embodiment, the configuration file acquisition module 430 can be used to perform the operation S240 described above, which will not be repeated here.
[0114] According to an embodiment of the present disclosure, the configuration information includes field class information, the configuration file template includes a field class template, and the field class template includes a template field name. The configuration parameter writing module includes a parameter field name acquisition unit and a service configuration parameter writing unit.
[0115] The parameter field name acquisition unit is used to acquire the parameter field name for the service configuration parameter location from the configuration page in response to detecting that the configuration information is field type information, and the parameter field name and the template field name have a mapping relationship.
[0116] The service configuration parameter writing unit is used to write the service configuration parameter into the field class template as a field value of a template field name having a mapping relationship with the parameter field name of the service configuration parameter.
[0117] According to an embodiment of the present disclosure, the configuration sub-page generation module includes a first configuration sub-page generation unit and a second configuration sub-page generation unit.
[0118] The first configuration sub-page generating unit is used for generating a configuration sub-page for adding a field value according to the target field name in response to determining that the information representing the failure only includes information of the target field name that failed the verification.
[0119] The second configuration sub-page generating unit is used for generating a configuration sub-page for updating the field value in the target field name-field value on the configuration page according to the target field name-field value in response to determining that the information representing the failure includes information of the target field name-field value that failed the verification.
[0120] According to an embodiment of the present disclosure, the configuration file obtaining module includes a target location obtaining unit, a conditional insertion instruction generating unit and an update information writing unit.
[0121] The target location acquisition unit is used to acquire target location information of a template field name having a mapping relationship with the update field name of the update information in the configuration file template.
[0122] The conditional insertion instruction generating unit is used to generate a conditional insertion instruction according to the target position information.
[0123] The update information writing unit is used to respond to the conditional insertion instruction and write the update information into a preset position of the intermediate configuration file.
[0124] According to an embodiment of the present disclosure, the configuration information includes script class information, the service configuration parameters include script configuration parameters, and the configuration file template includes a script class template. The configuration parameter writing module includes a parsing unit and a fusion unit.
[0125] The parsing unit is used to parse the script class template in response to detecting that the configuration information is script class information, and obtain the target script section in the script class template that matches the script configuration parameters.
[0126] The fusion unit is used to fuse the script configuration parameters into the target script section.
[0127] According to an embodiment of the present disclosure, the configuration information also includes a service address of the target service. The service configuration device also includes a loading module.
[0128] The loading module is used to call the application program interface and load the service configuration file into the target service according to the service address.
[0129] According to an embodiment of the present disclosure, the configuration information in the service configuration file is stored in a database. The service configuration device also includes a log information reading module, a first configuration information acquisition module, a reference information calculation module and a comparison result display module.
[0130] The log information reading module is used to call the hook program to read the log information of the target service.
[0131] The first configuration information acquisition module is used to acquire first configuration information related to the log information from a database.
[0132] The benchmark information calculation module is used to calculate the log information and the first configuration information based on the baseline algorithm to obtain benchmark information that characterizes the benchmark operating state of the target service.
[0133] The comparison result display module is used to display the comparison results of the target service's operating status information and the benchmark information in real time on the web page.
[0134] According to an embodiment of the present disclosure, the service configuration device also includes a network service data reading module, a second configuration information acquisition module, a detection list construction module and a detection list display module.
[0135] The network service data reading module is used to read the network service data information of the target service.
[0136] The second configuration information acquisition module is used to acquire second configuration information related to the network service data information from the database.
[0137] The detection list building module is used to build a network service detection list of the target service according to the network service data information and the second configuration information.
[0138] The detection list display module is used to display the network service detection list in real time on the web page.
[0139] According to an embodiment of the present disclosure, any multiple modules of the configuration information reading module 410, the configuration parameter writing module 420, the configuration sub-page generating module 430 and the configuration file obtaining module 440 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the configuration information reading module 410, the configuration parameter writing module 420, the configuration sub-page generating module 430 and the configuration file obtaining module 440 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the configuration information reading module 410, the configuration parameter writing module 420, the configuration sub-page generating module 430 and the configuration file obtaining module 440 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0140] Figure 5 A block diagram of an electronic device suitable for implementing a service configuration method according to an embodiment of the present disclosure is schematically shown.
[0141] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0142] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0143] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0144] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0145] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0146] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the service configuration method provided by the embodiment of the present disclosure.
[0147] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0148] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0149] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0150] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0151] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0152] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0153] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A service configuration method, characterized in that: The method comprises: In response to the configuration information for the target service being added on the configuration page of the web page, the configuration information is read, wherein the configuration information includes service configuration parameters of the target service; Writing the service configuration parameters into a predefined configuration file template to obtain an intermediate configuration file; In response to determining that the validity check on the intermediate configuration file fails, generating a configuration subpage for modifying the configuration information on the web page according to information indicating the failure; and In response to the update information being added to the configuration subpage, the update information is written into the intermediate configuration file according to the configuration file template to obtain a service configuration file for configuring the target service.
2. The method according to claim 1, characterized in that: The configuration information includes field class information, the configuration file template includes a field class template, and the field class template includes a template field name; and writing the service configuration parameters into a predefined configuration file template includes: In response to detecting that the configuration information is the field class information, acquiring a parameter field name for locating the service configuration parameter from the configuration page, the parameter field name having a mapping relationship with the template field name; and The service configuration parameter is written into the field class template as a field value of a template field name having a mapping relationship with the parameter field name of the service configuration parameter.
3. The method according to claim 1, characterized in that The step of generating a configuration subpage for modifying the configuration information on the web page according to the information indicating failure includes: In response to determining that the information representing the failure only includes information of the target field name that failed the verification, generating a configuration subpage for adding a field value according to the target field name; and In response to determining that the information representing the failure includes information of the target field name-field value that failed the verification, a configuration subpage for updating the field value in the target field name-field value is generated on the configuration page according to the target field name-field value.
4. The method according to claim 1, characterized in that The step of writing the update information into the intermediate configuration file according to the configuration file template comprises: Acquire target location information of a template field name having a mapping relationship with the update field name of the update information in the configuration file template; generating a conditional insertion instruction according to the target position information; and In response to the conditional insertion instruction, the update information is written into the preset position of the intermediate configuration file.
5. The method according to claim 1, characterized in that The configuration information includes script information, the service configuration parameters include script configuration parameters, and the configuration file template includes a script template; and writing the service configuration parameters into a predefined configuration file template includes: In response to detecting that the configuration information is the script class information, parsing the script class template, and obtaining a target script segment in the script class template that matches the script configuration parameter; and The script configuration parameters are merged into the target script section.
6. The method according to claim 1, characterized in that The configuration information also includes the service address of the target service; the method also includes: Call an application program interface and load the service configuration file into the target service according to the service address.
7. The method according to claim 1, characterized in that The configuration information in the service configuration file is stored in a database; the method further comprises: Calling the hook program to read the log information of the target service; Acquire first configuration information related to the log information from the database; Based on a baseline algorithm, the log information and the first configuration information are calculated to obtain benchmark information representing a benchmark operating state of the target service; and The comparison result of the running status information of the target service with the benchmark information is displayed in real time on the web page.
8. The method according to claim 1, characterized in that: The method further comprises: Read network service data information of the target service; Acquire second configuration information related to the network service data information from the database; Constructing a network service detection list of the target service according to the network service data information and the second configuration information; and The network service detection list is displayed in real time on the web page.
9. A service configuration device, characterized in that: The device comprises: A configuration information reading module, configured to read the configuration information for the target service in response to the configuration information for the target service being added on the configuration page of the web page, wherein the configuration information includes the service configuration parameters of the target service; A configuration parameter writing module, used to write the service configuration parameters into a predefined configuration file template to obtain an intermediate configuration file; a configuration sub-page generating module, configured to generate, in response to determining that the validity check for the intermediate configuration file fails, a configuration sub-page for modifying the configuration information on the web page according to information indicating the failure; and The configuration file obtaining module is used for writing the update information into the intermediate configuration file according to the configuration file template in response to the update information having been added to the configuration subpage, so as to obtain a service configuration file for configuring the target service.
10. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.