CN117152861A - Automatic inspection method, device, electronic equipment and computer readable medium - Google Patents

Automatic inspection method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN117152861A
CN117152861A CN202311175401.6A CN202311175401A CN117152861A CN 117152861 A CN117152861 A CN 117152861A CN 202311175401 A CN202311175401 A CN 202311175401A CN 117152861 A CN117152861 A CN 117152861A
Authority
CN
China
Prior art keywords
server
grouping
inspection
script
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311175401.6A
Other languages
Chinese (zh)
Inventor
陈跃飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202311175401.6A priority Critical patent/CN117152861A/en
Publication of CN117152861A publication Critical patent/CN117152861A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C1/00Registering, indicating or recording the time of events or elapsed time, e.g. time-recorders for work people
    • G07C1/20Checking timed patrols, e.g. of watchman
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses an automatic inspection method, an automatic inspection device, electronic equipment and a computer readable medium, and relates to the technical field of automatic program design. One embodiment of the method comprises the following steps: receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, thereby receiving server information returned by each server; determining each grouping strategy and grouping results corresponding to each grouping strategy according to the information of each server, and transmitting each grouping strategy and the grouping results corresponding to each grouping strategy to a client; and receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface, so as to receive a patrol script returned by the script generation interface. The technical problems of low inspection script development efficiency and insufficient quality can be solved.

Description

Automatic inspection method, device, electronic equipment and computer readable medium
Technical Field
The present invention relates to the field of automatic programming, and in particular, to an automatic inspection method, an apparatus, an electronic device, and a computer readable medium.
Background
At present, the inspection scheme is to manually inspect by developing inspection scripts, the inspection scripts also need to be adapted to different manufacturers, system architectures, operating systems and the like, and for the situation that the types of manufacturers, system architectures, operating systems and the like are relatively large, different inspection scripts need to be developed for each server, so that the development efficiency is low; moreover, manual development of the inspection script is prone to errors, resulting in insufficient quality of the inspection script.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide an automatic inspection method, an apparatus, an electronic device, and a computer readable medium, so as to solve the technical problems of low inspection script development efficiency and insufficient quality.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided an automatic inspection method, including:
receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, thereby receiving server information returned by each server;
determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client;
Receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface;
and sending the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
Optionally, determining each grouping policy and a grouping result corresponding to each grouping policy according to server information returned by each server, including:
determining each grouping element according to the server information returned by each server;
combining the grouping elements to obtain grouping strategies;
and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
Optionally, the server information includes at least one of:
vendor name, system architecture name, operating system name and version number, server name.
Optionally, the routing inspection script is issued to each target server in the target grouping result, including:
Testing the inspection script;
if the test passes, the inspection script is issued to each target server in the target grouping result;
and if the tests are different, sending a prompt for modifying the keywords to the client.
Optionally, testing the inspection script includes:
issuing the inspection script to the client;
receiving script test requests submitted by the client and address information of a test server; wherein, the test server is any one target server in the target grouping result;
the inspection script is issued to the test server, so that the inspection script runs on the test server, and an inspection result returned by the target server is received;
judging whether the inspection result is normal or not.
Optionally, the routing inspection script is issued to each target server in the target grouping result, so that the routing inspection script runs on each target server, and thus the routing inspection result returned by each target server is received, including:
configuring an execution strategy of the inspection script, wherein the execution strategy comprises execution time;
storing the inspection script and the execution strategy into a database;
And responding to the execution time of the inspection script, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
In addition, according to another aspect of the embodiment of the present invention, there is provided an automatic inspection apparatus, including:
the system comprises an acquisition module, a server information acquisition module and a server information processing module, wherein the acquisition module is used for receiving address information of each server submitted by a client and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, and server information returned by each server is received;
the grouping module is used for determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client;
the calling module is used for receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as an entry, and calling a script generation interface so as to receive a patrol script returned by the script generation interface;
And the inspection module is used for issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and therefore the inspection result returned by each target server is received.
Optionally, the grouping module is further configured to:
determining each grouping element according to the server information returned by each server;
combining the grouping elements to obtain grouping strategies;
and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
Optionally, the server information includes at least one of:
vendor name, system architecture name, operating system name and version number, server name.
Optionally, the inspection module is further configured to:
testing the inspection script;
if the test passes, the inspection script is issued to each target server in the target grouping result;
and if the tests are different, sending a prompt for modifying the keywords to the client.
Optionally, the inspection module is further configured to:
issuing the inspection script to the client;
Receiving script test requests submitted by the client and address information of a test server; wherein, the test server is any one target server in the target grouping result;
the inspection script is issued to the test server, so that the inspection script runs on the test server, and an inspection result returned by the target server is received;
judging whether the inspection result is normal or not.
Optionally, the inspection module is further configured to:
configuring an execution strategy of the inspection script, wherein the execution strategy comprises execution time;
storing the inspection script and the execution strategy into a database;
and responding to the execution time of the inspection script, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
one or more processors;
storage means for storing one or more programs,
The one or more processors implement the method of any of the embodiments described above when the one or more programs are executed by the one or more processors.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method according to any of the embodiments described above.
According to another aspect of embodiments of the present invention, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to any of the embodiments described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of determining each grouping strategy and grouping results corresponding to each grouping strategy according to server information returned by each server, transmitting each grouping strategy and the grouping results corresponding to each grouping strategy to a client, receiving target grouping results and keywords submitted by the client, taking the target grouping results and the keywords as input parameters, and calling a script generation interface, so that the technical means of receiving the inspection script returned by the script generation interface are adopted, and the technical problems of low inspection script development efficiency and insufficient quality in the prior art are solved. According to the embodiment of the invention, the servers are grouped according to the server information, and the inspection script suitable for the operation of the servers is automatically generated according to the grouping result and the keywords, so that the development efficiency of the inspection script is improved, and the quality of the inspection script is also improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
FIG. 1 is a flow chart of an automatic inspection method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an automatic inspection method according to one exemplary embodiment of the present invention;
FIG. 3 is a flow chart of an automated inspection method according to another exemplary embodiment of the present invention;
FIG. 4 is a flow chart of an automated inspection method according to yet another exemplary embodiment of the present invention;
FIG. 5 is a schematic diagram of an automated inspection device according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme of the invention, the aspects of acquisition, analysis, use, transmission, storage and the like of the related user personal information all meet the requirements of related laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside the aspects of legal use and the like, and are subjected to supervision and management of a supervision department. Necessary measures should be taken for the personal information of the user to prevent illegal access to such personal information data, ensure that personnel having access to the personal information data comply with the regulations of the relevant laws and regulations, and ensure the personal information of the user. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting the data collection and/or deletion.
User privacy is protected, when applicable, by de-identifying the data, including in some related applications, such as by removing specific identifiers (e.g., name, age, account number, date of birth, etc.), controlling the amount or specificity of stored data, controlling how the data is stored, and/or other methods.
Fig. 1 is a flow chart of an automatic inspection method according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the automatic inspection method may include:
step 101, receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, thereby receiving server information returned by each server.
The user can input the address information of each server on the page of the client, namely the address information of each server needing to be inspected, the client sends the address information of each server input by the user to the server, and the server receives the address information of each server and then sends the server information acquisition program to the servers through an OpenSSH protocol. After the servers receive the server information acquisition programs issued by the server, the server information acquisition programs are automatically operated, the server information acquisition programs acquire the server information of each server, and finally the acquired server information is returned to the server through json files.
Optionally, the server information includes at least one of: vendor name, system architecture name (arm architecture server or x86 architecture server), operating system name and version number (e.g., window7, centos7, kylin V10, SUSE SP12, etc.), server name (by which it can be determined what function the server is doing, web server, storage server).
And 102, determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client.
The server analyzes json files returned by each server through java Jackson to obtain server information of each server, then determines each grouping strategy and grouping results corresponding to each grouping strategy according to the server information of each server, and finally issues each grouping strategy and grouping results corresponding to each grouping strategy to the client.
Optionally, determining each grouping policy and a grouping result corresponding to each grouping policy according to server information returned by each server, including: determining each grouping element according to the server information returned by each server; combining the grouping elements to obtain grouping strategies; and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
For example, the server information returned by each server includes a vendor name and a system architecture name, and if the grouping elements are the vendor name and the system architecture name, the two grouping elements are combined to obtain each grouping policy (vendor name, vendor name—system architecture name and system architecture name), and then the servers are grouped according to the grouping policies to obtain grouping results corresponding to the grouping policies. For example, grouping result 1: vendor A; grouping result 2: vendor B; grouping result 3: vendor a_x86 architecture server; grouping result 4: vendor a_arm architecture server; grouping result 5: vendor b_x86 architecture server; grouping result 6: vendor b_arm architecture server; grouping result 7: an x86 architecture server; grouping result 8: an arm architecture server.
For another example, the server information returned by each server includes a system architecture name, an operating system name and a version number, and if the grouping elements are the system architecture name, the operating system name and the version number, the two grouping elements are combined to obtain each grouping policy (system architecture name, system architecture name_operating system name and version number, operating system name and version number), and then the servers are grouped according to the grouping policies to obtain grouping results corresponding to the grouping policies. For example, grouping result 1: an x86 architecture server; grouping result 2: an arm architecture server; grouping result 3: x86 architecture server_centros 7; grouping result 4: x86_windows7; grouping result 5: arm architecture server_centros 7; grouping result 6: arm architecture server_window 7; grouping result 7: centos7; grouping result 8: windows7.
For example, if the server information returned by each server includes a system architecture name, an operating system name and a version number, and a server name, then the grouping elements are the system architecture name, the operating system name and the version number, and the server name, and then the three grouping elements are combined to obtain each grouping policy (system architecture name, system architecture name_operating system name and version number, operating system name and version number, system architecture name_operating system name and version number_server name, system architecture name_server name, operating system name and version number_server name), and then the servers are grouped according to the grouping policies, so as to obtain grouping results corresponding to the grouping policies. For example, grouping result 1: an x86 architecture server; grouping result 2: an arm architecture server; grouping result 3: x86 architecture server_centros 7; grouping result 4: x86_windows7; grouping result 5: arm architecture server_centros 7; grouping result 6: arm architecture server_window 7; grouping result 7: centos7; grouping result 8: windows7; grouping result 9: arm architecture server_window 7_store server; grouping result 10: arm architecture server_centros7_store server; grouping result 11: arm architecture server_storage server; grouping result 12: x86 architecture server_storage server; grouping result 13: a window7 storage server; grouping result 14: the centos7_storage server, etc., will not be described in detail.
By the above grouping method, the servers can be flexibly grouped, and the grouping method can be freely combined.
And step 103, receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface.
After the server side issues the grouping strategies and grouping results corresponding to the grouping strategies to the client side, a user can see the grouping strategies and grouping results corresponding to the grouping strategies on a page of the client side. The user can select the target grouping result on the client page, and can also input keywords on the client page.
The server receives a target grouping result and a keyword sent by the client, then takes the target grouping result and the keyword as input parameters, and calls a script generation interface (such as a script generation interface externally provided by Chatgpt), so as to receive a patrol script which is returned by the script generation interface and is suitable for running by each server in the grouping.
For example, the user selects the grouping of x86 architecture server_centrs7, the keywords are: the CPU utilization rate script generates an interface by calling the script, and can receive a CPU utilization rate inspection script of a central os7 operating system of the x86 architecture server returned by the interface; for another example, the user selects a group of vendor a_x86 architecture server_centos7, the keywords are: and the CPU utilization rate script can receive the CPU utilization rate inspection script of the central os7 operating system of the x86 architecture server of the manufacturer A returned by the interface by calling the script generation interface.
The language of the script may also be specified in keywords, such as: python language or shell language. The more accurate the keyword information is, the more perfect the script returned by the interface is.
And 104, issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
After the inspection script suitable for each server in the group is obtained, the server side issues the inspection script to each target server in the target group result, and the target server automatically runs the inspection script after receiving the inspection script issued by the server side, and returns the acquired inspection result to the server side.
Optionally, issuing the inspection script to a target server matched with the grouping result, including: testing the inspection script; if the test passes, the inspection script is issued to each target server in the target grouping result; and if the tests are different, sending a prompt for modifying the keywords to the client. In order to improve the quality of the inspection script, the inspection script is tested before being issued to each target server in the target grouping result, if the test is passed, the inspection script is issued to each target server in the target grouping result, if the test is different, a prompt for modifying the keyword is sent to the client, the keyword can be modified by the user, the server executes step 103 again, namely, after the server receives a new keyword submitted by the client, the target grouping result and the new keyword are used as input parameters, a script generation interface is called, and the inspection script returned by the script generation interface is received. It should be noted that, the newly generated inspection script is tested, and after the inspection script passes, the inspection script is issued to each target server in the target grouping result, so that the quality of the inspection script can be ensured.
According to the various embodiments described above, it can be seen that the technical means of determining each grouping strategy and the grouping result corresponding to each grouping strategy according to the server information returned by each server, sending each grouping strategy and the grouping result corresponding to each grouping strategy to the client, receiving the target grouping result and the keyword submitted by the client, taking the target grouping result and the keyword as input parameters, calling the script generation interface, and receiving the inspection script returned by the script generation interface, solves the technical problems of low inspection script development efficiency and insufficient quality in the prior art. According to the embodiment of the invention, the servers are grouped according to the server information, and the inspection script suitable for the operation of the servers is automatically generated according to the grouping result and the keywords, so that the development efficiency of the inspection script is improved, and the quality of the inspection script is also improved.
Fig. 2 is a flow chart of an automatic inspection method according to one embodiment of the invention. As yet another embodiment of the present invention, as shown in fig. 2, the automatic inspection method may include:
step 201, receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server, so that the server information acquisition program runs on each server, thereby receiving server information returned by each server.
Step 202, determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client.
And 203, receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface.
Step 204, configuring an execution strategy of the inspection script, wherein the execution strategy comprises an execution time.
And step 205, saving the inspection script and the execution strategy into a database.
And step 206, obtaining the inspection script from the database in response to the execution time of the inspection script, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
The execution strategy of the inspection script can be configured according to the requirement, wherein the execution strategy comprises an execution mode and an execution time, and if the execution mode is automatic, the execution time is required to be configured. Specifically, the execution may be performed by a timed task, and the execution time is selected by setting the timed task. If performed manually, the execution time may be empty. And storing the inspection script and the execution strategy into a database to prevent other people from modifying.
If the execution time of the inspection script is reached, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server. This step may be performed by an allowable program. The client server is managed remotely by an OpenSSH mode without installing a client program on each client, and batch data configuration, batch equipment deployment and batch command execution are realized based on modules.
The inspection script can check whether the inspection item is abnormal in the execution process, if the inspection item is abnormal, whether manual processing is needed or program automatic processing is needed, and if the program starting processing is finished, the inspection item can be checked again until the inspection item has no abnormal condition. The generated patrol report can be stored in a database, so that history checking is facilitated. The generated patrol report can be transmitted to other personnel in a sharing or downloading mode.
In addition, in the embodiment of the present invention, the specific implementation of the automatic inspection method is described in detail in the above description of the automatic inspection method, so that the description is not repeated here.
Fig. 3 is a flow chart of an automatic inspection method according to another exemplary embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 3, the automatic inspection method may include:
step 301, receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server, so that the server information acquisition program runs on each server, thereby receiving server information returned by each server.
And 302, determining each grouping element according to the server information returned by each server.
And 303, combining the grouping elements to obtain the grouping strategies.
And step 304, grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
And step 305, issuing each grouping strategy and a grouping result corresponding to each grouping strategy to the client.
And 306, receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface.
And step 307, issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
In addition, in another embodiment of the present invention, the specific implementation of the automatic inspection method is already described in detail in the above description of the automatic inspection method, and thus the description thereof will not be repeated here.
Fig. 4 is a flowchart of an automatic inspection method according to still another exemplary embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 4, the automatic inspection method may include:
step 401, receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server, so that the server information acquisition program runs on each server, thereby receiving server information returned by each server.
And step 402, determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client.
Step 403, receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as an entry, and calling a script generation interface, thereby receiving a patrol script returned by the script generation interface.
And step 404, issuing the inspection script to the client.
Step 405, receiving a script test request submitted by the client and address information of a test server; the test server is any one target server in the target grouping result.
And step 406, issuing the inspection script to the test server so that the inspection script runs on the test server, and receiving an inspection result returned by the target server.
Step 407, judging whether the inspection result is normal; if yes, go to step 408; if not, go to step 409.
And step 408, issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
And 409, sending a prompt for modifying the keywords to the client.
After the inspection script is generated, accuracy test is required to be carried out on the script, a user can select a server which is required to carry out script test on a client page, the server is any one target server in target grouping results, then the server sends the inspection script to the test server, the inspection script is automatically operated after the inspection script is received by the test server, and the collected inspection result is returned to the server. The server side judges whether the inspection result is normal or not, if so, the test is passed, and if not, the test is not passed.
For example, the grouping selected by the user is centos7, the keyword input by the user is a CPU usage script, and the inspection script returned by the interface is as follows:
after the test server runs the inspection script, if the returned information is "current CPU utilization: xx% ", the inspection script generated by the interface is an effective script, and the test is passed, so that batch inspection operation can be performed. If the returned information is null or error, the inspection script is abnormal, and the keywords need to be readjusted to regenerate the inspection script; for example, it may be adjusted to: "remove the window sentence of CPU service scenario script", the regenerated inspection script is as follows:
Then, in the test, the returned result shows that "the current CPU utilization: 5.6% "is judged to be normal according to the returned result, so the inspection script generated at this time is normal, and the test is passed.
After the script test passes, the preservation work of the inspection script can be performed, and the acquired CPU inspection script can be added with a label, such as: the script of the x86 architecture centos7 for obtaining the CPU utilization rate can be directly obtained from the database when the CPU script is reused next time.
In addition, in still another embodiment of the present invention, the specific implementation of the automatic inspection method is described in detail in the above description of the automatic inspection method, so that the description is not repeated here.
Fig. 5 is a schematic view of an automatic inspection device according to an embodiment of the present invention. As shown in fig. 5, the automatic inspection device 500 includes an acquisition module 501, a grouping module 502, a calling module 503 and an inspection module 504; the collecting module 501 is configured to receive address information of each server submitted by a client, and send a server information collecting program to each server, so that the server information collecting program runs on each server, thereby receiving server information returned by each server; the grouping module 502 is configured to determine each grouping policy and a grouping result corresponding to each grouping policy according to server information returned by each server, and send each grouping policy and a grouping result corresponding to each grouping policy to the client; the calling module 503 is configured to receive a target packet result and a keyword submitted by the client, take the target packet result and the keyword as an entry, and call a script generation interface, thereby receiving a patrol script returned by the script generation interface; the inspection module 504 is configured to issue the inspection script to each target server in the target grouping result, so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
Optionally, the grouping module 502 is further configured to:
determining each grouping element according to the server information returned by each server;
combining the grouping elements to obtain grouping strategies;
and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
Optionally, the server information includes at least one of:
vendor name, system architecture name, operating system name and version number, server name.
Optionally, the inspection module 504 is further configured to:
testing the inspection script;
if the test passes, the inspection script is issued to each target server in the target grouping result;
and if the tests are different, sending a prompt for modifying the keywords to the client.
Optionally, the inspection module 504 is further configured to:
issuing the inspection script to the client;
receiving script test requests submitted by the client and address information of a test server; wherein, the test server is any one target server in the target grouping result;
the inspection script is issued to the test server, so that the inspection script runs on the test server, and an inspection result returned by the target server is received;
Judging whether the inspection result is normal or not.
Optionally, the inspection module 504 is further configured to:
configuring an execution strategy of the inspection script, wherein the execution strategy comprises execution time;
storing the inspection script and the execution strategy into a database;
and responding to the execution time of the inspection script, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
The specific implementation of the automatic inspection device of the present invention is described in detail in the above-mentioned automatic inspection method, and thus the description thereof will not be repeated here.
Fig. 6 illustrates an exemplary system architecture 600 in which an automated inspection method or automated inspection apparatus of embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server can analyze and other data such as the received article information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that, the automatic inspection method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the automatic inspection device is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes an acquisition module, a grouping module, a calling module, and a patrol module, where the names of the modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, thereby receiving server information returned by each server; determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client; receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface; and sending the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
As a further aspect, embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements the method according to any of the above embodiments.
According to the technical scheme of the embodiment of the invention, the grouping strategies and the grouping results corresponding to the grouping strategies are determined according to the server information returned by the servers, the grouping strategies and the grouping results corresponding to the grouping strategies are issued to the client, the target grouping results and the keywords submitted by the client are received, the target grouping results and the keywords are taken as input parameters, and the script generation interface is called, so that the technical means of the inspection script returned by the script generation interface is received, and the technical problems of low inspection script development efficiency and insufficient quality in the prior art are solved. According to the embodiment of the invention, the servers are grouped according to the server information, and the inspection script suitable for the operation of the servers is automatically generated according to the grouping result and the keywords, so that the development efficiency of the inspection script is improved, and the quality of the inspection script is also improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (15)

1. An automatic inspection method, comprising:
receiving address information of each server submitted by a client, and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, thereby receiving server information returned by each server;
determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client;
receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as input parameters, and calling a script generation interface so as to receive a patrol script returned by the script generation interface;
and sending the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and receiving the inspection result returned by each target server.
2. The method of claim 1, wherein determining each grouping policy and a grouping result corresponding to each grouping policy according to server information returned by each server, comprises:
Determining each grouping element according to the server information returned by each server;
combining the grouping elements to obtain grouping strategies;
and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
3. The method of claim 2, wherein the server information comprises at least one of:
vendor name, system architecture name, operating system name and version number, server name.
4. The method of claim 1, wherein issuing the inspection script to each target server in the target group result comprises:
testing the inspection script;
if the test passes, the inspection script is issued to each target server in the target grouping result;
and if the tests are different, sending a prompt for modifying the keywords to the client.
5. The method of claim 4, wherein testing the inspection script comprises:
issuing the inspection script to the client;
receiving script test requests submitted by the client and address information of a test server; wherein, the test server is any one target server in the target grouping result;
The inspection script is issued to the test server, so that the inspection script runs on the test server, and an inspection result returned by the target server is received;
judging whether the inspection result is normal or not.
6. The method of claim 1, wherein issuing the inspection script to each target server in the target group results to cause the inspection script to run at each target server to receive inspection results returned by each target server comprises:
configuring an execution strategy of the inspection script, wherein the execution strategy comprises execution time;
storing the inspection script and the execution strategy into a database;
and responding to the execution time of the inspection script, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
7. An automatic inspection device, comprising:
the system comprises an acquisition module, a server information acquisition module and a server information processing module, wherein the acquisition module is used for receiving address information of each server submitted by a client and transmitting a server information acquisition program to each server so that the server information acquisition program runs on each server, and server information returned by each server is received;
The grouping module is used for determining each grouping strategy and a grouping result corresponding to each grouping strategy according to the server information returned by each server, and transmitting each grouping strategy and the grouping result corresponding to each grouping strategy to the client;
the calling module is used for receiving a target grouping result and a keyword submitted by the client, taking the target grouping result and the keyword as an entry, and calling a script generation interface so as to receive a patrol script returned by the script generation interface;
and the inspection module is used for issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, and therefore the inspection result returned by each target server is received.
8. The apparatus of claim 7, wherein the grouping module is further configured to:
determining each grouping element according to the server information returned by each server;
combining the grouping elements to obtain grouping strategies;
and grouping the servers according to the grouping strategies so as to obtain grouping results corresponding to the grouping strategies.
9. The apparatus of claim 8, wherein the server information comprises at least one of:
vendor name, system architecture name, operating system name and version number, server name.
10. The apparatus of claim 7, wherein the inspection module is further configured to:
testing the inspection script;
if the test passes, the inspection script is issued to each target server in the target grouping result;
and if the tests are different, sending a prompt for modifying the keywords to the client.
11. The apparatus of claim 10, wherein the inspection module is further configured to:
issuing the inspection script to the client;
receiving script test requests submitted by the client and address information of a test server; wherein, the test server is any one target server in the target grouping result;
the inspection script is issued to the test server, so that the inspection script runs on the test server, and an inspection result returned by the target server is received;
judging whether the inspection result is normal or not.
12. The apparatus of claim 7, wherein the inspection module is further configured to:
configuring an execution strategy of the inspection script, wherein the execution strategy comprises execution time;
storing the inspection script and the execution strategy into a database;
and responding to the execution time of the inspection script, acquiring the inspection script from the database, and issuing the inspection script to each target server in the target grouping result so that the inspection script runs on each target server, thereby receiving the inspection result returned by each target server.
13. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more processors implement the method of any of claims 1-6 when the one or more programs are executed by the one or more processors.
14. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
CN202311175401.6A 2023-09-12 2023-09-12 Automatic inspection method, device, electronic equipment and computer readable medium Pending CN117152861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311175401.6A CN117152861A (en) 2023-09-12 2023-09-12 Automatic inspection method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311175401.6A CN117152861A (en) 2023-09-12 2023-09-12 Automatic inspection method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN117152861A true CN117152861A (en) 2023-12-01

Family

ID=88884056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311175401.6A Pending CN117152861A (en) 2023-09-12 2023-09-12 Automatic inspection method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN117152861A (en)

Similar Documents

Publication Publication Date Title
CN110149298B (en) Hijacking detection method and device
CN111198813A (en) Interface testing method and device
CN113449022A (en) Method and device for processing service request
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN110858172A (en) Automatic test code generation method and device
CN111221727B (en) Test method, test device, electronic equipment and computer readable medium
CN109218041B (en) Request processing method and device for server system
CN110896362A (en) Fault detection method and device
CN109522202B (en) Software testing method and device
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN114285774B (en) Flow recording method and device, electronic equipment and storage medium
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN117152861A (en) Automatic inspection method, device, electronic equipment and computer readable medium
CN110806967A (en) Unit testing method and device
CN112783903B (en) Method and device for generating update log
CN114020513A (en) Method and device for processing log information
CN113760712A (en) Test evaluation method and device
CN112395194A (en) Method and device for accessing test platform
CN111737129A (en) Service control method, service control device, computer readable medium and electronic equipment
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN113268417B (en) Task execution method and device
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN112783753B (en) Testing method and device for stream data processing system
CN116257432A (en) Service system testing method and device
CN108111611B (en) Client detection method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination