Method and device for processing online environment configuration of program, equipment and medium

By performing online environment configuration checks and alarm policy execution before the program source code is deployed, online issues caused by human error are resolved, ensuring the program can be deployed normally.

CN115309629BActive Publication Date: 2026-02-13BEIJING WATERDROP TECH GRP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210725822.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2026-02-13
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

During the program's deployment, a human error caused a problem with the online environment configuration, preventing users from using the program normally.

Method used

Before the program's source code is deployed online, the code content is obtained, key information is analyzed, and the online environment configuration is checked and verified. Based on the verification results, corresponding alarm policies are matched and executed to fix the online environment configuration.

Benefits of technology

It enables the detection and verification of online environment configurations before the source code is released, solving online problems caused by human error and ensuring that users can use the program normally after it is released.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309629B_ABST
    Figure CN115309629B_ABST
Patent Text Reader

Abstract

The application provides a processing method and device for online environment configuration of a program, computer equipment and a computer readable storage medium, and relates to the technical field of computers. The method can obtain code content of submitted source code of a program before the source code goes online, analyze the code content of the source code, find matching preset key information, use the preset key information to detect and verify the online environment configuration of the program, obtain a verification result, match a corresponding alarm strategy according to the verification result, and execute the corresponding alarm strategy. It can be seen that the embodiment of the application can detect and verify the online environment configuration of the submitted source code of the program before the source code goes online, match and execute the corresponding alarm strategy according to the verification result, repair the online environment configuration, and thus solve the online problems caused by manual operation omissions from the source.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and in particular, to a processing method and device for online environment configuration of a program, a computer device and a computer readable storage medium. BACKGROUND

[0002] Generally, the code online process of a program can include pulling branch code from a master branch, conducting research and development on the branch, submitting testing after the research and development is completed, and conducting online after the testing is completed, so that the user can normally use the program after the program is online.

[0003] At present, in the process of releasing a program online, manual operation omissions often occur in Internet companies, resulting in problems in online environment configuration, and the user cannot normally use the program after the program is online. Therefore, how to solve the online problems caused by manual operation omissions has become a technical problem to be solved. SUMMARY

[0004] In view of the above problems, the present application is proposed to provide a processing method and device for online environment configuration of a program, a computer device and a computer readable storage medium which overcome the above problems or at least partially solve the above problems. The technical solution is as follows:

[0005] In a first aspect, a processing method for online environment configuration of a program is provided, comprising:

[0006] obtaining code content of a submitted source code of the program before the source code is online;

[0007] analyzing the code content of the source code, finding a preset key information matched therein, using the preset key information to detect and verify the online environment configuration of the program, and obtaining a verification result;

[0008] matching a corresponding alarm strategy according to the verification result, and executing the corresponding alarm strategy.

[0009] In a possible implementation manner, the source code is submitted to a code repository of a code management platform as branch code, and a target link is generated;

[0010] obtaining code content of a submitted source code of the program before the source code is online, comprising:

[0011] merging the source code as branch code with master branch code, triggering the target link before the merged code is online;

[0012] obtaining the code content of the source code according to the target link; wherein the master branch code is a code of a project host, and the program is integrated into the project host.

[0013] In a possible implementation, the code content of the source code is analyzed to find matching preset key information, the preset key information is used to detect and verify the online environment configuration of the program, and a verification result is obtained, including:

[0014] One or more types of detection configuration are determined according to the preset key information;

[0015] For each type of detection configuration, the key information corresponding to the type of detection configuration is used to detect and verify the online environment configuration of the program, and a verification result is obtained.

[0016] In a possible implementation, the type of detection configuration includes a database configuration type, and the key information corresponding to the type of detection configuration is used to detect and verify the online environment configuration of the program, and a verification result is obtained, including:

[0017] According to the key information corresponding to the database configuration type, the newly created and / or modified data source in the code content of the source code is parsed to obtain a link parameter including one or more of a database name, a table name, a field name, and a field type;

[0018] The obtained link parameter is used to link to an online database through a database driver, the configuration of the online database is obtained through the database name and the table name, and the types of the field names are compared; when a field name is missing or a field type is inconsistent, the missing field name and the inconsistent field type are recorded as an unconfigured parameter.

[0019] In a possible implementation, the type of detection configuration includes a preset platform configuration type, and the key information corresponding to the type of detection configuration is used to detect and verify the online environment configuration of the program, and a verification result is obtained, including:

[0020] According to the key information corresponding to the preset platform configuration type, the newly created and / or modified code content in the code content of the source code is matched based on a specified syntax format through a regular expression, and a corresponding configuration name is obtained;

[0021] The name of the project host is obtained through the code management platform, and relevant configuration information is found in the code management platform according to the name of the project host and the configuration name;

[0022] According to an interface provided by a configuration platform corresponding to the preset platform configuration type, a value corresponding to the configuration information is found;

[0023] The value corresponding to the configuration information is parsed by the analysis tool, the parsed type is matched with the code content of the source code, and if the matching is inconsistent, the parameter is regarded as not configured.

[0024] In a possible implementation, the detection configuration type includes a rule configuration type, and the online environment configuration of the program is detected and verified by using the key information corresponding to the detection configuration type, to obtain a verification result, including:

[0025] According to the key information corresponding to the rule configuration type, the modified rule content in the code content of the source code is obtained;

[0026] The modified rule content is compared with the rule content of the corresponding online rule platform, and if the comparison is inconsistent, the parameter is regarded as not configured.

[0027] In a possible implementation, according to the verification result, a corresponding alarm strategy is matched, and the corresponding alarm strategy is executed, including:

[0028] The unconfigured parameters in the verification result are summarized to generate a detection report;

[0029] Alarm information containing the detection report is generated and provided to the background, and the unconfigured parameters of the online environment are configured by the background according to the alarm information.

[0030] In a second aspect, a processing apparatus for online environment configuration of a program is provided, including:

[0031] The obtaining module is configured to obtain the code content of the source code before the submitted program is put online.

[0032] The detection and verification module is configured to analyze the code content of the source code, find the preset key information, detect and verify the online environment configuration of the program by using the preset key information, and obtain a verification result.

[0033] The alarm processing module is configured to match a corresponding alarm strategy according to the verification result, and execute the corresponding alarm strategy.

[0034] In a possible implementation, the apparatus further includes:

[0035] The generating module is configured to generate a target link when the source code is submitted to the code repository of the code management platform as branch code.

[0036] The acquisition module is further configured to merge the source code as branch code with main branch code, trigger the target link before putting the merged code online, acquire code content of the source code according to the target link, wherein the main branch code is code of a project host, and the program is integrated into the project host.

[0037] In a possible implementation, the detection and verification module is further configured to:

[0038] determine one or more detection configuration types according to the preset key information;

[0039] for each detection configuration type, detect and verify an online environment configuration of the program by using key information corresponding to the detection configuration type, and obtain a verification result.

[0040] In a possible implementation, the detection configuration type includes a database configuration type, and the detection and verification module is further configured to:

[0041] according to key information corresponding to the database configuration type, parse a newly created and / or modified related data source in the code content of the source code, and acquire a link parameter including one or more of a database name, a table name, a field name and a field type;

[0042] link the acquired link parameter with an online database through a database driver, acquire a configuration of the online database through the database name and the table name, and compare types of each field name, when a field name is missing or field types are inconsistent, record the missing field name and the inconsistent field type as an unconfigured parameter.

[0043] In a possible implementation, the detection configuration type includes a preset platform configuration type, and the detection and verification module is further configured to:

[0044] according to key information corresponding to the preset platform configuration type, match code content newly created and / or modified in the code content of the source code based on a specified syntax format through a regular expression, and acquire a corresponding configuration name;

[0045] acquire a name of the project host through the code management platform, and according to the name of the project host and the configuration name, find related configuration information on the code management platform;

[0046] find a value corresponding to the configuration information according to an interface provided by a configuration platform corresponding to the preset platform configuration type;

[0047] The configuration information corresponding value is parsed by the analysis tool, the parsed type is matched with the code content of the source code, and if the matching is inconsistent, the parameter is regarded as not configured.

[0048] In a possible implementation, the detection configuration type includes a rule configuration type, and the detection verification module is further configured to:

[0049] According to the key information corresponding to the rule configuration type, the modified rule content in the code content of the source code is obtained;

[0050] The modified rule content is compared with the rule content of the corresponding online rule platform, and if the comparison is inconsistent, the parameter is regarded as not configured.

[0051] In a possible implementation, the alarm processing module is further configured to:

[0052] The unconfigured parameters in the verification result are summarized to generate a detection report;

[0053] Alarm information including the detection report is generated and provided to the background, and the unconfigured parameters in the online environment are configured according to the alarm information by the background.

[0054] In a third aspect, a computer device is provided, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the processing method for online environment configuration of the program according to any one of the preceding aspects.

[0055] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, wherein the computer program is configured to execute the processing method for online environment configuration of the program according to any one of the preceding aspects when running.

[0056] According to the technical solutions described above, the processing method and device for online environment configuration of the program, the computer device, and the computer readable storage medium provided by the embodiments of the present application can obtain the code content of the source code before the submitted source code of the program is online; analyze the code content of the source code, find the preset key information matched therein, detect and verify the online environment configuration of the program by using the preset key information, obtain a verification result, match a corresponding alarm strategy according to the verification result, and execute the corresponding alarm strategy. It can be seen that the embodiments of the present application can detect and verify the online environment configuration before the submitted source code of the program is online, match and execute the corresponding alarm strategy according to the verification result, repair the online environment configuration, and thus solve the online problems caused by manual operation from the source. BRIEF DESCRIPTION OF DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced.

[0058] Figure 1 is a flow chart of the processing method of the online environment configuration of the program provided by the embodiments of the present application;

[0059] Figure 2 is a code online flow chart of the program of the embodiments of the present application;

[0060] Figure 3 is a flow chart of the processing method of the online environment configuration of the program provided by another embodiment of the present application;

[0061] Figure 4 is a configuration detection flow chart of another embodiment of the present application;

[0062] Figure 5 is a structure diagram of the processing device of the online environment configuration of the program provided by the embodiments of the present application;

[0063] Figure 6 is a structure diagram of the processing device of the online environment configuration of the program provided by another embodiment of the present application;

[0064] Figure 7 is a structure diagram of the computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The exemplary embodiments of the present application will be described in detail with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present application can be more thoroughly understood and so that the scope of the present application can be completely conveyed to those skilled in the art.

[0066] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that such use can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" and its variants are to be interpreted as meaning "including but not limited to" an open term.

[0067] In order to solve the above technical problems, the embodiments of the present application provide a processing method of online environment configuration of a program, which can be applied to a server, a personal computer or other computer device, such as Figure 1 As shown in the figure, the processing method of online environment configuration of the program can specifically include the following steps S101-S103:

[0068] Step S101, before the source code of the submitted program goes online, the code content of the source code is acquired;

[0069] Step S102, the code content of the source code is analyzed to find the preset key information matched therein, the preset key information is used to detect and check the online environment configuration of the program, and a checking result is obtained;

[0070] Step S103, according to the checking result, a corresponding alarm strategy is matched, and the corresponding alarm strategy is executed.

[0071] If the checking result contains a parameter not configured in the online environment in step S103, an alarm operation needs to be performed, for example, the parameters not configured in the checking result are summarized to generate a detection report, and then alarm information containing the detection report is generated and provided to the background, and the background configures the parameters not configured in the online environment according to the alarm information. If the checking result does not contain a parameter not configured in the online environment, it is determined that the online environment configuration is accurate, and no alarm operation is needed.

[0072] The embodiment of the application can detect and check the online environment configuration before the source code of the submitted program goes online, match and execute a corresponding alarm strategy according to the checking result, repair the online environment configuration, and thus solve the online problems caused by manual operation from the source.

[0073] In the embodiment of the application, a possible implementation is provided, the source code of the program mentioned in step S101 can be submitted to the code repository of the code management platform as branch code to generate a target link, and then step S101 acquires the code content of the source code before the submitted program goes online. Specifically, the following steps A1 and A2 can be included:

[0074] Step A1, the source code is merged with the master branch code as branch code, and the target link is triggered before the merged code goes online;

[0075] Step A2, the code content of the source code is acquired according to the target link; wherein the master branch code is the code of the project host, and the program is integrated into the project host.

[0076] The program integrated into the project host mentioned in step A2 is the program mentioned in step S101.

[0077] For example, Figure 2The code online flowchart of the program of the embodiment of the application is shown, including pulling branch code from the main branch, developing on the branch, submitting testing after the development is completed, merging the source code as branch code with the main branch code after the testing is completed, initiating detection at this time, and uploading the source code of the program after the detection verification passes, solving online problems caused by manual operation omissions, and enabling users to normally use the program after the program is uploaded.

[0078] The embodiment of the application provides a possible implementation manner, and the code content of the source code is analyzed in step S102, matching preset key information is found, the preset key information is used for detecting and verifying the online environment configuration of the program, a verification result is obtained, and the following steps B1 and B2 can be specifically included:

[0079] Step B1, determining one or more detection configuration types according to the preset key information;

[0080] Step B2, for each detection configuration type, detecting and verifying the online environment configuration of the program by using the key information corresponding to the detection configuration type, and obtaining a verification result.

[0081] The embodiment of the application can detect and verify the online environment configuration of the program by using the key information corresponding to each detection configuration type, can realize classified configuration detection, and improves the efficiency of detection and verification. Here, the preset key information can be a keyword or a key file, and the code content of the source code can be matched with the preset keyword. The matched keywords are classified to determine one or more detection configuration types, and then the online environment configuration of the program is detected and verified by using the keywords corresponding to each detection configuration type, and a verification result is obtained.

[0082] The embodiment of the application provides a possible implementation manner, and the detection configuration type can be a database configuration type, a preset platform configuration type, or a rule configuration type, and the embodiment of the application does not limit this. If the detection configuration type is a database configuration type, for example, a Mysql configuration, step B2 detects and verifies the online environment configuration of the program by using the key information corresponding to the detection configuration type, and obtains a verification result, and the following steps B21 and B22 can be specifically included:

[0083] Step B21, according to the key information corresponding to the database configuration type, analyzing the newly created and / or modified data source in the code content of the source code, and obtaining a link parameter including one or more of a database name, a table name, a field name, and a field type;

[0084] Step B22, by the database driver, link with the online database by using the obtained link parameters, obtain the configuration of the online database through the database name and table name, compare the types of each field name, and record the missing field name and inconsistent field type as the unconfigured parameter when the field name is missing or the field type is inconsistent.

[0085] The embodiment of the application matches the key information according to the database configuration type, can accurately and quickly detect the unconfigured parameter, and realizes the repair of the subsequent online environment configuration of the database.

[0086] If the detected configuration type is a preset platform configuration type, such as Apollo platform configuration, step B2 detects and verifies the online environment configuration of the program by using the key information corresponding to the detected configuration type, and obtains a verification result, which can specifically include the following steps B211 to B244:

[0087] Step B211, according to the key information corresponding to the preset platform configuration type, based on the specified syntax format, matching the newly created and / or modified code content in the code content of the source code through a regular expression, and obtaining the corresponding configuration name;

[0088] Step B222, obtaining the name of the project host through the code management platform, and searching for the related configuration information in the code management platform according to the name of the project host and the configuration name;

[0089] Step B233, according to the interface provided by the configuration platform corresponding to the preset platform configuration type, searching for the value corresponding to the configuration information;

[0090] Step B244, parsing the value corresponding to the configuration information through the parsing tool, matching the type obtained by parsing with the code content of the source code, and if the matching is inconsistent, regarding it as an unconfigured parameter.

[0091] For example, a variable in the code content of the source code needs to modify the numerical value by using the preset platform, such as modifying the value of a variable from 12 o'clock to 13 o'clock. In actual development, if the value of a variable on the preset platform is parsed to be 12 o'clock through steps B211 to B244, and the value corresponding to the configuration information in the code content of the source code is 13 o'clock, it means that the value of the variable on the preset platform has not been modified from 12 o'clock to 13 o'clock, and a manual omission operation occurs. At this time, it is considered that time 12 o'clock and time 13 o'clock do not match, and the numerical value of the variable of the preset platform is regarded as an unconfigured parameter, which needs to be configured, that is, the value of the variable of the preset platform is configured from 12 o'clock to 13 o'clock.

[0092] The embodiment of the application matches the key information according to the preset platform configuration type, can accurately and quickly detect the unconfigured parameters, and realizes the repair of the subsequent online environment configuration of the preset platform.

[0093] If the detected configuration type is a rule configuration type, step B2 detects and verifies the online environment configuration of the program by using the key information corresponding to the detected configuration type, and obtains a verification result, which can specifically include the following steps B2111 to B2222:

[0094] Step B2111, according to the key information corresponding to the rule configuration type, the modified rule content in the code content of the source code is obtained.

[0095] Step B2222, the modified rule content is compared with the rule content of the corresponding online rule platform, and if the comparison is inconsistent, it is regarded as an unconfigured parameter.

[0096] For example, the modification detection of the data source. The modification of the data source will trigger the detection and verification. The obtained data source is compared with the data on the data management platform. If the comparison is inconsistent, it is regarded as an unconfigured parameter.

[0097] The embodiment of the application matches the key information according to the rule configuration type, can accurately and quickly detect the unconfigured parameters, and realizes the repair of the subsequent online environment configuration of the rule content.

[0098] The above introduces Figure 1 The various implementation manners of each link in the embodiment are shown in the embodiment, and the processing method of the online environment configuration of the program provided by the embodiment of the application is further described through specific embodiments.

[0099] In specific embodiments, the main branch code is the code of the project host, the branch code is pulled from the main branch, the research and development is carried out on the branch, the source code of the program as the branch code is obtained, and then submitted to the code repository of the code management platform to generate a target link. In this way, the code content of the source code of the program can be obtained through the target link.

[0100] Figure 3 is a flowchart of the processing method of the online environment configuration of the program provided by another embodiment of the application. After merging the branch code and the main branch code, the online environment configuration is detected and verified, which can specifically include the following steps S300 to S306:

[0101] Step S300, merge the submitted code.

[0102] Step S301, after merging the submitted code, triggering the target link of the code repository, at this time, the code content of the source code of this submission can be obtained according to the target link.

[0103] In this step, the code content of the source code of this submission can be obtained through gitlab.

[0104] In step S302, after obtaining the code content of the source code of this submission, keyword matching is performed on the code content of this submission. If there is, step S303 is performed; if not, it is ended.

[0105] In step S303, the online environment configuration is detected. If an unconfigured parameter is detected, step S304 is executed; if no unconfigured parameter is detected, it is ended.

[0106] In step S304, the unconfigured parameters in the detection result are summarized to generate a detection report, and a message containing the detection report is sent to the background.

[0107] In step S305, after the R&D personnel in the background receive the online unconfigured message prompt, the online environment is configured.

[0108] In step S306, the online environment configuration is detected again until all detection items have been configured.

[0109] In step S303 above, the online environment configuration is detected. As shown in Figure 4 The code detection is triggered to generate a detection task, and the matched keywords are classified and configured. The MQ (Message Queue) is sent to different configuration detection units, i.e. Apollo configuration detection unit, Mysql configuration detection unit and other configuration detection units. After receiving the parameter detection MQ message, the different configuration detection units verify the online environment configuration according to the parameters.

[0110] In the specific implementation, the code management platform mentioned above has the function of sending messages when new and / or modified codes are generated. When the above-mentioned situation occurs, the code modification information is sent to the message system, and a unique ID (identifier) is generated in the message system. After receiving the detection task, the message system sends the message to the detection platform. The detection platform analyzes according to the code modification situation. The detection platform will divide the configuration into the following three categories: database configuration, normal configuration and other configuration. The following is the specific detection method for the three types of configuration.

[0111] Database configuration (such as Mysql configuration) detection: according to the keywords or key files in the source code, the newly created and / or modified related data sources are parsed to obtain the database name, table name, field name, field type and other link parameters. According to the link parameters, the database driver program is used to link the online database by using the obtained database link parameters. The online database configuration is obtained through the database name and table name, and the types of each field are compared. When the field name is missing or the field type is inconsistent, the data matching situation is recorded, and the message system is sent. After the message system receives the information, the ownership of the current detection report is determined through the globally unique ID. When the detection of a certain ID is completed, the data is summarized, analyzed, and counted. According to the error information in the message, a report is generated and sent to the tester through email and other methods.

[0112] Common configuration (such as Apollo configuration) detection: configuration classes are often distinguished from common code by keywords. For a certain type of configuration, there is a fixed syntax format. The newly created and / or modified code is matched through a regular expression to obtain the corresponding configuration name. The project name can be obtained through the code management platform. According to the project name and the configuration name, the relevant configuration information can be accurately found. Through the interface provided by the configuration platform, the corresponding value can be quickly found. Then, the value of the configuration is parsed by the parsing tool. The type obtained by parsing is matched with the code. If it does not match, an error message is sent to the message system. If the corresponding configuration cannot be found, an unconfigured error message is sent to the message system. The message system summarizes and analyzes the detection report and sends it to the tester.

[0113] Other configuration detection: this type of configuration can be widely customized according to the rules of the configuration. For example, the modification of the data source will trigger the detection. The obtained data source is compared with the data on the data management platform. If there is no corresponding data source, an error message is sent to the message system.

[0114] Message system: the message system can receive various error messages. When the detection starts, a globally unique ID is generated. All information detected this time will have this ID. After the message system receives the detailed information, the messages are first classified by ID. Then, according to the specific analysis of the error information, the error information is divided into three categories: database configuration, common configuration, and other configuration. After receiving the detection end message, the data under the ID is summarized to generate a corresponding report, which is sent to the tester through email and other methods.

[0115] It should be noted that in actual application, all possible implementation methods described above can be combined in any combination to form possible embodiments of the present application, which will not be described here.

[0116] Based on the processing method of the online environment configuration of the program provided in each of the above embodiments, based on the same inventive concept, the embodiments of the present application further provide a processing device of online environment configuration of a program.

[0117] Figure 5 is the structural diagram of the processing device of online environment configuration of the program provided by the embodiments of the present application. As shown in the figure, Figure 5 the processing device of online environment configuration of the program can include an acquisition module 510, a detection and verification module 520, and an alarm processing module 530.

[0118] The acquisition module 510 is configured to acquire the code content of the source code before the source code of the submitted program is put online.

[0119] The detection and verification module 520 is configured to analyze the code content of the source code, find the preset key information matched therein, use the preset key information to detect and verify the online environment configuration of the program, and obtain a verification result.

[0120] The alarm processing module 530 is configured to match a corresponding alarm strategy according to the verification result, and execute the corresponding alarm strategy.

[0121] In the embodiments of the present application, a possible implementation manner is provided, as shown in the figure, Figure 6 the device shown above Figure 5 can further include a generation module 610 configured to generate a target link when the source code is submitted to the code repository of the code management platform as branch code.

[0122] The acquisition module 510 is further configured to merge the source code as branch code with the main branch code, trigger the target link before putting the merged code online, acquire the code content of the source code according to the target link, and wherein the main branch code is the code of the project host to which the program is integrated.

[0123] In the embodiments of the present application, a possible implementation manner is provided, as shown in the figure, Figure 5 or Figure 6 The detection and verification module 520 shown above is further configured to:

[0124] determine one or more types of detection configurations according to the preset key information;

[0125] For each type of detection configuration, use the key information corresponding to the type of detection configuration to detect and verify the online environment configuration of the program, and obtain a verification result.

[0126] In the embodiments of the present application, a possible implementation manner is provided, the type of detection configuration includes a database configuration type, as shown in the figure, Figure 5 or Figure 6The detection and verification module 520 shown is further configured to:

[0127] According to the key information corresponding to the database configuration type, the newly created and / or modified data source in the code content of the source code is parsed, and a link parameter containing one or more of a database name, a table name, a field name, and a field type is obtained;

[0128] Through a database driver, the link parameter obtained is used to link with an online database, the configuration of the online database is obtained through the database name and the table name, and the types of the field names are compared. When a field name is missing or the field types are inconsistent, the missing field name and the inconsistent field type are recorded as an unconfigured parameter.

[0129] In an embodiment of the present application, a possible implementation is provided, the type of the detected configuration includes a preset platform configuration type, and the above Figure 5 or Figure 6 The detection and verification module 520 shown is further configured to:

[0130] According to the key information corresponding to the preset platform configuration type, the newly created and / or modified code content in the code content of the source code is matched based on a specified syntax format through a regular expression, and a corresponding configuration name is obtained;

[0131] The name of the project host is obtained through the code management platform, and the related configuration information is searched in the code management platform according to the name of the project host and the configuration name;

[0132] According to an interface provided by a configuration platform corresponding to the preset platform configuration type, the value corresponding to the configuration information is searched;

[0133] The value corresponding to the configuration information is parsed through a parsing tool, the parsed type is matched with the code content of the source code, and if the match is inconsistent, the value is taken as an unconfigured parameter.

[0134] In an embodiment of the present application, a possible implementation is provided, the type of the detected configuration includes a rule configuration type, and the above Figure 5 or Figure 6 The detection and verification module 520 shown is further configured to:

[0135] According to the key information corresponding to the rule configuration type, the modified rule content in the code content of the source code is obtained;

[0136] The modified rule content is compared with the rule content of a corresponding online rule platform, and if the comparison is inconsistent, the rule content is taken as an unconfigured parameter.

[0137] In an embodiment of the present application, a possible implementation is provided, the above Figure 5 or Figure 6The displayed alarm processing module 530 is also used for:

[0138] The parameters not configured in the test results are summarized to generate a detection report.

[0139] The alarm information containing the detection report is generated and provided to the background, and the background configures the parameters not configured in the online environment according to the alarm information.

[0140] Based on the same inventive concept, the embodiments of the present application also provide a computer device, comprising a processor and a memory, the memory storing a computer program, and the processor being configured to run the computer program to execute the processing method of the online environment configuration of any one of the above embodiments.

[0141] In an exemplary embodiment, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in Figure 7 The computer device comprises a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with the external client through the network connection. The computer program is executed by the processor to realize the functions or steps of the processing method of the online environment configuration of a program.

[0142] Based on the same inventive concept, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the processing method of the online environment configuration of any one of the above embodiments when running.

[0143] Those skilled in the art can clearly understand the specific working process of the above-described system, device and module, and can refer to the corresponding process in the foregoing method embodiments. For the sake of brevity, no further description is given here.

[0144] Those skilled in the art can understand that the technical solutions of the present application can be embodied in the form of software product essentially or partially, and the computer software product is stored in a storage medium, and includes a plurality of program instructions to make a computer device (such as a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in the embodiments of the present application when the program instructions are run. The storage medium mentioned above includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0145] Alternatively, all or part of the steps of the foregoing method embodiments can be completed by program instruction related hardware (such as a computer device of a personal computer, a server, or a network device, etc.), and the program instructions can be stored in a computer readable storage medium. When the program instructions are executed by the processor of the computer device, the computer device executes all or part of the steps of the method described in the embodiments of the present application.

[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them. Although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that, within the spirit and principle of the present application, the technical solutions recorded in the foregoing embodiments can still be modified, or part or all of the technical features can be replaced equivalently. The modifications or replacements do not make the corresponding technical solutions deviate from the protection scope of the present application.

Claims

1. A method for configuring the online environment of a program, characterized in that, include: Before the submitted program's source code is released online, obtain the code content of the source code; The code content of the source code is analyzed to find and match preset key information. The preset key information is used to detect and verify the online environment configuration of the program to obtain the verification result. In the process of detecting and verifying the online environment configuration of the program, the matching keywords are configured in categories and sent to different configuration detection units through message queues. After receiving the parameter detection message queue, the different configuration detection units verify the online environment configuration according to the parameters. Match the corresponding alarm policy based on the verification result, and execute the corresponding alarm policy; Specifically, the code content of the source code is analyzed to find and match preset key information. This preset key information is then used to detect and verify the online environment configuration of the program, yielding verification results, including: The type of one or more detection configurations is determined based on the preset key information; When the detection configuration type includes a database configuration type, based on the key information corresponding to the database configuration type, the newly created and / or modified data sources in the source code are parsed to obtain one or more link parameters including database name, table name, field name, and field type. Using the database driver, a connection is established with the online database using the obtained connection parameters. The configuration of the online database is obtained through the database name and table name. The types of each field name are compared. When a field name is missing or the field type is inconsistent, the missing field name and the inconsistent field type are recorded as unconfigured parameters.

2. The method according to claim 1, characterized in that, The source code is submitted as a branch code to the code management platform's code repository to generate the target link; Before the submitted program's source code is released online, obtain the code content of the source code, including: The source code is merged as a branch code with the main branch code, and the target link is triggered before the merged code is deployed. The source code content is obtained according to the target link; wherein, the main branch code is the code of the project host, and the program is integrated into the project host.

3. The method according to claim 1 or 2, characterized in that, The source code is analyzed to find and match preset key information. This preset key information is then used to verify the online environment configuration of the program, yielding verification results, including: The type of one or more detection configurations is determined based on the preset key information; For each detection configuration type, the online environment configuration of the program is tested and verified using the key information corresponding to that detection configuration type, and the verification results are obtained.

4. The method according to claim 3, characterized in that, The detection configuration type includes a preset platform configuration type. The key information corresponding to this detection configuration type is used to detect and verify the online environment configuration of the program, obtaining the verification result, including: Based on the key information corresponding to the preset platform configuration type, and using regular expressions based on the specified syntax format, the newly created and / or modified code content in the source code is matched to obtain the corresponding configuration name; The project host name is obtained through the code management platform, and relevant configuration information is searched on the code management platform based on the project host name and the configuration name. Based on the interface provided by the configuration platform corresponding to the preset platform configuration type, find the value corresponding to the configuration information; The parsing tool parses the values ​​corresponding to the configuration information, and matches the parsed types with the code content of the source code. If the match is inconsistent, it is treated as an unconfigured parameter.

5. The method according to claim 3, characterized in that, The detection configuration type includes rule configuration type. The key information corresponding to this detection configuration type is used to detect and verify the online environment configuration of the program, obtaining verification results, including: Based on the key information corresponding to the rule configuration type, obtain the rule content modified in the source code. The modified rule content is compared with the rule content of the corresponding online rule platform. If the comparison is inconsistent, it is treated as an unconfigured parameter.

6. The method according to any one of claims 1 to 5, characterized in that, Match the corresponding alarm policy based on the verification result, and execute the corresponding alarm policy, including: The unconfigured parameters in the verification results are summarized to generate a detection report; An alarm message containing the detection report is generated and provided to the backend, which then configures any unconfigured parameters in the online environment based on the alarm message.

7. A processing apparatus for configuring an online environment for a program, characterized in that, include: The acquisition module is used to acquire the code content of the submitted program's source code before it is released online. The detection and verification module is used to analyze the code content of the source code, find and match preset key information, and use the preset key information to detect and verify the online environment configuration of the program to obtain the verification result. In the process of detecting and verifying the online environment configuration of the program, the matching keywords are configured in categories and sent to different configuration detection units through message queues. After receiving the parameter detection message queue, the different configuration detection units verify the online environment configuration according to the parameters. The alarm processing module is used to match the corresponding alarm policy according to the verification result and execute the corresponding alarm policy. The detection and verification module is further used for: The type of one or more detection configurations is determined based on the preset key information; When the detection configuration type includes a database configuration type, based on the key information corresponding to the database configuration type, the newly created and / or modified data sources in the source code are parsed to obtain one or more link parameters including database name, table name, field name, and field type. Using the database driver, a connection is established with the online database using the obtained connection parameters. The configuration of the online database is obtained through the database name and table name. The types of each field name are compared. When a field name is missing or the field type is inconsistent, the missing field name and the inconsistent field type are recorded as unconfigured parameters.

8. The apparatus according to claim 7, characterized in that, Also includes: The generation module is used to submit the source code as a branch code to the code management platform's code repository and generate the target link; The acquisition module is also used to merge the source code as branch code with the main branch code, and to trigger the target link before the merged code is deployed online; The source code content is obtained according to the target link; wherein, the main branch code is the code of the project host, and the program is integrated into the project host.

9. The apparatus according to claim 7 or 8, characterized in that, The detection and verification module is also used for: The type of one or more detection configurations is determined based on the preset key information; For each detection configuration type, the online environment configuration of the program is tested and verified using the key information corresponding to that detection configuration type, and the verification results are obtained.

10. The apparatus according to claim 9, characterized in that, The detection configuration type includes a preset platform configuration type, and the detection verification module is further used for: Based on the key information corresponding to the preset platform configuration type, and using regular expressions based on the specified syntax format, the newly created and / or modified code content in the source code is matched to obtain the corresponding configuration name; The project host name is obtained through the code management platform, and relevant configuration information is searched on the code management platform based on the project host name and the configuration name. Based on the interface provided by the configuration platform corresponding to the preset platform configuration type, find the value corresponding to the configuration information; The parsing tool parses the values ​​corresponding to the configuration information, and matches the parsed types with the code content of the source code. If the match is inconsistent, it is treated as an unconfigured parameter.

11. The apparatus according to claim 9, characterized in that, The detection configuration type includes rule configuration type, and the detection verification module is further used for: Based on the key information corresponding to the rule configuration type, obtain the rule content modified in the source code. The modified rule content is compared with the rule content of the corresponding online rule platform. If the comparison is inconsistent, it is treated as an unconfigured parameter.

12. The apparatus according to any one of claims 7 to 11, characterized in that, The alarm processing module is also used for: The unconfigured parameters in the verification results are summarized to generate a detection report; An alarm message containing the detection report is generated and provided to the backend, which then configures any unconfigured parameters in the online environment based on the alarm message.

13. A computer device, characterized in that, The system includes a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform a processing method for an online environment configuration of any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute, at runtime, a processing method for online environment configuration of the program according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for deploying application software

    CN104360878A

  • Deployment environment testing method and device, computer equipment and storage medium

    CN110851351A

  • Project deployment method and device, equipment and storage medium

    CN114610340A