CN109120432B - Fault server positioning method and device - Google Patents

Fault server positioning method and device Download PDF

Info

Publication number
CN109120432B
CN109120432B CN201810791660.4A CN201810791660A CN109120432B CN 109120432 B CN109120432 B CN 109120432B CN 201810791660 A CN201810791660 A CN 201810791660A CN 109120432 B CN109120432 B CN 109120432B
Authority
CN
China
Prior art keywords
server
target
address
code information
code
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
Application number
CN201810791660.4A
Other languages
Chinese (zh)
Other versions
CN109120432A (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810791660.4A priority Critical patent/CN109120432B/en
Publication of CN109120432A publication Critical patent/CN109120432A/en
Application granted granted Critical
Publication of CN109120432B publication Critical patent/CN109120432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults

Landscapes

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

Abstract

The invention provides a fault server positioning method and device, and belongs to the technical field of computers. The terminal may determine an IP address of at least one target server based on the received query request, then obtain information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information, then obtain the target code information, where the target code information is information of a target code deployed by the terminal for the target server, and finally determine a target server corresponding to the comparison code information that is not matched with the target code information to obtain the failed server. Therefore, connection with each server is not required to be established, and the terminal can determine whether the target server is the server with the restart failure fault or not based on the target code information of the self-acquired comparison code information base, so that the determination efficiency is improved, and the required cost is reduced.

Description

Fault server positioning method and device
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a fault server positioning method and device.
Background
With the continuous development of computer technology, users have more and more demands on network services, and accordingly, in order to meet the increasing demands of users, network providers often add new functions to network services according to the demands of users. Specifically, when a new function is added to a network service, a new service code is often developed based on the new function, then the new service code is deployed to a corresponding server, and finally the server is controlled to restart, so that the server starts to run the new service code, and then the service code update is completed. However, in practical applications, a server often fails to restart, which leads to a deployment failure, so that the service code before running on the server still cannot normally process a request for a new function. Therefore, how to determine the server with failed deployment failure becomes a problem of great concern.
In the prior art, a manual operation mode is often adopted, a test terminal establishes connection with each server one by one, and after the connection is successfully established, a test request is sent to the server, whether the server is successfully deployed is judged based on whether the server can normally process the test request, or whether the server is successfully deployed is judged based on whether the content of the accessed page is a page corresponding to a new service code by accessing the server through the test terminal after the connection is successfully established. However, since the network system includes a large number of servers, the method of establishing connections with the servers one by one and performing testing is inefficient and requires a large cost.
Disclosure of Invention
The invention provides a fault server positioning method and device, which are used for solving the problems of low efficiency and high cost of determining a server with a restart failure.
According to a first aspect of the present invention, there is provided a method for locating a fault server, which is applied to a terminal, and includes:
determining an IP address of at least one target server based on the received query request;
acquiring information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information;
acquiring target code information; the target code information is information of a target code deployed by the terminal for the target server;
and determining the target server corresponding to the comparison code information which is not matched with the target code information to obtain a fault server.
Optionally, the query request includes a target server attribute, where the target server attribute includes a target setting location and/or a target service type;
accordingly, the determining an IP address of at least one target server based on the received query request comprises:
extracting the target setting place and/or the target service type in the query request;
searching an IP address of a server corresponding to the target setting location and/or the target service type from a preset server database;
determining the IP address of the corresponding server as the IP address of a target server;
wherein, the preset server database stores the IP address of any server in the network system.
Optionally, before determining the IP address of the at least one target server based on the received query request, the method further includes:
establishing a first corresponding relation, a second corresponding relation and a third corresponding relation based on any server in the network system;
generating the preset server database based on the first corresponding relationship, the second corresponding relationship and the third corresponding relationship;
the first corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same service type and the service type, and the third corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
Optionally, the query request includes an IP address of at least one server;
accordingly, the determining an IP address of at least one target server based on the received query request comprises:
and extracting the IP address of the at least one server included in the query request, and determining the IP address of the at least one server as the IP address of the target server.
Optionally, after determining the target server corresponding to the comparison code information that is not matched with the target code information and obtaining a faulty server, the method further includes:
redeploying the object code for the failed server;
acquiring information of a currently running code in the fault server to obtain current code information;
and if the current code information is not matched with the target code information, displaying maintenance reminding information.
According to a second aspect of the present invention, there is provided a fault server locating apparatus, which is applied to a terminal, and may include:
a first determining module for determining an IP address of at least one target server based on the received query request;
the first acquisition module is used for acquiring information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information;
the second acquisition module is used for acquiring target code information; the target code information is information of a target code deployed by the terminal for the target server;
and the second determining module is used for determining the target server corresponding to the comparison code information which is not matched with the target code information to obtain the fault server.
Optionally, the query request includes a target server attribute, where the target server attribute includes a target setting location and/or a target service type;
accordingly, the first determining module comprises:
an extracting sub-module, configured to extract the target setting location and/or the target service type in the query request;
the searching submodule is used for searching an IP address of a server corresponding to the target setting place and/or the target service type from a preset server database;
the determining submodule is used for determining the IP address of the corresponding server as the IP address of the target server;
wherein, the preset server database stores the IP address of any server in the network system.
Optionally, the apparatus further comprises:
the establishing module is used for establishing a first corresponding relation, a second corresponding relation and a third corresponding relation based on any server in the network system;
a generating module, configured to generate the preset server database based on the first corresponding relationship, the second corresponding relationship, and the third corresponding relationship;
the first corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same service type and the service type, and the third corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
Optionally, the query request includes an IP address of at least one server;
accordingly, the first determining module is configured to:
and extracting the IP address of the at least one server included in the query request, and determining the IP address of the at least one server as the IP address of the target server.
Optionally, the apparatus further comprises:
a deployment module to redeploy the object code for the failed server;
the third acquisition module is used for acquiring the information of the currently running code in the fault server to obtain the current code information;
and the display module is used for displaying maintenance reminding information if the current code information is not matched with the target code information.
According to a third aspect of the present invention, there is provided a mobile terminal comprising: a processor, a memory and a fault server locating program stored on said memory and operable on said processor, which when executed by said processor implements the steps in the fault server locating method as described in the first aspect.
According to a fourth aspect of the present invention, there is provided a computer readable storage medium having stored thereon a fault server locating program which, when executed by a processor, implements the steps of the fault server locating method as described in the first aspect.
Aiming at the prior art, the invention has the following advantages:
the terminal may determine an IP address of at least one target server based on the received query request, then obtain information of a currently running code on each target server based on the IP address of the at least one target server, obtain at least one piece of comparison code information, then obtain the target code information, where the target code information is information of a target code deployed by the terminal for the target server, and finally determine a target server corresponding to the comparison code information that is not matched with the target code information, and obtain the failed server. Therefore, connection with each server is not required to be established, and the terminal can determine whether the target server is the server with the restart failure fault or not based on the target code information of the self-acquired comparison code information base, so that the determination efficiency is improved, and the required cost is reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating steps of a method for locating a fault server according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating steps of a fault server locating method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a fault server locating device according to a third embodiment of the present invention;
fig. 4 is a block diagram of a fault server locating apparatus according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Example one
Fig. 1 is a flowchart of steps of a fault server positioning method provided in an embodiment of the present invention, which is applied to a terminal, and as shown in fig. 1, the method may include:
step 101, determining an internet protocol, IP, address of at least one target server based on the received query request.
In the embodiment of the present invention, the query request may be sent to the terminal when the user needs to determine whether the server fails to be restarted, specifically, since the server needs to be restarted to run the redeployed code after redeploying the code for the server, in order to detect whether the deployed server successfully runs the redeployed code, the user generally sends the query request to the terminal after redeploying the code in the server, so that the terminal determines whether the server is successfully deployed. Further, the target server may be a server that redeploys code, and an Internet Protocol Address (IP) of the target server is a uniform Address format provided by an IP Protocol.
And 102, acquiring information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information.
In the embodiment of the invention, the terminal can access each target server based on the IP address of each target server, acquire the information of the currently running code in the target server from the target server, and take the information of the currently running code in the target server as the comparison code information. Wherein, the comparison code information may be a version number of a currently running code on the target server. In practical application, codes on a server are updated for many times according to requirements of a user, that is, new service codes are often redeployed for the server, each new deployed service code has a unique version number used for identifying the new service code, and specifically, the version number may be generated based on a deployment time point when a terminal deploys to the server. Of course, a unique preset identifier may be inserted into a preset position of a new service code deployed each time, and accordingly, the comparison code information may be a preset identifier of a preset position in a currently running code on the target server, the preset identifier may be generated based on a random number generation algorithm, the preset position may be the last bit of the code, further, the comparison code information may also be a preset code segment of the currently running code on the target server, and so on, which is not limited in the embodiment of the present invention.
103, acquiring target code information; the object code information is information of an object code deployed by the terminal for the object server.
In the embodiment of the present invention, the target code may be the latest code deployed for the target server last time, and for example, it is assumed that until now, code 01 is redeployed on the target server by number 7/10 in 2018, and code 01 is deployed on the target server by number 7/13 in 2018, and then code 02 deployed on the target server by number 7/13 in 2018 is the target code. Further, the terminal may obtain the information of the object code from the stored deployment record, and further obtain the information of the object code. When the comparison code information is a preset mark of a preset position in the currently running code on the target server, the information of the target code may be a preset line code segment of the target code.
And step 104, determining a target server corresponding to the comparison code information which is not matched with the target code information to obtain a fault server.
In the embodiment of the present invention, if the target server successfully completes the restart operation after the terminal deploys the target code to the target server, the version number of the currently running code on the target server should be the same as the version number of the target code, that is, the comparison code information matches with the target code information, accordingly, after the terminal deploys the target code to the target server, the target server fails, and the restart operation is not completed, then the version number of the currently running code on the target server is different from the version number of the target code, that is, the comparison code information does not match with the target code information, and therefore, in this step, the terminal may determine the target server whose comparison code information does not match with the target code information as a failed server.
In summary, in the method for locating a fault server provided in the first embodiment of the present invention, the terminal may first determine an IP address of at least one target server based on the received query request, then obtain information of a code currently running on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information, then obtain the target code information, where the target code information is information of a target code deployed by the terminal for the target server, and finally determine a target server corresponding to the comparison code information that does not match with the target code information to obtain the fault server. Therefore, connection with each server is not required to be established, and the terminal can determine whether the target server is the server with the restart failure fault or not based on the target code information of the self-acquired comparison code information base, so that the determination efficiency is improved, and the required cost is reduced.
Example two
Fig. 2 is a flowchart of steps of a fault server positioning method provided in the second embodiment of the present invention, which is applied to a terminal, and as shown in fig. 2, the method may include:
step 201, based on the received query request, determines an IP address of at least one target server.
In this step, the query request may include a target server attribute, and the target server attribute may include a target setting location and/or a target service type. The target setting place represents the setting place of the target server, and the target service type represents the service type provided by the target server. In practical application, in order to make the service coverage range larger, a network provider often sets servers in a plurality of different areas, for example, 30 servers in west ampere, 50 servers in Guangdong and 20 servers in all, further, in order to attract more users, different types of services can be provided for the users, and correspondingly, corresponding servers can be set for the different types of services to implement the service, for example, codes for a type a service can be deployed for the 1 st to 10 th servers in west ampere, the 1 st to 20 th servers in Guangdong and the 1 st to 9 th servers in all, so as to provide a type a service through the 39 servers; codes aiming at the type B service can be deployed for 11 th to 20 th servers of the Xian, 21 th to 35 th servers of the Guangdong and 10 th to 17 th servers of the Chengdu, so that the type B service is provided through the 33 servers; codes aiming at the type C service are deployed for 21 st to 30 th servers of the Xian, 36 th to 50 th servers of the Guangdong and 18 th to 20 th servers of the Chengdu, so that the type C service is provided through the 28 servers.
Because the codes for different services are all independently developed, when the codes are redeployed for the server, the servers providing different services may be independently deployed, for example, when the codes are deployed, new codes for the type a services may be deployed only for the 1 st to 10 th servers of west ampere, the 1 st to 20 th servers of the broad east and the 1 st to 9 th servers of the achievements, of course, new codes for the type a services may also be deployed for the 1 st to 10 th servers of west ampere, the 1 st to 20 th servers of the broad east and the 1 st to 9 th servers of the achievements, and new codes for the type C services may also be deployed for the 21 st to 30 th servers of west ampere, the 36 th to 50 th servers of the broad east and the 18 th to 20 th servers of the achievements.
Furthermore, if there is a problem that the server in a certain area fails to be restarted after the new code is deployed, at this time, if the servers deployed in all areas are detected, many unnecessary operations are performed, and thus system resources of the terminal are wasted, and further, when there is a server in a certain area that fails to be restarted, the traffic flow of the certain area is relatively low, accordingly, in this embodiment of the present invention, a user may, after the new code is deployed, take the area with a low corresponding traffic flow as a target setting location, take the type of traffic as a target traffic, send an inquiry request including the target setting location and/or the type of the target traffic to the terminal, so as to control the terminal to detect only the server in the target setting location and/or the service providing the target traffic type, and then avoid carrying out unnecessary detection, improve and detect the precision.
Correspondingly, when the query request includes a target setting location and/or a target service type terminal, the terminal may implement step 201 through the following substeps (1) to (3):
substep (1): and extracting the target setting place and/or the target service type in the query request.
Specifically, in this step, the terminal may analyze the query request first, and then extract the target setting location and/or the target service type from the analyzed query request. Specifically, when the query request only includes the target setting location, the target setting location is extracted, when the query request only includes the target service type, the target service type is extracted, and further, when the query request includes the target setting location and the target service type, the target setting location and the target service type are extracted.
Substep (2): and searching the IP address of the server corresponding to the target setting place and/or the target service type from a preset server database.
In this step, the preset server database may store an IP address of any server in the network system, and the preset server may be established by the terminal in advance before step 201, and specifically, the terminal may establish a first corresponding relationship, a second corresponding relationship, and a third corresponding relationship based on any server in the network system; generating a preset server database based on the first corresponding relation, the second corresponding relation and the third corresponding relation; the first corresponding relation is the corresponding relation between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relation is the corresponding relation between the IP addresses of the servers with the same service type and the service type, and the third corresponding relation is the corresponding relation between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
For example, it is assumed that the network system includes server 01, server 02, server 03, and server 04 set in area a, and the IP addresses of these 4 servers are: a001, a002, a003 and a 004; b, server 05, server 06 and server 07, the IP addresses of these 3 servers are: b005, b006, and b 007; server 08, server 09, server 10, and server 11 set in area c, and the IP addresses of these 4 servers are: c008, c009, c0010 and c 0011; wherein, the service types provided by the server 01, the server 02, the server 06, and the server 11 are X, the service types provided by the server 03, the server 05, and the server 09 are Y, and the service types provided by the server 04, the server 07, the server 08, and the server 10 are Z, then a first relationship as shown in the following table 1 may be established:
location of installation IP address of server
Region a a001、a002、a003、a004
Region b b005、b006、b007
Region c c008、c009、c0010、c0011
TABLE 1
Further, a second relationship may be established as shown in table 2 below:
type of service IP address of server
X a001、a002、b006、c0011
Y a003、b005、c009
Z a004、b007、c008、c0010
TABLE 2
Further, a third relationship may be established as shown in table 3 below:
Figure BDA0001735062060000101
Figure BDA0001735062060000111
TABLE 3
Further, the terminal may establish a database based on the 3 corresponding relationships to obtain a preset server database. Assuming that the query request includes the target setting location "b zone", the terminal may search, in a first relationship in a preset server database, an IP address of a server corresponding to the target setting location "b zone" to obtain "b 005, b006, b 007"; assuming that the query request includes a target service type "Z", the terminal may search, in a second relationship in the preset server database, an IP address of a server corresponding to the target service type "Z" to obtain "a 004, b007, c008, c 0010"; assuming that the query request includes the target setting location "c zone" and the target service type "Z", the terminal may search, in a third relationship in the preset server database, for the IP address of the server corresponding to the target setting location "c zone" and the target service type "Z", to obtain "c 008 and" c0010 ".
Substep (3): and determining the IP address of the corresponding server as the IP address of the target server.
For example, assuming that the query request includes a target setting location "b zone", the terminal may determine "b 005, b006, b 007" as the IP address of the target server, and assuming that the query request includes a target service type "Z", the terminal may determine "a 004, b007, c008, c 0010" as the IP address of the target server; assuming that the target setting location "c zone" and the target traffic type "Z" are included in the query request, the terminal may determine "c 008, c 0010" as the IP address of the target server.
In practical application, when deploying the code, if only some servers in a certain setting location and/or a certain service type are deployed, then there is no need to detect the servers in a certain setting location and/or a certain service type, for example, only the server 01 in the area a is relocated, then the terminal is controlled to perform detection by setting the target setting location in the query request, and unnecessary detection is performed on other servers in the area a, which wastes system resources of the terminal, therefore, in the embodiment of the present invention, the query request may also include an IP address of at least one server, where the IP address of the server may be an IP address of the server, the IP address of the at least one server may be set by a user, and accordingly, when the query request includes the IP address of the at least one server, the terminal may extract an IP address of at least one server included in the query request and determine the IP address of the at least one server as an IP address of the target server. Therefore, the user can realize that the specific server is detected by the appointed terminal by setting the IP address of the server in the query request, and further avoid unnecessary detection of the terminal and further waste of system resources of the terminal. For example, the user transmits an inquiry request including information of the server 01, that is, an address of the server 01, to the terminal to control the terminal to detect the server 01 with the information of the server 01 as an IP address of a target server.
Step 202, obtaining information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information.
Specifically, the implementation manner of this step may refer to step 102, which is not described herein again in this embodiment of the present invention.
Step 203, acquiring target code information; the object code information is information of an object code deployed by the terminal for the object server.
Specifically, the implementation manner of this step may refer to step 103, which is not described herein again in this embodiment of the present invention.
And step 204, determining a target server corresponding to the comparison code information which is not matched with the target code information to obtain a fault server.
Specifically, the implementation manner of this step may refer to step 104, which is not described herein again in this embodiment of the present invention.
Step 205, redeploying the object code for the failed server.
For example, assuming that the failed server is server 01, the terminal may redeploy the object code for server 01, so that server 01 and server 03 can provide a new function corresponding to the object code for the user based on the normal running object code.
And step 206, acquiring information of the currently running code in the fault server to obtain current code information.
In practical applications, the existence of a failure and thus the failure of the server may be due to a software failure, for example, due to a system error occurring during the restart process, or may be due to a hardware failure, for example, due to a hardware failure. Generally, a server that has failed to restart due to software failure may successfully complete a restart when the server is restarted after the target code is redeployed, and accordingly, the target code may be run on the server.
Therefore, in the embodiment of the present invention, after the target code is redeployed for the fault server, the information of the currently running code in the fault server may be obtained, so as to obtain the current code information, so as to determine whether the target code runs in the fault server, and further determine whether the fault occurring in the fault server is a hardware fault that needs to be maintained.
And step 207, if the current code information is not matched with the target code information, displaying maintenance reminding information.
In this step, this maintenance reminding information can be used for reminding the user to overhaul the fault server, and further, if current code information and target code information do not match, then can confirm not operating the target code in the fault server, the fault server has hardware fault, needs to detect, at this moment, can show maintenance reminding information to in time overhaul the fault server for the maintenance personal, and then guarantee the normal work of server.
In summary, in the method for locating a fault server provided in the second embodiment of the present invention, the terminal may first determine an IP address of at least one target server based on the received query request, then obtain information of a code currently running on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information, then obtain the target code information, where the target code information is information of a target code deployed by the terminal for the target server, and finally determine a target server corresponding to the comparison code information that does not match with the target code information to obtain the fault server. Therefore, connection with each server is not needed to be established respectively, the terminal can determine whether the target server is the server with the restart failure or not based on autonomously acquiring the target code information of the comparison code information base, the determination efficiency is improved, the required cost is reduced, meanwhile, the target code can be redeployed for the fault server by the terminal, then, the information of the currently running code in the fault server is acquired, the current code information is obtained, finally, if the current code information is not matched with the target code information, the maintenance reminding information is displayed, so that maintenance personnel can timely maintain the fault server, and the normal work of the server is ensured.
EXAMPLE III
Fig. 3 is a block diagram of a fault server locating apparatus according to a third embodiment of the present invention, and as shown in fig. 3, the apparatus 30 may include:
a first determining module 301, configured to determine an IP address of at least one target server based on the received query request.
A first obtaining module 302, configured to obtain information of a currently running code on each target server based on the IP address of the at least one target server, so as to obtain at least one piece of comparison code information.
A second obtaining module 303, configured to obtain target code information; the object code information is information of an object code deployed by the terminal for the object server.
A second determining module 304, configured to determine a target server corresponding to the comparison code information that is not matched with the target code information, so as to obtain a failed server.
In summary, in the fault server locating device provided in the third embodiment of the present invention, the first determining module may first determine an IP address of at least one target server based on the received query request, then the first obtaining module may obtain information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information, then the second obtaining module may obtain the target code information, where the target code information is information of a target code deployed by a terminal for the target server, and finally the second determining module may determine a target server corresponding to the comparison code information that does not match with the target code information, so as to obtain the fault server. Therefore, connection with each server is not required to be established, and the terminal can determine whether the target server is the server with the restart failure fault or not based on the target code information of the self-acquired comparison code information base, so that the determination efficiency is improved, and the required cost is reduced.
Example four
Fig. 4 is a block diagram of a fault server locating apparatus according to a fourth embodiment of the present invention, and as shown in fig. 4, the apparatus 40 may include:
a first determining module 401, configured to determine an IP address of at least one target server based on the received query request;
a first obtaining module 402, configured to obtain information of a currently running code on each target server based on the IP address of the at least one target server, to obtain at least one piece of comparison code information;
a second obtaining module 403, configured to obtain target code information; the target code information is information of a target code deployed by the terminal for the target server;
a second determining module 404, configured to determine a target server corresponding to the comparison code information that is not matched with the target code information, so as to obtain a failed server.
Optionally, the query request includes a target server attribute, where the target server attribute includes a target setting location and/or a target service type;
accordingly, the first determining module 401 includes:
an extracting sub-module, configured to extract the target setting location and/or the target service type in the query request;
the searching submodule is used for searching an IP address of a server corresponding to the target setting place and/or the target service type from a preset server database;
the determining submodule is used for determining the IP address of the corresponding server as the IP address of the target server;
wherein, the preset server database stores the IP address of any server in the network system.
Optionally, the apparatus 40 further includes:
the establishing module is used for establishing a first corresponding relation, a second corresponding relation and a third corresponding relation based on any server in the network system;
a generating module, configured to generate the preset server database based on the first corresponding relationship, the second corresponding relationship, and the third corresponding relationship;
the first corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same service type and the service type, and the third corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
Optionally, the query request includes an IP address of at least one server;
accordingly, the first determining module 401 is configured to:
and extracting the IP address of the at least one server included in the query request, and determining the IP address of the at least one server as the IP address of the target server.
Optionally, the apparatus 40 further includes:
a deployment module 405 for redeploying the object code for the failed server;
a third obtaining module 406, configured to obtain information of a currently running code in the fault server, so as to obtain current code information;
and a display module 407, configured to display maintenance reminding information if the current code information is not matched with the target code information.
In summary, in the fault server locating device provided in the fourth embodiment of the present invention, the first determining module may first determine an IP address of at least one target server based on the received query request, then the first obtaining module may obtain information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information, then the second obtaining module may obtain the target code information, where the target code information is information of a target code deployed by a terminal for the target server, and finally the second determining module may determine a target server corresponding to the comparison code information that does not match with the target code information, so as to obtain the fault server. Therefore, connection with each server is not needed to be established respectively, the terminal can determine whether the target server is the server with the restart failure or not based on autonomously acquiring the target code information of the comparison code information, the determination efficiency is improved, the required cost is reduced, meanwhile, the target code can be redeployed for the fault server by the deployment module, then, the third acquisition module can acquire the information of the currently running code in the fault server to obtain the current code information, finally, the display module can display the maintenance reminding information when the current code information is not matched with the target code information, so that maintenance personnel can timely maintain the fault server, and further the normal work of the server is ensured.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
Further, according to an embodiment of the present invention, there is provided a mobile terminal including: the system comprises a processor, a memory and a fault server positioning program which is stored on the memory and can run on the processor, wherein the fault server positioning program realizes the fault server positioning method of the embodiment when being executed by the processor.
According to an embodiment of the present invention, there is also provided a computer-readable storage medium having stored thereon a fault server locating program which, when executed by a processor, implements the fault server locating method of the foregoing embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The fault server location methods provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the fault server location method according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (10)

1. A fault server positioning method is applied to a terminal, and comprises the following steps:
determining an internet protocol, IP, address of at least one target server based on the received query request; the query request comprises a target server attribute, wherein the target server attribute comprises a target setting place and/or a target service type;
acquiring information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information; wherein the comparison code information includes: the version number of the currently running code on the target server or a preset identifier of a preset position in the currently running code on the target server;
acquiring target code information; the target code information is information of a target code deployed by the terminal for the target server;
and determining the target server corresponding to the comparison code information which is not matched with the target code information to obtain a fault server.
2. The method of claim 1, wherein determining the IP address of the at least one target server based on the received query request comprises:
extracting the target setting place and/or the target service type in the query request;
searching an IP address of a server corresponding to the target setting location and/or the target service type from a preset server database;
determining the IP address of the corresponding server as the IP address of a target server;
wherein, the preset server database stores the IP address of any server in the network system.
3. The method of claim 2, wherein prior to determining the IP address of the at least one target server based on the received query request, the method further comprises:
establishing a first corresponding relation, a second corresponding relation and a third corresponding relation based on any server in the network system;
generating the preset server database based on the first corresponding relationship, the second corresponding relationship and the third corresponding relationship;
the first corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same service type and the service type, and the third corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
4. The method of claim 1, wherein the query request includes an IP address of at least one server;
accordingly, the determining an IP address of at least one target server based on the received query request comprises:
and extracting the IP address of the at least one server included in the query request, and determining the IP address of the at least one server as the IP address of the target server.
5. The method of claim 1, wherein after determining that the target server corresponding to the comparison code information that does not match the target code information obtains a failed server, the method further comprises:
redeploying the object code for the failed server;
acquiring information of a currently running code in the fault server to obtain current code information;
and if the current code information is not matched with the target code information, displaying maintenance reminding information.
6. A fault server positioning device is applied to a terminal, and comprises:
a first determining module for determining an IP address of at least one target server based on the received query request; the query request comprises a target server attribute, wherein the target server attribute comprises a target setting place and/or a target service type;
the first acquisition module is used for acquiring information of a currently running code on each target server based on the IP address of the at least one target server to obtain at least one piece of comparison code information; wherein the comparison code information includes: the version number of the currently running code on the target server or a preset identifier of a preset position in the currently running code on the target server;
the second acquisition module is used for acquiring target code information; the target code information is information of a target code deployed by the terminal for the target server;
and the second determining module is used for determining the target server corresponding to the comparison code information which is not matched with the target code information to obtain the fault server.
7. The apparatus of claim 6, wherein the first determining module comprises:
an extracting sub-module, configured to extract the target setting location and/or the target service type in the query request;
the searching submodule is used for searching an IP address of a server corresponding to the target setting place and/or the target service type from a preset server database;
the determining submodule is used for determining the IP address of the corresponding server as the IP address of the target server;
wherein, the preset server database stores the IP address of any server in the network system.
8. The apparatus of claim 7, further comprising:
the establishing module is used for establishing a first corresponding relation, a second corresponding relation and a third corresponding relation based on any server in the network system;
a generating module, configured to generate the preset server database based on the first corresponding relationship, the second corresponding relationship, and the third corresponding relationship;
the first corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the setting location, the second corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same service type and the service type, and the third corresponding relationship is a corresponding relationship between the IP addresses of the servers with the same setting location and the same service type and the setting location and the service type.
9. The apparatus of claim 6, wherein the query request includes an IP address of at least one server;
accordingly, the first determining module is configured to:
and extracting the IP address of the at least one server included in the query request, and determining the IP address of the at least one server as the IP address of the target server.
10. The apparatus of claim 6, further comprising:
a deployment module to redeploy the object code for the failed server;
the third acquisition module is used for acquiring the information of the currently running code in the fault server to obtain the current code information;
and the display module is used for displaying maintenance reminding information if the current code information is not matched with the target code information.
CN201810791660.4A 2018-07-18 2018-07-18 Fault server positioning method and device Active CN109120432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810791660.4A CN109120432B (en) 2018-07-18 2018-07-18 Fault server positioning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810791660.4A CN109120432B (en) 2018-07-18 2018-07-18 Fault server positioning method and device

Publications (2)

Publication Number Publication Date
CN109120432A CN109120432A (en) 2019-01-01
CN109120432B true CN109120432B (en) 2021-10-15

Family

ID=64862205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810791660.4A Active CN109120432B (en) 2018-07-18 2018-07-18 Fault server positioning method and device

Country Status (1)

Country Link
CN (1) CN109120432B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535685B (en) * 2019-07-25 2023-01-13 北京奇艺世纪科技有限公司 Fault determination method and device and computer readable storage medium
CN114039842A (en) * 2021-09-26 2022-02-11 天翼爱音乐文化科技有限公司 Fault positioning method, system, equipment and storage medium for distributed service
CN115378801B (en) * 2022-08-10 2024-01-30 福州六察网络科技有限公司 Multi-server communication method and terminal
CN117596187B (en) * 2024-01-19 2024-04-30 融科联创(天津)信息技术有限公司 Server operation and maintenance method, device, equipment and medium based on multi-cloud platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1752930A (en) * 2004-09-23 2006-03-29 华为技术有限公司 Chip program loading method
CN104978191A (en) * 2015-06-24 2015-10-14 小米科技有限责任公司 Application deployment method and server
CN106095483A (en) * 2016-05-31 2016-11-09 乐视控股(北京)有限公司 The Automation arranging method of service and device
CN106445613A (en) * 2016-10-11 2017-02-22 北京北方烽火科技有限公司 Code upgrading method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1752930A (en) * 2004-09-23 2006-03-29 华为技术有限公司 Chip program loading method
CN104978191A (en) * 2015-06-24 2015-10-14 小米科技有限责任公司 Application deployment method and server
CN106095483A (en) * 2016-05-31 2016-11-09 乐视控股(北京)有限公司 The Automation arranging method of service and device
CN106445613A (en) * 2016-10-11 2017-02-22 北京北方烽火科技有限公司 Code upgrading method and system

Also Published As

Publication number Publication date
CN109120432A (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN109120432B (en) Fault server positioning method and device
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN111240653B (en) Interface document generation method, device and readable storage medium
CN110765001B (en) Modularized automatic test method and device for application system
CN105893075A (en) Update method and device of application
CN107526642A (en) The acquisition methods and terminal of terminal room application program
CN111182089A (en) Container cluster system, method and device for accessing big data assembly and server
CN110968356B (en) Method and device for acquiring configuration information
CN109561167B (en) Domain name resolution method and device
CN106302384A (en) DNS message processing method and device
CN108958855B (en) Page jump method, device and system
CN108694121B (en) Automatic testing method, device and system
CN105357267A (en) Method, device and system for obtaining server information
CN106789170B (en) Task processing method and device
CN110674427A (en) Method, device, equipment and storage medium for responding to webpage access request
CN111628878A (en) Fault positioning method, device and system based on multi-stage network nodes
CN113535262A (en) Method, device, equipment and storage medium for controlling starting of proxy node
CN101009601A (en) A maintenance and detection method, system and device of the network element
US7975177B2 (en) System and method for testing network performance
CN107483294B (en) Method and device for monitoring network request
CN106202289B (en) Webpage positioning method and electronic equipment
CN114443294B (en) Big data service component deployment method, system, terminal and storage medium
CN115129596A (en) Automatic interface testing method, system, device and storage medium
CN107203915B (en) Data storage method and device
CN112035432B (en) Data replacement migration method and device and computer 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
GR01 Patent grant
GR01 Patent grant