CN115686911A - Server-side self-checking method and device, electronic equipment and storage medium - Google Patents
Server-side self-checking method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115686911A CN115686911A CN202211351424.3A CN202211351424A CN115686911A CN 115686911 A CN115686911 A CN 115686911A CN 202211351424 A CN202211351424 A CN 202211351424A CN 115686911 A CN115686911 A CN 115686911A
- Authority
- CN
- China
- Prior art keywords
- server
- picture
- access request
- returned
- client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000002159 abnormal effect Effects 0.000 claims abstract description 28
- 238000004590 computer program Methods 0.000 claims description 20
- 238000010998 test method Methods 0.000 claims description 12
- 230000005856 abnormality Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 8
- 230000003287 optical effect Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a server self-checking method and device, electronic equipment and a storage medium. The method is characterized by comprising the following steps: the method comprises the steps that a client receives a first access request for accessing a first picture, and the first access request is sent to a server; if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server; and if the status code which is returned by the server and used for indicating that the second picture is successfully accessed is not acquired, determining that the server is abnormal. The embodiment of the invention realizes the self-check of the server picture storage and improves the efficiency of the self-check of the server picture access.
Description
Technical Field
The invention relates to the technical field of data interaction, in particular to a server-side self-checking method and device, electronic equipment and a storage medium.
Background
The independent service of the mobile terminal at present is composed of a client and a server, when the client serves a client, a front page can be displayed by a picture data corresponding to a client request, when the client receives a service request, the client requests the server for the corresponding picture data, if the server returns the requested picture data, the corresponding page data can be displayed on the client page, if the server cannot return the requested picture data or other data, the client cannot provide the corresponding service, the use experience of a user is influenced, and the reason why the picture resource cannot be obtained needs to be determined in time.
In the prior art, when an abnormality occurs, the abnormality is captured, then abnormal information is recorded through a log, and then a client and a mobile terminal are checked according to the abnormal information, so that the problem obtaining efficiency is low, and the position where the error occurs is difficult to quickly and accurately locate due to the intervention of a developer.
Disclosure of Invention
The invention provides a server-side self-checking method, a server-side self-checking device, electronic equipment and a storage medium, and aims to accurately and quickly determine a path of leaked data.
According to an aspect of the present invention, a service-side self-checking method is provided, including:
the method comprises the steps that a client receives a first access request for accessing a first picture, and the first access request is sent to a server;
if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server;
and if the status code which is returned by the server and used for indicating that the second picture is successfully accessed is not acquired, determining that the server is abnormal.
According to another aspect of the present invention, there is provided a server-side self-test apparatus, including:
the first picture access module is used for receiving a first access request for accessing a first picture by a client and sending the first access request to a server;
the second picture access module is used for generating a second access request for accessing a second picture stored in a preset directory in the server and sending the second access request to the server if the client does not acquire the first picture returned by the server;
and the access exception module is used for determining that the server side is abnormal if the status code which is returned by the server side and used for indicating that the second picture is successfully accessed is not acquired.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the server-side self-test method according to any embodiment of the present invention.
According to another aspect of the present invention, a computer-readable storage medium is provided, where computer instructions are stored, and the computer instructions are configured to enable a processor to implement the server-side self-test method according to any embodiment of the present invention when executed.
The technical scheme of the embodiment of the invention receives a first access request for accessing a first picture through a client and sends the first access request to a server; if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server; requesting a second picture again through a second access request, further determining the connection state of the server, further eliminating the influence of server errors on the first picture request, if a state code which is returned by the server and used for indicating successful access of the second picture is not obtained, determining that the server is abnormal, and determining that the connection state of the server is abnormal when the server cannot return the second picture, thereby realizing self-checking of the server and improving the efficiency of determining the abnormality of the server data transmission errors. The technical problem that the position where the error occurs is difficult to position quickly and accurately in the prior art is solved, and the quick positioning abnormity problem and the abnormity self-checking of the server are realized.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a server-side self-checking method according to an embodiment of the present invention;
fig. 2 is a flowchart of another server-side self-test method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server-side self-inspection apparatus according to an embodiment of the present invention;
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between similar users and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a server-side self-test method according to an embodiment of the present invention, where the method is applicable to a situation where a picture request of a client and a server has a problem, the method may be executed by a server-side self-test device, the server-side self-test device may be implemented in a form of hardware and/or software, and the server-side self-test device may be configured in an electronic device. As shown in fig. 1, the method includes:
s110, the client receives a first access request for accessing the first picture, and sends the first access request to the server.
The first picture may be an image that the client needs to display, and is used for displaying in a front-end page of the client. The first access request may be a request sent by the client for the first picture to be presented by the front-end page as needed. The server side can be used for acquiring request data according to the received data request and returning the request data to the client side.
Optionally, in the embodiment of the present invention, when the client displays the front-end page, the client needs a first picture and other related resources, the resources needed by the front-end page are configured, and the first picture needs to be uploaded to the server for storage, and then the front-end page needs to send a first access request to the client, the client sends the first access request to the server, and the server obtains the first picture stored in the server according to the first access request and then returns the first picture to the client for configuration.
Specifically, the client receives a first access request for accessing the first picture from the front-end page, and sends the first access request to the server for requesting to access the first picture.
Optionally, the server receives a first access request for accessing the first picture, analyzes the first access request, determines the accessed first picture, further determines a storage location of the first picture, acquires the first picture, and returns the acquired first picture to the client.
Optionally, in another embodiment of the present invention, after the sending the first access request to the server, the method further includes: and the server calls an hdfs method to access the hadoop server so as to acquire a first picture corresponding to the first access request.
The Distributed File System is operated by a mobile terminal, wherein the hdfs (Hadoop Distributed File System) is a Distributed File System operated by the mobile terminal.
Specifically, the server receives the first access request, calls an hdfs method to access the hadoop server according to the first access request, and obtains a first picture corresponding to the first access request and stored in the hadoop server.
Optionally, in another optional embodiment of the present invention, after the sending the first access request to the server, the method further includes:
the client receives feedback data corresponding to the first access request returned by the server; the client determines whether the feedback data is data in a picture format; if yes, determining to acquire a first picture returned by the server and displaying the first picture; otherwise, determining that the first picture returned by the server is not acquired.
The feedback data may be data returned by the server according to the first access request. The picture format may be a format in which a picture is stored by a computer. The storage format of the pictures may be bmp, jpg, and png, which is not limited in this embodiment of the present invention.
Specifically, when the client receives feedback data corresponding to a first access request returned by the server, a storage format of the feedback data is obtained, whether the feedback data is data in a picture format or not is judged, if the feedback data is data in the picture format, the feedback data is determined to be a first picture returned by the server, and the client sends the first picture to a front-end page for displaying; and if the feedback data is not the data in the picture format, determining that the first picture returned by the server side is not acquired.
Optionally, in another optional embodiment of the present invention, after the sending the first access request to the server, the method further includes:
and if the returned data of the server is empty data or the returned data of the server is not received within the preset access time, determining that the first picture returned by the server is not obtained.
The preset access time may be a time that the client is used to determine in advance whether the setting server can return data. It should be noted that, when the client requests data from the server, a certain access time is preset, and if the server does not return data within the access time, the client considers that the request fails. The null data may be that the return data of the server is null.
Specifically, when a client requests data from a server, recording the time of the request, and after the client passes preset access time and still does not receive the returned data of the server, determining that the client does not acquire a first picture returned by the server; and if the client receives the empty data of the returned data within the preset access time, determining that the client does not acquire the first picture returned by the server.
And S120, if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server.
The preset directory may be an address preset to store the second picture. The second access request may be an access request to access the second picture.
Optionally, in the embodiment of the present invention, the client wants the server to send a first access request for accessing the first picture, and if the server cannot respond to the first access request, the client may not obtain the first picture for a long time, and when the client does not obtain the first picture returned by the server, the client may access the second picture to determine the response state of the server.
Optionally, the second picture may be pre-stored in a fixed directory preset in the server, and when the second picture is stored, the directory of the second picture in the server is sent to the client, and the client may directly generate a second access request for accessing the second picture in the directory preset in the server, and send the second access request to the server.
Specifically, when the client does not acquire the first picture returned by the server, the client generates a second access request, sends the second access request to the server, and accesses the second picture stored in a preset directory in the server.
S130, if the status code which is returned by the server and used for indicating that the second picture is successfully accessed is not acquired, determining that the server is abnormal.
Wherein the status code may be a numeric code for indicating success or failure of access to the second picture. It should be noted that the status code may be used to indicate the response status, for example: a status code of type 200 may be used to indicate that a request was received, a status code of type 300 may be used to indicate a redirect, a status code of type 400 may be used to indicate that it cannot be recognized by the server, and a status code of type 500 may indicate that an error or exception condition exists with the server.
In the embodiment of the disclosure, the client sends the second access request to the server, and if the status code returned by the server and received by the client is different from the status code used for indicating that the second picture is successfully accessed, or the status code returned by the server is not received, it is determined that the server is abnormal.
The technical scheme of the embodiment of the invention receives a first access request for accessing a first picture through a client and sends the first access request to a server; if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server; requesting a second picture again through a second access request, further determining the connection state of the server, further eliminating the influence of server error on the first picture request, if a state code which is returned by the server and used for indicating successful access of the second picture is not obtained, determining that the server is abnormal, and determining that the connection state of the server is abnormal when the server cannot return the second picture, thereby realizing self-checking of the server and improving the efficiency of determining the abnormality of the server data transmission error. The problem of be difficult to among the prior art quick accurate location take place the wrong position technique is solved, realized quick location anomaly problem and the unusual self-checking of server-side.
Fig. 2 is a flowchart of another server-side self-test method according to an embodiment of the present invention, where a server state is further determined according to a response time of a server when a second picture is requested from a server. As shown in fig. 2, the method includes:
s210, the client receives a first access request for accessing the first picture, and sends the first access request to the server.
Optionally, in another optional embodiment of the present invention, after the sending the first access request to the server, the method further includes:
the client receives feedback data corresponding to the first access request returned by the server; the client determines whether the feedback data is data in a picture format; if yes, determining to acquire a first picture returned by the server and displaying the first picture; otherwise, determining that the first picture returned by the server is not acquired.
The feedback data may be data returned by the server according to the first access request. The picture format may be a format in which a picture is stored by a computer. The storage format of the pictures may be bmp, jpg, and png, which is not limited in this embodiment of the present invention.
Specifically, when the client receives feedback data corresponding to a first access request returned by the server, a storage format of the feedback data is obtained, whether the feedback data is data in a picture format or not is judged, if the feedback data is data in the picture format, the feedback data is determined to be a first picture returned by the server, and the client sends the first picture to a front-end page for displaying; and if the feedback data is not the data in the picture format, determining that the first picture returned by the server side is not acquired.
S220, if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server.
Optionally, in another optional embodiment of the present invention, after the sending the second access request to the server, the method further includes:
and the server calls an httpparent method to access a second picture in a preset directory in the server.
Among them, the httpclient () method can be a class for requesting a server. Optionally, when the server is requested to access data, the httpparent method request mode saves more time, multiple calls among hdfs components can be skipped, and the data requesting efficiency is improved.
Specifically, the server calls an httpparent method to access the second picture in a preset directory in the server according to the storage address of the second picture.
S230, if the client does not acquire the status code which is returned by the server and used for indicating that the second picture is successfully accessed within the preset access time, determining that the server is abnormal.
Specifically, when the client requests the server for the second picture, the time for performing the second access request is recorded, and after the client passes through the preset access time, the client still does not receive the status code which is returned by the server of the server and is used for indicating that the second picture is successfully accessed, and it is determined that the server is abnormal.
S240, if the client acquires the status code which is returned by the server and used for indicating that the second picture is successfully accessed, determining that the first picture is abnormal.
Specifically, when the client requests the server for the second picture, and receives a status code which is returned by the server of the server and used for indicating that the second picture is successfully accessed, the client determines that the server is normal, and then determines that the first picture is abnormal. The abnormality of the first picture may include a first picture configuration abnormality and/or a first picture data format error.
The technical scheme of the embodiment of the invention receives a first access request for accessing a first picture through a client and sends the first access request to a server; if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, sending the second access request to the server, if the client does not acquire a state code which is returned by the server and used for indicating successful access of the second picture, determining that the server is abnormal, and determining that the connection state of the server is abnormal when the server cannot return the second picture in preset request time; and if the client acquires the status code which is returned by the server and used for indicating that the second picture is successfully accessed, determining that the first picture is abnormal, and determining that the first picture configuration storage of the server is abnormal on the premise that the connection state of the server is normal, so that the efficiency of determining the abnormality of the data transmission error of the server is improved. The technical problem that the position where the error occurs is difficult to position quickly and accurately in the prior art is solved, and the quick positioning abnormity problem and the abnormity self-checking of the server are realized.
Fig. 3 is a schematic structural diagram of a server-side self-inspection device according to an embodiment of the present invention. As shown in fig. 3, the apparatus includes: a first picture access module 310, a second picture access module 320, and an access exception module 330. Wherein,
the first picture access module 310 is configured to receive a first access request for accessing a first picture by a client, and send the first access request to a server;
the second picture access module 320 is configured to generate a second access request for accessing a second picture stored in a preset directory in the server if the client does not obtain the first picture returned by the server, and send the second access request to the server;
the access exception module 330 is configured to determine that an exception exists in the server if a status code, which is returned by the server and used for indicating that the access of the second picture is successful, is not obtained.
The technical scheme of the embodiment of the invention receives a first access request for accessing a first picture through a client and sends the first access request to a server; if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server; requesting a second picture again through a second access request, further determining the connection state of the server, further eliminating the influence of server error on the first picture request, if a state code which is returned by the server and used for indicating successful access of the second picture is not obtained, determining that the server is abnormal, and determining that the connection state of the server is abnormal when the server cannot return the second picture, thereby realizing self-checking of the server and improving the efficiency of determining the abnormality of the server data transmission error. The technical problem that the position where the error occurs is difficult to position quickly and accurately in the prior art is solved, and the quick positioning abnormity problem and the abnormity self-checking of the server are realized.
The device further comprises:
and the server access module is used for calling the hdfs method to access the hadoop server by the server so as to acquire the first picture corresponding to the first access request.
And the server network access module is used for calling an httpclient method by the server side to access a second picture under a preset directory in the server.
The data receiving module is used for receiving feedback data corresponding to the first access request returned by the server side by the client side;
the picture checking module is used for determining whether the feedback data is data in a picture format or not by the client;
if yes, determining to acquire a first picture returned by the server and displaying the first picture;
otherwise, determining that the first picture returned by the server is not acquired.
Optionally, the first picture access module is further configured to:
and if the returned data of the server is empty data or the returned data of the server is not received within the preset access time, determining that the first picture returned by the server is not obtained.
And if the client does not acquire the status code which is returned by the server and used for indicating that the second picture is successfully accessed within the preset access time, determining that the server is abnormal.
Optionally, the access exception module is further configured to:
and if the client acquires the status code which is returned by the server and used for indicating that the second picture is successfully accessed, determining that the first picture is abnormal.
The server self-checking device provided by the embodiment of the invention can execute the server self-checking method provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of the execution method.
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as the server-side self-test method.
In some embodiments, the server-side self-test method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the server side self test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the server-side self-test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include a client and a server. A user terminal and server are generally remote from each other and typically interact through a communication network. The relationship of user side and server arises by virtue of computer programs running on the respective computers and having a user side-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the server-side self-test method provided in any embodiment of the present invention, where the method includes:
the method comprises the steps that a client receives a first access request for accessing a first picture, and the first access request is sent to a server;
if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server;
and if the status code which is returned by the server and used for indicating that the second picture is successfully accessed is not acquired, determining that the server is abnormal.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A server-side self-checking method is characterized by comprising the following steps:
the method comprises the steps that a client receives a first access request for accessing a first picture, and the first access request is sent to a server;
if the client does not acquire the first picture returned by the server, generating a second access request for accessing a second picture stored in a preset directory in the server, and sending the second access request to the server;
and if the status code which is returned by the server and used for indicating that the second picture is successfully accessed is not acquired, determining that the server is abnormal.
2. The method of claim 1, further comprising, after the sending the first access request to a server:
and the server calls an hdfs method to access the hadoop server so as to acquire a first picture corresponding to the first access request.
3. The method of claim 1, further comprising, after the sending the second access request to the server:
and the server side calls an httpcl agent method to access a second picture under a preset directory in the server.
4. The method of claim 1, further comprising, after the sending the first access request to a server:
the client receives feedback data corresponding to the first access request returned by the server;
the client determines whether the feedback data is data in a picture format;
if yes, determining to acquire a first picture returned by the server and displaying the first picture;
otherwise, determining that the first picture returned by the server is not acquired.
5. The method of claim 1, further comprising, after the sending the first access request to a server:
and if the return data of the server side is null data or the return data of the server side is not received in preset access time, determining that the first picture returned by the server side is not obtained.
6. The method according to claim 1, wherein the determining that the server side has an exception if a status code indicating that the second picture access is successful, which is returned by the server side, is not obtained comprises:
and if the client does not acquire the status code which is returned by the server and used for indicating that the second picture is successfully accessed within the preset access time, determining that the server is abnormal.
7. The method of claim 1, further comprising:
and if the client acquires the status code which is returned by the server and used for indicating that the second picture is successfully accessed, determining that the first picture is abnormal.
8. A server-side self-checking device is characterized by comprising:
the first picture access module is used for receiving a first access request for accessing a first picture by a client and sending the first access request to a server;
the second picture access module is used for generating a second access request for accessing a second picture stored in a preset directory in the server and sending the second access request to the server if the client does not acquire the first picture returned by the server;
and the access exception module is used for determining that the server side is abnormal if the status code which is returned by the server side and used for indicating that the second picture is successfully accessed is not acquired.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the server-side self-test method according to any embodiment of the present invention.
10. A computer-readable storage medium, storing computer instructions, which are used to enable a processor to implement a server-side self-test method according to any embodiment of the present invention when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211351424.3A CN115686911A (en) | 2022-10-31 | 2022-10-31 | Server-side self-checking method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211351424.3A CN115686911A (en) | 2022-10-31 | 2022-10-31 | Server-side self-checking method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115686911A true CN115686911A (en) | 2023-02-03 |
Family
ID=85046451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211351424.3A Pending CN115686911A (en) | 2022-10-31 | 2022-10-31 | Server-side self-checking method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115686911A (en) |
-
2022
- 2022-10-31 CN CN202211351424.3A patent/CN115686911A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113900834B (en) | Data processing method, device, equipment and storage medium based on Internet of things technology | |
CN110457632B (en) | Webpage loading processing method and device | |
CN109828830B (en) | Method and apparatus for managing containers | |
CN110881224B (en) | Network long connection method, device, equipment and storage medium | |
CN110620806B (en) | Information generation method and device | |
CN114490126A (en) | Page processing method and device, electronic equipment and storage medium | |
CN113434384B (en) | Pressure testing method and device | |
CN114138397B (en) | Page display method and device, electronic equipment and storage medium | |
CN117632545A (en) | Data sharing method and device of business system and electronic equipment | |
CN116545905A (en) | Service health detection method and device, electronic equipment and storage medium | |
CN115686911A (en) | Server-side self-checking method and device, electronic equipment and storage medium | |
CN112395194B (en) | Method and device for accessing test platform | |
CN113986135B (en) | Method, device, equipment and storage medium for processing request | |
CN115309730A (en) | Data auditing method and device, electronic equipment and storage medium | |
CN111737129B (en) | Service control method, device, computer readable medium and electronic equipment | |
CN114546705A (en) | Operation response method, operation response device, electronic apparatus, and storage medium | |
CN113094268A (en) | Test method, device, equipment, medium and program product | |
CN112860770A (en) | Report generation method and device, electronic equipment and storage medium | |
CN111769965B (en) | Information processing method, device and equipment | |
CN115600029A (en) | Method, device, system, equipment and storage medium for displaying webpage | |
CN110825610B (en) | Method and device for providing test data | |
CN117670236A (en) | Mobile-terminal-based to-be-handled flow approval method, device, equipment and medium | |
CN117785264A (en) | Interface configuration method, device and storage medium for server operation and maintenance | |
CN116012158A (en) | Service processing method, device, equipment and storage medium | |
CN115344801A (en) | Method, device, equipment and medium for updating webpage link |
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 |