CN111131490A - State updating method and device, computer equipment and storage medium - Google Patents

State updating method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111131490A
CN111131490A CN201911400177.XA CN201911400177A CN111131490A CN 111131490 A CN111131490 A CN 111131490A CN 201911400177 A CN201911400177 A CN 201911400177A CN 111131490 A CN111131490 A CN 111131490A
Authority
CN
China
Prior art keywords
server
resource transfer
target
state
status
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.)
Withdrawn
Application number
CN201911400177.XA
Other languages
Chinese (zh)
Inventor
尹航
王彪
牛一佳
张琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201911400177.XA priority Critical patent/CN111131490A/en
Publication of CN111131490A publication Critical patent/CN111131490A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/59Providing operational support to end devices by off-loading in the network or by emulation, e.g. when they are unavailable

Landscapes

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

Abstract

The application discloses a state updating method and device, computer equipment and a storage medium, and belongs to the technical field of internet. The method comprises the following steps: sending a first resource transfer request to a transfer server, wherein the transfer server is used for sending the first resource transfer request to a resource transfer server, and the resource transfer server carries out resource transfer operation based on the first resource transfer request; receiving a status code sent by the transit server based on the first resource transfer request; and if the status code is a target status code indicating the failure of resource transfer, updating the statuses of the transfer server and a target server generating the status code in the resource transfer server to be a fault status. According to the method and the system, the server with the fault state in the transfer server and the resource transfer server is automatically determined through the state code, the state of the server is updated, the server can be updated in time, and the labor cost is saved.

Description

