Test environment pre-checking method and device, electronic equipment and storage medium
By automatically restoring production data and performing batch inspection and configuration, the inefficiency problem caused by manual repetitive operations in the existing technology is solved, and the efficiency and reliability of the pre-inspection of the test environment are improved.
Patent Information
- Application Number
- CN202410755824.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, a large number of manual repeated operations are required to perform environmental checks when restoring production data to a test environment, resulting in low efficiency and weak reliability.
Provides a test environment pre-check method that automatically restores production data to the test environment, checks services in batches, configures target data, and checks database connectivity to avoid manual repeated checks and improve efficiency.
Automated inspection of the test environment is realized, saving manpower and time costs, and improving the efficiency and reliability of pre-inspection of the test environment.
Smart Images

Figure CN118733443A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a test environment pre-checking method, device, electronic equipment and storage medium. Background Art
[0002] Batch data processing is a common form of non-real-time data processing in the financial field. When processing non-real-time data, it is generally processed in the underlying basic environment (i.e., the test environment). Therefore, before batch data processing, it is necessary to ensure the effectiveness of the test environment.
[0003] In the related art, generally before batch data processing is performed, each part of the test environment is checked manually, and then each part of the test environment is restored or set manually to the configuration required for data processing.
[0004] However, the above technology requires a large amount of repetitive manual operations when performing environmental inspections, resulting in low efficiency in the entire environmental inspection process. Summary of the invention
[0005] The present invention provides a test environment pre-check method, device, electronic device and storage medium, which are used to solve the defect in the prior art that the test environment needs to be checked repeatedly by manual operations when the production data is restored to the test environment, and achieve the technical effect of improving the efficiency of the test environment check.
[0006] The present invention provides a test environment pre-check method, comprising:
[0007] Restore the acquired production data to the test environment to obtain the target data;
[0008] Perform batch checks on services in the test environment and obtain service check results;
[0009] Configure the target data according to the preset test environment differentiated configuration and determine the target data configuration result;
[0010] When the service check result is that the service check is successful and the target data configuration result is that the configuration is successful, the connectivity between each database pair in the test environment is checked, the inspection result of each database pair is determined, and the inspection result of the test environment is obtained based on the inspection result of each database pair.
[0011] According to a test environment pre-check method provided by the present invention, the batch check of services in the test environment to obtain service check results includes:
[0012] Perform batch checks on the scheduling management services in the test environment; the above scheduling management services are basic services in the test environment;
[0013] When all scheduling management services are checked successfully, batch restart the application services in the test environment; the above application services are responsible for the orchestration management and processing flow of scheduling jobs;
[0014] After all application services are successfully restarted, the proxy services in the test environment are restarted in batches, and the service inspection results are obtained according to the restart results of the proxy services; the above-mentioned proxy services are services responsible for the task execution of scheduling jobs.
[0015] According to a test environment pre-check method provided by the present invention, the batch check of the scheduling management service in the test environment includes:
[0016] Check whether the status of each sub-service in the scheduling management service is normal;
[0017] If any sub-service is in an abnormal state, perform fault handling on any sub-service;
[0018] When all sub-services are in normal status, it is determined that the inspection of the scheduling management service is successful.
[0019] According to a test environment pre-check method provided by the present invention, the target data is configured according to the preset test environment differential configuration to determine the target data configuration result, including:
[0020] Unlock the first user in the target data, and reset the user password of the first user according to the password generation specification requirements of the test environment; the first user is the user corresponding to each application software and / or database;
[0021] A second user dedicated to the test environment is established, and corresponding database operation permissions are configured for the second user; and a login trigger for logging into the database is established based on the relevant information of the second user to obtain the target data configuration result.
[0022] According to a test environment pre-check method provided by the present invention, the above-mentioned establishment of a login trigger for logging into the database according to the relevant information of the second user to obtain the target data configuration result includes:
[0023] Obtaining relevant information input by the second user in the client of the database; the relevant information includes the user name of the second user and the terminal name corresponding to the terminal where the client is installed;
[0024] If the user name meets the first preset condition and the terminal name meets the second preset condition, the second user is prohibited from logging into the database; otherwise, the second user is allowed to log into the database.
[0025] According to a test environment pre-check method provided by the present invention, the connectivity between each database pair in the test environment is checked to determine the check result of each database pair, including:
[0026] Obtain each INFA program for checking connectivity of each database in the test environment, and obtain the connection string name corresponding to each INFA program;
[0027] Search the INFA instance table and INFA connection string information table of the test environment according to each connection string name to determine the query result corresponding to each connection string name;
[0028] Determine the corresponding password update script and connectivity check script according to each query result; each database pair corresponds to a password update script and a connectivity check script;
[0029] Execute the password update script and connectivity check script corresponding to each database pair, check the connectivity of the corresponding database pair, and determine the check result of each database pair.
[0030] According to a test environment pre-check method provided by the present invention, the query result of the connection string name includes the connection object name, connection string type, connection string user name, subject domain, workflow name and session name;
[0031] The above-mentioned corresponding password update script and connectivity check script are determined according to each query result, including:
[0032] The connection object name, connection string type, connection string user name and preset test environment user password corresponding to each connection string name are spliced to determine the password update script corresponding to each connection string name;
[0033] The subject domain, workflow name, session name and preset data extraction time corresponding to each connection string name are spliced to determine the connectivity check script corresponding to each connection string name.
[0034] The present invention also provides a test environment pre-checking device, comprising:
[0035] The data recovery module is used to restore the acquired production data to the test environment to obtain the target data;
[0036] The service inspection module is used to perform batch inspections on services in the test environment and obtain service inspection results;
[0037] The data configuration module is used to configure the target data according to the preset test environment differentiation configuration and determine the target data configuration result;
[0038] The database check module is used to check the connectivity between the database pairs in the test environment when the service check result is successful and the target data configuration result is successful, determine the inspection result of each database pair, and obtain the inspection result of the test environment based on the inspection result of each database pair.
[0039] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the test environment pre-check method as described above is implemented.
[0040] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the test environment pre-checking method as described in any one of the above is implemented.
[0041] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the test environment pre-checking method as described above is implemented.
[0042] The test environment pre-check method, device, electronic device and storage medium provided by the present invention obtain target data by restoring the acquired production data to the test environment, and batch checking the services in the test environment to obtain service check results, and configuring the target data according to the preset test environment differentiated configuration to obtain target data configuration results, and then, when the service check is successful and the target data configuration is successful, the connectivity between the database pairs in the test environment is checked to determine the check results of each database pair and then obtain the test environment check results. In this method, after the production data is restored to the test environment, the services in the test environment can be automatically checked, the data can be configured, and the connectivity of the database can be checked, so that manual repeated checks on the test environment can be avoided, saving labor costs and time costs. At the same time, compared with manual repeated checks on the test environment, the automatic check of the test environment of the present invention is more efficient, that is, the efficiency of pre-checking the test environment can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 It is a flow chart of the test environment pre-checking method provided by the present invention;
[0045] Figure 2 It is the overall flow chart of the test environment pre-check provided by the present invention;
[0046] Figure 3 It is a schematic diagram of a flow chart of checking services in a test environment provided by the present invention;
[0047] Figure 4 It is a flow chart of checking the scheduling management service provided by the present invention;
[0048] Figure 5 It is a schematic diagram of a process of restarting an application service provided by the present invention;
[0049] Figure 6 It is a schematic diagram of the process of restarting the proxy service provided by the present invention;
[0050] Figure 7 It is a schematic diagram of the production data localization configuration process provided by the present invention;
[0051] Figure 8 It is a login process diagram of the login trigger provided by the present invention;
[0052] Fig. 9 It is a schematic diagram of a database connectivity check process based on INFA provided by the present invention;
[0053] Fig.10 It is a schematic diagram of database connection based on INFA provided by the present invention;
[0054] Fig.11 It is a structural schematic diagram of the test environment pre-checking device provided by the present invention;
[0055] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] Batch data processing is a common form of non-real-time data processing in the financial field. It is a set of operations for data processing, which is completed through stored procedures, shell scripts and related Java programs. The effectiveness of the underlying test environment is supported by the availability of batch services, the validity of test data, and the connectivity between the data warehouse and various databases.
[0058] At present, in order to ensure the effectiveness of the test environment test, it is necessary to restore the production data regularly. However, after the production data is restored to the test environment after being desensitized, some differentiated configurations of production tests will be lost, resulting in the data being unable to meet the needs of the test environment to quickly start for testing. In addition, the data warehouse based on the CTM+INFA batch framework is connected to the scattered, relatively independent, and heterogeneous source business databases. The connectivity of the relevant data needs to be compared and verified after the data is restored. After desensitization, the production data needs to be called up for batch services, localized for production data, and checked for connectivity of related databases. The availability of batch services involves the availability of CTM management nodes, application nodes, and various Agent services and INFA services; the localization of production data involves the differentiated configuration of the test production environment, including password reset of application data users, establishment and authorization of test database users, and database configuration address changes; the database connectivity check is based on the connectivity verification of the source database data written to the destination database after extraction, processing, and deformation under the INFA framework. Its essence is to verify that the relevant INFA data users can access and process each database normally.
[0059] At present, when pre-checking the test environment, most of the time, each part of the test environment is checked manually, and then each part of the test environment is restored or set to the configuration required for data processing manually. A large number of repetitive manual operations are required in the process of pre-checking the environment, resulting in low efficiency and poor reliability of the entire environment inspection process. Based on this, the present invention provides a test environment pre-check method, device, electronic device and storage medium, which can support the test environment to adapt to the rapid iteration of the development and testing cycle, and is a set of fast and complete solutions after the recovery of production data, which can support the pre-check of the test batch environment, and ensure that the fast, stable and continuous test environment can meet the effectiveness of the test.
[0060] The above CTM refers to Control-M, which is a cross-platform batch job scheduling management software that adopts C / S mode. Enterprise Manager and server are installed on the server, and Agent is installed on the controlled host. Agent can submit the job flow defined by Control-M on the host and return the running results. Enterprise Manager can fully monitor the running status of all batch jobs, and can control the running conditions and process intervention of jobs in a variety of ways.
[0061] INFA (Information Integrator) is a data integration framework used to design and execute data extraction, transformation, and loading (ETL) processes. In INFA, data extraction usually involves creating a source database connection and a target database connection.
[0062] It should be noted that the test environment pre-check method of the present invention is a check scheme based on the CTM and INFA frameworks.
[0063] The execution subject of the embodiment of the present invention may be a test environment pre-check device, or an electronic device, or other device including an electronic device or a test environment pre-check device. The following embodiments are described with the electronic device as the execution subject.
[0064] Combine the following Figure 1-Figure 10 The test environment pre-check method of the present invention is described.
[0065] Figure 1 is a flow chart of the test environment pre-check method provided by the present invention, see Figure 1 As shown, the method may include the following steps:
[0066] S102, restoring the acquired production data to the test environment to obtain target data.
[0067] In this step, the actual production data may be obtained regularly, periodically or irregularly, and then the production data may be desensitized and the like, and the production data may be restored to the test environment to obtain target data synchronized with the production data.
[0068] The production data here can be, for example, financial data generated in the actual production process in the financial field, such as budget data, settlement data, etc. The test environment here refers to the software environment or hardware environment or a combination of software and hardware built for processing data. The software environment can be, for example, the software services required for processing data, the hardware environment can be, for example, the hardware equipment required for processing data, and the combination of software and hardware can include both software services and hardware equipment.
[0069] S104, performing batch inspection on the services in the test environment to obtain service inspection results.
[0070] Among them, when the production data is restored in the test environment, the connection between the batch service of the related test environment and the database will be disconnected. After the production data is desensitized and restored, it is necessary to automatically restart the services of the related batch framework to ensure that the basic services of batch operation are normal. Therefore, it is necessary to perform batch checks on the services in the test environment.
[0071] In this step, as mentioned above, the test environment includes the software environment, and the software environment may include services provided for subsequent data processing. The services here are generally multiple services, that is, batch services, such as services for scheduling data, services for accessing databases during data processing, etc. During the inspection, after the production data is restored to the test environment, all of these services can be automatically checked in batches. The inspection here can be, for example, checking the startup and availability of the service, such as checking whether the service needs to be restarted, whether the service is normal, whether the service has a fault, etc.
[0072] The above inspection may be, for example, batch inspection of all sub-services in a certain service, and then batch inspection of all sub-services in another service, to complete batch inspection of all services.
[0073] When each service is inspected, the inspection result of the service can be obtained, and the inspection results of all services can be obtained by combining the inspection results of each service. Alternatively, it can be determined based on the inspection result of the previous service to perform a batch inspection on the next service, and the inspection result of the next service can be obtained, and so on until the last service is inspected and its inspection result is obtained, and the inspection results of all services are obtained based on the inspection result of the last service. Or it can be other ways, which are not specifically limited here.
[0074] In addition, the above service check result refers to the check result of all services, which may include service check success or service check failure. For example, if a service is in a normal state or restarts successfully, it can be considered that the service check is successful, otherwise the service check fails. Here, service check success refers to the success of all service checks, and service check failure can be any service check failure, such as if the service has a fault or other problems, the check will fail.
[0075] S106, configuring the target data according to the preset test environment differentiated configuration, and determining the target data configuration result.
[0076] Among them, after the general production data is restored to the test environment after being desensitized, some differentiated configurations of the production test will be lost. In this case, some differentiated configurations can be pre-set for the test environment, and then according to the pre-set differentiated configurations, the target data restored to the test environment is automatically updated or information configured to obtain the configuration result of the target data. The configuration result after the target data is configured here can include the success or failure of the configuration of the target data.
[0077] It should be noted that there is no particular order in which S104 and S106 are executed. For example, the two can be executed in parallel, or S106 can be executed first and then S104, or S104 can be executed first and then S106.
[0078] S108, when the service check result is that the service check is successful and the target data configuration result is that the configuration is successful, check the connectivity between the database pairs in the test environment, determine the inspection results of each database pair, and obtain the inspection results of the test environment based on the inspection results of each database pair.
[0079] In this step, after checking the services of the test environment and configuring the target data in the test environment, if all services are checked successfully and the target data is configured successfully, the next step can be automatically performed to check the connectivity of the database in the test environment.
[0080] Optionally, this step is mainly based on the INFA tool when checking the connectivity of the database. As mentioned above, the INFA tool is generally used for data extraction, conversion and loading processes between two databases, which generally include a source database and a target database, that is, a database pair. Therefore, when checking the connectivity of the database here, what is actually checked by the INFA tool is the connectivity between the database pairs.
[0081] In addition, the test environment generally includes multiple databases, and correspondingly there will be multiple database pairs. In this case, the INFA tool can be used to extract, convert, and load data between each database pair to check whether the two databases of each database pair are connected, that is, to check whether the user corresponding to the INFA tool can access the two databases normally. If so, the two databases are connected, otherwise they are not connected.
[0082] Furthermore, the connectivity between each database pair can be checked in batches to obtain the check result of each database pair, and the check result can include whether the two databases are connected or not connected. Then, the check result of the test environment is obtained through the check result of each database pair. For example, if the check results of each database pair are all connected, the check result of the test environment is a successful check. If the check result of one or more database pairs is not connected, the check result of the test environment can be a failed check. At this time, the disconnected data pairs can be repaired to make them connected.
[0083] See also Figure 2 The overall flow chart of the test environment pre-check shown in the figure, combined with the above description, shows that after the production data is desensitized and restored to the test environment, the batch services of the test environment can be checked (for example, it can be a startup and availability check), and the production data restored in the test environment can be differentially configured (also called localized configuration), and then based on the previous successful service check and data configuration, the INFA-based database connectivity check is automatically performed, and after the entire test environment check is successful, batch data processing is performed in the test environment. Such automated batch service checks, production data localization configuration, and INFA-based database connectivity checks can improve the efficiency of pre-checking the test environment, and thus improve the ability of the test environment to be quickly and effectively ready.
[0084] In this embodiment, the target data is obtained by restoring the acquired production data to the test environment, and the services in the test environment are batch checked to obtain the service inspection results, and the target data is configured according to the preset test environment differential configuration to obtain the target data configuration results, and then, when the service inspection is successful and the target data configuration is successful, the connectivity between the database pairs in the test environment is checked to determine the inspection results of each database pair and then obtain the inspection results of the test environment. In this method, after the production data is restored to the test environment, the services in the test environment can be automatically checked, the data can be configured, and the connectivity of the database can be checked, so that manual repeated inspection of the test environment can be avoided, saving labor costs and time costs. At the same time, compared with manual repeated inspection of the test environment, the automatic inspection of the test environment of the present invention is more efficient, that is, the efficiency of pre-inspection of the test environment can be improved.
[0085] As mentioned above, the test environment generally includes multiple services. The following embodiment describes the process of batch checking each service in the test environment.
[0086] In an exemplary embodiment, the above S104 may specifically include the following steps:
[0087] Step A1, batch check the scheduling management service in the test environment; the above scheduling management service is the basic service in the test environment.
[0088] The test environment of the present invention is a task processing model based on CTM and various types of databases. The batch service inspection includes three node services: EM (Execution Management) node scheduling management service, Server (Server) node scheduling application service, Agent node scheduling agent service. The specific inspection process is as follows Figure 3 As shown in the figure, the scheduling management service is the basic service, which will provide a unified GUI (Graphical User Interface) applicable to all platforms to manage and control all servers and agents. The application service is the core service for batch processing, responsible for the scheduling management and processing flow of scheduling jobs, and an engine that provides job flow status information. It must be based on the scheduling management service. The scheduling agent service must be based on the application service, mainly responsible for the task execution of scheduling jobs, and can be installed on various operating systems.
[0089] The following is an explanation of the process of checking the scheduling management service. The scheduling management service is responsible for checking whether the services of each scheduling management component are started normally and whether the database connection is normal. If not, the service will be restarted and checked after the fault is resolved. If there is no problem in the inspection, the inspection process of the scheduling management service ends.
[0090] The scheduling management service generally includes multiple services (also called sub-services), which mainly include the following services:
[0091] Gateway service: handles the communication between the EM node scheduling management service and the Server node scheduling application service. The gateway is only responsible for managing who communicates with whom, and the specific communication is handled by the CMS;
[0092] CMS service: Content Management System, responsible for handling the communication with the Configuration agent of the Server node, through which it processes the requests issued by the administrator;
[0093] GCS service: Ground Communication System, which publishes global conditions to different Control-M / Servers;
[0094] BIM service: perform key operations and issue early warnings;
[0095] Forecast service: helps to view the tasks that need to be performed on a certain day in the future;
[0096] Naming Service: used to provide the external service interface of EM node;
[0097] Configuration agent service: used to communicate with Control-M / Server and issue job scheduling instructions;
[0098] SELF service: self-service for scheduling management services;
[0099] GUI_Server: Graphical user interface service;
[0100] Web Server: web page service.
[0101] When performing batch checks on multiple subservices / services in a scheduling management service, as an option, see Figure 4 The scheduling management service inspection process diagram shown can be used to check whether the status of each sub-service in the scheduling management service is normal, that is, each sub-service can be checked in batches in parallel to see whether it is normal or has a fault, and the inspection result of each sub-service can be obtained.
[0102] Among them, if any sub-service is in an abnormal state, then any sub-service will be fault-handled, that is, if the detection result of a sub-service shows that the sub-service has a fault, that is, it is in an abnormal state, then any sub-service can be fault-handled until the fault of any sub-service is eliminated and it is converted to a normal state. In this way, all sub-services that have a fault or are in an abnormal state can be fault-handled until the faults are eliminated and converted to a normal state. Then, when all sub-services are in a normal state, it can be determined that the inspection of the scheduling management service is successful, that is, the inspection result of the scheduling management service is that all sub-services in the scheduling management service have been successfully inspected.
[0103] Step A2: when all scheduling management services are checked successfully, batch restart the application services in the test environment; the above application services are services responsible for the orchestration management and processing flow of scheduling jobs.
[0104] In this step, after all sub-services in the scheduling management service have been checked successfully, that is, the basic services of the test environment have been checked successfully, you can continue to check the application services. The check of application services in this step is mainly to batch restart various application services in the application services and check whether the restart is successful.
[0105] Specifically, the restart of application services includes: the Server node application service communicates with the Control-M / EM node (scheduling management service) through the Gateway, interacts with EM through the Configuration Manager Server, has an independent knowledge base, communicates with the agent that executes the job through the server-to-agent and agent-to-server ports, and is responsible for restarting batch application services and monitoring to ensure the availability of batch application services.
[0106] See also Figure 5 The process diagram of restarting application services shown in the figure mainly includes: first stop monitoring, then stop service, then start service, and then start monitoring. During these processes, you can check whether they are successful, such as whether the service is stopped successfully, whether the service is started successfully, etc., and finally obtain the inspection result of whether all application services are restarted successfully.
[0107] Step A3, after all application services are successfully restarted, the proxy services in the test environment are restarted in batches, and service inspection results are obtained according to the restart results of the proxy services; the above-mentioned proxy services are services responsible for scheduling the execution of job tasks.
[0108] In this step, after all application services are successfully restarted, the proxy services in the test environment can be checked. The check of the proxy services in this step mainly involves batch restarting various proxy services in the proxy services and checking whether the restart is successful.
[0109] Specifically, the agent node executes the proxy service and is responsible for receiving instructions to execute specific jobs on the application server. The agent is deployed on the ETL server, BDP server, and CTM server respectively. Four agents are established on the CTM server to respectively act as agents for the four databases of CTM knowledge base, data warehouse EDW / edw, adaptation market ADS / ads, and new market BAM / bam; the ETL and BDP agents are deployed on their respective application servers to act as agents for the INFA platform and big data platform jobs, and start the service as an administrator user. After data recovery, each agent process will have communication anomalies due to the restart of the application service. Each agent process needs to be restarted to ensure the availability of the batch framework service.
[0110] See also Figure 6The process diagram of agent service restart shown in the figure mainly includes restarting the agent services deployed on different servers when the agent services are restarted in batches. During the restart process of the agent services deployed on each server, it is possible to check whether the restart is successful. Finally, the inspection result of whether the restart of all agent services is successful is obtained through the inspection result of whether the restart of each agent service is successful.
[0111] After all proxy services are successfully restarted, it can be determined that the inspection result of the entire service framework (including scheduling management services, application services, and proxy services) is a successful service inspection, and then a subsequent database connectivity check can be performed.
[0112] In this embodiment, by performing cascade checks on the dispatch proxy service, application service, and proxy service in the entire service framework, that is, automatically checking the next service based on the successful check of the former, the efficiency and accuracy of batch service checks can be improved. Furthermore, when checking the dispatch management service, the faulty sub-service can be handled, which can facilitate the rapid success of the dispatch management service check. At the same time, the dispatch management service check is determined to be successful only when all sub-services are in normal status. This ensures that all sub-services in the dispatch management service are successfully checked, avoiding the problem that some sub-services are unavailable and affecting the use of other services.
[0113] In the actual testing process, in order to ensure the effectiveness of the test, the test environment will be regularly restored from the production data after desensitization to the test environment, which usually leads to the unavailability of the test environment data, such as the locking of various applications and database users, the modification of user passwords, the missing of test users and login triggers, etc. In order to avoid this problem, after the production data is restored to the test environment, the restored target data can be localized / differentiated. The following embodiment describes the process of localizing / differentiating the target data restored to the test environment.
[0114] In one exemplary embodiment, see Figure 7 As shown in the production data localization configuration process diagram, the above S106 may specifically include the following steps:
[0115] Step B1, unlocking the first user in the target data, and resetting the user password of the first user according to the password generation specification requirements of the test environment; the above-mentioned first user is the user corresponding to each application software and / or database.
[0116] Among them, the target data may include user data, which may include a first user. The first user may be a user with greater authority, such as an application / application software user (for example, a user registered on the application software), a database user, a user corresponding to a development or R&D personnel, etc.
[0117] Generally, when production data is restored or imported into the test environment after data deformation / massaging, the passwords of application users and database users will be reset to the passwords of production users (i.e. users in the production environment). However, the interactions between applications in the test environment and background tasks will still use the original test user's account and password as verification information for communication. This will be mistakenly considered as frequent use of incorrect passwords to log in in the test environment and exceeding the upper limit of input errors, thus locking the application user. Based on the identifiers corresponding to the accounts of each application user and database user, each user account is unlocked separately, so that the accounts of these application users and database users are all available in the test environment.
[0118] In addition, from the perspective of data security, the user passwords of applications and databases are inherent differences between the production and test environments. Therefore, after data is desensitized and restored from the production to the test environment, the user passwords of the relevant applications and databases need to be reset to the passwords in the test environment in accordance with the generation and specification requirements of the test environment passwords to ensure the availability of each application in the test environment.
[0119] The password generation specification of the test environment here can be set according to the specific situation of the test environment. For example, the password can be composed of numbers + letters + special characters.
[0120] Step B2, establishing a second user dedicated to the test environment, and configuring corresponding database operation permissions for the second user; and establishing a login trigger for logging into the database according to relevant information of the second user to obtain target data configuration results.
[0121] Among them, the second user can be a dedicated user belonging to the test environment, which can also be called a test user. In order to distinguish whether the relevant operations of the database are human test behaviors or application behaviors, it is necessary to establish a set of dedicated users for the test environment for testers to query the database and developers to troubleshoot problems. Specifically, one or more second user accounts can be established in the test environment. After the second user is established, the corresponding database operation permissions can be assigned to the second user. Generally, the permissions assigned to the second user will be less than the permissions assigned to the first user. For example, the second user can only query the database, but cannot read and write the database.
[0122] After the second user dedicated to the test environment is established, the second user is specifically granted or authorized, that is, specific database operation permissions are allocated. This can, on the one hand, avoid confusion in permissions caused by excessive manual operations of the test user on the database, and on the other hand, meet the basic query needs of the test-dedicated user for the database, thereby better ensuring the effectiveness of the test.
[0123] Furthermore, after the second user dedicated to the test environment is established and authorized, a login trigger for logging into the database can be established. The login trigger will be triggered when the user logs into the database client, and the login trigger determines whether the user can log in successfully. The login trigger, that is, for the test environment such as the data warehouse, there are users with high role permissions such as XYD and MIG in production. During the production process, specific network firewalls and operating specifications can be used to avoid abnormal user access. The test environment itself is a process version state, and frequent login access by these two users is required for problem troubleshooting and deployment actions. Here, in order to avoid the frequent login and use of high-authority users in the test environment, it is necessary to establish a login trigger to limit the arbitrary use of high-authority users in the test environment to access the database.
[0124] The login process diagram of the login trigger can be found in Figure 8 As shown, as an optional embodiment, when the second user logs in to the client of the database, the relevant information entered by the second user in the client of the database can be obtained; the above-mentioned relevant information includes the user name of the second user and the terminal name corresponding to the terminal where the client is installed, such as the user name, password, IP (Internet Protocol), port, instance name, terminal name and other information. After the second user clicks to log in, he can try to connect and log in. The background can obtain the user name and terminal name of the current second user accessing the database. If the user name meets the first preset condition and the terminal name meets the second preset condition, the second user is prohibited from logging in to the database, otherwise the second user is allowed to log in to the database. For example, if the second user currently accessing is a high-authority user, such as XYD or MIG user, and the terminal name accessed is marked with the "KF" character, access restrictions will be made, and relevant error information that the relevant user is not allowed to access the database will pop up, otherwise the login can be successful directly.
[0125] In this embodiment, by automatically acquiring target data that is restored in the current test environment and is synchronized with production data, the target data is automatically updated according to the preset test environment differentiation configuration to obtain corresponding test data. This can improve the degree of automation in updating test data for the target data, effectively improve the efficiency and reliability of test data processing, and improve the rapid readiness capability of the test environment.
[0126] On the basis of successful service check and test data configuration in the above test environment, the connectivity of the database in the test environment may be checked. The following embodiment will describe the process of checking the connectivity of the database in the test environment.
[0127] In one exemplary embodiment, see Fig. 9 In the schematic diagram of the INFA-based database connectivity check process, the above S108 checks the connectivity between each database pair in the test environment and determines the check result of each database pair, which may include the following steps:
[0128] Step C1, obtaining each INFA program for performing connectivity check on each database in the test environment, and obtaining a connection string name corresponding to each INFA program.
[0129] Among them, INFA is a tool for data extraction, conversion and loading. Through the INFA program, data transmission and synchronization between heterogeneous databases can be realized. For the batch framework, in order to ensure the continuity of the overall batch data processing, it is necessary to check in advance whether the links of each data node are unobstructed, mainly including the source business system (also called the source library) and the data warehouse, the data warehouse and the warehouse market, and the warehouse market. Fig.10 In the diagram of database connection based on INFA, the source business system and the data warehouse can include the connection of three types of database pairs: DB2-ORACLE, ORACLE-ORACLE, and MYSQL-ORACLE. The connection between the data warehouse and the warehouse market includes the connection of three types of database pairs: ORACLE-ORACLE, ORACLE-MYSQL, and ORACLE-DaMeng. The connection between the warehouse market and other systems mainly includes the connection of three types of database pairs: ORACLE-ORACLE, ORACLE-DB2, and ORACLE-DaMeng.
[0130] At present, for different source and target databases in production and testing, inconsistent operation permissions lead to inconsistent users. Generally, read-only permissions are required for the source database, and read-write permissions are required for the target database. In addition, in order to ensure the isolation of database users in actual production and testing, the read and write users of each database are inconsistent. Therefore, in order to ensure that the database permissions are correct and the relevant database connection users and passwords can access each database normally, it is necessary to perform database connectivity checks based on the INFA program to ensure normal interaction between batch database pairs.
[0131] To ensure the effectiveness of the test environment test, the version of the INFA program will be regularly exported from the production environment and restored to the test environment. The recovery frequency and the version basis of the recovery are consistent with the database recovery. After being exported from the production in the REP file format, it is imported into the INFA client of the test environment. At the same time, the configuration information of all INFA programs in the test environment will be restored to the production configuration information, including the connection string information.
[0132] Each of the above database pairs will correspond to an INFA program. After the production data is restored to the test environment, the INFA program of each database pair will also be restored from production and imported into the INFA client in the test environment. At the same time, the configuration information of each INFA program will also be restored to the production configuration information. The production configuration information of each INFA program includes the corresponding connection string information, which may include the connection string name.
[0133] Step C2: query the INFA instance table and the INFA connection string information table of the test environment according to each connection string name to determine the query result corresponding to each connection string name.
[0134] After obtaining the connection string name of each INFA program as described above, you can search in the preset INFA instance table and INFA connection string information table. Specifically, you can perform an associated query based on the connection string name, and remove invalid backup and initialization Subject_area domains in the relevant environment. Since the same connection string name may be used by multiple Sessions, it is necessary to group the records of the same connection string name according to the object_name object name and sort and mark them according to the session_name session name. Finally, remove duplicates and only query the records marked with a sequence number of 1 to obtain the query results corresponding to each INFA program or each connection string name. Optionally, the query result of the connection string name may include object_name connection object name, object_subtype connection string type, user_name connection string user name, subject_area subject domain, workflow_name workflow name, and session_name session name.
[0135] It should be noted that the above INFA instance table and INFA connection string information table may include connection string information, session information, etc. for multiple INFA programs and multiple environments. This step searches by connection string name, which is essentially to search for connection string information and session information actually used in the current test environment.
[0136] Step C3, determining corresponding password update scripts and connectivity check scripts according to the query results; each database pair corresponds to a password update script and a connectivity check script.
[0137] In this step, based on the query results obtained in C2 above, for each connection string or each INFA program, optionally, the connection object name, connection string type, connection string user name and preset test environment user password corresponding to each connection string name can be spliced to determine the password update script corresponding to each connection string name; and the subject domain, workflow name, session name and preset data extraction time corresponding to each connection string name can be spliced to determine the connectivity check script corresponding to each connection string name.
[0138] The preset test environment user password can be set according to the actual situation of the test environment, for example, it can be a password composed of numbers, letters, etc. The preset data extraction time can also be set according to the actual situation, for example, it can be a long time ago. For example, if the data stored in the database starts from 1990, the data extraction time here can be set to a time before 1990, such as 1890.
[0139] Step C4, executing the password update script and connectivity check script corresponding to each database pair, checking the connectivity of the corresponding database pair, and determining the check result of each database pair.
[0140] In this step, after obtaining a password update script and a connectivity check script corresponding to each INFA program, an INFA program corresponds to a database pair, that is, a database pair will correspond to a password update script and a connectivity check script, then the password update script of each database pair can be executed, and the user passwords (also called connection passwords) of the preset test environment can be reset to the connection string of the corresponding INFA program in batches to achieve batch password update. At the same time, the connectivity check script of each database pair can be executed, and data can be extracted according to the preset long-term date in the connectivity check script as a parameter, and the connectivity between the source library and the target library of the corresponding INFA degree connection can be checked in batches, that is, the connectivity of the INFA connection string can be tested in batches. At the same time, the inspection results can be recorded in the INFA log table, and then the connection string reported in the INFA log table can be repaired.
[0141] In this embodiment, by restoring the production data based on the connection string information of the existing production environment, the corresponding relationship between the relevant connection string information and each session is automatically queried and the session information of the same connection string is deduplicated. At the same time, automatic batch connection string password reset is performed to ensure that the password design rules of the test environment are met. At the same time, the connectivity of the batch connection strings is verified based on the INFA program. In this way, the connectivity between database pairs can be automatically checked, thereby improving the efficiency and reliability of the connectivity check between database pairs.
[0142] The test environment pre-checking device provided by the present invention is described below. The test environment pre-checking device described below and the test environment pre-checking method described above can be referred to each other.
[0143] Fig.11 is a schematic diagram of the structure of the test environment pre-checking device provided by the present invention, see Fig.11 As shown, the device may include:
[0144] The data recovery module 210 is used to recover the acquired production data to the test environment to obtain the target data;
[0145] The service inspection module 220 is used to perform batch inspection on the services in the test environment and obtain service inspection results;
[0146] The data configuration module 230 is used to configure the target data according to the preset test environment differential configuration and determine the target data configuration result;
[0147] The database check module 240 is used to check the connectivity between each database pair in the test environment when the service check result is that the service check is successful and the target data configuration result is that the configuration is successful, determine the inspection result of each database pair, and obtain the inspection result of the test environment based on the inspection result of each database pair.
[0148] In an exemplary embodiment, the service inspection module 220 includes:
[0149] A management service inspection unit, used to perform batch inspection on the scheduling management service in the test environment; the above scheduling management service is a basic service in the test environment;
[0150] The application service inspection unit is used to batch restart the application services in the test environment when the scheduling management services are all successfully inspected; the above application services are services responsible for the orchestration management and processing flow of scheduling jobs;
[0151] The proxy service inspection unit is used to batch restart the proxy services in the test environment after all application services are successfully restarted, and obtain service inspection results based on the restart results of the proxy services; the above-mentioned proxy service is a service responsible for scheduling the task execution of the job.
[0152] Optionally, the above-mentioned management service inspection unit is specifically used to check whether the status of each sub-service in the scheduling management service is normal; if any sub-service is in an abnormal state, then any sub-service is fault-handled; when all sub-services are in normal status, it is determined that the scheduling management service inspection is successful.
[0153] In an exemplary embodiment, the data configuration module 230 includes:
[0154] A first user configuration unit, used to unlock the first user in the target data and reset the user password of the first user according to the password generation specification requirements of the test environment; the first user is a user corresponding to each application software and / or database;
[0155] The second user configuration unit is used to establish a second user dedicated to the test environment and configure corresponding database operation permissions for the second user; and to establish a login trigger for logging into the database according to the relevant information of the second user to obtain the target data configuration result.
[0156] Optionally, the above-mentioned second user configuration unit is specifically used to obtain relevant information entered by the second user in the client of the database; the above-mentioned relevant information includes the user name of the second user and the terminal name corresponding to the terminal on which the client is installed; if the user name meets the first preset condition and the terminal name meets the second preset condition, the second user is prohibited from logging into the database, otherwise the second user is allowed to log into the database.
[0157] In an exemplary embodiment, the above-mentioned database check module 240 is specifically used to obtain each INFA program that performs connectivity check on each database in a test environment, and obtain the connection string name corresponding to each INFA program; query the INFA instance table and the INFA connection string information table of the test environment according to each connection string name, and determine the query result corresponding to each connection string name; determine the corresponding password update script and connectivity check script according to each query result; each database pair corresponds to a password update script and a connectivity check script; execute the password update script and connectivity check script corresponding to each database pair, check the connectivity of the corresponding database pair, and determine the check result of each database pair.
[0158] Optionally, the query results of the above-mentioned connection string name include the connection object name, connection string type, connection string user name, subject domain, workflow name and session name; the above-mentioned database check module 240 is specifically used to splice the connection object name, connection string type, connection string user name and the preset test environment user password corresponding to each connection string name, and determine the password update script corresponding to each connection string name; splice the subject domain, workflow name, session name and preset data extraction time corresponding to each connection string name, and determine the connectivity check script corresponding to each connection string name.
[0159] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the test environment pre-check method, which includes: restoring the acquired production data to the test environment to obtain the target data; performing batch checks on the services in the test environment to obtain service check results; configuring the target data according to the preset test environment differential configuration to determine the target data configuration result; when the service check result is that the service check is successful and the target data configuration result is that the configuration is successful, checking the connectivity between the database pairs in the test environment to determine the check results of the database pairs, and obtaining the test environment check results according to the check results of the database pairs.
[0160] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0161] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the test environment pre-check method provided by the above methods, which includes: restoring the acquired production data to the test environment to obtain target data; performing batch checks on the services in the test environment to obtain service inspection results; configuring the target data according to a preset differentiated configuration of the test environment to determine the target data configuration result; when the service inspection result is that the service inspection is successful and the target data configuration result is that the configuration is successful, checking the connectivity between each database pair in the test environment to determine the inspection result of each database pair, and obtaining the inspection result of the test environment based on the inspection result of each database pair.
[0162] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the test environment pre-check method provided by the above-mentioned methods, the method comprising: restoring the acquired production data to the test environment to obtain target data; performing batch checks on services in the test environment to obtain service inspection results; configuring the target data according to a preset differentiated configuration of the test environment to determine the target data configuration result; when the service inspection result is that the service inspection is successful and the target data configuration result is that the configuration is successful, checking the connectivity between each database pair in the test environment to determine the inspection result of each database pair, and obtaining the inspection result of the test environment based on the inspection result of each database pair.
[0163] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A test environment pre-check method, characterized in that: include: Restore the acquired production data to the test environment to obtain the target data; Performing batch inspection on the services in the test environment to obtain service inspection results; Configuring the target data according to a preset test environment differentiated configuration to determine a target data configuration result; When the service check result is that the service check is successful and the target data configuration result is that the configuration is successful, the connectivity between the database pairs in the test environment is checked, the inspection results of each database pair are determined, and the inspection results of the test environment are obtained based on the inspection results of each database pair.
2. The test environment pre-check method according to claim 1, characterized in that: The batch checking of the services in the test environment to obtain service checking results includes: Performing batch inspection on the scheduling management service in the test environment; the scheduling management service is a basic service in the test environment; When the scheduling management services are all checked successfully, the application services in the test environment are restarted in batches; the application services are services responsible for the orchestration management and processing flow of scheduling jobs; After the application services are all restarted successfully, the proxy services in the test environment are restarted in batches, and service inspection results are obtained according to the restart results of the proxy services; the proxy services are services responsible for scheduling the execution of tasks of jobs.
3. The test environment pre-check method according to claim 2, characterized in that: The batch checking of the scheduling management service in the test environment includes: Check whether the status of each sub-service in the scheduling management service is normal; If any sub-service is in an abnormal state, a fault handling is performed on the sub-service; When all the sub-services are in normal status, it is determined that the inspection of the scheduling management service is successful.
4. The test environment pre-check method according to any one of claims 1 to 3, characterized in that: The configuring the target data according to the preset test environment differentiated configuration and determining the target data configuration result includes: Unlock the first user in the target data, and reset the user password of the first user according to the password generation specification requirements of the test environment; the first user is the user corresponding to each application software and / or database; A second user dedicated to the test environment is established, and corresponding database operation permissions are configured for the second user; and a login trigger for logging into the database is established based on the relevant information of the second user to obtain the target data configuration result.
5. The test environment pre-check method according to claim 4, characterized in that: The step of establishing a login trigger for logging into the database according to the relevant information of the second user to obtain the target data configuration result includes: Obtaining relevant information input by the second user in the client of the database; the relevant information includes the user name of the second user and the terminal name corresponding to the terminal where the client is installed; If the user name meets a first preset condition and the terminal name meets a second preset condition, the second user is prohibited from logging into the database; otherwise, the second user is allowed to log into the database.
6. The test environment pre-check method according to any one of claims 1 to 3, characterized in that: The checking of connectivity between each database pair in the test environment and determining the checking result of each database pair includes: Obtaining each INFA program for performing connectivity check on each of the databases in the test environment, and obtaining a connection string name corresponding to each of the INFA programs; Searching the INFA instance table and the INFA connection string information table of the test environment according to each of the connection string names, and determining the query results corresponding to each of the connection string names; Determine a corresponding password update script and a connectivity check script according to each of the query results; each of the database pairs corresponds to a password update script and a connectivity check script; The password update script and connectivity check script corresponding to each database pair are executed to check the connectivity of the corresponding database pair and determine the check result of each database pair.
7. The test environment pre-check method according to claim 6, characterized in that: The query result of the connection string name includes the connection object name, connection string type, connection string user name, subject domain, workflow name and session name; Determining the corresponding password update script and connectivity check script according to each of the query results includes: The connection object name, connection string type, connection string user name and preset test environment user password corresponding to each connection string name are spliced to determine the password update script corresponding to each connection string name; The subject domain, workflow name, session name and preset data extraction time corresponding to each connection string name are spliced to determine the connectivity check script corresponding to each connection string name.
8. A test environment pre-checking device, characterized in that: include: The data recovery module is used to restore the acquired production data to the test environment to obtain the target data; A service inspection module, used to perform batch inspection on the services in the test environment and obtain service inspection results; A data configuration module, used to configure the target data according to a preset test environment differential configuration and determine the target data configuration result; The database checking module is used to check the connectivity between the database pairs in the test environment, determine the inspection results of each database pair, and obtain the inspection results of the test environment based on the inspection results of each database pair when the service inspection result is that the service inspection is successful and the target data configuration result is that the configuration is successful.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the test environment pre-check method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the test environment pre-check method according to any one of claims 1 to 7 is implemented.
