CN111290866A - Service processing method and device - Google Patents

Service processing method and device Download PDF

Info

Publication number
CN111290866A
CN111290866A CN202010086202.8A CN202010086202A CN111290866A CN 111290866 A CN111290866 A CN 111290866A CN 202010086202 A CN202010086202 A CN 202010086202A CN 111290866 A CN111290866 A CN 111290866A
Authority
CN
China
Prior art keywords
service
processing
target
request
asynchronous
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.)
Granted
Application number
CN202010086202.8A
Other languages
Chinese (zh)
Other versions
CN111290866B (en
Inventor
窦方钰
吴宽展
沈涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010086202.8A priority Critical patent/CN111290866B/en
Publication of CN111290866A publication Critical patent/CN111290866A/en
Application granted granted Critical
Publication of CN111290866B publication Critical patent/CN111290866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Telephonic Communication Services (AREA)

Abstract

One or more embodiments of the present specification disclose a method and an apparatus for processing a service, so as to solve the problem of low reliability of service processing in the prior art. The method is applied to a first server and comprises the following steps: and generating a request identifier of the service processing request based on the service processing request of the target service. And sending the service processing request to a synchronous service interface of a second server. And the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service. And acquiring the synchronous processing result from the synchronous service interface, and generating a processing record corresponding to the target service based on the synchronous processing result. And according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.

Description

Service processing method and device
Technical Field
The present specification relates to the field of service processing technologies, and in particular, to a service processing method and apparatus.
Background
In the process of business processing, special services are generally required to be provided for some businesses. For example, in a wind control scenario, if it is identified that the business risk is very high, a penalty such as blocking or no login is required to be performed on a corresponding subject (user or merchant, etc.) so as to secure the account and funds of the user.
For the type of service mentioned above, the system level requires the provision of highly reliable services. While a traditional Remote Procedure Call Protocol (RPC) server provides services, it is difficult to ensure 100% of services available due to network jitter, bottom storage jitter, and the like. Still taking a wind control scenario as an example, for example, if an account is a black-out account, the balance of the account should be prohibited from being cash up, but if an exception occurs in the process of "prohibit cash up" by invoking a penalty, the account may be caused to transfer funds out, which may result in many risks and investment losses.
Disclosure of Invention
In one aspect, one or more embodiments of the present specification provide a service processing method, applied to a first server, including: and generating a request identifier of the service processing request based on the service processing request of the target service. And sending the service processing request to a synchronous service interface of a second server. And the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service. And acquiring the synchronous processing result from the synchronous service interface, and generating a processing record corresponding to the target service based on the synchronous processing result. And according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
In another aspect, one or more embodiments of the present specification provide a business processing method applied to a risk identification system, including: generating a request identification of an account service request based on the account service request of a target account; the account service request includes a request to prohibit an account from performing a specified class of operation. And sending the account service request to a synchronous service interface of a remote calling protocol server. The synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account. And acquiring the synchronous service result from the synchronous service interface, and generating a service record corresponding to the target account based on the synchronous service result. And according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
In another aspect, one or more embodiments of the present specification provide a service processing apparatus, applied to a first server, including: the first generation module generates a request identifier of a service processing request based on the service processing request of a target service. And the first sending module is used for sending the service processing request to a synchronous service interface of the second server. And the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service. And the first acquisition module acquires the synchronous processing result from the synchronous service interface and generates a processing record corresponding to the target service based on the synchronous processing result. And the asynchronous processing module is used for asynchronously processing the service which meets the asynchronous processing condition in the target service according to the request identifier of the service processing request and the processing record.
In another aspect, one or more embodiments of the present specification provide a business processing apparatus applied to a risk identification system, including: and the second generation module generates a request identifier of the account service request based on the account service request of the target account. The account service request includes a request to prohibit an account from performing a specified class of operation. And the second sending module is used for sending the account service request to a synchronous service interface of a remote calling protocol server. The synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account. And the second acquisition module acquires the synchronous service result from the synchronous service interface and generates a service record corresponding to the target account based on the synchronous service result. And the asynchronous service module is used for carrying out asynchronous service on the account meeting the asynchronous service condition in the target account according to the request identifier of the account service request and the service record.
In another aspect, one or more embodiments of the present specification provide a service processing apparatus, applied to a first server, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: and generating a request identifier of the service processing request based on the service processing request of the target service. And sending the service processing request to a synchronous service interface of a second server. And the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service. And acquiring the synchronous processing result from the synchronous service interface, and generating a processing record corresponding to the target service based on the synchronous processing result. And according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
In another aspect, one or more embodiments of the present specification provide a business processing apparatus applied to a risk identification system, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: generating a request identification of an account service request based on the account service request of a target account; the account service request includes a request to prohibit an account from performing a specified class of operation. And sending the account service request to a synchronous service interface of a remote calling protocol server. The synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account. And acquiring the synchronous service result from the synchronous service interface, and generating a service record corresponding to the target account based on the synchronous service result. And according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
In yet another aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, where the computer-executable instructions, when executed, implement the following processes: and generating a request identifier of the service processing request based on the service processing request of the target service. And sending the service processing request to a synchronous service interface of a second server. And the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service. And acquiring the synchronous processing result from the synchronous service interface, and generating a processing record corresponding to the target service based on the synchronous processing result. And according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
In yet another aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, where the computer-executable instructions, when executed, implement the following processes: generating a request identification of an account service request based on the account service request of a target account; the account service request includes a request to prohibit an account from performing a specified class of operation. And sending the account service request to a synchronous service interface of a remote calling protocol server. The synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account. And acquiring the synchronous service result from the synchronous service interface, and generating a service record corresponding to the target account based on the synchronous service result. And according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
Drawings
In order to more clearly illustrate one or more embodiments or technical solutions in the prior art in the present specification, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in one or more embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive exercise.
FIG. 1 is a schematic block diagram of a business processing system in accordance with one embodiment of the present description;
FIG. 2 is a schematic flow chart diagram of a method of business processing according to one embodiment of the present description;
FIG. 3 is a schematic flow chart diagram of a method of traffic processing according to another embodiment of the present description;
FIG. 4 is a schematic block diagram of a business processing system in accordance with another embodiment of the present description;
FIG. 5 is a schematic flow chart diagram of a method of traffic processing according to another embodiment of the present description;
fig. 6 is a schematic block diagram of a service processing apparatus according to an embodiment of the present description;
FIG. 7 is a schematic block diagram of a traffic processing apparatus according to another embodiment of the present description;
FIG. 8 is a schematic block diagram of a traffic processing device according to one embodiment of the present description;
fig. 9 is a schematic block diagram of a service processing device according to another embodiment of the present specification.
Detailed Description
One or more embodiments of the present disclosure provide a service processing method and apparatus, so as to solve the problem of low reliability of service processing in the prior art.
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments of the present disclosure without making any creative effort shall fall within the protection scope of one or more of the embodiments of the present disclosure.
Fig. 1 is a schematic block diagram of a business processing system according to an embodiment of the present description. As shown in fig. 1, the business processing system includes a first server 110 and a second server 120. The first server 110 is configured to respond to the service processing request and send the service processing request to the second server 120; the second server 120 is configured to process the service processing request, including synchronous processing and/or asynchronous processing. In order to ensure highly reliable RPC service, the service processing system provides the RPC service at the near end, for example, the first server needs to call the second server, and the second server can provide a near-end service package and be integrated into the application system of the first server to run. How to implement the service processing by using the near-end service package integrated by the second server in the first server will be described in detail below.
Fig. 2 is a schematic flow chart of a service processing method according to an embodiment of the present specification, and as shown in fig. 2, the method is applied to the first server 110 shown in fig. 1, and includes:
s202, based on the service processing request of the target service, generating a request identifier of the service processing request.
The first server generates a unique request identifier for each service processing request, and the representation mode of the request identifier is not limited, for example, any identifier such as a serial number, a letter, a number, and the like is adopted.
And S204, sending the service processing request to a synchronous service interface of the second server, wherein the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service.
S206, a synchronous processing result is obtained from the synchronous service interface, and a processing record corresponding to the target service is generated based on the synchronous processing result.
The processing record corresponding to the target service may include a correspondence between the request identifier of the target service and the synchronization processing result. The synchronization processing result may include a synchronization processing success, a synchronization processing failure, a synchronization processing exception, a synchronization processing timeout, and the like.
And S208, according to the request identifier and the processing record of the service processing request, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
The service meeting the asynchronous processing condition may include a service whose synchronous processing result is synchronous processing failure, synchronous processing exception, or synchronous processing timeout. Based on this, by performing asynchronous processing on the services with synchronous processing failure, abnormal synchronous processing or overtime synchronous processing, the success rate of service processing can be further improved, and the reliability of service processing can be ensured.
In this embodiment, the target service may be one or more. When the target service includes a plurality of services, the first server may simultaneously transmit service processing requests of the plurality of target services to the second server.
It can be seen that, with the technical solutions provided by one or more embodiments of the present specification, the first server performs synchronization processing by generating a request identifier of a service processing request of a target service and sending the service processing request to a synchronization service interface of the second server. And, by acquiring a synchronous processing request of the synchronous service interface to the target service, and generating a processing record corresponding to the target service based on a synchronous processing result, the asynchronous processing is performed on the service meeting the asynchronous processing condition according to the request identifier and the processing record of the service processing request. Therefore, the purpose of processing the service by calling other servers is achieved, the processed rate and the processing success rate of the target service are ensured by asynchronously processing the service, and the condition that the service processing is easy to fail when only synchronously processing the service is avoided. In addition, most operations in the business processing process are integrated into the first server (namely, the near-end server) to be executed, so that the reliability of business processing is ensured.
In one embodiment, the processing record includes a correspondence between the request identifier of the target service and a synchronization processing result, where the synchronization processing result includes a synchronization processing success, a synchronization processing failure, a synchronization processing exception, a synchronization processing timeout, and the like. The asynchronous processing conditions include at least one of: and the synchronous processing result is abnormal synchronous processing and does not include a synchronous processing result corresponding to the target service in the processing record. Based on this, when the asynchronous processing is performed on the service meeting the asynchronous processing condition in the target service according to the request identifier and the processing record of the service processing request (i.e., S208), the synchronous processing result corresponding to the target service may be firstly queried from the processing record according to the request identifier of the service processing request; then, according to the inquired synchronous processing result, determining the service which accords with the asynchronous processing condition in the target service; and further carrying out asynchronous processing on the services meeting the asynchronous processing conditions in the target services.
In one embodiment, when asynchronous processing is performed on a service meeting asynchronous processing conditions in a target service, if a synchronous processing result corresponding to the target service is abnormal in synchronous processing, an asynchronous message corresponding to the target service is sent to a second server, and the second server is used for performing asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service. And if the processing record does not contain the synchronous processing result corresponding to the target service, performing asynchronous processing on the target service according to the current service state of the user corresponding to the target service.
In this embodiment, if the processing record does not include the synchronous processing result corresponding to the target service, the service type corresponding to the target service may be determined, and the current service state of the user corresponding to the target service may be determined; judging whether the service type corresponding to the target service is matched with the current service state; and if the service type corresponding to the target service is not matched with the current service state of the user, sending the asynchronous message corresponding to the target service to the second server. The second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service. If the service type corresponding to the target service is matched with the current service state of the user, it can be determined that the target service has been successfully processed, and the processing record corresponding to the target service can be updated according to the information that the target service has been successfully processed, for example, a corresponding relationship between the request identifier corresponding to the target service and the processing result is added to the processing record.
Wherein the service type may be determined based on the service content. For example, in a wind control scenario, the service content is a frozen account, a prohibited account login, etc., and the service type may be divided into a frozen account type, a prohibited account login type, etc. The user corresponding to the target service may be understood as a user initiating the target service, and may also be understood as a user related to the target service (e.g., an account corresponding to the target service).
For example, the service type corresponding to the target service is a frozen account type, and the current service state of the user corresponding to the target service can be determined by querying the account state. If the current account status is frozen, it indicates that the current account status matches the service type corresponding to the target service (i.e., the frozen account type), and at this time, the processing record corresponding to the target service may be updated according to the information that the target service has been successfully processed. If the current account status is not frozen, it indicates that the current account status is not matched with the service type corresponding to the target service (i.e., the frozen account type), at this time, an asynchronous message corresponding to the target service may be sent to the second server, and the second server performs asynchronous processing on the target service.
In an embodiment, before asynchronous processing is performed on a service meeting asynchronous processing conditions in a target service, log information corresponding to a service processing request may be generated according to a preset log format. And further converting the log information corresponding to the service processing request into asynchronous messages to obtain the asynchronous messages corresponding to the target service.
In this embodiment, since the process of generating the log is equivalent to the write-in operation of the local disk, the log is generated successfully, that is, the log information corresponding to the service processing request is generated successfully and written into the local area of the first server, so as to ensure that the first server converts the asynchronous information corresponding to the target service. In addition, the present embodiment does not limit the log format to which the log information should conform.
In an embodiment, after the asynchronous message corresponding to the target service is sent to the second server, the processing record corresponding to the target service may be updated according to the asynchronous processing result of the target service by the second server. Specifically, if the asynchronous processing result corresponding to the target service is successful, the asynchronous processing result and the request identifier corresponding to the target service are added to the processing record corresponding to the target service, so as to update the processing record corresponding to the target service. If the asynchronous processing result corresponding to the target service is asynchronous processing failure or asynchronous processing abnormity (such as asynchronous processing overtime), determining the asynchronous processing frequency of the target service, and determining a processing mode of the target service based on the asynchronous processing frequency of the target service.
In an embodiment, if the asynchronous processing result corresponding to the target service is asynchronous processing failure or asynchronous processing exception (for example, asynchronous processing timeout), the processing mode of the target service is determined based on the number of asynchronous processing times of the target service. The method specifically comprises the following steps: judging whether the asynchronous processing times of the target service is greater than a preset threshold value or not; if so, outputting log information for identifying the failure of the target service processing; if not, the asynchronous processing is continuously carried out on the target service.
In this embodiment, if the number of times of asynchronous processing of the target service is not greater than the preset value, the target service is continuously processed asynchronously. The process may be specifically implemented as: and sending the asynchronous message corresponding to the target service to a second server, carrying out asynchronous processing on the target service by the second server, and generating an asynchronous processing result corresponding to the target service.
In one embodiment, before asynchronous processing is performed on a service meeting asynchronous processing conditions in a target service, a message duration of an asynchronous message corresponding to the target service can be further determined, wherein the message duration comprises a duration from a generation time point of the asynchronous message to a current time point; judging whether the message duration of the asynchronous message is less than a preset duration or not; if so, prolonging the message duration of the asynchronous message by a first duration so that the prolonged message duration is greater than or equal to the preset duration; if not, the asynchronous message corresponding to the target service is sent to the second server, the second server carries out asynchronous processing on the target service, and an asynchronous processing result corresponding to the target service is generated.
For example, the preset time duration is 30 seconds, and if the message time duration of the asynchronous message corresponding to the target service (i.e., the time duration from the generation time point of the asynchronous message to the current time point) is less than 30 seconds, the message time duration of the asynchronous message is extended to 30 seconds or more than 30 seconds, and then the delayed asynchronous message is sent to the second server.
In this embodiment, when the asynchronous message is sent to the second server, the asynchronous message with the message duration less than the preset duration needs to be delayed, so that the time when the asynchronous message reaches the second server is prevented from being later than the time when the synchronous processing request reaches the second server. That is, the service processing request based on the target service is firstly processed synchronously, and the service meeting the asynchronous processing condition is processed asynchronously after the synchronous processing is completed.
Fig. 3 is a schematic flow chart of a service processing method according to another embodiment of the present specification, and as shown in fig. 3, the method is applied to the first server 110 shown in fig. 1, and includes:
s301, checking the basic parameters and the basic logic. If the check is passed, the step S302 is continuously executed; if the check does not pass, S312 is executed.
Wherein the basic parameters may comprise any one or more parameters in the first server; the base logic may include business processing logic preset in the application system of the first server. The check of the basic parameters and the basic logic can ensure that the first server normally runs the business processing flow.
S302, based on the service processing request of the target service, generating a request identifier of the service processing request, and generating log information corresponding to the service processing request according to a predetermined log format.
The first server generates a unique request identifier for each service processing request, and the representation mode of the request identifier is not limited, for example, any identifier such as a serial number, a letter, a number, and the like is adopted.
The log information corresponding to the service processing request can be converted into the logged asynchronous message, namely the asynchronous message corresponding to the target service, through a near-end service package (provided by the second server) deployed in the first server.
S303, sending the service processing request of the target service to the synchronization service interface of the second server.
The synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service.
S304, a synchronization processing result corresponding to the target service is obtained from the synchronization service interface of the second server, and a processing record corresponding to the target service is generated based on the synchronization processing result.
The processing record corresponding to the target service may include a correspondence between the request identifier of the target service and the synchronization processing result. The synchronization processing result may include a synchronization processing success, a synchronization processing failure, a synchronization processing exception, a synchronization processing timeout, and the like.
In this step, if the first server has a processing record, the process of generating the processing record corresponding to the target service can be completed by adding the synchronous processing result corresponding to the target service to the processing record. If the first server does not process the record, a new processing record containing the synchronous processing result corresponding to the target service can be generated.
S305, determining that the synchronization processing result in the target service is a service with abnormal synchronization processing, and processing the service without the synchronization processing result in the record. For the service (marked as the first service in fig. 3) whose synchronization processing result is abnormal, jumping to S307 for execution; for the service (marked as the second service in fig. 3) that does not include the synchronization processing result in the processing record, the execution jumps to S306.
Where synchronization process exceptions may result from a variety of conditions, such as synchronization process timeouts, etc.
S306, judging whether the service type corresponding to the target service is matched with the current service state of the user corresponding to the target service; if yes, go to S311; if not, go to step S307.
S307, acquiring an asynchronous message corresponding to the target service, and judging whether the message duration of the asynchronous message is greater than or equal to a preset duration; if yes, go to S309; if not, go to S308.
Wherein the message duration of the asynchronous message comprises a duration from a generation time point of the asynchronous message to a current time point. The asynchronous message may be generated when S302 is executed, that is, after log information corresponding to the service processing request is generated, the asynchronous message is converted into a log through a near-end service packet (provided by the second server) deployed in the first server, that is, the asynchronous message corresponding to the target service.
S308, the message duration of the asynchronous message is prolonged by a first duration, so that the prolonged message duration is greater than or equal to a preset duration.
S309, the asynchronous message corresponding to the target service is sent to the second server, the second server carries out asynchronous processing on the target service, and an asynchronous processing result corresponding to the target service is generated.
S310, an asynchronous processing result corresponding to the target service is obtained from the second server, and a processing record corresponding to the target service is updated based on the asynchronous processing result.
For example, the request identifier corresponding to the target service and the asynchronous processing result are correspondingly added to the processing record.
In this step, the asynchronous processing result may also include asynchronous processing failure, asynchronous processing exception, and the like, and in this case, the processing mode for the target service may be determined based on the number of asynchronous processing times of the target service. Specifically, if the asynchronous processing times of the target service is greater than a preset threshold, outputting log information for identifying the processing failure of the target service; and if the number of asynchronous processing times of the target service is not greater than the preset threshold, continuing to perform asynchronous processing on the target service, namely returning to the step S309 for execution.
And S311, updating the processing record corresponding to the target service based on the information that the target service has been successfully processed.
For example, the request identifier and the processing result corresponding to the target service are correspondingly added to the processing record.
S312, returning an error code, and ending the process.
As can be seen from the above, the present embodiment not only achieves the purpose of processing the service by calling another server (e.g., the second server), but also ensures the processed rate and the processing success rate of the target service by asynchronously processing the service, thereby avoiding the situation that the service processing is easily failed when only synchronously processing the service. In addition, most operations in the business processing process are integrated into the first server (namely, the near-end server) to be executed, so that the reliability of business processing is ensured.
The service processing method provided by the above embodiment is described below by taking a wind control scene as an example.
Fig. 4 is a schematic block diagram of a business processing system according to an embodiment of the present description. As shown in fig. 4, the business processing system includes a risk identification system 410 and a remote invocation protocol server (e.g., a penalty system 420). The penalty system 420 provides a near-end service package for the risk identification system 410, and integrates the near-end service package into the application system of the risk identification system 410 to operate.
As shown in fig. 4, the risk identification system 410 includes a service distribution unit and an Agent collection unit deployed by the penalty system 420, in addition to the risk identification unit itself. Penalty system 420 includes a synchronous service interface and an asynchronous service interface. The service distribution unit is configured to send a service processing request of the target service to a synchronous service interface of the penalty system 420, and the synchronous service interface performs synchronous processing on the target service. The Agent acquisition unit is configured to generate an asynchronous message corresponding to a service meeting an asynchronous processing condition in the target service, perform delay processing on the asynchronous message requiring delay processing, and send the asynchronous message to an asynchronous service interface of the penalty system 420, where the asynchronous service interface performs asynchronous processing on the service meeting the asynchronous processing condition in the target service.
Fig. 5 is a schematic flow chart of a business processing method according to an embodiment of the present specification, and as shown in fig. 5, the method is applied to the risk identification system 410 shown in fig. 4, and includes:
s502, based on the account service request of the target account, a request identifier of the account service request is generated.
The account service request comprises a request for forbidding an account to execute a specified operation, such as forbidding account login, forbidding account withdrawal, forbidding account transfer, account freezing and the like.
The risk identification system 410 generates a unique request identifier for each account service request, and the representation manner of the request identifier is not limited, such as any identifier of serial number, letter, number, and the like. For example, the request identifications of the account service request are ID01, ID02, ID03, and the like, respectively.
S504, the account service request is sent to a synchronous service interface of a remote calling protocol server; and the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account.
S506, acquiring a synchronous service result from the synchronous service interface; and generating a service record corresponding to the target account based on the synchronous service result.
The service record corresponding to the target account may include a correspondence between the request identifier of the target account and the synchronization service result. The synchronization service result may include a synchronization service success, a synchronization service failure, a synchronization service exception, a synchronization service timeout, and the like.
Table 1 schematically shows a portion of the service record corresponding to the target account. The method comprises the following information of correspondence relationship: the request identification corresponding to the target account, the penalty subject (such as identification information of the penalty subject), the penalty action and the return result of the penalty system. The penalty action may be understood as a type of service that services the target account, and the return result is the result of the synchronization service that services the target account in synchronization.
TABLE 1
Request identification Punishment subject Penalty actions Returning results
ID01 Uid01 Transfer prohibition Success of the method
ID02 Uid02 Forbidding login Abnormality (S)
And S508, according to the request identification and the service record of the account service request, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
The accounts meeting the asynchronous service condition may include accounts with a synchronization service result of synchronization service failure, synchronization service exception, or synchronization service timeout. Based on the method, the account which has failed the synchronous service, has abnormal synchronous service or has overtime synchronous service is asynchronously serviced, so that the success rate of the account service can be further improved, and the reliability of the account service is ensured.
In this embodiment, the target account may be one or more. When multiple target accounts are included, risk identification system 410 may send account service requests for the multiple target accounts simultaneously to the synchronization service interface of penalty system 420.
In one embodiment, when asynchronous service is performed on an account meeting asynchronous service conditions in a target account, if a synchronous service result corresponding to the target account is abnormal in synchronous service, an asynchronous message corresponding to the target account is sent to a punishing system, and the punishing system is used for performing asynchronous service on the target account and generating an asynchronous service result corresponding to the target account. And if the service record does not contain the synchronous service result corresponding to the target account, performing asynchronous service on the target account according to the current account state of the user corresponding to the target account.
In this embodiment, if the service record does not include the synchronization service result corresponding to the target account, the service type corresponding to the target account may be determined, and the current account status of the user (the penalty subject shown in table 1) corresponding to the target account may be determined; judging whether the service type corresponding to the target account is matched with the current account state; and if the service type corresponding to the target account is not matched with the current account state of the user, sending the asynchronous message corresponding to the target account to a punishment system. And the punishment system is used for performing asynchronous service on the target account and generating an asynchronous service result corresponding to the target account. If the service type corresponding to the target account is matched with the current account state of the user, it may be determined that the target account has been successfully serviced, and a service record corresponding to the target account may be updated according to information that the target account has been successfully serviced, for example, a correspondence between a request identifier corresponding to the target account and a service result is added to the service record.
Wherein the service type may be determined based on the penalty action. For example, the penalty action is to freeze an account, prohibit account login, etc., then the service type may be divided into a frozen account type, a prohibited account login type, etc.
For example, the service type corresponding to the target account is a frozen account type, and the current account status of the user corresponding to the target account can be determined by querying the account status. If the current account status is frozen, it indicates that the current account status matches the service type corresponding to the target account (i.e., the frozen account type), and at this time, the service record corresponding to the target account may be updated according to the information that the service of the target account is successful. Assuming that the current account status is not frozen, it indicates that the current account status does not match the service type corresponding to the target account (i.e., the frozen account type), at this time, an asynchronous message corresponding to the target account may be sent to the penalty system, and the penalty system performs asynchronous service on the target account.
In one embodiment, before asynchronous service is performed on an account meeting asynchronous service conditions in the target account, log information corresponding to the account service request may be generated according to a preset log format. And further converting the log information corresponding to the account service request into asynchronous messages to obtain the asynchronous messages corresponding to the target account.
In this embodiment, since the process of generating the log is equivalent to the write-in operation of the local disk, the log is generated successfully, that is, the log information corresponding to the service request is generated successfully and written into the risk identification system, so as to ensure that the risk identification system converts the asynchronous information corresponding to the target account. In addition, the present embodiment does not limit the log format to which the log information should conform.
In one embodiment, after the asynchronous message corresponding to the target account is sent to the penalty system, the service record corresponding to the target account may be updated according to the asynchronous service result of the penalty system on the target account. Specifically, if the asynchronous service result corresponding to the target account is that the asynchronous service is successful, the asynchronous service result and the request identifier corresponding to the target account are added to the service record corresponding to the target account to update the service record corresponding to the target account. If the asynchronous service result corresponding to the target account is asynchronous service failure or asynchronous service abnormity (such as asynchronous service overtime and the like), determining the number of asynchronous services of the target account, and determining a service mode for the target account based on the number of asynchronous services of the target account.
In one embodiment, if the asynchronous service result corresponding to the target account is asynchronous service failure or asynchronous service abnormality (for example, asynchronous service timeout), the service mode for the target account is determined based on the number of asynchronous services of the target account. The method specifically comprises the following steps: judging whether the number of asynchronous services of the target account is greater than a preset threshold value or not; if so, outputting log information for identifying the service failure of the target account; and if not, continuing to perform asynchronous service on the target account.
In this embodiment, if the number of times of asynchronous service of the target account is not greater than the preset number, the asynchronous service of the target account is continued. The process may be specifically implemented as: and sending the asynchronous message corresponding to the target account to a punishing system, performing asynchronous service on the target account by the punishing system, and generating an asynchronous service result corresponding to the target account.
In one embodiment, before asynchronous service is performed on an account meeting asynchronous service conditions in a target account, the message duration of an asynchronous message corresponding to the target account can be further determined, wherein the message duration comprises the duration from the generation time point of the asynchronous message to the current time point; judging whether the message duration of the asynchronous message is less than a preset duration or not; if so, prolonging the message duration of the asynchronous message by a first duration so that the prolonged message duration is greater than or equal to the preset duration; and if not, sending the asynchronous message corresponding to the target account to a punishing system, performing asynchronous service on the target account by the punishing system, and generating an asynchronous service result corresponding to the target account.
For example, the preset time duration is 30 seconds, and if the message time duration of the asynchronous message corresponding to the target account (i.e., the time duration from the generation time point of the asynchronous message to the current time point) is less than 30 seconds, the message time duration of the asynchronous message is extended to 30 seconds or more than 30 seconds, and then the delayed asynchronous message is sent to the penalty system.
In this embodiment, when the asynchronous message is sent to the penalty system, the asynchronous message whose message duration is less than the preset duration needs to be delayed, so that the time when the asynchronous message reaches the penalty system is prevented from being later than the time when the synchronous service request reaches the penalty system. Namely, the account service request based on the target account firstly performs synchronous service, and the account meeting the asynchronous service condition is asynchronously serviced after the synchronous service is completed.
It can be seen that, by adopting the technical solutions provided by the above embodiments of the present specification, the risk identification system performs the synchronization service by generating the request identifier of the account service request of the target account and sending the account service request to the synchronization service interface of the penalty system. And the synchronous service request of the synchronous service interface to the target account is acquired, the service record corresponding to the target account is generated based on the synchronous service result, and then the asynchronous service is performed on the account meeting the asynchronous service condition according to the request identifier of the account service request and the service record. Therefore, the purpose of servicing the account by calling other servers (such as a punishing system) is achieved, the serviced rate and the service success rate of the target account are ensured through the asynchronous service account, and the condition that account service is easy to fail when only the synchronous service account is used is avoided. In addition, as most operations in the account service process are integrated into the risk identification system for execution, the reliability of the account service is ensured.
In summary, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may be advantageous.
Based on the same idea, the service processing method provided in one or more embodiments of the present specification further provides a service processing apparatus.
Fig. 6 is a schematic block diagram of a service processing apparatus according to an embodiment of the present specification, and as shown in fig. 6, the apparatus is applied to a first server and includes:
a first generating module 610, configured to generate a request identifier of a service processing request based on the service processing request of a target service;
a first sending module 620, configured to send the service processing request to a synchronization service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
a first obtaining module 630, obtaining the synchronization processing result from the synchronization service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and the asynchronous processing module 640 performs asynchronous processing on the service meeting the asynchronous processing condition in the target service according to the request identifier of the service processing request and the processing record.
In one embodiment, the processing record includes a correspondence between a request identifier of the target service and the synchronization processing result; the synchronous processing result comprises at least one of success of synchronous processing, failure of synchronous processing and exception of synchronous processing;
the asynchronous processing module 640 includes:
the query unit is used for querying the synchronous processing result corresponding to the target service from the processing record according to the request identifier of the service processing request;
the determining unit is used for determining the services meeting the asynchronous processing conditions in the target services according to the inquired synchronous processing result; the asynchronous processing conditions include at least one of: the synchronous processing result is the synchronous processing exception, and the processing record does not include the synchronous processing result corresponding to the target service;
and the asynchronous processing unit is used for carrying out asynchronous processing on the service meeting the asynchronous processing condition in the target service.
In one embodiment, the asynchronous processing unit is further to:
if the synchronous processing result corresponding to the target service is the synchronous processing abnormity, sending the asynchronous message corresponding to the target service to the second server; the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service;
and if the processing record does not contain the synchronous processing result corresponding to the target service, performing asynchronous processing on the target service according to the current service state of the user corresponding to the target service.
In one embodiment, the asynchronous processing unit is further to:
determining a service type corresponding to the target service; determining the current service state of the user corresponding to the target service;
judging whether the service type corresponding to the target service is matched with the current service state;
if not, sending the asynchronous message corresponding to the target service to the second server; and the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service.
In one embodiment, the apparatus further comprises:
the generating module generates log information corresponding to the service processing request according to a preset log format before the asynchronous processing is performed on the service meeting the asynchronous processing condition in the target service;
and the conversion module is used for converting the log information corresponding to the service processing request into asynchronous information to obtain the asynchronous information corresponding to the target service.
In one embodiment, the apparatus further comprises:
an updating module, configured to add the asynchronous processing result and the corresponding request identifier to the processing record to update the processing record if the asynchronous processing result is successful after the asynchronous message corresponding to the target service is sent to the second server;
the first determining module is used for determining the asynchronous processing times of the target service if the asynchronous processing result is asynchronous processing failure or asynchronous processing abnormity; and determining a processing mode of the target service based on the asynchronous processing times.
In one embodiment, the determining module is further configured to:
judging whether the asynchronous processing times are larger than a preset threshold value or not;
if so, outputting log information for identifying the target service processing failure;
if not, continuing to perform asynchronous processing on the target service.
In one embodiment, the apparatus further comprises:
a second determining module, configured to determine a message duration of the asynchronous message corresponding to the target service before performing asynchronous processing on a service meeting an asynchronous processing condition in the target service; the message duration comprises a duration from a generation time point of the asynchronous message to a current time point;
the judging module is used for judging whether the message duration of the asynchronous message is less than the preset duration or not;
if yes, the time delay module prolongs the message duration of the asynchronous message by a first time; the message time length after the prolonging is greater than or equal to the preset time length;
and if not, the execution module executes the step of sending the asynchronous message to the second server.
By adopting the apparatus provided in one or more embodiments of the present specification, the first server performs synchronization processing by generating a request identifier of a service processing request of a target service and sending the service processing request to a synchronization service interface of the second server. And, by acquiring a synchronous processing request of the synchronous service interface to the target service, and generating a processing record corresponding to the target service based on a synchronous processing result, the asynchronous processing is performed on the service meeting the asynchronous processing condition according to the request identifier and the processing record of the service processing request. Therefore, the purpose of processing the service by calling other servers is achieved, the processed rate and the processing success rate of the target service are ensured by asynchronously processing the service, and the condition that the service processing is easy to fail when only synchronously processing the service is avoided. In addition, most operations in the business processing process are integrated into the first server (namely, the near-end server) to be executed, so that the reliability of business processing is ensured.
It should be understood by those skilled in the art that the foregoing service processing apparatus can be used to implement the foregoing service processing method, and the detailed description thereof should be similar to that of the foregoing method, and is not repeated herein to avoid complexity.
Fig. 7 is a schematic block diagram of a business processing apparatus according to another embodiment of the present specification, and as shown in fig. 7, the apparatus is applied to a risk identification system, and includes:
the second generation module 710 generates a request identifier of the account service request based on the account service request of the target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
a second sending module 720, sending the account service request to a synchronous service interface of a remote invocation protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
a second obtaining module 730, configured to obtain the synchronization service result from the synchronization service interface; generating a service record corresponding to the target account based on the synchronous service result;
the asynchronous service module 740 performs asynchronous service on the account meeting the asynchronous service condition in the target account according to the request identifier of the account service request and the service record.
By adopting the device provided by the above embodiment of the present specification, the risk identification system generates the request identifier of the account service request of the target account, and sends the account service request to the synchronization service interface of the penalty system to perform synchronization service. And the synchronous service request of the synchronous service interface to the target account is acquired, the service record corresponding to the target account is generated based on the synchronous service result, and then the asynchronous service is performed on the account meeting the asynchronous service condition according to the request identifier of the account service request and the service record. Therefore, the purpose of servicing the account by calling other servers (such as a punishing system) is achieved, the serviced rate and the service success rate of the target account are ensured through the asynchronous service account, and the condition that account service is easy to fail when only the synchronous service account is used is avoided. In addition, as most operations in the account service process are integrated into the risk identification system for execution, the reliability of the account service is ensured.
It should be understood by those skilled in the art that the foregoing service processing apparatus can be used to implement the foregoing service processing method, and the detailed description thereof should be similar to that of the foregoing method, and is not repeated herein to avoid complexity.
Based on the same idea, one or more embodiments of the present specification further provide a service processing device, as shown in fig. 8. The business processing apparatus, which may have a large difference due to different configurations or performances, may include one or more processors 801 and a memory 802, and one or more stored applications or data may be stored in the memory 802. Wherein the memory 802 may be a transient storage or a persistent storage. The application program stored in memory 802 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for a business processing device. Still further, the processor 801 may be configured to communicate with the memory 802 such that a series of computer-executable instructions in the memory 802 are executed on the business processing device. The traffic processing apparatus may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input-output interfaces 805, one or more keyboards 806.
In particular, in this embodiment, the business processing apparatus includes a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the business processing apparatus, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
generating a request identifier of a service processing request based on the service processing request of a target service;
sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
acquiring the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
Optionally, the processing record includes a correspondence between the request identifier of the target service and the synchronization processing result; the synchronous processing result comprises at least one of success of synchronous processing, failure of synchronous processing and exception of synchronous processing;
the computer executable instructions, when executed, may further cause the processor to:
according to the request identification of the service processing request, the synchronous processing result corresponding to the target service is inquired from the processing record;
determining the services meeting asynchronous processing conditions in the target services according to the inquired synchronous processing results; the asynchronous processing conditions include at least one of: the synchronous processing result is the synchronous processing exception, and the processing record does not include the synchronous processing result corresponding to the target service;
and carrying out asynchronous processing on the service meeting the asynchronous processing condition in the target service.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
if the synchronous processing result corresponding to the target service is the synchronous processing abnormity, sending the asynchronous message corresponding to the target service to the second server; the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service;
and if the processing record does not contain the synchronous processing result corresponding to the target service, performing asynchronous processing on the target service according to the current service state of the user corresponding to the target service.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
determining a service type corresponding to the target service; determining the current service state of the user corresponding to the target service;
judging whether the service type corresponding to the target service is matched with the current service state;
if not, sending the asynchronous message corresponding to the target service to the second server; and the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
generating log information corresponding to the service processing request according to a preset log format before performing asynchronous processing on services meeting asynchronous processing conditions in the target services;
and converting the log information corresponding to the service processing request into asynchronous messages to obtain the asynchronous messages corresponding to the target service.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
after the asynchronous message corresponding to the target service is sent to the second server, if the asynchronous processing result is that the asynchronous processing is successful, the asynchronous processing result and the corresponding request identifier are added to the processing record so as to update the processing record;
if the asynchronous processing result is asynchronous processing failure or asynchronous processing abnormity, determining the asynchronous processing times of the target service; and determining a processing mode of the target service based on the asynchronous processing times.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
judging whether the asynchronous processing times are larger than a preset threshold value or not;
if so, outputting log information for identifying the target service processing failure;
if not, continuing to perform asynchronous processing on the target service.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
before asynchronous processing is carried out on services meeting asynchronous processing conditions in the target services, message duration of the asynchronous messages corresponding to the target services is determined; the message duration comprises a duration from a generation time point of the asynchronous message to a current time point;
judging whether the message duration of the asynchronous message is less than a preset duration or not;
if so, prolonging the message duration of the asynchronous message by a first duration; the message time length after the prolonging is greater than or equal to the preset time length;
and if not, executing the step of sending the asynchronous message to the second server.
Based on the same idea, one or more embodiments of the present specification further provide a service processing device, as shown in fig. 9. The business processing apparatus, which may have a large difference due to different configurations or performances, may include one or more processors 901 and a memory 902, and one or more stored applications or data may be stored in the memory 902. Memory 902 may be, among other things, transient storage or persistent storage. The application program stored in memory 902 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for a business processing device. Still further, processor 901 may be configured to communicate with memory 902 to execute a series of computer-executable instructions in memory 902 on a business processing device. The traffic processing apparatus may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input-output interfaces 905, one or more keyboards 906.
In particular, in this embodiment, the business processing apparatus includes a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the business processing apparatus, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
generating a request identification of an account service request based on the account service request of a target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
One or more embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the above-mentioned business processing method, and in particular to perform:
generating a request identifier of a service processing request based on the service processing request of a target service;
sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
acquiring the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
One or more embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the above-mentioned business processing method, and in particular to perform:
generating a request identification of an account service request based on the account service request of a target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
One skilled in the art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the present specification are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (trans-entity media) such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only one or more embodiments of the present disclosure, and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of claims of one or more embodiments of the present specification.

Claims (18)

1. A service processing method is applied to a first server and comprises the following steps:
generating a request identifier of a service processing request based on the service processing request of a target service;
sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
acquiring the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
2. The method according to claim 1, wherein the processing record includes a correspondence between a request identifier of the target service and the synchronization processing result; the synchronous processing result comprises at least one of success of synchronous processing, failure of synchronous processing and exception of synchronous processing;
the asynchronous processing of the service meeting the asynchronous processing condition in the target service according to the request identifier of the service processing request and the processing record comprises the following steps:
according to the request identification of the service processing request, the synchronous processing result corresponding to the target service is inquired from the processing record;
determining the services meeting asynchronous processing conditions in the target services according to the inquired synchronous processing results; the asynchronous processing conditions include at least one of: the synchronous processing result is the synchronous processing exception, and the processing record does not include the synchronous processing result corresponding to the target service;
and carrying out asynchronous processing on the service meeting the asynchronous processing condition in the target service.
3. The method of claim 2, wherein asynchronously processing the traffic meeting the asynchronous processing condition in the target traffic comprises:
if the synchronous processing result corresponding to the target service is the synchronous processing abnormity, sending the asynchronous message corresponding to the target service to the second server; the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service;
and if the processing record does not contain the synchronous processing result corresponding to the target service, performing asynchronous processing on the target service according to the current service state of the user corresponding to the target service.
4. The method according to claim 3, wherein the asynchronously processing the target service according to the current service state of the user corresponding to the target service includes:
determining a service type corresponding to the target service; determining the current service state of the user corresponding to the target service;
judging whether the service type corresponding to the target service is matched with the current service state;
if not, sending the asynchronous message corresponding to the target service to the second server; and the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service.
5. The method according to claim 3 or 4, before performing asynchronous processing on the traffic meeting the asynchronous processing condition in the target traffic, further comprising:
generating log information corresponding to the service processing request according to a preset log format;
and converting the log information corresponding to the service processing request into asynchronous messages to obtain the asynchronous messages corresponding to the target service.
6. The method according to claim 3 or 4, after the sending the asynchronous message corresponding to the target service to the second server, further comprising:
if the asynchronous processing result is that the asynchronous processing is successful, adding the asynchronous processing result and the corresponding request identifier into the processing record to update the processing record;
if the asynchronous processing result is asynchronous processing failure or asynchronous processing abnormity, determining the asynchronous processing times of the target service; and determining a processing mode of the target service based on the asynchronous processing times.
7. The method of claim 6, wherein determining the processing mode of the target service based on the number of asynchronous processes comprises:
judging whether the asynchronous processing times are larger than a preset threshold value or not;
if so, outputting log information for identifying the target service processing failure;
if not, continuing to perform asynchronous processing on the target service.
8. The method of claim 5, before asynchronously processing the traffic meeting the asynchronous processing condition in the target traffic, further comprising:
determining the message duration of the asynchronous message corresponding to the target service; the message duration comprises a duration from a generation time point of the asynchronous message to a current time point;
judging whether the message duration of the asynchronous message is less than a preset duration or not;
if so, prolonging the message duration of the asynchronous message by a first duration; the message time length after the prolonging is greater than or equal to the preset time length;
and if not, executing the step of sending the asynchronous message to the second server.
9. A business processing method is applied to a risk identification system and comprises the following steps:
generating a request identification of an account service request based on the account service request of a target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
10. A service processing device applied to a first server comprises:
the first generation module generates a request identifier of a service processing request based on the service processing request of a target service;
the first sending module is used for sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
the first acquisition module acquires the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and the asynchronous processing module is used for asynchronously processing the service which meets the asynchronous processing condition in the target service according to the request identifier of the service processing request and the processing record.
11. The apparatus according to claim 10, wherein the processing record includes a correspondence between a request identifier of the target service and the synchronization processing result; the synchronous processing result comprises at least one of success of synchronous processing, failure of synchronous processing and exception of synchronous processing;
the asynchronous processing module comprises:
the query unit is used for querying the synchronous processing result corresponding to the target service from the processing record according to the request identifier of the service processing request;
the determining unit is used for determining the services meeting the asynchronous processing conditions in the target services according to the inquired synchronous processing result; the asynchronous processing conditions include at least one of: the synchronous processing result is the synchronous processing exception, and the processing record does not include the synchronous processing result corresponding to the target service;
and the asynchronous processing unit is used for carrying out asynchronous processing on the service meeting the asynchronous processing condition in the target service.
12. The apparatus of claim 11, the asynchronous processing unit to further:
if the synchronous processing result corresponding to the target service is the synchronous processing abnormity, sending the asynchronous message corresponding to the target service to the second server; the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service;
and if the processing record does not contain the synchronous processing result corresponding to the target service, performing asynchronous processing on the target service according to the current service state of the user corresponding to the target service.
13. The apparatus of claim 12, the asynchronous processing unit to further:
determining a service type corresponding to the target service; determining the current service state of the user corresponding to the target service;
judging whether the service type corresponding to the target service is matched with the current service state;
if not, sending the asynchronous message corresponding to the target service to the second server; and the second server is used for carrying out asynchronous processing on the target service and generating an asynchronous processing result corresponding to the target service.
14. A business processing device applied to a risk identification system comprises:
the second generation module generates a request identifier of the account service request based on the account service request of the target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
the second sending module is used for sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
the second acquisition module is used for acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and the asynchronous service module is used for carrying out asynchronous service on the account meeting the asynchronous service condition in the target account according to the request identifier of the account service request and the service record.
15. A business processing device applied to a first server comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
generating a request identifier of a service processing request based on the service processing request of a target service;
sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
acquiring the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
16. A business processing device applied to a risk identification system comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
generating a request identification of an account service request based on the account service request of a target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
17. A storage medium storing computer-executable instructions that, when executed, implement the following:
generating a request identifier of a service processing request based on the service processing request of a target service;
sending the service processing request to a synchronous service interface of a second server; the synchronous service interface is used for carrying out synchronous processing on the target service based on the service processing request and generating a synchronous processing result corresponding to the target service;
acquiring the synchronous processing result from the synchronous service interface; generating a processing record corresponding to the target service based on the synchronous processing result;
and according to the request identifier of the service processing request and the processing record, performing asynchronous processing on the service meeting the asynchronous processing condition in the target service.
18. A storage medium storing computer-executable instructions that, when executed, implement the following:
generating a request identification of an account service request based on the account service request of a target account; the account service request comprises a request for forbidding an account to execute a specified class of operation;
sending the account service request to a synchronous service interface of a remote calling protocol server; the synchronization service interface is used for performing synchronization service on the target account based on the account service request and generating a synchronization service result corresponding to the target account;
acquiring the synchronous service result from the synchronous service interface; generating a service record corresponding to the target account based on the synchronous service result;
and according to the request identification of the account service request and the service record, carrying out asynchronous service on the account meeting the asynchronous service condition in the target account.
CN202010086202.8A 2020-02-11 2020-02-11 Service processing method and device Active CN111290866B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010086202.8A CN111290866B (en) 2020-02-11 2020-02-11 Service processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010086202.8A CN111290866B (en) 2020-02-11 2020-02-11 Service processing method and device

Publications (2)

Publication Number Publication Date
CN111290866A true CN111290866A (en) 2020-06-16
CN111290866B CN111290866B (en) 2023-06-30

Family

ID=71029214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010086202.8A Active CN111290866B (en) 2020-02-11 2020-02-11 Service processing method and device

Country Status (1)

Country Link
CN (1) CN111290866B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311883A (en) * 2020-10-30 2021-02-02 杭州安恒信息安全技术有限公司 Data synchronization method and system
CN112579622A (en) * 2020-12-10 2021-03-30 腾讯科技(深圳)有限公司 Method, device and equipment for processing service data
CN112929431A (en) * 2021-02-01 2021-06-08 深圳市科漫达智能管理科技有限公司 Message synchronous and asynchronous response conversion method and device based on micro-service framework
CN113034178A (en) * 2021-03-15 2021-06-25 深圳市麦谷科技有限公司 Multi-system integral calculation method and device, terminal equipment and storage medium
CN113256373A (en) * 2021-05-17 2021-08-13 北京京东振世信息技术有限公司 Document distribution method and device and server
CN113448931A (en) * 2021-07-01 2021-09-28 京东科技控股股份有限公司 Data processing method, service transaction platform and service providing platform
CN113535782A (en) * 2021-07-22 2021-10-22 成都数之联科技有限公司 BI report query response method, system, electronic equipment and computer readable storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN115412592A (en) * 2022-08-19 2022-11-29 恒生电子股份有限公司 Service processing system and method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100281528A1 (en) * 2009-05-02 2010-11-04 Richard Hayton Methods and systems for generating and delivering an interactive application delivery store
US20110276983A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Automatic return to synchronization context for asynchronous computations
JP2014191655A (en) * 2013-03-27 2014-10-06 Toyota Motor Corp Multiprocessor, electronic control device, and program
US20170317962A1 (en) * 2015-02-13 2017-11-02 Tencent Technology (Shenzhen) Company Limited Message sending method, apparatus, and system, and server
CN107741885A (en) * 2017-10-09 2018-02-27 用友网络科技股份有限公司 Affairs and business association method, interconnected system based on CS frameworks
CN109635020A (en) * 2018-10-29 2019-04-16 阿里巴巴集团控股有限公司 A kind of processing method of business, device, equipment and system
CN110442481A (en) * 2019-07-10 2019-11-12 阿里巴巴集团控股有限公司 Method for processing business, Service Component container and electronic equipment
CN110457142A (en) * 2019-07-10 2019-11-15 阿里巴巴集团控股有限公司 Method for processing business, system, computer room, framework and electronic equipment
WO2019223390A1 (en) * 2018-05-21 2019-11-28 阿里巴巴集团控股有限公司 Authorization guidance data processing method, apparatus, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100281528A1 (en) * 2009-05-02 2010-11-04 Richard Hayton Methods and systems for generating and delivering an interactive application delivery store
US20110276983A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Automatic return to synchronization context for asynchronous computations
JP2014191655A (en) * 2013-03-27 2014-10-06 Toyota Motor Corp Multiprocessor, electronic control device, and program
US20170317962A1 (en) * 2015-02-13 2017-11-02 Tencent Technology (Shenzhen) Company Limited Message sending method, apparatus, and system, and server
CN107741885A (en) * 2017-10-09 2018-02-27 用友网络科技股份有限公司 Affairs and business association method, interconnected system based on CS frameworks
WO2019223390A1 (en) * 2018-05-21 2019-11-28 阿里巴巴集团控股有限公司 Authorization guidance data processing method, apparatus, device and system
CN109635020A (en) * 2018-10-29 2019-04-16 阿里巴巴集团控股有限公司 A kind of processing method of business, device, equipment and system
CN110442481A (en) * 2019-07-10 2019-11-12 阿里巴巴集团控股有限公司 Method for processing business, Service Component container and electronic equipment
CN110457142A (en) * 2019-07-10 2019-11-15 阿里巴巴集团控股有限公司 Method for processing business, system, computer room, framework and electronic equipment

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311883A (en) * 2020-10-30 2021-02-02 杭州安恒信息安全技术有限公司 Data synchronization method and system
CN112579622A (en) * 2020-12-10 2021-03-30 腾讯科技(深圳)有限公司 Method, device and equipment for processing service data
CN112929431B (en) * 2021-02-01 2022-12-20 深圳市科漫达智能管理科技有限公司 Message synchronous and asynchronous response conversion method and device based on micro-service framework
CN112929431A (en) * 2021-02-01 2021-06-08 深圳市科漫达智能管理科技有限公司 Message synchronous and asynchronous response conversion method and device based on micro-service framework
CN113034178A (en) * 2021-03-15 2021-06-25 深圳市麦谷科技有限公司 Multi-system integral calculation method and device, terminal equipment and storage medium
CN113256373A (en) * 2021-05-17 2021-08-13 北京京东振世信息技术有限公司 Document distribution method and device and server
CN113256373B (en) * 2021-05-17 2023-11-07 北京京东振世信息技术有限公司 Document distribution method, device and server
CN113448931A (en) * 2021-07-01 2021-09-28 京东科技控股股份有限公司 Data processing method, service transaction platform and service providing platform
CN113448931B (en) * 2021-07-01 2024-05-17 京东科技控股股份有限公司 Data processing method, business transaction platform and business providing platform
CN113535782A (en) * 2021-07-22 2021-10-22 成都数之联科技有限公司 BI report query response method, system, electronic equipment and computer readable storage medium
CN113535782B (en) * 2021-07-22 2024-05-07 成都数之联科技股份有限公司 BI report query response method, system, electronic equipment and computer readable storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN115328670B (en) * 2022-06-27 2023-11-17 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN115412592A (en) * 2022-08-19 2022-11-29 恒生电子股份有限公司 Service processing system and method
CN115412592B (en) * 2022-08-19 2023-08-22 恒生电子股份有限公司 Service processing system and method

Also Published As

Publication number Publication date
CN111290866B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111290866A (en) Service processing method and device
CN110046023B (en) Data processing method and system based on intelligent contract of block chain
CN109933404B (en) Encoding and decoding method and system based on block chain intelligent contract
CN113840012B (en) Block chain-based screen recording evidence obtaining method and system and electronic equipment
CN110022260B (en) Cross-environment receipt message processing method and system
CN111382168A (en) Node group creating method and node group-based transaction method in alliance chain network
CN110046991B (en) Data processing method and system based on intelligent contract of block chain
EP3428796A1 (en) Resource loading method, and service function implementing method and device for application (app)
CN114416224B (en) Method and device for calling micro service under multi-micro service environment
CN111464319B (en) Transaction storage and signature verification method based on centralized block chain type account book
CN111159298B (en) Service request processing method and device, electronic equipment and storage medium
CN112231192A (en) Log data analysis method and device
CN109150795B (en) Information processing method, device and equipment
CN112445504A (en) Equipment firmware upgrading method, device and system
CN109656805B (en) Method and device for generating code link for business analysis and business server
CN108089927B (en) Method and device for realizing message communication based on Web Worker
CN113485758A (en) Micro-service issuing method and device, electronic equipment and storage medium
CN111383025B (en) Method and device for forwarding wind control data and electronic equipment
CN114528264A (en) Data synchronization method and system
CN110968453A (en) Data storage method and device
CN112258300B (en) Auditing method and device for order generation
CN111314189B (en) Service message sending method and device
CN111488388B (en) Deployment method, device and equipment of data storage contract
CN114331447B (en) Cross-link message submitting method and device
CN107861822B (en) Method, device and equipment for simulating broadcast notification in client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant