CN112565019B - Method, system and electronic equipment for detecting connectivity of database - Google Patents
Method, system and electronic equipment for detecting connectivity of database Download PDFInfo
- Publication number
- CN112565019B CN112565019B CN202011416083.4A CN202011416083A CN112565019B CN 112565019 B CN112565019 B CN 112565019B CN 202011416083 A CN202011416083 A CN 202011416083A CN 112565019 B CN112565019 B CN 112565019B
- Authority
- CN
- China
- Prior art keywords
- data
- database
- socket
- network
- software
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000005540 biological transmission Effects 0.000 claims abstract description 7
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 6
- 238000012544 monitoring process Methods 0.000 claims description 20
- 238000001514 detection method Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 12
- 230000009193 crawling Effects 0.000 claims 2
- 230000000694 effects Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Environmental & Geological Engineering (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention discloses a method, a system and electronic equipment for detecting connectivity of a database, and relates to the technical field of databases. The method comprises the steps that firstly, a Socket is used for grabbing a bidirectional transmission data packet at a database server; then copying the captured binary data to an application server, and sending the data to a database server by using a network Socket; and then detecting whether data returned by the database server can be received or not, and if so, judging that the network connection is normal. According to the scheme, the binary data are captured and sent by using the network Socket, the problem that in the prior art, the network connectivity check is not complete is solved, the data transmission process during database connection can be rapidly and clearly displayed in software, the network connectivity condition can be clearly displayed, and the capability of a company for analyzing the network connectivity of the Sybase database is improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of databases, in particular to a method, a system and electronic equipment for detecting connectivity of a database.
Background
Based on the requirement of network security, the firewall has increasingly strict limitation on the network, and also provides clear limitation on the trend of data and the size of a data packet, so that the condition that software such as service software or middleware and the like cannot normally access the database can be caused. The Sybase database is an enterprise-level relational database, isql is a client tool which is carried by the Sybase database and is connected with the database in a command line mode and executes sql statements, and dsedit is a graphic tool which is carried by the Sybase database and is used for configuring service names, the database ip and ports. The dsedit software has a network detection function and can be used for preliminarily detecting whether the database client, namely each application server, can be connected to the database service.
In the prior art, although dsedit software of the Sybase database has a function of detecting a network, the dsedit software only performs a connect operation on a database server, and does not actually send data to really check whether data transmission between a client and the server is normal. Especially, when the client can send data to the server and the server cannot return data to the client, the client software is in a state of no response or in detection, and the condition that the network is not communicated is not clearly prompted, so that the problem is extremely hidden and is not easy to be found, and the problem of incomplete network connectivity check still exists.
Disclosure of Invention
The embodiment of the invention provides a method, a system and electronic equipment for detecting database connectivity, which solve the problem of incomplete network connectivity check in the prior art by using a network Socket to capture and send binary data.
In order to achieve the purpose, the invention discloses the following technical scheme:
one aspect of the present invention provides a method for detecting connectivity of a database, the method comprising the steps of:
capturing a bidirectional transmission data packet by using Socket at a database server;
copying the captured binary data to an application server, and sending the data to a database server by using a network Socket;
and detecting whether the data returned by the database server can be received or not, and if so, judging that the network connection is normal.
Based on the above scheme, further, the capturing a bidirectional transmission data packet by using Socket at the database server includes the following steps:
setting a monitoring port of the capturing software and a port of the database service in the database server;
starting a Socket monitoring function of the capturing software;
connecting a monitoring port of the capturing software by using a database client tool;
capturing connection request data sent by a software record client tool, and forwarding the data to a database service;
and the database service sends the receipt data agreeing to be connected to the capture software, and the capture software records the receipt data.
Further, in the above step, the database client tool may be connected to the monitoring port of the capture software, and specifically, the client tool isql of the Sybase database may be connected to the monitoring port of the capture software.
Further, the sending data to the database service by using the network Socket includes the following steps:
reading the captured data at the application server;
and connecting the IP and the port of the database service by using Socket, sending the captured data, and printing displayable characters in the captured data.
Preferably, the detecting may be to receive data returned by the database server, and the detecting may be to receive data returned by the database server and print displayable characters therein, and if the data can be printed normally, determine that the network connection is normal.
As another preferable mode, the detecting whether the data returned by the database server can be received or not may be performed in a manner of detecting whether the connection with the database server is maintained or not, and if the connection is normal, it is determined that the network connection is normal.
In another aspect, the present invention provides a system for detecting connectivity of a database, the system comprising:
the data packet capturing unit is used for capturing the data packet transmitted in the two directions by using Socket at the database server;
the data packet sending unit is used for copying the captured binary data to the application server and sending the data to the database server by using a network Socket;
and the connectivity detection unit is used for detecting whether the data returned by the database server can be received or not and judging whether the network is normal or not.
Based on the above system, further, the data packet capturing unit captures a data packet transmitted in two directions by using Socket at the database server, specifically including: setting a monitoring port of capturing software and a port of database service in a database server; starting a Socket monitoring function of the capture software; connecting a monitoring port of the capturing software by using a database client tool; capturing connection request data sent by a software record client tool, and forwarding the data to a database service; and the database service sends the receipt data agreeing to be connected to the capturing software, and the capturing software records the receipt data.
Further, the sending unit of the data packet sends data to the database server by using a network Socket, and specifically includes: firstly, reading captured data by an application server; socket is then used to connect the IP and port of the database service, send the captured data, and print the displayable characters therein.
Further, the connectivity detection unit detects whether data returned by the database server can be received and judges whether the network is normal, and the detection mode is to receive the data returned by the database server and print displayable characters in the data, or to detect whether the network is normal by detecting whether the connection with the database server is maintained, and if the network is normally printed or normally connected, the network is judged to be normally connected.
In addition, the present invention also provides an electronic device, which includes at least one processing unit and at least one storage unit communicatively connected to the processing unit:
the storage unit stores program instructions executable on the processing unit;
the processing unit calls the program instructions to be able to perform the specific steps of the method for detecting database connectivity as described above.
The effects provided in the summary of the invention are only the effects of the embodiments, not all of the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
the method for detecting the connectivity of the database comprises the steps that firstly, a Socket is used for capturing a data packet transmitted in two directions at a database server; then copying the captured binary data to an application server, and sending the data to a database server by using a network Socket; and then detecting whether the data returned by the database server can be received or not, and if so, judging that the network connection is normal. The method of the embodiment uses the network Socket to capture and send the binary data, thereby solving the problem of incomplete network connectivity check in the prior art. The method can rapidly and clearly display the data transmission process when the database is connected in the software, clearly display the network connectivity condition and improve the capability of a company for analyzing the network connectivity of the Sybase database. In addition, the method is also suitable for detecting the connectivity of other databases, and has strong expansibility and wide application.
The system and the electronic device for detecting the connectivity of the database provided by the embodiment of the application can realize the method for detecting the connectivity of the database and obtain the technical effects.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flowchart of a method for detecting connectivity of a database according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an implementation process of step S1 in FIG. 1;
fig. 3 is a schematic structural diagram of a system for detecting connectivity of a database according to an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a method for detecting connectivity of a database according to an embodiment of the present invention.
Referring to fig. 1, the method of the present embodiment includes the following steps:
s1, grabbing the data packet transmitted in two directions by using Socket at the database server;
specifically, as shown in fig. 2, in this step, a Socket is used to capture a bidirectional data packet at the database server, and the specific work flow includes:
s11, setting a monitoring port of the capturing software and a port of the database service in the database server;
s12, starting a Socket monitoring function of the capture software;
s13, connecting a monitoring port of the grabbing software by using a database client tool;
s14, capturing connection request data sent by the software record client tool, and forwarding the data to database service;
and S15, the database service sends the receipt data agreeing to be connected to the capture software, and the capture software records the receipt data.
In the step S13, the database client tool may be connected to the listening port of the grabbing software, specifically, the client tool isql of the Sybase database may be connected to the listening port of the grabbing software. It should be noted that this step is equally applicable to corresponding client tools of other databases as well.
S2, copying the captured binary data to an application server, and sending the data to a database server by using a network Socket;
specifically, in this step, a network Socket is used to send data to the database server, and the specific workflow includes:
reading the captured data at the application server;
and connecting the IP and the port of the database service by using Socket, sending the captured data, and printing displayable characters in the captured data.
And S3, detecting whether the data returned by the database server can be received or not, and if so, judging that the network connection is normal.
In this step, the detection of whether the data returned by the database server can be received or not may be performed in a manner of receiving the data returned by the database server and printing displayable characters therein, and if the data can be normally printed, it is determined that the network connectivity is normal; or whether the connection with the database service is kept or not is detected, and if the connection can be normally carried out, the network connection is judged to be normal.
Fig. 3 is a schematic structural diagram of a system for detecting connectivity of a database according to an embodiment of the present invention.
Referring to fig. 3, the system of the present embodiment includes:
the data packet capturing unit 1 is used for capturing the data packet transmitted in two directions by using Socket at the database server;
the data packet sending unit 2 is used for copying the captured binary data to an application server and sending the data to a database server by using a network Socket;
and the connectivity detection unit 3 is used for detecting whether the data returned by the database server can be received or not and judging whether the network is normal or not.
Specifically, in the system of this embodiment, the capturing unit 1 uses Socket to capture the bidirectional data packet at the database server, and specifically includes: setting a monitoring port of capturing software and a port of database service in a database server; starting a Socket monitoring function of the capturing software; connecting a monitoring port of the capturing software by using a database client tool; capturing connection request data sent by a software record client tool, and forwarding the data to a database service; and the database service sends the receipt data agreeing to be connected to the capturing software, and the capturing software records the receipt data.
Further, the sending unit 2 sends data to the database server by using a network Socket, and specifically includes: firstly, reading captured data by an application server; socket is then used to connect the IP and port of the database service, send the captured data, and print the displayable characters therein.
Further, the connectivity detection unit 3 detects whether the data returned by the database server can be received and determines whether the network is normal, and the detection mode is to receive the data returned by the database server and print displayable characters therein, or to detect whether the network is normal by detecting whether the connection with the database server is maintained, and if the network is normal, the network connectivity is determined to be normal.
Based on the same inventive concept, the embodiment also provides the electronic equipment. The electronic device comprises at least one processing unit and at least one storage unit in communication connection with the processing unit: the storage unit stores program instructions executable on the processing unit; the processing unit calls the program instructions to execute the specific steps of the method for detecting the connectivity of the database in the above embodiment. For specific functions implemented by each unit and the combination thereof, and achieved technical effects, reference may be made to the description of the corresponding parts of the foregoing method embodiments, and details are not repeated here.
The above description is only a preferred embodiment of the present invention, and it should be understood that the present invention is not limited thereto, and those skilled in the art will appreciate that various modifications, improvements, substitutions and the like can be made without departing from the principle of the present invention.
Claims (5)
1. A method of detecting connectivity of a database, comprising the steps of:
capturing a bidirectional transmission data packet by using Socket at a database server;
copying the captured binary data to an application server, and sending the data to a database server by using a network Socket;
detecting whether data returned by the database server can be received or not, and if so, judging that the network connection is normal;
the method for capturing the data packet transmitted in the two directions by using the Socket at the database server comprises the following steps:
setting a monitoring port of capturing software and a port of database service in a database server;
starting a Socket monitoring function of the capture software;
connecting a monitoring port of the grabbing software by using a database client tool;
capturing connection request data sent by a software record client tool, and forwarding the data to a database service;
the database service sends receipt data agreeing to connection to the capture software, and the capture software records the receipt data;
the method for sending data to the database service by using the network Socket comprises the following steps:
reading the captured data at the application server;
connecting an IP and a port of a database service by using a Socket, sending captured data, and printing displayable characters in the captured data;
and detecting whether the data returned by the database server can be received or not, wherein the detection mode is to receive the data returned by the database server and print displayable characters in the data, and if the data can be printed normally, judging that the network connection is normal.
2. The method for detecting connectivity of a database according to claim 1, wherein the database client tool is connected to the listening port of the crawling software, and in particular the client tool isql of the Sybase database is connected to the listening port of the crawling software.
3. The method according to claim 1, wherein the detecting whether the data returned by the database server can be received is performed by detecting whether the connection with the database server is maintained, and if the connection is normal, determining that the network connection is normal.
4. A system for detecting connectivity of a database, the system comprising:
the data packet capturing unit is used for capturing the data packet transmitted in the two directions by using Socket at the database server;
the method for capturing the data packet transmitted in the two directions by using the Socket at the database server comprises the following steps:
setting a monitoring port of the capturing software and a port of the database service in the database server;
starting a Socket monitoring function of the capture software;
connecting a monitoring port of the capturing software by using a database client tool;
capturing connection request data sent by a software record client tool, and forwarding the data to a database service;
the database service sends receipt data agreeing to connection to the capture software, and the capture software records the receipt data;
the data packet sending unit is used for copying the captured binary data to the application server and sending the data to the database server by using a network Socket;
the method for sending data to the database service by using the network Socket comprises the following steps:
reading the captured data at the application server;
connecting an IP and a port of a database service by using a Socket, sending captured data, and printing displayable characters in the captured data;
the connectivity detection unit is used for detecting whether the data returned by the database server can be received or not and judging whether the network is normal or not;
the connectivity detection unit receives data returned by the database service and prints displayable characters in the data, or detects whether the network is normal or not by detecting whether the data is connected with the database service, and if the data can be printed normally or can be connected normally, the connectivity detection unit judges that the network is normally connected.
5. An electronic device comprising at least one processing unit, and at least one memory unit communicatively coupled to the processing unit:
the storage unit stores program instructions executable on the processing unit;
the processing unit calls the program instructions to be able to perform the specific steps of the method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011416083.4A CN112565019B (en) | 2020-12-04 | 2020-12-04 | Method, system and electronic equipment for detecting connectivity of database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011416083.4A CN112565019B (en) | 2020-12-04 | 2020-12-04 | Method, system and electronic equipment for detecting connectivity of database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112565019A CN112565019A (en) | 2021-03-26 |
CN112565019B true CN112565019B (en) | 2022-07-15 |
Family
ID=75058963
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011416083.4A Active CN112565019B (en) | 2020-12-04 | 2020-12-04 | Method, system and electronic equipment for detecting connectivity of database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112565019B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040230661A1 (en) * | 2003-01-29 | 2004-11-18 | Gus Rashid | Rules based notification system |
CN106874388B (en) * | 2017-01-11 | 2020-08-11 | 中科院微电子研究所昆山分所 | Relational database-based heterogeneous system data cascade operation automatic construction method |
CN107453953B (en) * | 2017-08-30 | 2020-09-15 | 苏州朗动网络科技有限公司 | Httpclient-based data updating system and method |
CN109257254B (en) * | 2018-09-21 | 2022-02-15 | 平安科技(深圳)有限公司 | Network connectivity checking method, device, computer equipment and storage medium |
-
2020
- 2020-12-04 CN CN202011416083.4A patent/CN112565019B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112565019A (en) | 2021-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7301909B2 (en) | Trouble-ticket generation in network management environment | |
CN100536403C (en) | Method and equipment of intelligent patrol detection for communication network | |
CN110719199B (en) | Network automatic testing and fault positioning method and device | |
CN103138988B (en) | Positioning treatment method and positioning treatment device of network faults | |
CN105554042A (en) | Method and system for UDP tele-transmission log | |
CN114050979A (en) | Industrial control protocol safety test system and device | |
CN112565019B (en) | Method, system and electronic equipment for detecting connectivity of database | |
CN109474540B (en) | Method and device for identifying OPC (optical proximity correction) flow | |
CN111402456A (en) | Unlocking method and device | |
CN111817878A (en) | Networking method and device of intelligent equipment and cloud server | |
CN115208695A (en) | Black box safety scanning method, device and system and electronic equipment | |
EP2988476A1 (en) | Method and apparatus for processing operation on endpoint peripheral | |
US8499070B2 (en) | Electronic device and method for monitoring communication within a network | |
CN111431911B (en) | Method for collecting basic information of equipment in network, network edge equipment and network equipment | |
CN114500178A (en) | Intelligent internet of things gateway capable of self-operation and self-maintenance | |
CN106485378A (en) | The transmission method of business datum, system server | |
CN108199918B (en) | Method and system for testing washing machine | |
CN108337128B (en) | Method, device and system for monitoring communication state between systems | |
CN201383815Y (en) | Terminal scanner | |
CN112328322A (en) | Apollo configuration localization method and system | |
JPH0888672A (en) | Intelligent communication protocol monitor | |
KR101680736B1 (en) | Process for checking status of network device | |
CN110329207A (en) | VATS Vehicle Anti-Theft System and its method based on OBD system | |
US7643433B2 (en) | Automatic local LAPB device configuration method and apparatus | |
CN112187565B (en) | Intelligent network line quality detection method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |