CN114900451A - System interaction processing method and device, storage medium and electronic device - Google Patents

System interaction processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN114900451A
CN114900451A CN202210462291.0A CN202210462291A CN114900451A CN 114900451 A CN114900451 A CN 114900451A CN 202210462291 A CN202210462291 A CN 202210462291A CN 114900451 A CN114900451 A CN 114900451A
Authority
CN
China
Prior art keywords
target
service
thread
transaction
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210462291.0A
Other languages
Chinese (zh)
Inventor
陈鹏礼
史晨阳
黄登玺
陈广华
胡彬
李彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Everbright Bank Co Ltd
Original Assignee
China Everbright Bank 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 China Everbright Bank Co Ltd filed Critical China Everbright Bank Co Ltd
Priority to CN202210462291.0A priority Critical patent/CN114900451A/en
Publication of CN114900451A publication Critical patent/CN114900451A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a system interaction processing method and device, a storage medium and an electronic device. The method comprises the following steps: under the condition that the exchange system detects a target interaction request, receiving the target interaction request by using a first type of service, wherein the target interaction request is used for requesting a target business system to process target transaction, and the first type of service is a main control service for receiving the interaction request in the exchange system; controlling a first class of service to forward a target interaction request to an asynchronous frame, and sending the target interaction request to a target service system through the asynchronous frame, wherein the asynchronous frame is a multi-thread service; and under the condition that the switching system detects a target transaction response returned by the target service system, receiving the target transaction response by using a second type of service, wherein the second type of service is a main control service for receiving a response message in the switching system. Therefore, the problem of low system interaction processing efficiency in the related technology can be solved, and the effect of improving the system interaction processing effect is achieved.

Description

System interaction processing method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of computers, in particular to a system interaction processing method and device, a storage medium and an electronic device.
Background
Currently, when each business system needs to interact with a third-party system, it is usually required to perform online processing with a centralized exchange system deployed in the business system, and communicate with the third-party system using a transaction middleware.
Taking a banking system as an example, when online interaction with a third-party service system is required, a centralized exchange system based on deployment is usually required to communicate with the third-party service system by using Tuxedo transaction middleware. The centralized switching system is used as a requester, the third-party service system is used as a server, the main control service of the centralized switching system forwards the interaction request to the third-party service system, and the third-party service system returns the response message to the main control service of the centralized switching system after receiving and processing the interaction request.
Since the main control service of the centralized switching system is always in a state of waiting for a response message after forwarding the interactive request, a new interactive request cannot be processed in the period. If the time for the third-party service system to process the interaction is long, the main control service of the centralized switching system needs to wait for a long time to obtain the response of the third-party service system, and in the process, the main control of the centralized switching system is always in a waiting state and cannot process other interactions in time, so that the efficiency of the interaction processing is very low. If a problem occurs in the process of the interaction by the third-party service system, the master service of the centralized switching system is likely to be stuck on the interaction, and the processing efficiency of the interaction is further reduced.
Disclosure of Invention
The embodiment of the invention provides a system interaction processing method and device, a storage medium and an electronic device, which are used for at least solving the problem of low system interaction processing efficiency in the related art.
According to an embodiment of the present invention, a method for processing system interaction is provided, including: under the condition that a switching system detects a target interaction request, receiving the target interaction request by using a first type of service, wherein the target interaction request is used for requesting a target business system to process a target transaction, and the first type of service is a main control service for receiving the interaction request in the switching system; controlling the first class of service to forward the target interaction request to an asynchronous frame, and sending the target interaction request to the target service system through the asynchronous frame, wherein the asynchronous frame is a multi-thread service; and under the condition that the switching system detects a target transaction response returned by the target service system, receiving the target transaction response by using a second service, wherein the second service is a main control service for receiving a response message in the switching system.
In an exemplary embodiment, the receiving the target interaction request by using the first type of service includes: determining a first service currently in an idle state in the first class of services; and receiving a target request message indicating the target interaction request by using the first service, and storing the context data of the target transaction carried in the target request message.
In an exemplary embodiment, controlling the first class of service to forward the target interactive request to an asynchronous framework, and sending a target processing request to the target service system through the asynchronous framework includes: controlling the first service to forward the target request packet to the asynchronous frame; controlling a target thread in the asynchronous frame to analyze the target request message; and sending the target request message to the target service system under the condition that the analysis result of the target request message meets the interaction condition.
In an exemplary embodiment, controlling the target thread in the asynchronous framework to parse the target request packet includes: controlling the target thread of the asynchronous frame to analyze a system identifier and target transaction time indicating the target service system from the target request message; and under the condition that the current time does not exceed the target transaction time, adding the monitoring information of the target transaction into a monitoring linked list of a monitoring thread, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
In an exemplary embodiment, in the case that the current time exceeds the target transaction time, releasing the target thread; and generating a target response message indicating that the timeout is abnormal, and sending the target response message to the second type of service so as to respond to the target interaction request by using the second type of service.
In an exemplary embodiment, controlling the monitoring thread to perform linked list processing on the monitoring linked list every time the monitoring thread passes through the target time includes: adjusting the monitoring linked list to a locking state, wherein the monitoring linked list does not respond to the adjustment operation executed on the monitoring linked list in the locking state; judging whether the monitoring linked list is an empty linked list or not; under the condition that the monitoring linked list is not an empty linked list, sequentially judging whether each piece of monitoring information in the monitoring linked list exceeds the current time; when the monitoring information exceeds the current time, indicating the monitoring thread to close the thread corresponding to the monitoring information; and adjusting the monitoring linked list to be in an unlocking state after the monitoring linked list is an empty linked list or each piece of monitoring information is traversed, wherein the monitoring linked list responds to the adjustment operation executed on the monitoring linked list in the unlocking state.
In an exemplary embodiment, when the exchange system detects the target transaction response and the target thread runs normally, the target thread is used to obtain a target response message indicating the target transaction response; controlling the target thread to add the context data of the target transaction in the target response message, and forwarding the target response message added with the context data of the target transaction to the second service; and releasing the target thread.
In an exemplary embodiment, when the switching system detects the target transaction response and the target thread runs abnormally, the target thread is released, and a target response message indicating that the target thread is abnormal is generated; and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
According to another embodiment of the present invention, there is provided a system interaction processing apparatus, including: a request receiving unit, configured to receive a target interaction request by using a first type of service when a switching system detects the target interaction request, where the target interaction request is used to request a target service system to process a target transaction, and the first type of service is a master control service for receiving the interaction request in the switching system; a forwarding unit, configured to control the first class of service to forward the target interaction request to an asynchronous frame, and send the target interaction request to the target service system through the asynchronous frame, where the asynchronous frame is a multi-thread service; and a response receiving unit, configured to receive the target transaction response by using a second type of service when the switching system detects a target transaction response returned by the target service system, where the second type of service is a master control service used in the switching system to receive a response message.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
In the invention, based on the condition that a target interaction request is detected by a switching system, the target interaction request is received by utilizing a first class of service, wherein the target interaction request is used for requesting a target business system to process a target transaction, the first class of service is a main control service used for receiving the interaction request in the switching system, the first class of service is controlled to forward the target interaction request to an asynchronous frame, the target interaction request is sent to the target business system through the asynchronous frame, the asynchronous frame is a multi-thread service, and the target transaction response is received by utilizing a second class of service under the condition that the switching system detects the target transaction response returned by the target business system, wherein the second class of service is the main control service used for receiving a response message in the switching system, the interaction request for requesting the target business system to process the target transaction is received by utilizing the first class of service in the switching system, and the interaction request is transmitted to the asynchronous frame, and when the transaction response returned by the target business system is received by using the multithread service of the asynchronous frame, the transaction response is received by using the second type of service, so that the interaction request and the interaction response are asynchronously received by using the multithread server of the asynchronous frame, the long-time occupation of the same transaction after the interaction request is received by the thread service until the interaction response is completed is avoided, and the processing efficiency of system interaction is improved. Therefore, the problem of low processing efficiency of system interaction in the related technology can be solved, and the technical effect of improving the processing efficiency of system interaction is achieved.
Drawings
Fig. 1 is a block diagram of a hardware configuration of a computer terminal of a system interaction processing method according to an embodiment of the present invention;
FIG. 2 is a diagram of a network architecture according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method of processing system interactions according to an embodiment of the invention;
FIG. 4 is a flow diagram of a method of processing system interactions, according to an embodiment of the invention;
FIG. 5 is a flow chart of a method of processing system interactions according to an embodiment of the invention;
FIG. 6 is a flow diagram of a method of processing system interactions according to an embodiment of the invention;
FIG. 7 is a flow diagram of a method of processing system interactions, according to an embodiment of the invention;
fig. 8 is a block diagram of a system interaction processing apparatus according to another embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In order to facilitate understanding of the technical solutions provided by the present invention, the following explains the terms of art that will be referred to in the embodiments of the present invention.
AP: an application server.
The atomic method comprises the following steps: function capable of being configured in transaction process and with smaller granularity
Tuxedo: a client/server middleware product that leverages between clients and servers to ensure proper processing.
Main control: the Tuxedo service is used for processing transaction messages and can configure transaction processing flows.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a computer terminal, fig. 1 is a hardware structure block diagram of the computer terminal of the system interaction processing method according to the embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a Processing device such as a Microprocessor (MCU) or a Programmable logic device (FPGA)) and a memory 104 for storing data, wherein the computer terminal may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the principal behavior authority management method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include memory located remotely from the processor 102, which can be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Fig. 2 is a network architecture diagram of processing of system interaction according to an embodiment of the present invention, as shown in fig. 2, the network architecture includes a switching system 200 and a service system 210, the switching system 200 is configured to process an interaction request regarding a transaction in the system, the interaction request is to request the corresponding service system 210 to process the transaction, and after the service system 210 processes the transaction, the switching system 200 receives a transaction response to complete the interaction request. The switching system 200 receives the interactive request by using a first type service 202 when detecting the interactive request, wherein the first type service 202 is a master service for receiving the interactive request in the switching system 200. The first type of service 202 is controlled to forward the interactive request to the asynchronous framework 206, and the interactive request is sent to the business system 210 through the asynchronous framework 206, wherein the asynchronous framework is a multi-thread service. And under the condition that the switching system 200 detects the transaction response returned by the business system 210, receiving the transaction response by using the second type of service 204, wherein the second type of service 204 is a master service for receiving the response message in the switching system.
Fig. 3 is a flowchart of a processing method of system interaction according to an embodiment of the present invention, as shown in fig. 3, the flowchart includes the following steps:
step S302, under the condition that the exchange system detects a target interaction request, receiving the target interaction request by using a first type of service, wherein the target interaction request is used for requesting a target business system to process target transaction, and the first type of service is a main control service used for receiving the interaction request in the exchange system;
step S304, controlling the first class service to forward the target interaction request to an asynchronous frame, and sending the target interaction request to a target service system through the asynchronous frame, wherein the asynchronous frame is a multi-thread service;
step S306, under the condition that the exchange system detects the target transaction response returned by the target service system, receiving the target transaction response by using a second type of service, wherein the second type of service is a main control service for receiving the response message in the exchange system.
The exchange system is not limited to be used for receiving the interaction request in the system, interacts with the service system through the exchange system based on the transaction, and receives a transaction response returned by the service system through the exchange system to determine whether the transaction is successfully completed.
The exchange system is not limited to be provided with a first service for receiving the interactive request and a second service for receiving the transaction response, and the interactive request and the transaction response are respectively received through different services, so that the service is called to receive under the condition of interactive demand, and the occupation of the service and the interactive request in the exchange system is avoided.
The asynchronous framework is not limited to multi-threaded services that employ asynchronous processing, each thread processing interactive requests independently of the other. And processing each interactive request by each thread, forwarding the interactive requests to the service system through the threads under the condition that the first-class service receives the interactive requests, and receiving transaction responses returned by the service system based on the threads.
In the above embodiment of the present invention, based on that, in the case that the switching system detects a target interaction request, the target interaction request is received by using a first class of service, where the target interaction request is used to request the target business system to process a target transaction, the first class of service is a master service used in the switching system to receive the interaction request, the first class of service is controlled to forward the target interaction request to an asynchronous frame, the target interaction request is sent to the target business system through the asynchronous frame, where the asynchronous frame is a multi-thread service, and in the case that the switching system detects a target transaction response returned by the target business system, the target transaction response is received by using a second class of service, where the second class of service is a master service used in the switching system to receive a response packet, the interaction request requesting the target business system to process the target transaction is received by using the first class of service in the switching system, and the interaction request is transmitted to the asynchronous frame, and when the transaction response returned by the target business system is received by using the multithread service of the asynchronous frame, the transaction response is received by using the second type of service, so that the interaction request and the interaction response are asynchronously received by using the multithread server of the asynchronous frame, the long-time occupation of the same transaction after the interaction request is received by the thread service until the interaction response is completed is avoided, and the processing efficiency of system interaction is improved. Therefore, the problem of low processing efficiency of system interaction in the related technology can be solved, and the technical effect of improving the processing efficiency of system interaction is achieved.
In an optional example, the step S302 includes: determining a first service currently in an idle state in a first class of services; and receiving a target request message indicating a target interaction request by using the first service, and storing context data of target transaction carried in the target request message.
And under the condition that the exchange system receives the interaction request, receiving the interaction request by using a first service currently in an idle state in the first class of services, wherein the first class of services and the second class of services are not limited to comprise a plurality of independent main control services and are used for independently processing the received interaction request or the transaction response. In the case that the first service forwards the interactive request to the asynchronous framework, the first service is adjusted from the occupied state to the idle state, so that the other interactive requests can be continuously received.
Similarly, under the condition of receiving the transaction response, the transaction response is received by using the second service currently in the idle state in the second class of services, and after the transaction response is processed, the second service is adjusted from the occupied state to the idle state, so that other transaction responses can be continuously received.
The interactive request is not limited to the interactive request message, and the first server stores the context data for identifying the transaction is not limited to storing the context data of the transaction in the message header of the interactive request message. The context data is not limited to identifying the interaction request and the transaction response, and is used to indicate the context associated with the transaction.
Optionally, the context Data is placed in the header of the transaction packet by using the atomic method Data _ SaveKeyData, so that the transaction packet carrying the context Data is forwarded to the asynchronous framework, and the context Data indicates the context of the transaction, thereby implementing the decoupling of the transaction and the thread.
The processing flow of the transaction by the switching system is not limited to that shown in fig. 4. The main control A (first service) executes the request processing flow, and the main control B (second service) executes the response processing flow transaction flow. In the event that an interactive request is received, it is determined that a transaction processing flow is to begin. And the main control A and the girl transaction logic process and save the context data. And forwarding the interactive message carrying the context data to an asynchronous frame. The asynchronous framework sends a request to a third party (service system) in case of receiving the interactive message. And the asynchronous framework receives the third party response and sends the third party response to the main control B. And the main control B recovers the context data, and returns a response to the requesting party of the system after the transaction logic processing. This concludes the transaction processing flow.
The data format of the transaction message is not limited to the following table 1:
TABLE 1
Figure BDA0003622550560000091
In an optional example, the step S304 includes: controlling the first service to forward the target request message to an asynchronous frame; controlling a target thread in an asynchronous frame to analyze a target request message; and sending the target request message to a target service system under the condition that the analysis result of the target request message meets the interaction condition.
The asynchronous framework is not limited to initializing the service at startup via Tuxedo configuration files to support multithreading, where transactional threads are supported by Tuxedo middleware via configuration attributes MINDISPATCHTHREADS to monitor thread startup in the asynchronous framework's startup flow. The start-up flow of the asynchronous framework is not limited to that shown in fig. 5. Initializing tpinit, analyzing parameters to set the name of the issued service according to the parameters, issuing the service after the setting is finished, and creating a monitoring thread, wherein the transaction thread is Tuxedo. The monitoring thread is used for monitoring transaction threads running in the asynchronous framework, and the transaction threads are used for receiving and forwarding the interaction requests and receiving and forwarding the transaction responses.
In an optional example, the parsing, by the target thread in the control asynchronous framework, the target request packet includes: a target thread of the control asynchronous frame analyzes a system identifier indicating a target service system and target transaction time from a target request message; and under the condition that the current time does not exceed the target transaction time, adding the monitoring information of the target transaction into a monitoring linked list of a monitoring thread, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
And receiving and analyzing the request message through the target thread which is determined in the asynchronous frame and is in the idle state at present, and analyzing a system identifier for indicating a service system and transaction time for judging whether the transaction is overtime from the request message. Taking the transaction time as the transaction timeout moment as an example, under the condition that the current time does not exceed the transaction time, determining that the transaction is not currently overtime; in the event the time exceeds the transaction time, the transaction is determined to have timed out. And when the transaction is not overtime, adding the monitoring information of the transaction to a monitoring linked list of the monitoring thread.
The monitoring linked list is not limited to a linked list for monitoring each transaction thread and recording related information of each transaction thread for the monitoring thread in the asynchronous frame, and the current state of each transaction thread, the monitoring information of the received transaction, the transaction information and the like are recorded. The transaction thread is in a running state when processing the interactive request and receiving the transaction response, and is in an idle state when not processing the interactive request and receiving the transaction response.
The monitoring information of the target transaction is not limited to include the identification of the target thread processing the target transaction and the target transaction time, so as to monitor the transaction threads running in the asynchronous framework through the monitoring linked list.
In an optional example, in the event that the current time exceeds the target trade time, the target thread is released; and generating a target response message indicating the timeout abnormity, and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
And under the condition that the current time exceeds the target transaction time, namely the target transaction is overtime currently, releasing a target thread for processing the target transaction, and generating a response message indicating that the transaction is overtime abnormally, so that the target transaction is indicated to be completed within the indicated target transaction time.
And under the condition that the current time does not exceed the target transaction time, namely the target transaction is not overtime currently, recording the monitoring information of the target transaction in a monitoring linked list, and simultaneously sending the interaction request to a third-party service system indicated by the interaction request by using a target thread so as to indicate the service system to process the target transaction.
After the interactive request is sent to the third-party service system, the asynchronous framework is not limited to process the monitoring linked list through the monitoring thread so as to determine whether the transaction thread currently processing the transaction is overtime.
In an optional example, controlling the monitoring thread to perform linked list processing on the monitoring linked list every time the target time passes includes:
s1, adjusting the monitoring linked list to a locking state, wherein the monitoring linked list does not respond to the adjustment operation executed on the monitoring linked list in the locking state;
s2, judging whether the monitoring linked list is an empty linked list;
s3, under the condition that the monitoring linked list is not an empty linked list, sequentially judging whether each monitoring information in the monitoring linked list exceeds the current time;
s4, when the monitoring information exceeds the current time, indicating the monitoring thread to close the thread corresponding to the monitoring information;
and S5, adjusting the monitoring linked list to be in an unlocking state after the monitoring linked list is an empty linked list or each piece of monitoring information is traversed, wherein the monitoring linked list responds to the adjustment operation executed on the monitoring linked list in the unlocking state.
The monitoring thread executes the processing of the steps on the monitoring linked list every time the target time passes, judges whether each monitoring information in the monitoring linked list exceeds the current time so as to judge whether the transaction of each thread running at present is overtime, and closes the thread corresponding to the overtime transaction in time to release thread resources under the condition that the transaction is overtime, so that the thread is prevented from being occupied for a long time by the transaction.
The monitoring linked list records the transaction thread in a running state, namely the thread occupied by the transaction currently. In the case that the transaction thread is in an idle state, it is not recorded in the monitoring linked list.
The processing of the watch list by the watch thread is not limited to that shown in FIG. 6. And starting to acquire the current time, locking the monitoring linked list, enabling the monitoring linked list to be in a locking state, and judging whether the linked list is empty or not. And unlocking the monitoring linked list under the condition that the linked list is judged and determined to be empty, namely no transaction thread is currently running and no transaction request is currently processed. And sequentially judging whether the transaction is overtime or not under the conditions that the linked list is judged and determined not to be empty and the currently running transaction process exists. And sequentially judging whether the transaction is overtime or not for each transaction, and closing an overtime transaction thread under the condition of judging that the transaction is overtime. And locking the monitoring linked list after all the transactions in the linked list are judged. And the duration of the target time of the dormancy is re-executed after the dormancy, and the monitoring linked list is processed for the next round.
Optionally, when the monitoring information of the target transaction is written into the monitoring linked list, a locking operation is also performed on the monitoring linked list, so that it is ensured that the information of only one thread is changed in the monitoring linked list in the same time period. And under the conditions of closing and releasing the transaction thread, deleting the monitoring information corresponding to the transaction thread in the monitoring linked list.
In an optional example, when the switching system detects a target transaction response and a target thread runs normally, a target response message indicating the target transaction response is acquired by using the target thread; controlling the target thread to add context data of the target transaction in the target response message, and forwarding the target response message added with the context data of the target transaction to the second type of service; and releasing the target thread.
Under the condition of receiving a transaction response, firstly, judging whether a target thread operates normally, and under the condition that the target thread operates normally, acquiring a response message by using the target thread; and under the condition that the target thread runs abnormally, responding the interactive request by using an abnormal response message is not limited.
In an optional example, in the case that the switching system detects a target transaction response and a target thread runs abnormally, the target thread is released, and a target response message indicating that the target thread is abnormal is generated; and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
And under the condition that the target thread runs abnormally, releasing the target thread and generating a response message indicating the thread abnormality to respond to the interaction request.
The processing flow of the interaction request and the transaction response by the target thread in the asynchronous framework is not limited to that shown in fig. 7. And under the condition of receiving the request message, analyzing the message and acquiring context data. And acquiring the third-party service ratio bridge and the timeout from the request message. And judging whether the transaction is overtime, releasing the thread under the condition of judging that the transaction is overtime, and generating an abnormal message indicating the overtime of the transaction. And under the condition that the transaction is not overtime, adding the transaction information to the monitoring linked list. And forwarding the transaction request to the third-party service to acquire a transaction response returned by the third-party service. And under the condition of acquiring a transaction response, judging whether the thread runs normally. And under the condition that the thread is judged to run normally, context data are spliced through transaction response to obtain a response message. And sending the response message to the second service to respond to the interactive request. And under the condition of judging that the thread runs abnormally, releasing the thread and generating a response message indicating the thread abnormality.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a Read-Only Memory/Random Access Memory (ROM/RAM), a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a system interaction processing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of which have been already described are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 8 is a block diagram of a processing apparatus for system interaction according to an embodiment of the present invention, as shown in fig. 8, the apparatus includes:
a request receiving unit 802, configured to receive a target interaction request by using a first type of service when the switching system detects the target interaction request, where the target interaction request is used to request the target service system to process a target transaction, and the first type of service is a master control service used in the switching system to receive the interaction request;
the forwarding unit 804 is configured to control the first class service to forward the target interaction request to an asynchronous frame, and send the target interaction request to the target service system through the asynchronous frame, where the asynchronous frame is a multi-thread service;
the response receiving unit 806 is configured to, when the switching system detects a target transaction response returned by the target service system, receive the target transaction response by using a second type of service, where the second type of service is a master service for receiving a response message in the switching system.
The request receiving unit 802 further includes:
the determining module is used for determining a first service in an idle state currently in the first class of services;
and the receiving module is used for receiving a target request message indicating a target interaction request by using the first service and storing context data of the target transaction carried in the target request message.
The forwarding unit 804 includes:
the forwarding module is used for controlling the first service to forward the target request message to the asynchronous frame;
the analysis module is used for controlling a target thread in the asynchronous frame to analyze the target request message;
and the sending module is used for sending the target request message to the target service system under the condition that the analysis result of the target request message meets the interaction condition.
The analysis module is also used for controlling a target thread of the asynchronous frame to analyze the system identifier indicating the target service system and the target transaction time from the target request message; and under the condition that the current time does not exceed the target transaction time, adding the monitoring information of the target transaction into a monitoring linked list of a monitoring thread, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
The device comprises all the modules shown in fig. 8, and further comprises a release unit, which is used for releasing the target thread when the current time exceeds the target transaction time; and generating a target response message indicating the timeout abnormity, and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
The apparatus includes, in addition to all modules shown in fig. 8, a monitoring unit configured to control a monitoring thread to perform linked list processing on a monitoring linked list every time the monitoring thread passes through a target time, including: adjusting the monitoring linked list to be in a locking state, wherein the monitoring linked list does not respond to the adjustment operation executed on the monitoring linked list in the locking state; judging whether the monitoring linked list is an empty linked list or not; under the condition that the monitoring linked list is not an empty linked list, sequentially judging whether each monitoring information in the monitoring linked list exceeds the current time; when the monitoring information exceeds the current time, indicating the monitoring thread to close the thread corresponding to the monitoring information; and adjusting the monitoring linked list to be in an unlocking state after the monitoring linked list is an empty linked list or each piece of monitoring information is traversed, wherein the monitoring linked list responds to the adjustment operation executed on the monitoring linked list in the unlocking state.
The response receiving unit 806 further includes:
the acquisition module is used for acquiring a target response message indicating the target transaction response by using the target thread under the condition that the exchange system detects the target transaction response and the target thread runs normally;
the adding module is used for controlling the target thread to add the context data of the target transaction in the target response message and forwarding the target response message added with the context data of the target transaction to the second type of service;
and the releasing module is used for releasing the target thread.
The apparatus includes, in addition to all modules shown in fig. 8, an exception unit, configured to release a target thread and generate a target response packet indicating that the target thread is abnormal, when the switching system detects a target transaction response and the target thread runs abnormally; and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method for processing system interaction is characterized by comprising the following steps:
under the condition that a target interaction request is detected by an exchange system, receiving the target interaction request by utilizing a first type of service, wherein the target interaction request is used for requesting a target business system to process a target transaction, and the first type of service is a main control service for receiving the interaction request in the exchange system;
controlling the first class of service to forward the target interaction request to an asynchronous framework, and sending the target interaction request to the target business system through the asynchronous framework, wherein the asynchronous framework is a multi-thread service;
and under the condition that the switching system detects a target transaction response returned by the target service system, receiving the target transaction response by using a second type of service, wherein the second type of service is a main control service for receiving a response message in the switching system.
2. The method of claim 1, wherein receiving the target interaction request using a first class of service comprises:
determining a first service currently in an idle state in the first class of services;
and receiving a target request message indicating the target interaction request by using the first service, and storing the context data of the target transaction carried in the target request message.
3. The method of claim 2, wherein controlling the first class of service to forward the target interactive request to an asynchronous framework, and sending a target processing request to the target business system through the asynchronous framework comprises:
controlling the first service to forward the target request packet to the asynchronous frame;
controlling a target thread in the asynchronous frame to analyze the target request message;
and sending the target request message to the target service system under the condition that the analysis result of the target request message meets the interaction condition.
4. The method according to claim 3, wherein controlling the target thread in the asynchronous framework to parse the target request packet comprises:
controlling the target thread of the asynchronous frame to analyze a system identifier indicating the target service system and target transaction time from the target request message;
and under the condition that the current time does not exceed the target transaction time, adding the monitoring information of the target transaction into a monitoring linked list of a monitoring thread, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
5. The method of claim 4, wherein:
releasing the target thread if the current time exceeds the target transaction time;
and generating a target response message indicating timeout abnormity, and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
6. The method of claim 4, wherein controlling the monitor thread to perform linked list processing on the monitor linked list each time a target time elapses comprises:
adjusting the monitoring linked list to be in a locking state, wherein the monitoring linked list does not respond to the adjustment operation executed on the monitoring linked list in the locking state;
judging whether the monitoring linked list is an empty linked list or not;
under the condition that the monitoring linked list is not an empty linked list, sequentially judging whether each piece of monitoring information in the monitoring linked list exceeds the current time;
when the monitoring information exceeds the current time, indicating the monitoring thread to close the thread corresponding to the monitoring information;
and adjusting the monitoring linked list to be in an unlocking state when the monitoring linked list is an empty linked list or after traversing each piece of monitoring information, wherein the monitoring linked list responds to the adjustment operation executed on the monitoring linked list in the unlocking state.
7. The method of claim 3, wherein:
under the condition that the exchange system detects the target transaction response and the target thread runs normally, acquiring a target response message indicating the target transaction response by using the target thread;
controlling the target thread to add the context data of the target transaction in the target response message, and forwarding the target response message added with the context data of the target transaction to the second type of service;
and releasing the target thread.
8. The method of claim 3, wherein:
when the exchange system detects the target transaction response and the target thread runs abnormally, releasing the target thread and generating a target response message indicating that the target thread is abnormal;
and sending the target response message to the second type of service so as to respond to the target interaction request by utilizing the second type of service.
9. A system interaction processing apparatus, comprising:
a request receiving unit, configured to receive a target interaction request by using a first type of service when a switching system detects the target interaction request, where the target interaction request is used to request a target service system to process a target transaction, and the first type of service is a master control service used in the switching system to receive the interaction request;
the forwarding unit is used for controlling the first class of service to forward the target interaction request to an asynchronous frame and sending the target interaction request to the target service system through the asynchronous frame, wherein the asynchronous frame is a multi-thread service;
and the response receiving unit is used for receiving the target transaction response by using a second type of service under the condition that the switching system detects the target transaction response returned by the target service system, wherein the second type of service is a main control service for receiving a response message in the switching system.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 8.
CN202210462291.0A 2022-04-28 2022-04-28 System interaction processing method and device, storage medium and electronic device Pending CN114900451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210462291.0A CN114900451A (en) 2022-04-28 2022-04-28 System interaction processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210462291.0A CN114900451A (en) 2022-04-28 2022-04-28 System interaction processing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN114900451A true CN114900451A (en) 2022-08-12

Family

ID=82719752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210462291.0A Pending CN114900451A (en) 2022-04-28 2022-04-28 System interaction processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114900451A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150295844A1 (en) * 2012-12-03 2015-10-15 Hewlett-Packard Development Company, L.P. Asynchronous framework for management of iaas
CN110177146A (en) * 2019-05-28 2019-08-27 东信和平科技股份有限公司 A kind of non-obstruction Restful communication means, device and equipment based on asynchronous event driven
CN110764930A (en) * 2019-10-21 2020-02-07 中国民航信息网络股份有限公司 Request or response processing method and device based on message mode
CN112306695A (en) * 2020-11-19 2021-02-02 中国民航信息网络股份有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113535355A (en) * 2021-06-30 2021-10-22 北京宇信科技集团股份有限公司 Method, device, medium and equipment for data asynchronous processing
CN114138853A (en) * 2021-12-08 2022-03-04 兴业银行股份有限公司 Core service system access queue system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150295844A1 (en) * 2012-12-03 2015-10-15 Hewlett-Packard Development Company, L.P. Asynchronous framework for management of iaas
CN110177146A (en) * 2019-05-28 2019-08-27 东信和平科技股份有限公司 A kind of non-obstruction Restful communication means, device and equipment based on asynchronous event driven
CN110764930A (en) * 2019-10-21 2020-02-07 中国民航信息网络股份有限公司 Request or response processing method and device based on message mode
CN112306695A (en) * 2020-11-19 2021-02-02 中国民航信息网络股份有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113535355A (en) * 2021-06-30 2021-10-22 北京宇信科技集团股份有限公司 Method, device, medium and equipment for data asynchronous processing
CN114138853A (en) * 2021-12-08 2022-03-04 兴业银行股份有限公司 Core service system access queue system and method

Similar Documents

Publication Publication Date Title
US10200506B2 (en) Method, system and device for monitoring data
CN111930529B (en) Data synchronization method, device and system based on message queue and microservice
CN111245900B (en) Distributed message sending processing system and processing method thereof
CN102523243B (en) The system and method that quick header is selected is provided in the distributed system of simple topology
CN111447102B (en) SDN network device access method and device, computer device and storage medium
US20190158626A1 (en) Method, apparatus and computer readable storage medium for processing service
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN112288577B (en) Transaction processing method, device, electronic equipment and medium for distributed service
US11537336B2 (en) Resource service system, control method, and storage medium
CN111858007A (en) Task scheduling method and device based on message middleware
CN112486707A (en) Redis-based message asynchronous consumption method and device
CN111586140A (en) Data interaction method and server
CN114090198A (en) Distributed task scheduling method and device, electronic equipment and storage medium
CN114338769B (en) Access request processing method and device
CN115439250A (en) Transaction request processing method and device, storage medium and electronic device
US10587768B2 (en) Client apparatus and method
CN115250233B (en) Gray scale routing control method, gray scale routing assembly and computer equipment
CN111367795A (en) Performance test method based on benchmark service and related equipment
CN115333942B (en) Event retry method and device, storage medium and electronic equipment
CN114900451A (en) System interaction processing method and device, storage medium and electronic device
CN116340111A (en) Linux socket monitoring event monitoring method and device
CN113392081B (en) Data processing system and method
US11223578B2 (en) System and control method to direct transmission of event data to one of a plurality of reception queues
US20080005291A1 (en) Coordinated information dispersion in a distributed computing system
CN113660178B (en) CDN content management system

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