CN113553201A - Service request processing method and device, storage medium and electronic equipment - Google Patents

Service request processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113553201A
CN113553201A CN202110850617.2A CN202110850617A CN113553201A CN 113553201 A CN113553201 A CN 113553201A CN 202110850617 A CN202110850617 A CN 202110850617A CN 113553201 A CN113553201 A CN 113553201A
Authority
CN
China
Prior art keywords
channel
state
request
service request
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110850617.2A
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202110850617.2A priority Critical patent/CN113553201A/en
Publication of CN113553201A publication Critical patent/CN113553201A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure provides a service request processing method, a service request processing device, a storage medium and an electronic device, wherein the method comprises the following steps: updating the channel state of the channel; responding to a current service request of a request terminal, and determining the current channel state of a channel requested by the current service request; when the current channel state is the unavailable state, storing the current service request in a database; processing the service request stored in the database based on the channel state of the channel; and returning a first processing result to the request end, wherein the first processing result is used for representing the processing state of the current service request. According to the method and the device, the channel state of the channel is updated regularly, the availability of the channel is determined, the service request is stored when the channel based on the current service request is in the unavailable state, the condition that the request fails or is repeatedly requested is avoided, the overall load condition of the system is reduced, and the overall performance of the system is improved.

Description

Service request processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a service request, a storage medium, and an electronic device.
Background
In the existing network application, a user may send a service request to a corresponding server through various application programs to acquire or implement a corresponding function. However, in the communication process, a certain request channel may be delayed or in a failure state due to a network reason or a link reason, and for a service request that needs to be transmitted through the channel, a situation of repeated request or request channel switching may occur due to channel failure, and in this case, the system load is easily increased, which affects the overall performance of the system.
Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a method for processing a service request, a storage medium, and an electronic device, so as to solve the problem of system load increase caused by a service channel abnormality in the prior art.
The embodiment of the disclosure adopts the following technical scheme: a method for processing service requests comprises the following steps: updating a channel state of a channel, wherein the channel state at least comprises an unavailable state or an available state; responding to a current service request of a request terminal, and determining the current channel state of a channel requested by the current service request; when the current channel state is an unavailable state, storing the current service request in a database; processing the service request stored in the database based on the channel state of the channel; and returning a first processing result to the request end, wherein the first processing result is used for representing the processing state of the current service request.
In an embodiment, the processing the service request stored in the database based on the channel state of the channel includes: when the current channel state is an unavailable state, marking the current service request stored in a database, wherein the marking is used for ensuring that the current service request is a service request which is not sent; the returning of the first processing result to the request end includes: and feeding back a first processing result which is used for representing the processing state of the current service request as the processing to the request terminal.
In an embodiment, after the updating the channel state of the channel, the processing the service request stored in the database based on the channel state of the channel includes: detecting whether a first channel with the current channel state changed from the unavailable state to the available state exists in all the channels or not; under the condition that the first channel exists, sending the unsent service request of which the request channel is the first channel in all unsent service requests stored in the database through the first channel; and recording unsent service requests of which the request channel is the first channel and stored in the database as sent service requests.
In an embodiment, the returning the first processing result to the request end includes: after the service request with the request channel as the first channel is successfully processed, a first processing result for representing the successful processing of the service request is returned to the request end; or after the service request processing of which the request channel is the first channel fails, returning a first processing result for representing the service request processing failure to the request end.
In an embodiment, after the updating the channel state of the channel, the method further includes: detecting whether a second channel with unavailable channel state updating results within continuous preset times or preset duration exists in all the channels; under the condition that the second channel exists, recording unsent service requests of which the request channel is the second channel in all unsent service requests stored in the database as service stop requests; and returning a first processing result used for representing the processing failure of the service request to the request end.
In an embodiment, the updating the channel state of the channel includes: sending a test request through each channel according to a first preset time interval; updating the channel state of the channel which does not receive the feedback of the test request into an unavailable state; updating the channel state of the channel receiving the feedback of the test request to an available state.
In an embodiment, the updating the channel state of the channel includes: sending a simulation service request through each channel according to a first preset time interval and determining the response time of the simulation service request; updating the channel state of the channel of which the response time does not exceed a preset threshold value to be an available state; and updating the channel state of the channel with the response time exceeding a preset threshold value into an unavailable state.
In an embodiment, the updating the channel state of the channel includes: acquiring service data of each channel in first preset time according to a first preset time interval; determining the channel status for each channel based on the service data for each channel.
In an embodiment, after determining, in response to a current service request of a requesting end, a current channel state of a channel on which the current service request is based, the method further includes: and when the current channel state is an available state, sending the current service request through a channel based on which the current service request is based.
An embodiment of the present disclosure further provides a device for processing a service request, including: the updating module is used for updating the channel state of the channel, wherein the channel state at least comprises an unavailable state or an available state; the determining module is used for responding to a current service request of a request terminal and determining the current channel state of a channel requested by the current service request; the storage module is used for storing the current service request in a database when the current channel state is an unavailable state; the processing module is used for processing the service request stored in the database based on the channel state of the channel; and the feedback module is used for returning a first processing result to the request end, and the first processing result is used for representing the processing state of the current service request.
Embodiments of the present disclosure also provide a storage medium having a computer program stored thereon, which, when being executed by a processor, performs the steps of the above-mentioned service request processing method.
Embodiments of the present disclosure also provide an electronic device, which at least includes a memory and a processor, where the memory stores a computer program thereon, and the processor implements the steps of the method for processing a service request when executing the computer program on the memory.
The beneficial effects of this disclosed embodiment lie in: the channel state of the channel is updated regularly, the availability of the channel is determined, the service request is stored when the channel based on the current service request is in the unavailable state, the condition that the request fails or the request is repeated is avoided, the integral load condition of the system is reduced, and the integral performance of the system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of a payment system architecture in the prior art when a user needs to pay during use of an application;
fig. 2 is a flowchart of a method for processing a service request according to a first embodiment of the disclosure;
fig. 3 is another flowchart of a processing method of a service request in the first embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a device for processing a service request according to a second embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device in a fourth embodiment of the present disclosure;
fig. 6 is a flowchart of the overall design of the payment system architecture in the fourth embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating a flow of availability detection between a channel docking module and a service channel according to a fourth embodiment of the present disclosure;
fig. 8 is a schematic flow chart illustrating a task of making a supplementary order by the channel docking module after the service channel is available according to the fourth embodiment of the disclosure.
Detailed Description
Various aspects and features of the disclosure are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Other modifications will occur to those skilled in the art within the scope and spirit of the disclosure.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above, and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the present disclosure will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present disclosure has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of the disclosure, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the disclosure that may be embodied in various forms. Well-known and/or repeated functions and structures have not been described in detail so as not to obscure the present disclosure with unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the disclosure.
In the existing network application, a user may send a service request to a corresponding server through various application programs to acquire or implement a corresponding function. However, in the communication process, a certain request channel may be delayed or in a failure state due to a network reason or a link reason, and for a service request that needs to be transmitted through the channel, a channel failure may cause a situation of a repeated request or a request switching manner, and in this case, a system load is easily increased, which affects the overall performance of the system. This is described in detail below with reference to the practical embodiment of fig. 1.
Fig. 1 is a schematic diagram illustrating a payment system architecture in the prior art when a user needs to pay in the process of using an application program, the user selects a certain payment method (an a bank card, a B bank card, credit payment, etc.) through a cash register provided by the payment system and submits a payment request, and the payment system finally sends the payment request of the user to a corresponding payment channel through a channel docking module in the system. Because an external service provider (payment channel) is involved, the stability of the service of the payment system cannot be guaranteed, so that for the payment system, when the payment system determines that a certain payment channel has a problem, the user cannot realize payment operation, but in some cases, the payment channel is only temporarily unavailable, repeated payment operation or operation of switching payment modes, which is realized by the user at the moment, affects the payment efficiency, causes the system load to be improved, and affects the overall performance of the payment system.
In order to solve the problems in the prior art, a first embodiment of the present disclosure provides a method for processing a server request, which can be applied to any service request system or network, and the flowchart is shown in fig. 2, and mainly includes steps S1 to S5:
and S1, updating the channel state of the channel.
There may be multiple service channels from the request end used by the user to the service end providing the service, or when there are multiple service ends, the request end realizes the intercommunication with multiple service ends through different service channels. In this embodiment, the channel states of the channels are detected and updated, and actually, the channel state of each channel may be detected according to a preset first time interval. The channel state indicates whether each channel is currently available, specifically including an available state and an unavailable state, where the channel state may be represented by a flag bit, for example, 0 indicates that the channel is in the available state, and 1 indicates that the channel is in the unavailable state, where the available state refers to a state where a service request sent through the current channel can correctly reach a corresponding server and timely receives feedback, and the unavailable state is a state where the service request cannot reach the server or cannot receive feedback from the server.
Specifically, the present embodiment determines and updates the channel state of the channel by the following several ways: (1) determined by the test request; the request end can send a test request to the server through each channel according to a first preset time interval, and the test request can be a heartbeat packet; if a request end receives a feedback result of the server and determines that the feedback result is correct feedback content corresponding to the test request aiming at a certain channel, the corresponding channel can be determined to be available and the channel state of the channel can be correspondingly updated; if the feedback result is not received within a certain time, or the received feedback content does not correspond to the test request, determining that the corresponding channel is unavailable, and updating the channel state which does not receive the feedback of the test request to be the unavailable state. (2) Determining through a simulation service request; the request terminal may send a simulation service request to the server through each channel according to a first predetermined time interval, where the simulation service request may have the same format or requirement as the service request, and determine a channel state of the channel based on a response time of the server to the simulation service request, where the response time may be a time of acknowledgement information sent by the server to the request terminal when the server receives the simulation service request, or a time of the server performing a corresponding operation based on the simulation service request and then feeding back corresponding content; under the condition that the response time of a certain channel does not exceed a preset threshold value, determining and updating the channel state of the channel to be an available state; and if the response time of the channel exceeds a preset threshold, determining and updating the channel state of the channel to be an unavailable state, wherein the preset threshold can be set according to the actual situation. (3) Determining service data through the channel; the service data may be a service success rate of each channel in the first predetermined time, an average response time of all service requests sent through a certain channel in the first predetermined time, or may represent other data indicators whether the channel is available, a corresponding qualification condition may be set according to different service data contents, when the service data meets the qualification condition, the channel is proved to be available and the channel state is updated to be an available state, otherwise, the channel is determined to be unavailable.
It should be noted that in this embodiment, the channel state of each channel is changed in real time, and in the current detection period, the channel state of a certain channel is unavailable, and then the channel state of the channel can be switched to be available in the next detection period, and vice versa; the first predetermined time interval may be set according to the number of actual channels, the number of requests that may be actually issued, or other limitations between the server and the request end, and in this embodiment, the first time interval may be preferably set to one minute, that is, the channel status of the channel is detected and updated every one minute.
In addition, the above-mentioned manner of detecting the channel state may be used singly or in combination, or different detection manners may be used in different situations according to different requirements, and the embodiment is not limited herein.
S2, in response to the current service request of the requesting end, determining a current channel state of a channel requested by the current service request.
The request end initiates a service request based on user operation or requirement, the service request is generated based on the service which the user wishes to obtain, and the service request is transmitted through a channel between the request end and the corresponding server under normal conditions. When a current service request generated by a request end is transmitted through a channel requested by the current service request, the current channel state of the channel requested by the current service request is firstly determined, and whether to send the current service request is determined based on the current channel state.
And S3, storing the current service request in the database when the current channel state is the unavailable state.
When the channel state of the channel requested by the current service request is an unavailable state, it indicates that the channel may have a communication fault, or the corresponding server cannot provide a service correctly, and at this time, even if the current service request is sent out, there is a high probability that correct feedback cannot be obtained, so as to avoid directly feeding back negative results such as a service request sending failure or a service failure and the like to a user at a request end, and at the same time, avoid a frequent request problem caused by a sending failure. In addition, the database may be a database corresponding to the designated channel, and is mainly used for storing all service requests passing through the designated channel and corresponding feedback contents thereof, or the database is a channel used by all channels in a unified manner, and when a service request to be suspended is stored, the service request is associated with a channel ID or a channel mark of the corresponding designated channel, so as to be distinguished in the following process.
In addition, when the channel requested by the current service request is in an available state, it indicates that the communication condition of the channel is good in the last time interval, and the server can also provide the corresponding service normally, and at this time, the current service request is directly sent to the corresponding server through the channel.
S4, the service request stored in the database is processed based on the channel status of the channel.
For the service request of which the used channel is in an unavailable state, after the service request is stored in a database, representing the current service request as an unsent service request in a marked form; specifically, the implementation form of the above-mentioned flag may be represented by a separate database field, or the flag may be implemented by modifying the name and the specific content of the attribute of the service request, or a separate list may be partitioned in the database for storing the unsent service request.
In practical implementation, the channel status of the channel is continuously updated and changed, and the channel in the unavailable status in the previous cycle may also become available in the next cycle, and vice versa, so that for the unsent service request stored in the database, corresponding processing can be performed according to the update result of the channel status of each channel.
In some embodiments, detecting and updating the channel state of the channel, and after updating, determining whether a first channel with the current channel state changed from an unavailable state to an available state exists in all the channels after the current updating; and if the first channel exists, responding to the channel state change of the first channel, and sending all unsent service requests stored in the database, wherein the request channel is the unsent service request of the first channel through the first channel, so that the suspended service requests are sent under the condition that the channels are available, the processing success rate of the service requests is ensured, and the request times of the service requests are reduced. After sending the corresponding unsent service request, the tag corresponding to the service request may be modified to record the service request as a sent service request. It should be understood that the first channel may be any one or more of all channels, which actually characterizes a type of channel whose channel state changes from the unavailable state to the available state after the current channel state is updated, and the embodiment does not limit which particular channel is specifically the first channel.
In some embodiments, after the channel state detection update, it may further detect whether there is a second channel in all channels whose update results of the channel state updates within a predetermined number of consecutive times or a predetermined time are all in an unavailable state; if the second channel exists, that is, the channel state of the second channel is always in an unavailable state in the detection updates of a plurality of times continuously, or is always in an unavailable state in the given detection update in a preset time period, at this time, the unsent service request of the second channel, which is the request channel in all unsent service requests stored in the database, is recorded as a service stop request, and is not processed any more, and simultaneously, the corresponding request end is timely informed of the service request processing failure, and the request end can be prompted to suspend the request or to carry out the request through other channels. Specifically, the service request which is stopped from being processed can be directly deleted from the database so as to save the space of the database and prevent the storage pressure of the database caused by the continuous increase of the service request which is stopped from being processed. It should be noted that the second channel in this embodiment may be any one or more of all channels, and it actually represents a type of channel that is always in an unavailable state after multiple channel state updates, and this embodiment does not limit which specific channel is specifically the second channel; in addition, the predetermined number of times and the predetermined time length may be adjusted according to contents such as an update interval of the channel status, a channel load condition, and a system overall load condition, which is not particularly limited in this embodiment.
And S5, returning the first processing result to the request end.
The first processing result is used to characterize the processing status of the current service request, for example, the current service request is being processed, or the processing is successful, the processing is failed, and the like. When the current service request is suspended and stored in the database and is not sent, actually, the channel may be abnormal or the opposite side server cannot provide service, and at this time, a processing state for representing the current service request is returned to the request end as a first processing result in the processing. In actual implementation, the first processing result can be updated according to the updating condition of the channel state, the sending condition of the service request and the feedback condition of the service request, so that the request end can receive timely and accurate feedback content, and a good reminding effect is achieved.
In some embodiments, if there is a first channel whose current channel state is changed from an unavailable state to an available state, a non-transmitted service request whose request channel is the first channel is correspondingly transmitted through the first channel, and at this time, different first processing results may be returned to the request end according to a processing result of the transmitted service request.
Specifically, if the service request of which the request channel is the first channel is successfully processed, that is, the content fed back by the server based on the service request is received through the first channel, a first processing result used for representing that the service request is successfully processed is returned to the request end; and if the service request processing of the request channel which is the first channel fails, that is, the request content fed back by the server is not received or the received request content does not serve the request content corresponding to the request, returning a first processing result for representing the service request processing failure to the request end. When the first processing result of the processing failure is actually returned to the request end, the failure reason can also be returned to the request end and the request end is prompted to make a request again or initiate a request through other channels.
In some embodiments, in the presence of the second channel, the corresponding unsent service request, which is stored in the database and for which the request channel is the second channel, may be terminated, at this time, a first processing result used for representing that the service request processing fails may be returned to the request end, and a failure reason may be returned to the request end and the request end may be prompted to make a request again or initiate a request through another channel.
In the embodiment, the channel state of the channel is periodically updated, the availability of the channel is determined, and the service request is stored when the channel requested by the current service request is in the unavailable state, so that the condition that the request fails or is repeatedly requested is avoided, the overall load condition of the system is reduced, and the overall performance of the system is improved.
It should be understood that, in the actual implementation process, the step S1 is actually continuously implemented in the communication process between the request end and the server, there is no defined sequence between the actual and subsequent steps S2 to S5, and the channel status determined at each first predetermined time interval is used as a basis for confirming the channel status when a new service request arrives in the next period.
Further, after the channel state of the channel is updated according to a certain time interval, if the channel state of one channel is available, especially when the channel state determined by the last detection period of the channel is unavailable, the unsent service request corresponding to the channel in the database can be sent through the channel, so that the situation that the normal use of the user is influenced due to the fact that the suspended service request is not processed for a long time is avoided.
In some embodiments, in response to a current service request based on a specified channel, upon determining that a current channel state is an unavailable state, the steps of another implementation of the processing method shown in fig. 3 may also be performed: s6, detecting the current channel status of the channel according to a second predetermined time interval within a predetermined time, for example, during a peak time period when the service request is bundled, the second predetermined time interval may be set to be smaller than the first predetermined time interval to shorten an update interval of the channel status, and when the channel is changed from unavailable to available, the waiting time of the service request may be further shortened, for example, the first predetermined time interval is one minute, and the second predetermined time interval is five seconds; s7, when a predetermined condition is satisfied, switching the current channel state from an unavailable state to an available state, where the channel state detection may be performed by a test request or a simulated service request, and the predetermined condition is that a feedback of the test request is received or a response time does not exceed a threshold, and when the condition is satisfied, indicating that the current channel is available, switching the current channel state to the available state; s8, after the current channel status is switched to the available status, sending a corresponding service request based on the channel switched to the available status, where the service request may be an unsent service request corresponding to the specified channel previously stored in the database and a current service request newly produced after the channel is available.
In some embodiments, it may also happen that, for example, the first predetermined time interval is one minute, and assuming that the channel status between 9 th and 10 th minutes is determined to be available at 10 th minute, the channel status of the current channel is available for all new service requests within 10 th to 11 th minutes, assuming that the network fails at 10 th to 30 th seconds and the service request cannot reach the server, the service request before 10 th to 30 th seconds may be normally sent, the network request after 10 th to 30 th seconds may have been sent, but the request does not reach the server, for these requests, the embodiment may store it in the database and return the first processing result to the user, and when the channel status is updated at 11 th minute, the service request that failed to send may also be used as statistical data to calculate the service data together, and ultimately has an effect on the 11 th minute update results.
The second embodiment of the present disclosure provides a service request processing apparatus, which can be installed in a processing system of any kind of service request, and used as a relay device or a relay device between a request end or a request end and a service end. The schematic structural diagram of the present invention is shown in fig. 4, and mainly includes an updating module 10, a determining module 20, a storing module 30, a processing module 40, and a feedback module 50, where the updating module 10 is configured to update a channel state of a channel, and the channel state at least includes an unavailable state or an available state; the determining module 20 is configured to determine, in response to a current service request of a requesting end, a current channel state of a channel requested by the current service request; the storage module 30 is configured to store the current service request in the database when the current channel state is the unavailable state; the processing module 40 is configured to process the service request stored in the database based on the channel state of the channel; the feedback module 50 is configured to return a first processing result to the request end, where the first processing result is used to represent a processing state of the current service request.
In some embodiments, the processing module 40 is specifically configured to, when the current channel state is the unavailable state, mark the current service request stored in the database, where the mark is used to ensure that the current service request is an unsent service request; the feedback module 50 is specifically configured to feed back, to the request end, a first processing result in the processing state used for representing the current service request.
In some embodiments, the processing module 40 is further configured to detect whether there is a first channel in all channels, where the current channel status changes from the unavailable status to the available status; under the condition that a first channel exists, sending unsent service requests with request channels as the first channel in all unsent service requests stored in a database through the first channel; and recording unsent service requests of which the request channel is the first channel stored in the database as sent service requests.
Further, the feedback module 50 is further configured to, after the service request processing of the request channel being the first channel is successful, return a first processing result used for representing that the service request processing is successful to the request end; or after the service request processing of which the request channel is the first channel fails, returning a first processing result for representing the service request processing failure to the request end.
In some embodiments, the processing module 40 is further configured to detect whether there is a second channel in which the update results of the channel state updates within a predetermined number of consecutive times or a predetermined time period are all in an unavailable state; under the condition that a second channel exists, recording unsent service requests of which the request channel is the second channel in all unsent service requests stored in the database as service stop requests; the feedback module 50 is further configured to return a first processing result for characterizing the processing failure of the service request to the request end.
In some embodiments, the updating module 10 is specifically configured to send the test request through each channel according to a first predetermined time interval; updating the channel state of the channel which does not receive the feedback of the test request into an unavailable state; and updating the channel state of the channel receiving the feedback of the test request into an available state.
In some embodiments, the updating module 10 is specifically configured to send a simulated service request through each channel according to a first predetermined time interval and determine a response time of the simulated service request; updating the channel state of the channel of which the response time does not exceed the preset threshold value into an available state; and updating the channel state of the channel with the response time exceeding the preset threshold value into an unavailable state.
In some embodiments, the updating module 10 is specifically configured to obtain the service data of each channel in the first predetermined time according to the first predetermined time interval; a channel status for each channel is determined based on the service data for each channel.
In some embodiments, the determining module 20 is further configured to send the current service request through the channel on which the current service request is based when the current channel status is the available status.
In the embodiment, the channel state of the channel is periodically updated, the availability of the channel is determined, and the service request is stored when the channel on which the current service request is based is in the unavailable state, so that the condition that the request fails or is repeatedly requested is avoided, the overall load condition of the system is reduced, and the overall performance of the system is improved.
A third embodiment of the present disclosure provides a storage medium, which is installable in any one of request terminals where an application program can be installed, and is specifically a computer-readable medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the method provided in any embodiment of the present disclosure, and the method includes steps S21 to S25:
s21, updating the channel state of the channel, wherein the channel state at least comprises an unavailable state or an available state;
s22, responding to the current service request of the request terminal, and determining the current channel state of the channel requested by the current service request;
s23, when the current channel state is the unavailable state, storing the current service request in the database;
s24, based on the channel state of the channel, processing the service request stored in the database;
and S25, returning a first processing result to the request end, wherein the first processing result is used for representing the processing state of the current service request.
When the computer program is executed by the processor based on the channel state of the channel and processes the service request stored in the database, the following steps are specifically executed by the processor: when the current channel state is an unavailable state, marking the current service request stored in the database, wherein the marking is used for ensuring that the current service request is a service request which is not sent; when the computer program is executed by the processor to return a first processing result to the request end, the following steps are specifically executed by the processor: and feeding back a first processing result which is used for representing the processing state of the current service request as the processing to the request terminal.
The computer program is executed by the processor, after updating the channel state of the channel, and further executed by the processor, the steps of: detecting whether a first channel with the current channel state changed from the unavailable state to the available state exists in all channels or not; under the condition that a first channel exists, sending unsent service requests with request channels as the first channel in all unsent service requests stored in a database through the first channel; and recording unsent service requests of which the request channel is the first channel stored in the database as sent service requests.
When the computer program is executed by the processor to return a first processing result to the request end, the following steps are specifically executed by the processor: after the service request with the request channel as the first channel is successfully processed, a first processing result for representing the successful processing of the service request is returned to the request end; or after the service request processing of which the request channel is the first channel fails, returning a first processing result for representing the service request processing failure to the request end.
The computer program is executed by the processor, after updating the channel state of the channel, and further executed by the processor, the steps of: detecting whether a second channel with unavailable channel state updating results within continuous preset times or preset duration exists in all channels; under the condition that a second channel exists, recording unsent service requests of which the request channel is the second channel in all unsent service requests stored in the database as service stop requests; and returning a first processing result for representing the processing failure of the service request to the request end.
When the computer program is executed by the processor to update the channel state of the channel, the processor specifically executes the following steps: sending a test request through each channel according to a first preset time interval; updating the channel state of the channel which does not receive the feedback of the test request into an unavailable state; and updating the channel state of the channel receiving the feedback of the test request into an available state.
When the computer program is executed by the processor to update the channel state of the channel, the processor specifically executes the following steps: sending a simulation service request through each channel according to a first preset time interval and determining the response time of the simulation service request; updating the channel state of the channel of which the response time does not exceed the preset threshold value into an available state; and updating the channel state of the channel with the response time exceeding the preset threshold value into an unavailable state.
When the computer program is executed by the processor to update the channel state of the channel, the processor specifically executes the following steps: acquiring service data of each channel in first preset time according to a first preset time interval; a channel status for each channel is determined based on the service data for each channel.
The computer program is executed by the processor, after responding to the current service request of the request terminal and determining the current channel state of the channel based on the current service request, the following steps are also executed by the processor: and when the current channel state is the available state, sending the current service request through the channel based on which the current service request is based.
In the embodiment, the channel state of the channel is periodically updated, the availability of the channel is determined, and the service request is stored when the channel on which the current service request is based is in the unavailable state, so that the condition that the request fails or is repeatedly requested is avoided, the overall load condition of the system is reduced, and the overall performance of the system is improved.
A fourth embodiment of the present disclosure provides an electronic device, which can be used as any user end device capable of installing an application program, and a schematic structural diagram of the electronic device is shown in fig. 5, where the electronic device at least includes a memory 100 and a processor 200, the memory 100 stores a computer program, and the processor 200 implements the method provided in any embodiment of the present disclosure when executing the computer program on the memory 100. Illustratively, the electronic device computer program steps are as follows S31-S35:
s31, updating the channel state of the channel, wherein the channel state at least comprises an unavailable state or an available state;
s32, responding to the current service request of the request terminal, and determining the current channel state of the channel requested by the current service request;
s33, when the current channel state is the unavailable state, storing the current service request in the database;
s34, based on the channel state of the channel, processing the service request stored in the database;
and S35, returning a first processing result to the request end, wherein the first processing result is used for representing the processing state of the current service request.
When the processor executes the channel-based channel state stored in the memory and processes the service request stored in the database, the following computer program is specifically executed: when the current channel state is an unavailable state, marking the current service request stored in the database, wherein the marking is used for ensuring that the current service request is a service request which is not sent; when the processor executes the first processing result which is stored in the memory and returned to the request end, the following computer programs are specifically executed: and feeding back a first processing result which is used for representing the processing state of the current service request as the processing to the request terminal.
The processor, after executing the channel state of the updated channel stored on the memory, further executes the following computer program: detecting whether a first channel with the current channel state changed from the unavailable state to the available state exists in all channels or not; under the condition that a first channel exists, sending unsent service requests with request channels as the first channel in all unsent service requests stored in a database through the first channel; and recording unsent service requests of which the request channel is the first channel stored in the database as sent service requests.
When the processor executes the first processing result which is stored in the memory and returned to the request end, the following computer programs are specifically executed: after the service request with the request channel as the first channel is successfully processed, a first processing result for representing the successful processing of the service request is returned to the request end; or after the service request processing of which the request channel is the first channel fails, returning a first processing result for representing the service request processing failure to the request end.
The processor, after executing the channel state of the updated channel stored on the memory, further executes the following computer program: detecting whether a second channel with unavailable channel state updating results within continuous preset times or preset duration exists in all channels; under the condition that a second channel exists, recording unsent service requests of which the request channel is the second channel in all unsent service requests stored in the database as service stop requests; and returning a first processing result for representing the processing failure of the service request to the request end.
When the processor executes the channel state of the update channel stored in the memory, the following computer program is specifically executed: sending a test request through each channel according to a first preset time interval; updating the channel state of the channel which does not receive the feedback of the test request into an unavailable state; and updating the channel state of the channel receiving the feedback of the test request into an available state.
When the processor executes the channel state of the update channel stored in the memory, the following computer program is specifically executed: sending a simulation service request through each channel according to a first preset time interval and determining the response time of the simulation service request; updating the channel state of the channel of which the response time does not exceed the preset threshold value into an available state; and updating the channel state of the channel with the response time exceeding the preset threshold value into an unavailable state.
When the processor executes the channel state of the update channel stored in the memory, the following computer program is specifically executed: acquiring service data of each channel in first preset time according to a first preset time interval; a channel status for each channel is determined based on the service data for each channel.
The processor, after executing a current service request stored on the memory in response to the requestor, determining a current channel state of a channel on which the current service request is based, further executes the following computer program: and when the current channel state is the available state, sending the current service request through the channel based on which the current service request is based.
In the embodiment, the channel state of the channel is periodically updated, the availability of the channel is determined, and the service request is stored when the channel on which the current service request is based is in the unavailable state, so that the condition that the request fails or is repeatedly requested is avoided, the overall load condition of the system is reduced, and the overall performance of the system is improved.
The following description will take the payment system architecture as an example in conjunction with fig. 6 to 8.
Fig. 6 shows an overall design flow diagram of the payment system architecture. Specifically, the channel docking module adds an availability switch for each service channel, checks channel availability by periodically checking a request processing success rate of the service channel and the requested service channel, and updates the availability switch. When a request terminal sends a service request, the channel docking module checks the availability switch of the channel, when the availability switch is unavailable, the channel docking module stops sending the request to the corresponding service channel, writes the service request into the channel database, and returns the service request to the request terminal for processing. And when the availability switch is available, scanning the channel database, taking out the server temporarily stored in the database before, sending the server through a corresponding channel, waiting for a request result returned by the service channel, and informing the request terminal.
FIG. 7 illustrates a flow diagram of availability detection between a channel docking module and a service channel. It specifically shows a scheme for updating channel availability by detecting the success rate of channel service request. The channel docking module checks the request success rate of the current channel as a channel availability updating basis, if the success rate suddenly decreases (for example, the success rate decreases to below 90%), the availability switch is updated to be unavailable, and if the success rate does not suddenly decrease or increase, the channel docking module requests a service channel availability interface and updates the availability switch state according to the request result. Specifically, the specific state of the availability switch is updated into the dynamic configuration center TCC.
FIG. 8 is a schematic diagram illustrating the task of making a repair order by the channel docking module after the service channel is available. When the channel repair task is executed, firstly, the channel availability is obtained from the TCC, whether the channel availability is available or not is judged, if the channel availability is still unavailable, the channel repair task is quickly ended, namely, the current service channel repair task is skipped, and other channel repair tasks are executed. And if the service channel is available currently, scanning the state in the database as the unsent service request, sending the unsent service request through the available service channel, carrying out request processing after the service channel receives the service request, feeding back a request result to the channel docking module, and updating the state of the corresponding service request in the database.
While the present disclosure has been described in detail with reference to the embodiments, the present disclosure is not limited to the specific embodiments, and those skilled in the art can make various modifications and alterations based on the concept of the present disclosure, and the modifications and alterations should fall within the scope of the present disclosure as claimed.

Claims (12)

1. A method for processing a service request, comprising:
updating a channel state of a channel, wherein the channel state at least comprises an unavailable state or an available state;
responding to a current service request of a request terminal, and determining the current channel state of a channel requested by the current service request;
when the current channel state is an unavailable state, storing the current service request in a database;
processing the service request stored in the database based on the channel state of the channel;
and returning a first processing result to the request end, wherein the first processing result is used for representing the processing state of the current service request.
2. The processing method according to claim 1, wherein the processing the service request stored in the database based on the channel state of the channel comprises: when the current channel state is an unavailable state, marking the current service request stored in a database, wherein the marking is used for ensuring that the current service request is a service request which is not sent;
the returning of the first processing result to the request end includes: and feeding back a first processing result which is used for representing the processing state of the current service request as the processing to the request terminal.
3. The processing method according to claim 2, wherein after the updating the channel state of the channel, the processing the service request stored in the database based on the channel state comprises:
detecting whether a first channel with the current channel state changed from the unavailable state to the available state exists in all the channels or not;
under the condition that the first channel exists, sending the unsent service request of which the request channel is the first channel in all unsent service requests stored in the database through the first channel;
and recording unsent service requests of which the request channel is the first channel and stored in the database as sent service requests.
4. The processing method according to claim 3, wherein the returning the first processing result to the request side includes:
after the service request with the request channel as the first channel is successfully processed, a first processing result for representing the successful processing of the service request is returned to the request end; or the like, or, alternatively,
and after the service request processing of which the request channel is the first channel fails, returning a first processing result for representing the service request processing failure to the request end.
5. The processing method according to claim 2, further comprising, after the updating the channel state of the channel:
detecting whether a second channel with unavailable channel state updating results within continuous preset times or preset duration exists in all the channels;
under the condition that the second channel exists, recording unsent service requests of which the request channel is the second channel in all unsent service requests stored in the database as service stop requests;
and returning a first processing result used for representing the processing failure of the service request to the request end.
6. The processing method according to claim 1, wherein the updating the channel state of the channel comprises:
sending a test request through each channel according to a first preset time interval;
updating the channel state of the channel which does not receive the feedback of the test request into an unavailable state;
updating the channel state of the channel receiving the feedback of the test request to an available state.
7. The processing method according to claim 1, wherein the updating the channel state of the channel comprises:
sending a simulation service request through each channel according to a first preset time interval and determining the response time of the simulation service request;
updating the channel state of the channel of which the response time does not exceed a preset threshold value to be an available state;
and updating the channel state of the channel with the response time exceeding a preset threshold value into an unavailable state.
8. The processing method according to claim 1, wherein the updating the channel state of the channel comprises:
acquiring service data of each channel in first preset time according to a first preset time interval;
determining the channel status for each channel based on the service data for each channel.
9. The processing method according to any one of claims 1 to 8, after determining, in response to a current service request of a requesting end, a current channel state of a channel on which the current service request is based, further comprising: and when the current channel state is an available state, sending the current service request through a channel based on which the current service request is based.
10. An apparatus for processing a service request, comprising:
the updating module is used for updating the channel state of the channel, wherein the channel state at least comprises an unavailable state or an available state;
the determining module is used for responding to a current service request of a request terminal and determining the current channel state of a channel requested by the current service request;
the storage module is used for storing the current service request in a database when the current channel state is an unavailable state;
the processing module is used for processing the service request stored in the database based on the channel state of the channel;
and the feedback module is used for returning a first processing result to the request end, and the first processing result is used for representing the processing state of the current service request.
11. A storage medium storing a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps of the method of processing a service request according to any one of claims 1 to 9.
12. An electronic device comprising at least a memory, a processor, said memory having stored thereon a computer program, characterized in that the processor, when executing the computer program on the memory, realizes the steps of the method of processing a service request of any of claims 1 to 9.
CN202110850617.2A 2021-07-27 2021-07-27 Service request processing method and device, storage medium and electronic equipment Pending CN113553201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110850617.2A CN113553201A (en) 2021-07-27 2021-07-27 Service request processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110850617.2A CN113553201A (en) 2021-07-27 2021-07-27 Service request processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113553201A true CN113553201A (en) 2021-10-26

Family

ID=78104583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110850617.2A Pending CN113553201A (en) 2021-07-27 2021-07-27 Service request processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113553201A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105591810A (en) * 2015-10-22 2016-05-18 杭州华三通信技术有限公司 Backup information sending method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105591810A (en) * 2015-10-22 2016-05-18 杭州华三通信技术有限公司 Backup information sending method and device

Similar Documents

Publication Publication Date Title
CN107562385B (en) Method, device and equipment for reading data by distributed storage client
EP2723017A1 (en) Method, apparatus and system for implementing distributed auto-incrementing counting
CN110705893B (en) Service node management method, device, equipment and storage medium
CN103150205A (en) Information processing system, information processing device and client terminal
CN112437155B (en) Service data processing method and device and server device
CN108241616B (en) Message pushing method and device
CN113553201A (en) Service request processing method and device, storage medium and electronic equipment
CN114466321B (en) Message sending method and device, electronic equipment and storage medium
CN108306815A (en) A kind of method, apparatus, equipment and computer readable storage medium obtaining message
CN112751743A (en) Message sending exception processing method, message sending device and electronic equipment
CN111130714A (en) Data transmission method, device, electronic equipment and computer readable medium
CN115412609A (en) Service processing method, device, server and storage medium
CN113194498A (en) Communication detection method and device
CN112463317A (en) Computer room task scheduling method and device, electronic equipment and storage medium
CN109634787B (en) Distributed file system monitor switching method, device, equipment and storage medium
KR101216674B1 (en) Improved loss data rate of billing data apparatus and method
CN111858100A (en) BMC message transmission method and related device
CN111865631A (en) Fault information reporting method and device, electronic equipment and readable storage medium
CN115914152B (en) Receipt information pushing method, system and storage medium
WO2024001213A1 (en) Information processing method, publisher, subscriber, and computer-readable storage medium
CN112866359B (en) Data chaining method and device, electronic equipment and storage medium
CN112214466B (en) Distributed cluster system, data writing method, electronic equipment and storage device
WO2000059258A2 (en) A data transfer management system and method for a telecommunications network
EP4171076A1 (en) Methods for reporting usage, and network function and storage medium
CN116760793A (en) Message polling reissue method, device, server 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