State updating method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for updating a state, a computer device, and a storage medium.
Background
With the continuous development of internet technology, online resource transfer is more and more common. Wherein the online resource transfer can be accomplished through the server. However, when a server is in a failure state, such as a server being damaged, a maintenance person maintaining service, etc., the server cannot complete resource transfer.
At present, if a server needs to be maintained, a maintenance worker sends a maintenance notification mail in advance to notify a technician of the expected maintenance time, and after receiving the notification mail, the corresponding technician updates the recorded state of the server according to the expected maintenance time.
However, both the estimated maintenance time and the actual maintenance time of the server are determined by the maintenance staff, and if the maintenance staff does not strictly perform maintenance according to the estimated maintenance time in the mail, the recorded state of the server does not match the actual state of the server.
Disclosure of Invention
The embodiment of the application provides a state updating method and device, computer equipment and a storage medium, and can solve the problem of manual reminding in the related art. The technical scheme is as follows:
in one aspect, a status updating method is provided, and the method includes:
sending a first resource transfer request to a transfer server, wherein the transfer server is used for sending the first resource transfer request to a resource transfer server, and the resource transfer server carries out resource transfer operation based on the first resource transfer request;
receiving a status code sent by the transit server based on the first resource transfer request;
and if the status code is a target status code indicating the failure of resource transfer, updating the statuses of the transfer server and a target server generating the status code in the resource transfer server to be a fault status.
In a possible implementation manner, if the status code is a target status code indicating a failure of resource transfer, updating the statuses of the transit server and a target server of the resource transfer server that generates the status code to a failure status includes:
and if the state code is a target state code indicating resource transfer failure and the total number of the received target state codes meets a preset condition, updating the state of the target server to be a fault state.
In a possible implementation manner, if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes meets a preset condition, updating the status of the relay server and a target server generating the status code in the resource transfer server to a failure status includes:
if the state code is a target state code indicating resource transfer failure and the total number of the received target state codes is not less than a first threshold value, updating the state of the target server to be a fault state; or,
if the state code is a target state code indicating resource transfer failure, and the ratio of the total number of the received target state codes to the total number of the received other state codes is not less than a second threshold value, updating the state of the target server to be a fault state; or,
and if the state code is a target state code indicating the failure of resource transfer, and the ratio of the total number of the received target state codes to the total number of the received state codes is not less than a third threshold value, updating the state of the target server to be a fault state.
In a possible implementation manner, if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes meets a preset condition, updating the status of the target server to a failure status includes:
if the state code is a target state code indicating resource transfer failure, adding 1 to the total number of the received target state codes to obtain the total number;
and if the total number meets the preset condition, updating the state of the target server to be a fault state.
In one possible implementation manner, the total number of the received target status codes is the total number of the received target status codes within a preset time period.
In one possible implementation, the target status code is a first target status code, and the first target status code indicates a resource transfer failure; or, the target status code is a second target status code, the second target status code indicates that the resource transfer fails, and the status of the target server is a failure status.
In a possible implementation manner, after the updating the states of the transit server and the target server that generates the state code in the resource transfer server to a failure state if the state code is a target state code indicating a failure of resource transfer, the method further includes:
caching a second resource transfer request, wherein the second resource transfer request is a resource transfer request waiting for processing by the target server;
and when the state of the target server is updated to be a normal state, sending a cached second resource transfer request to the target server.
In a possible implementation manner, after the updating the states of the transit server and the target server that generates the state code in the resource transfer server to a failure state if the state code is a target state code indicating a failure of resource transfer, the method further includes:
and sending alarm information, wherein the alarm information is used for prompting that the target server is in a fault state.
In one aspect, a status updating apparatus is provided, the apparatus including:
a sending module, configured to send a first resource transfer request to a transfer server, where the transfer server is configured to send the first resource transfer request to a resource transfer server, and the resource transfer server performs a resource transfer operation based on the first resource transfer request;
a receiving module, configured to receive a status code sent by the transit server based on the first resource transfer request;
and the updating module is used for updating the states of the relay server and the target server which generates the state code in the resource transfer server to be a fault state if the state code is a target state code indicating the failure of resource transfer.
In one possible implementation, the target server is configured to:
acquiring the state code corresponding to the state responding to the first resource transfer request from the stored plurality of state codes; or,
and generating a character string according to the state responding to the first resource transfer request and a preset generation rule, and writing the character string into a target field to obtain the state code.
In a possible implementation manner, the updating module is configured to update the state of the target server to be a failure state if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes meets a preset condition.
In one possible implementation, the update module includes:
an updating unit, configured to update the state of the target server to a failure state if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes is not less than a first threshold; or if the status code is a target status code indicating that resource transfer fails and the ratio of the total number of the received target status codes to the total number of the received other status codes is not less than a second threshold, updating the status of the target server to be a fault status; or,
and if the state code is a target state code indicating the failure of resource transfer, and the ratio of the total number of the received target state codes to the total number of the received state codes is not less than a third threshold value, updating the state of the target server to be a fault state.
In one possible implementation, the update module includes:
a counting unit, configured to add 1 to the total number of the received target status codes to obtain the total number if the status code is a target status code indicating a failure of resource transfer;
and the updating unit is used for updating the state of the target server to be a fault state if the total number meets the preset condition.
In one possible implementation manner, the total number of the received target status codes is the total number of the received target status codes within a preset time period.
In one possible implementation, the target status code is a first target status code, and the first target status code indicates a resource transfer failure; or, the target status code is a second target status code, the second target status code indicates that the resource transfer fails, and the status of the target server is a failure status.
In one possible implementation, the apparatus further includes:
the cache module is used for caching a second resource transfer request, wherein the second resource transfer request is a resource transfer request waiting for processing by the target server;
and the sending module is used for sending the cached second resource transfer request to the target server when the state of the target server is updated to be a normal state.
In one possible implementation, the apparatus further includes:
and the alarm module is used for sending alarm information, and the alarm information is used for prompting that the target server is in a fault state.
In one aspect, a computer device is provided that includes one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform operations performed to implement a state update method as described in any one of the possible implementations above.
In one aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the state updating method according to any one of the above possible implementations.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
according to the state updating method provided by the embodiment of the application, whether the transfer server and the resource transfer server are in the fault state or not is determined through the state code returned by the transfer server based on the first resource transfer request, and the state of the target server in the fault state is updated to be in the fault state, so that the automatic monitoring and configuration of the server state are realized, and the labor cost is reduced.
In the related art, when the transit server needs maintenance, a maintenance person may send a maintenance notification mail in advance to notify a technician of the expected maintenance time, and after receiving the notification mail, the corresponding technician may update the recorded state of the transit server according to the expected maintenance time. For example, the notification mail indicates that the transit server is to be maintained between 10:00 and 12:00, but the time for actually maintaining the transit server may be 10:30 to 11: 30.
Therefore, the related art has a problem that the maintenance time cannot be accurately provided, and the actual maintenance time may be different from the expected maintenance time. If the actual maintenance start time is earlier than the predicted maintenance time, the problem of failure of resource transfer is caused, and if the actual maintenance start time is later than the predicted maintenance time, the problem of waste of available resources is caused.
The state updating method provided by the embodiment of the application can automatically monitor the state of the server without depending on the maintenance notice of maintenance personnel, and the automatically monitored state of the server is consistent with the actual state of the server, so that the transfer server and the resource transfer server can be effectively utilized to perform resource transfer operation, and the problem that available resources are wasted is avoided as much as possible.
In addition, the resource transfer server and the application server do not interact directly, so that when the resource transfer server needs to be maintained, the maintenance personnel do not send notification messages to the technical personnel of the application server. The state updating method provided by the embodiment of the application can determine the state of the resource transfer server, and avoids the problem that the application server misjudges that the transfer server is in the fault state due to the fact that the resource transfer server is in the fault state.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, 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 schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 3 is a flow chart of a status updating method provided by an embodiment of the present application;
FIG. 4 is a flowchart of a status updating method provided by an embodiment of the present application;
FIG. 5 is a flowchart of a status updating method provided by an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a status update apparatus according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a status update apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The state updating method provided by the embodiment of the application can be applied to computer equipment, and in a possible implementation manner, the computer equipment can be a server, and the server can be one server, a server cluster formed by a plurality of servers, or a cloud computing service center. The server may be an application server associated with the target application. Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, the implementation environment includes: an application server 101, a transit server 102, and a resource transfer server 103. A communication connection is established between the application server 101 and the relay server 102, and a communication connection is established between the relay server 102 and the resource transfer server 103.
In a possible implementation manner, the application server 101 may send a resource transfer request to the relay server 102, the relay server 102 sends the resource transfer request to the resource transfer server 103, the resource transfer server 103 performs a resource transfer operation based on the resource transfer request, and then, the application server 101 receives a status code sent by the relay server 102 based on the resource transfer request, where the status code may be generated by the resource transfer server 103, forwarded by the relay server, or generated by the relay server, and if the status code is a target status code indicating a failure of resource transfer, the status of the relay server and a target server of the resource transfer server that generates the status code is updated to a failure status.
In addition, in a possible implementation manner, the computer device may also be a terminal such as a mobile phone, a notebook computer, a tablet computer, and the like, and the terminal may be installed with a target application, and the terminal may implement resource transfer through the target application. Fig. 2 is a schematic diagram of another real-time environment provided by an embodiment of the present application, and referring to fig. 2, the implementation environment includes: an application server 101, a relay server 102, a resource transfer server 103, and a terminal 104. A communication connection is established between the terminal 104 and the application server 101, a communication connection is established between the application server 101 and the relay server 102, and a communication connection is established between the relay server 102 and the resource transfer server 103.
The terminal 104 is installed with a target application, and the application server 101 is a server associated with the target application and can provide a service for a user of the target application. In a possible implementation manner, the terminal 104 sends a resource transfer request to the application server 101 according to a trigger operation of a user, the application server 101 sends the resource transfer request to the relay server 102, the relay server 102 sends the resource transfer request to the resource transfer server 103, and the resource transfer server 103 performs resource transfer based on the resource transfer request. The application server 101 receives the status code transmitted by the relay server 102 based on the resource transfer request, and updates the status of the relay server and the target server that generates the status code among the resource transfer servers to a failure status if the status code is a target status code indicating a failure of the resource transfer.
The state updating method provided by the embodiment of the application can be applied to any resource transfer scenario, for example, a collection scenario or a payment scenario, and it should be noted that collection and payment are for an application server.
For example, the application server is an e-commerce application server, after a terminal user purchases a service using the e-commerce application, the application server sends a first resource transfer request to the transfer server, the transfer server sends the first resource transfer request to the resource transfer server, and the resource transfer server completes resource transfer.
For another example, the application server needs to transfer the resource to the merchant registered in the application server, and with the state updating method provided in the embodiment of the present application, when the relay server or the resource transfer server is in the fault state, the resource can be detected in time, and the state of the relay server or the resource transfer server is updated to the fault state, and when the relay server or the resource transfer server is in the fault state, the application server may use another relay server or the resource transfer server to complete the resource transfer, or cache the second resource transfer request, and send the cached second resource transfer request to the application server after the state of the application server is updated to the normal state.
Fig. 3 is a flowchart of a status updating method according to an embodiment of the present application. Applied to a computer device, see fig. 3, this embodiment includes:
301. and sending a first resource transfer request to a transfer server, wherein the transfer server is used for sending the first resource transfer request to a resource transfer server, and the resource transfer server carries out resource transfer operation based on the first resource transfer request.
302. And receiving a status code sent by the transit server based on the first resource transfer request.
303. And if the status code is a target status code indicating the failure of the resource transfer, updating the statuses of the transfer server and a target server generating the status code in the resource transfer server to be a fault status.
According to the state method provided by the embodiment of the application, the states of the target servers generating the state codes in the transfer server and the resource transfer server can be determined according to the state codes sent by the transfer server to the application server, and then when the state of the target server is in the fault state, the state of the target server is updated to be in the fault state, so that the state can be automatically updated, the manual operation of technicians is not needed, and the labor cost is reduced.
In a possible implementation manner, if the status code is a target status code indicating a failure of resource transfer, updating the statuses of the transit server and a target server of the resource transfer server that generates the status code to a failure status includes:
and if the state code is a target state code indicating the failure of resource transfer and the total number of the received target state codes meets a preset condition, updating the state of the target server to be a fault state.
In a possible implementation manner, if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes meets a preset condition, updating the statuses of the transit server and a target server generating the status code in the resource transfer server to a failure status includes:
if the state code is a target state code indicating the failure of resource transfer and the total number of the received target state codes is not less than a first threshold value, updating the state of the target server to be a fault state; or,
if the state code is a target state code indicating resource transfer failure, and the ratio of the total number of the received target state codes to the total number of the received other state codes is not less than a second threshold value, updating the state of the target server to be a fault state; or,
and if the state code is a target state code indicating the failure of resource transfer, and the ratio of the total number of the received target state codes to the total number of the received state codes is not less than a third threshold value, updating the state of the target server to be a fault state.
In a possible implementation manner, if the status code is a target status code indicating a resource transfer failure and the total number of the received target status codes satisfies a preset condition, updating the status of the target server to a failure status includes:
if the status code is a target status code indicating resource transfer failure, adding 1 to the total number of the received target status codes to obtain the total number;
and if the total number meets the preset condition, updating the state of the target server to be a fault state.
In one possible implementation manner, the total number of the received target status codes is the total number of the received target status codes within a preset time period.
In one possible implementation, the target status code is a first target status code indicating a resource transfer failure; or, the target status code is a second target status code, the second target status code indicates that the resource transfer fails, and the status of the target server is a failure status.
In a possible implementation manner, after the updating the statuses of the transit server and the target server of the resource transfer server that generates the status code to a failure status if the status code is a target status code indicating a failure of resource transfer, the method further includes:
caching a second resource transfer request, wherein the second resource transfer request is a resource transfer request waiting for processing by the target server;
and when the state of the target server is updated to be a normal state, sending the cached second resource transfer request to the target server.
In a possible implementation manner, after the updating the statuses of the transit server and the target server of the resource transfer server that generates the status code to a failure status if the status code is a target status code indicating a failure of resource transfer, the method further includes:
and sending alarm information, wherein the alarm information is used for prompting the target server to be in a fault state.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 4 is a flowchart of a status updating method according to an embodiment of the present application. Referring to fig. 4, the embodiment includes:
401. the application server sends a first resource transfer request to the transit server.
The application server may be a server associated with an application, may provide a server for the application, and the application may be any application such as an electronic commerce application, an instant messaging application, a game application, and the like, and the type of the application is not limited in this embodiment of the application.
The relay server may provide a communication channel for the two servers that cannot directly communicate with each other, for example, when the application server needs to perform a resource transfer operation through the resource transfer server, the application server and the resource transfer server are not established with a communication connection, and at this time, the relay server may provide a resource transfer channel for the application server and the resource transfer server, that is, the application server may send the resource transfer request to the relay server, the relay server sends the resource transfer request to the resource transfer server, and after the resource transfer server completes the resource transfer, the resource transfer result is sent to the application server.
The first resource transfer request is used for instructing the resource transfer server to perform the resource transfer operation, and the first resource transfer request can comprise a first quantity, a receiver account and a payer account. The resource transfer server may transfer the first amount of the resource in the payer account to the recipient account after receiving the first resource transfer request.
Wherein, the sending of the first resource transfer request to the transit server by the application server may be triggered by a user. For example, after the user purchases a service on the application server, payment is made to the merchant, at which point the user may select a payment method and select a payer account under the payment method. The payment method selected by the user is equivalent to determining a transfer server for providing a resource transfer channel, the payment party account selected by the user is equivalent to selecting a resource transfer server for resource transfer, and the resource transfer server is a server to which the payment party account belongs. The method comprises the steps that after a user terminal receives user operation, a first resource transfer request is sent to an application server, the first resource transfer request comprises a first quantity, a receiver account, a payer account and a transfer server identifier, the application server sends the first resource transfer request to a corresponding transfer server according to the transfer server identifier, the transfer server sends the resource transfer request to a resource transfer server, and the resource transfer server carries out resource transfer operation according to the first resource transfer request.
In addition, the sending of the first resource transfer request to the transit server by the application server may also be automatically triggered by the system. For example, to ensure the benefits of the merchant and the user, the resource paid by the user may be held by the application instead of being held after the user pays for the resource and before the user gets the service, and then transferred to the account of the merchant at a later time when the user gets the service or at a regular time. At this time, when receiving the operation of confirming to receive the service by the user or when reaching the target time point, the application server may send the first resource transfer request to the relay server, the relay server sends the first resource transfer request to the resource transfer server, and the resource transfer server transfers the resource received by the application server to the account of the merchant based on the first resource transfer request.
402. The relay server receives the first resource transfer request sent by the application server, if the relay server is in a failure state, step 403 is executed, and if the relay server is in a normal state, step 404 is executed.
The server may include two states, one being a normal state and one being a fault state. The normal state refers to that after the server receives the request, the server can respond to the request and execute the operation corresponding to the request. The failure state means that the server cannot execute an operation corresponding to the request after receiving the request.
The failure state may be a maintenance state, a damage state, or the like, and the relay server cannot send the first resource transfer request to the resource transfer server in the failure state, that is, the relay server cannot provide a resource transfer channel for the application server and the resource transfer server in the failure state.
403. The transfer server sends a status code to the application server based on the first resource transfer request, wherein the status code is a target status code indicating the failure of the resource transfer.
When server a receives the request sent by server B, server a may send a status code to server B, which may indicate the status of the processing of the request by server a, e.g., the status code indicates that server a received the request; as another example, the status code indicates that server a received the request, and based on the request, processed completion, and so on.
Wherein, the sending, by the server receiving the request, the status code to the server sending the request may include: the server acquires a state code corresponding to the state of the response request from the stored plurality of state codes and sends the state code to the server sending the request; or the server generates a corresponding state code according to the response condition of the request and sends the state code to the server sending the request.
In a possible implementation manner, a plurality of status codes are stored in the server, the server status indicated by each status code is different, and the server acquires the corresponding status code from the plurality of stored status codes according to the status of the response request and the corresponding relationship between the status of the response request and the status code, and sends the status code to the server sending the request.
Wherein the status code may only comprise a field indicating the status, e.g. the status code has a bit length of 3, i.e. 3 bits indicate a plurality of different status codes, e.g. 200 indicates that the request has succeeded, the requested data will be returned with the status code, 409 indicates that the request has timed out.
The status code may also include a field indicating the status and a field indicating the server. For example, the bit length of the status code is 5, wherein the bit length of the server identifier is 2, that is, 2 bits are used to represent the server identifier, and 3 bits are used to represent the status code.
In another possible implementation manner, a character string is generated according to the state of the response request and a preset generation rule, and the character string is written into the target field to obtain the state code. Optionally, the target field may be a field in a feedback message, where the feedback message is a message sent by the server receiving the request to the server sending the request after receiving the request, the feedback message includes the target field, the content of the target field may be null, and after the server generates the character string, the character string may be written in the target field to obtain the status code.
Optionally, the preset generation rule may be a correspondence between a state of the response request and a number, and the server may obtain the corresponding character string according to the state of the current response request.
Optionally, the server may also add a server identifier to the target field, for example, the bit length of the status code is 5, where the bit length of the server identifier is 2, that is, the former 2 bits represent the server identifier and the later 3 bits represent the character string.
After the forwarding server receives the first resource transfer request, a status code may be sent to the application server, where the status code may be a target status code when the forwarding server is in a failure state, and the target status code may indicate a failure of the resource transfer based on the first resource transfer request.
The target status code may be a first target status code indicating a resource transfer failure; the target status code may also be a second target status code, which may indicate that the resource transfer failed and the status of the target server is a failed status.
When the target status code is the first target status code, the application server may determine that the resource transfer fails according to the first target status code, but the reason for the resource transfer failure cannot be determined, which may be caused by a poor network or a failure state of the relay server.
When the target status code is the second target status code, the application server may determine that the resource transfer fails according to the second target status code, and the reason for the resource transfer failure is that the relay server is in a failure state.
404. The transfer server sends the first resource transfer request to a resource transfer server.
In one possible implementation manner, the transfer server determines a resource transfer server to which a receiver account belongs according to the receiver account in the first resource transfer request, and sends the first resource transfer request to the resource transfer server.
In another possible implementation manner, the transit server determines a resource transfer server to which the payer account belongs according to the payer account in the first resource transfer request, and sends the first resource transfer request to the resource transfer server.
In a possible implementation manner, after the transit server sends the first resource transfer request to the resource transfer server, a first status code may also be sent to the application server, where the first status code indicates that the transit server completes the transit operation of the first resource transfer request.
405. And the resource transfer server receives the first resource transfer request and carries out resource transfer operation based on the first resource transfer request.
The resource transfer server is a server with resource transfer, for example, the resource transfer server may be a bank server, an application server, or the like.
The resource transfer server performing the resource transfer operation based on the first resource transfer request may include: and the resource transfer server transfers the first amount of the resources in the account of the payer to the account of the receiver according to the first amount, the account of the receiver and the account of the payer in the first resource transfer request.
406. And the resource transfer server sends the status code to the transfer server based on the first resource transfer request.
When the resource transfer server completes the resource transfer operation based on the first resource transfer request, the resource transfer server may send a status code to the relay server, where the status code may indicate that the resource transfer is successful.
It should be noted that, in the embodiment of the present application, the resource transfer operation is exemplified based on the first resource transfer request only when the resource transfer server is in the normal state, but in another embodiment, the resource transfer server may also be in the failure state, and when the resource transfer server is in the failure state, the resource transfer server cannot perform the resource transfer operation after receiving the first resource transfer request, but sends a status code to the relay server based on the first resource transfer request, where the status code is the target status code. In addition, when the resource transfer operation fails, the resource server may also send the target status code to the transit server.
407. The transfer server forwards the status code to the application server based on the first resource transfer request.
When receiving the status code sent by the resource transfer server, the relay server may forward the status code to the application server, so that the application server determines whether the resource transfer is successful based on the status code.
408. And the application server receives a state code sent by the transfer server based on the first resource transfer request, and if the state code is a target state code indicating the failure of resource transfer, the state of the transfer server and a target server generating the state code in the resource transfer server is updated to be a fault state.
The application server receives a status code sent by the relay server based on the first resource transfer request, where the status code may be generated by the relay server or generated by the resource transfer server.
The target status code may be a first target status code indicating a resource transfer failure; the target status code may also be a second target status code, which may indicate that the resource transfer failed and the status of the target server is a failed status.
(1) When the target status code is the second target status code, the application server receives the status code sent by the transfer server based on the first resource transfer request, and then the status of the target server generating the status code in the transfer server and the resource transfer server is updated to the fault status by at least one of the following methods:
in one possible implementation, the target status code generated by each server is different, and the target server generating the target status code can be directly determined according to the target status code. In this way, when the application server receives the target status code, the application server can directly determine the target server generating the target status code, and update the status of the target server to be a failure status.
In another possible implementation manner, the target status codes generated by at least one server are the same, and the manner of determining the target server generating the target status code according to the target status code may include: when the application server receives the first state code sent by the transit server, the target server generating the target state code is determined to be the resource transfer server. Since the first status code indicates that the relay server forwards the first resource transfer request to the resource transfer server, it indicates that the relay server completes the relay operation, and the relay server is in a normal state, so that the resource transfer server is in a failure state.
In another possible implementation manner, the target status codes generated by at least one server are the same, and the transit server sends the target status code to the application server only when the transit fails, and the manner of determining the target server generating the target status code according to the target status code may include: when the application server receives the target state codes based on the first resource transfer request, adding 1 to the number of the target state codes corresponding to the transfer server, and adding 1 to the number of the target state codes corresponding to the resource transfer server, and determining the target server generating the target state codes according to the total number of the target state codes corresponding to the transfer server and the total number of the target state codes corresponding to the resource transfer server in unit time.
For example, since the application server may interact with the resource transfer server through at least one relay server, and the application server may also interact with at least one resource transfer server through one relay server, in a unit time, the total number of the target status codes corresponding to the relay server is less than or equal to the total number of the target status codes corresponding to the resource transfer server, which indicates that the relay server can complete resource transfer when communicating with other resource transfer servers, and cannot complete resource transfer when communicating with other relay servers, so that the resource transfer server may be determined to be the target server generating the target status codes. Otherwise, it may be determined that the transit server is the server that generates the target status code.
(2) When the target status code is the first target status code, the application server receives the status code sent by the transfer server based on the first resource transfer request, and then the status of the target server generating the status code in the transfer server and the resource transfer server is updated to the failure status by at least one of the following manners:
the target status code may only indicate that the resource transfer fails, but it cannot be determined that the resource transfer failure is caused by the target server being in a failure state, or possibly being caused by a network failure, or other reasons. Wherein the total number is the total number of the target status codes received after the status of the target server is updated to the normal status for the last time.
If the status code is a target status code indicating a failure of resource transfer and the total number of received target status codes meets a preset condition, updating the status of the target server to a failure status may include any one of the following possible implementation manners:
in one possible implementation manner, if the status code is a target status code indicating a resource transfer failure and the total number of received target status codes is not less than a first threshold, the status of the target server is updated to a failure status.
For example, when the application server receives the target status code, adding 1 to the total number X of the target status codes corresponding to the relay server, adding 1 to the total number Y of the target status codes corresponding to the resource transfer server, and when X is not less than a first threshold, updating the status of the relay server to a fault status; and when the Y is not less than the first threshold value, updating the state of the transit server to be a failure state.
In one possible implementation manner, if the status code is a target status code indicating a failure of resource transfer, and a ratio of the total number of the received target status codes to the total number of other status codes is not less than a second threshold, the status of the target server is updated to a failure status.
For example, when the application server receives the target status code, the total number X of the target status code corresponding to the relay server is added with 1, the total number Y of the target status code corresponding to the resource transfer server is added with 1, the total number M of other status codes corresponding to the relay server is obtained, and the total number N of other status codes corresponding to the resource transfer server is obtained, where the other status codes indicate that the resource transfer is successful. When the ratio of the X to the M is not less than a second threshold value, the transfer server is a server for generating the target state code, and the state of the transfer server is updated to be a fault state; and when the ratio of the Y to the N is not less than the second threshold value, the resource transfer server is a server for generating the target state code, and the state of the resource transfer server is updated to be a fault state.
In one possible implementation manner, if the status code is a target status code indicating a failure of resource transfer, and a ratio of the total number of received target status codes to the total number of received status codes is not less than a third threshold, the status of the target server is updated to a failure status.
For example, as shown in fig. 5, when the application server receives the target status code, the total number X of the target status codes corresponding to the relay server is added with 1, the total number Y of the target status codes corresponding to the resource transfer server is added with 1, the total number Z of the status codes corresponding to the relay server is obtained, and the total number W of the status codes corresponding to the resource transfer server is obtained, where the total number of the status codes corresponding to the server is the sum of the total number of the target status codes corresponding to the server and the total number of other status codes corresponding to the server. When the ratio A of the X to the Z is not less than the third threshold value, the transfer server is a server for generating the target state code, and the state of the transfer server is updated to be a fault state; and when the ratio B of the Y to the W is not less than the third threshold value, the resource transfer server is a server for generating the target state code, and the state of the resource transfer server is updated to be a fault state.
In addition, in order to ensure timeliness, the total number of the received target status codes may be the total number of the received target status codes within a preset time period, and the preset time period may be any time period such as 1 hour, 30 minutes, 10 minutes, and the like.
In a possible implementation manner, after the state of the target server is updated to the fault state, alarm information can be sent, where the alarm information is used to prompt the target server to be in the fault state, where the sending of the alarm information can be at least one of sending an alarm ringtone, lighting an alarm indicator lamp, sending alarm prompt information to a user account, and the like.
409. And the application server caches a second resource transfer request, wherein the second resource transfer request is a resource transfer request waiting for processing by the target server.
The second resource transfer request is a resource transfer request waiting for processing by the target server, for example, when the target server is a transfer server, the second resource transfer request is a request for indicating the target server to send the second resource transfer request to the resource transfer server by the user; and when the target server is the resource transfer server, the second resource transfer request is a request for indicating the target server to perform resource transfer operation.
In addition, when the application server caches the second resource transfer request, the application server may generate time sequence according to the second resource transfer request, so as to process the cached second resource transfer request in sequence in the following.
410. And when the state of the target server is updated to be a normal state, sending the cached second resource transfer request to the target server.
In a possible implementation manner, when the state of the target server is obtained as the normal state, a technician manually updates the state of the target server in the application server to the normal state.
In another possible implementation manner, the application server may automatically detect whether the state of the target server is updated to a normal state, and update the state of the target server to the normal state when the state of the target server is the normal state.
The method for automatically detecting whether the state of the target server is updated to the normal state by the application server may include: and the application server sends a test request to the target server, and if feedback based on the test request of the target server is received, the state of the target server is determined to be updated to be a normal state.
When the application server sends the cached second resource transfer request to the target server, the cached second resource transfer request may be sent to the target server in sequence according to the ranking order of the plurality of second resource requests.
According to the state updating method provided by the embodiment of the application, whether the transfer server and the resource transfer server are in the fault state or not is determined through the state code returned by the transfer server based on the first resource transfer request, and the state of the target server in the fault state is updated to be in the fault state, so that the automatic monitoring and configuration of the server state are realized, and the labor cost is reduced.
In the related art, when the transit server needs maintenance, a maintenance person may send a maintenance notification mail in advance to notify a technician of the expected maintenance time, and after receiving the notification mail, the corresponding technician may update the recorded state of the transit server according to the expected maintenance time. For example, the notification mail indicates that the transit server is to be maintained between 10:00 and 12:00, but the time for actually maintaining the transit server may be 10:30 to 11: 30.
Therefore, the related art has a problem that the maintenance time cannot be accurately provided, and the actual maintenance time may be different from the expected maintenance time. If the actual maintenance start time is earlier than the predicted maintenance time, the problem of failure of resource transfer is caused, and if the actual maintenance start time is later than the predicted maintenance time, the problem of waste of available resources is caused.
The state updating method provided by the embodiment of the application can automatically monitor the state of the server without depending on the maintenance notice of maintenance personnel, and the automatically monitored state of the server is consistent with the actual state of the server, so that the transfer server and the resource transfer server can be effectively utilized to perform resource transfer operation, and the problem that available resources are wasted is avoided as much as possible.
In addition, the resource transfer server and the application server do not interact directly, so that when the resource transfer server needs to be maintained, the maintenance personnel do not send notification messages to the technical personnel of the application server. The state updating method provided by the embodiment of the application can determine the state of the resource transfer server, and avoids the problem that the application server misjudges that the transfer server is in the fault state due to the fact that the resource transfer server is in the fault state.
Fig. 6 is a schematic structural diagram of a state updating apparatus according to an embodiment of the present application. Referring to fig. 6, the apparatus includes:
a sending module 601, configured to send a first resource transfer request to a relay server, where the relay server is configured to send the first resource transfer request to a resource transfer server, and the resource transfer server performs a resource transfer operation based on the first resource transfer request;
a receiving module 602, configured to receive a status code sent by the transit server based on the first resource transfer request;
an updating module 603, configured to update the statuses of the transit server and a target server that generates the status code in the resource transfer server to a failure status if the status code is a target status code indicating that the resource transfer fails.
In one possible implementation, the target server is configured to:
acquiring a state code corresponding to a state responding to the first resource transfer request from the stored plurality of state codes; or,
and generating a character string according to the state responding to the first resource transfer request and a preset generation rule, and writing the character string into a target field to obtain a state code.
In a possible implementation manner, the updating module 603 is configured to update the status of the target server to be a failure status if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes meets a preset condition.
In one possible implementation, the update module 603 includes:
an updating unit 6031, configured to update the status of the target server to be a failure status if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes is not less than a first threshold; or if the status code is a target status code indicating a failure of resource transfer, and the ratio of the total number of the received target status codes to the total number of other status codes is not less than a second threshold, updating the status of the target server to a failure status.
In one possible implementation, the update module includes:
a counting unit 6032, configured to add 1 to the total number of the received target status codes to obtain the total number if the status code is a target status code indicating a failure of resource transfer;
an updating unit 6031, configured to update the status of the target server to be a failure status if the total number satisfies the preset condition.
In one possible implementation manner, the total number of the received target status codes is the total number of the received target status codes within a preset time period.
In one possible implementation, the target status code is a first target status code indicating a resource transfer failure; or, the target status code is a second target status code, the second target status code indicates that the resource transfer fails, and the status of the target server is a failure status.
In one possible implementation, the apparatus further includes:
a caching module 604, configured to cache a second resource transfer request, where the second resource transfer request is a resource transfer request to be processed by the target server;
the sending module 601 is configured to send the cached second resource transfer request to the target server when the status of the target server is updated to the normal status.
In one possible implementation, the apparatus further includes:
and an alarm module 605, configured to send alarm information, where the alarm information is used to prompt the target server to be in a fault state.
It should be noted that: in the state updating apparatus provided in the foregoing embodiment, only the division of the functional modules is illustrated when the state is updated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for updating a state and the method for updating a state provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
Fig. 8 shows a block diagram of a terminal 800 according to an exemplary embodiment of the present application. The terminal 800 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer iv, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 800 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 800 includes: a processor 801 and a memory 802.
The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 801 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 802 is used to store at least one instruction for execution by processor 801 to implement the state update methods provided by method embodiments herein.
In some embodiments, the terminal 800 may further include: a peripheral interface 803 and at least one peripheral. The processor 801, memory 802 and peripheral interface 803 may be connected by bus or signal lines. Various peripheral devices may be connected to peripheral interface 803 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a touch screen display 805, a camera 806, an audio circuit 807, a positioning component 808, and a power supply 809.
The peripheral interface 803 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral interface 803 may be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 804 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 804 converts an electrical signal into an electromagnetic signal to be transmitted, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 804 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 804 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 805 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 805 is a touch display, the display 805 also has the ability to capture touch signals on or above the surface of the display 805. The touch signal may be input to the processor 801 as a control signal for processing. At this point, the display 805 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 805 may be one, providing the front panel of the terminal 800; in other embodiments, the display 805 may be at least two, respectively disposed on different surfaces of the terminal 800 or in a folded design; in still other embodiments, the display 805 may be a flexible display disposed on a curved surface or a folded surface of the terminal 800. Even further, the display 805 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 805 can be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 806 is used to capture images or video. Optionally, camera assembly 806 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 801 for processing or inputting the electric signals to the radio frequency circuit 804 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 800. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 807 may also include a headphone jack.
The positioning component 808 is used to locate the current geographic position of the terminal 800 for navigation or LBS (location based Service). The positioning component 808 may be a positioning component based on the GPS (global positioning System) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
Power supply 809 is used to provide power to various components in terminal 800. The power supply 809 can be ac, dc, disposable or rechargeable. When the power source 809 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: acceleration sensor 811, gyro sensor 812, pressure sensor 813, fingerprint sensor 814, optical sensor 815 and proximity sensor 816.
The acceleration sensor 811 may detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 800. For example, the acceleration sensor 811 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 801 may control the touch screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 812 may detect a body direction and a rotation angle of the terminal 800, and the gyro sensor 812 may cooperate with the acceleration sensor 811 to acquire a 3D motion of the user with respect to the terminal 800. From the data collected by the gyro sensor 812, the processor 801 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 813 may be disposed on the side bezel of terminal 800 and/or underneath touch display 805. When the pressure sensor 813 is disposed on the side frame of the terminal 800, the holding signal of the user to the terminal 800 can be detected, and the processor 801 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed at a lower layer of the touch display screen 805, the processor 801 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 805. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 814 is used for collecting a fingerprint of the user, and the processor 801 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations including unlocking a screen, viewing encrypted information, downloading software, paying for and changing settings, etc. Fingerprint sensor 814 may be disposed on the front, back, or side of terminal 800. When a physical button or a vendor Logo is provided on the terminal 800, the fingerprint sensor 814 may be integrated with the physical button or the vendor Logo.
The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 may control the display brightness of the touch screen 805 based on the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 805 is increased; when the ambient light intensity is low, the display brightness of the touch display 805 is turned down. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 based on the ambient light intensity collected by the optical sensor 815.
A proximity sensor 816, also known as a distance sensor, is typically provided on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front surface of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front surface of the terminal 800 gradually decreases, the processor 801 controls the touch display 805 to switch from the bright screen state to the dark screen state; when the proximity sensor 816 detects that the distance between the user and the front surface of the terminal 800 becomes gradually larger, the processor 801 controls the touch display 805 to switch from the screen-on state to the screen-on state.
Those skilled in the art will appreciate that the configuration shown in fig. 8 is not intended to be limiting of terminal 800 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
Fig. 9 is a schematic structural diagram of a server provided in this embodiment, where the server 900 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 901 and one or more memories 902, where the memory 1002 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 901 to implement the methods provided by the foregoing method embodiments. Certainly, the computer device may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input and output, and the computer device may further include other components for implementing the functions of the device, which is not described herein again.
In an exemplary embodiment, a computer device is provided that includes one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform operations performed to implement a state update method as any one of the possible implementations described above.
In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction is stored, and the at least one instruction is loaded by a processor and executed to implement the operations performed by the state updating method according to any one of the above possible implementations. For example a memory comprising instructions executable by a processor in the terminal to perform the state updating method in the above embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program comprising at least one instruction loaded and executed by a processor to implement the state updating method as in the above embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method for status update, the method further comprising:
sending a first resource transfer request to a transfer server, wherein the transfer server is used for sending the first resource transfer request to a resource transfer server, and the resource transfer server carries out resource transfer operation based on the first resource transfer request;
receiving a status code sent by the transit server based on the first resource transfer request;
and if the status code is a target status code indicating the failure of resource transfer, updating the statuses of the transfer server and a target server generating the status code in the resource transfer server to be a fault status.
2. The method of claim 1, wherein the target server is configured to:
acquiring the state code corresponding to the state responding to the first resource transfer request from the stored plurality of state codes; or,
and generating a character string according to the state responding to the first resource transfer request and a preset generation rule, and writing the character string into a target field to obtain the state code.
3. The method of claim 1, wherein if the status code is a target status code indicating a failure of resource transfer, updating the statuses of the transit server and a target server of the resource transfer server that generates the status code to a failure status comprises:
and if the state code is a target state code indicating resource transfer failure and the total number of the received target state codes meets a preset condition, updating the state of the target server to be a fault state.
4. The method of claim 3, wherein if the status code is a target status code indicating a failure of resource transfer and a total number of the received target status codes meets a preset condition, updating a status of a target server of the transit server and the resource transfer server that generates the status code to a failure status comprises:
if the state code is a target state code indicating resource transfer failure and the total number of the received target state codes is not less than a first threshold value, updating the state of the target server to be a fault state; or,
if the state code is a target state code indicating resource transfer failure, and the ratio of the total number of the received target state codes to the total number of the received other state codes is not less than a second threshold value, updating the state of the target server to be a fault state; or,
and if the state code is a target state code indicating the failure of resource transfer, and the ratio of the total number of the received target state codes to the total number of the received state codes is not less than a third threshold value, updating the state of the target server to be a fault state.
5. The method of claim 3, wherein if the status code is a target status code indicating a failure of resource transfer and the total number of the received target status codes satisfies a predetermined condition, updating the status of the target server to a failure status comprises:
if the state code is a target state code indicating resource transfer failure, adding 1 to the total number of the received target state codes to obtain the total number;
and if the total number meets the preset condition, updating the state of the target server to be a fault state.
6. The method of claim 5, wherein the total number of the target status codes received is a total number of the target status codes received within a preset time period.
7. The method of claim 1, wherein the target status code is a first target status code, the first target status code indicating a resource transfer failure; or, the target status code is a second target status code, the second target status code indicates that the resource transfer fails, and the status of the target server is a failure status.
8. The method of claim 1, wherein after updating the statuses of the transit server and a target server of the resource transfer server that generates the status code to a failure status if the status code is a target status code indicating a failure of resource transfer, the method further comprises:
caching a second resource transfer request, wherein the second resource transfer request is a resource transfer request waiting for processing by the target server;
and when the state of the target server is updated to be a normal state, sending a cached second resource transfer request to the target server.
9. The method of claim 1, wherein after updating the statuses of the transit server and a target server of the resource transfer server that generates the status code to a failure status if the status code is a target status code indicating a failure of resource transfer, the method further comprises:
and sending alarm information, wherein the alarm information is used for prompting that the target server is in a fault state.
10. A status updating apparatus, characterized in that the apparatus comprises:
a sending module, configured to send a first resource transfer request to a transfer server, where the transfer server is configured to send the first resource transfer request to a resource transfer server, and the resource transfer server performs a resource transfer operation based on the first resource transfer request;
a receiving module, configured to receive a status code sent by the transit server based on the first resource transfer request;
and the updating module is used for updating the states of the relay server and the target server which generates the state code in the resource transfer server to be a fault state if the state code is a target state code indicating the failure of resource transfer.
11. A computer device comprising one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform operations performed by the state updating method of any of claims 1 to 9.
12. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform operations performed by a state updating method according to any one of claims 1 to 9.
CN201911400177.XA 2019-12-30 2019-12-30 State updating method and device, computer equipment and storage medium Withdrawn CN111131490A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911400177.XA CN111131490A (en) 2019-12-30 2019-12-30 State updating method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911400177.XA CN111131490A (en) 2019-12-30 2019-12-30 State updating method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111131490A true CN111131490A (en) 2020-05-08

Family

ID=70505602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911400177.XA Withdrawn CN111131490A (en) 2019-12-30 2019-12-30 State updating method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111131490A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265343A (en) * 2021-11-19 2022-04-01 青岛海尔科技有限公司 Target equipment processing method, device, equipment, storage medium and product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202709A (en) * 2006-12-11 2008-06-18 村田机械株式会社 Relay server and relay communication system
US20160179607A1 (en) * 2014-12-19 2016-06-23 Verizon Patent And Licensing Inc. Failure management for electronic transactions
CN106656839A (en) * 2016-10-20 2017-05-10 财付通支付科技有限公司 Resource transfer method and apparatus
CN108470298A (en) * 2017-02-23 2018-08-31 腾讯科技(深圳)有限公司 The methods, devices and systems of resource numerical value transfer
CN108876497A (en) * 2017-05-11 2018-11-23 腾讯科技(深圳)有限公司 Resource transfers method, apparatus and third-party server
CN110570282A (en) * 2019-09-10 2019-12-13 腾讯科技(深圳)有限公司 cross-region resource transfer method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202709A (en) * 2006-12-11 2008-06-18 村田机械株式会社 Relay server and relay communication system
US20160179607A1 (en) * 2014-12-19 2016-06-23 Verizon Patent And Licensing Inc. Failure management for electronic transactions
CN106656839A (en) * 2016-10-20 2017-05-10 财付通支付科技有限公司 Resource transfer method and apparatus
CN108470298A (en) * 2017-02-23 2018-08-31 腾讯科技(深圳)有限公司 The methods, devices and systems of resource numerical value transfer
CN108876497A (en) * 2017-05-11 2018-11-23 腾讯科技(深圳)有限公司 Resource transfers method, apparatus and third-party server
CN110570282A (en) * 2019-09-10 2019-12-13 腾讯科技(深圳)有限公司 cross-region resource transfer method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265343A (en) * 2021-11-19 2022-04-01 青岛海尔科技有限公司 Target equipment processing method, device, equipment, storage medium and product
CN114265343B (en) * 2021-11-19 2023-09-15 青岛海尔科技有限公司 Target equipment processing method, device, equipment, storage medium and product

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110278464B (en) Method and device for displaying list
CN113098755B (en) Group chat creating method, device, terminal and storage medium
CN107682255B (en) Message transmission method, device and storage medium
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN113204298A (en) Method and device for displaying release progress, electronic equipment and storage medium
CN111061550A (en) Task processing method, device, equipment and storage medium
CN110942308A (en) Resource transfer method, device, computer equipment and storage medium
CN111311155A (en) Method, apparatus, system, device and storage medium for modifying distribution position
CN111159604A (en) Picture resource loading method and device
CN108111397B (en) Method and device for processing forwarding notification message
CN110290191B (en) Resource transfer result processing method, device, server, terminal and storage medium
CN109600301B (en) Message processing method and device
CN111131392A (en) Method, device, electronic equipment and medium for processing message
CN112738475B (en) Video playing method and device and electronic equipment
CN110912830A (en) Method and device for transmitting data
CN111064657B (en) Method, device and system for grouping concerned accounts
CN110399246B (en) Program repair method and device
CN111881423A (en) Method, device and system for limiting function use authorization
CN111258683A (en) Detection method, detection device, computer equipment and storage medium
CN109107163B (en) Analog key detection method and device, computer equipment and storage medium
CN107800720B (en) Hijacking reporting method, device, storage medium and equipment
CN111131490A (en) State updating method and device, computer equipment and storage medium
CN110781032A (en) Data transmission method, device, electronic equipment and medium
CN115827299A (en) Interface abnormity compensation method, device, equipment and storage medium

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200508

WW01 Invention patent application withdrawn after publication