[go: up one dir, main page]

CN114900451B - A system interaction processing method and device, storage medium, and electronic device - Google Patents

A system interaction processing method and device, storage medium, and electronic device Download PDF

Info

Publication number
CN114900451B
CN114900451B CN202210462291.0A CN202210462291A CN114900451B CN 114900451 B CN114900451 B CN 114900451B CN 202210462291 A CN202210462291 A CN 202210462291A CN 114900451 B CN114900451 B CN 114900451B
Authority
CN
China
Prior art keywords
target
service
monitoring
linked list
thread
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.)
Active
Application number
CN202210462291.0A
Other languages
Chinese (zh)
Other versions
CN114900451A (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.)
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/CN114900451B/en
Publication of CN114900451A publication Critical patent/CN114900451A/en
Application granted granted Critical
Publication of CN114900451B publication Critical patent/CN114900451B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例提供了一种系统交互的处理方法及装置、存储介质、电子装置。该方法包括:在交换系统检测到目标交互请求的情况下,利用第一类服务接收目标交互请求,其中,目标交互请求用于请求目标业务系统处理目标交易,第一类服务为交换系统中用于接收交互请求的主控服务;控制第一类服务将目标交互请求转发至异步框架,通过异步框架向目标业务系统发送目标交互请求,其中,异步框架为多线程服务;在交换系统检测到目标业务系统返回的目标交易应答的情况下,利用第二类服务接收目标交易应答,其中,第二类服务为交换系统中用于接收应答报文的主控服务。因此,可以解决相关技术中系统交互处理效率低的问题,达到提高系统交互处理效果的效果。

The embodiment of the present invention provides a method and device for processing system interaction, a storage medium, and an electronic device. The method includes: when a switching system detects a target interaction request, using a first type of service to receive the target interaction request, wherein the target interaction request is used to request a target business system to process a target transaction, and the first type of service is a master control service in the switching system for receiving interaction requests; controlling the first type 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-threaded service; when the switching system detects a target transaction response returned by the target business system, using a second type of service to receive the target transaction response, wherein the second type of service is a master control service in the switching system for receiving a response message. Therefore, the problem of low efficiency of system interaction processing in the related art can be solved, and the effect of improving the system interaction processing effect can be 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 processing method and device for system interaction, a storage medium and an electronic device.
Background
Currently, when each service system needs to interact with a third party system, the service system generally needs to perform online processing through a centralized switching system deployed in the service system, and use transaction middleware to communicate with the third party system.
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 generally required, and Tuxedo transaction middleware is used to communicate with the third party service system. The centralized switching system is used as a request party, the third party service system is used as a service party, the main control service of the centralized switching system forwards the interaction request to the third party service system, and after the third party service system receives and processes the interaction request, the response message is returned to the main control service of the centralized switching system.
Because the main control service of the centralized switching system is always in a state of waiting for the response message after forwarding the interaction request, a new interaction request cannot be processed in the period. If the interaction time of the third party service system is longer, the master control service of the centralized switching system needs to wait for a longer time to obtain the response of the third party service system, and in the process, the master control of the centralized switching system is always in a waiting state and cannot process other interactions in time, so that the interaction processing efficiency is low. If the third party service system processes the interaction, the master control service of the centralized switching system is likely to be blocked on the interaction, and the processing efficiency of the interaction is further reduced.
Disclosure of Invention
The embodiment of the invention provides a processing method and device for system interaction, a storage medium and an electronic device, which are used for at least solving the problem of low processing efficiency of system interaction in the related technology.
According to one embodiment of the invention, a processing method of system interaction is provided, which comprises the steps of receiving a target interaction request by using a first type service under the condition that the exchange system detects the target interaction request, wherein the target interaction request is used for requesting a target business system to process target transaction, the first type service is a main control service used for receiving the interaction request in the exchange system, controlling the first type service to forward the target interaction request to an asynchronous frame, sending the target interaction request to the target business system through the asynchronous frame, wherein the asynchronous frame is a multithreaded service, and receiving the target transaction response by using a second type service under the condition that the exchange system detects the target transaction response returned by the target business system, wherein the second type service is the main control service used for receiving response messages in the exchange system.
In an exemplary embodiment, the receiving the target interaction request by using a first service includes determining a first service currently in an idle state in the first service, receiving a target request message indicating the target interaction request by using the first service, and storing context data of the target transaction carried in the target request message.
In an exemplary embodiment, controlling the first service to forward the target interaction 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 message to the asynchronous framework, controlling a target thread in the asynchronous framework to parse the target request message, and sending the target request message to the target service system when a parsing result of the target request message meets an interaction condition.
In an exemplary embodiment, controlling the target thread in the asynchronous frame to parse the target request message includes controlling the target thread in the asynchronous frame to parse a system identifier and a target transaction time indicating the target service system from the target request message, and adding monitoring information of the target transaction to a monitoring linked list of a monitoring thread when the current time does not exceed the target transaction time, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
In an exemplary embodiment, the target thread is released if the current time exceeds the target transaction time, a target response message indicating a timeout exception is generated, and the target response message is sent to the second class of service to answer the target interaction request by using the second class of service.
In one exemplary embodiment, controlling the monitoring thread to process the monitoring link list every time a target time passes includes adjusting the monitoring link list to a locked state, wherein the monitoring link list does not respond to an adjustment operation performed on the monitoring link list in the locked state, judging whether the monitoring link list is an empty link list, sequentially judging whether each monitoring information in the monitoring link list exceeds a current time if the monitoring link list is not the empty link list, indicating the monitoring thread to close the thread corresponding to the monitoring information if the monitoring information exceeds the current time, and adjusting the monitoring link list to an unlocked state after the monitoring link list is the empty link list or after traversing each monitoring information, wherein the monitoring link list responds to the adjustment operation performed on the monitoring link list in the unlocked state.
In an exemplary embodiment, when the switching system detects the target transaction response and the target thread operates normally, the target thread is used to obtain a target response message indicating the target transaction response, control the target thread to add context data of the target transaction to the target response message, and forward the target response message to which the context data of the target transaction is added to the second class service, and release the target thread.
In an exemplary embodiment, when the switching system detects the target transaction response and the target thread is running abnormally, the target thread is released, a target response message indicating that the target thread is abnormal is generated, and the target response message is sent to the second type service to respond to the target interaction request by using the second type service.
According to another embodiment of the present invention, a processing apparatus for system interaction is provided, including a request receiving unit configured to receive, when a switching system detects a target interaction request, the target interaction request by using a first type service, where the target interaction request is used to request a target business system to process a target transaction, the first type service is a master service in the switching system for receiving the interaction request, a forwarding unit configured to control the first type service to forward the target interaction request to an asynchronous frame, and send the target interaction request to the target business system through the asynchronous frame, where the asynchronous frame is a multithreaded service, and a response receiving unit configured to receive, when the switching system detects a target transaction response returned by the target business system, the target transaction response by using a second type service, where the second type service is a master service in the switching system for receiving a response message.
According to a further embodiment of the invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In the invention, the target interaction request is received by utilizing the first type service based on the condition that the exchange system detects the target interaction request, wherein the target interaction request is used for requesting the target service system to process target transaction, the first type service is a main control service used for receiving the interaction request in the exchange system, the first type service is controlled to forward the target interaction request to the asynchronous framework, the target interaction request is sent to the target service system through the asynchronous framework, the asynchronous framework is a multithread service, the target transaction response is received by utilizing the second type service under the condition that the exchange system detects the target transaction response returned by the target service system, the second type service is a main control service used for receiving response messages in the exchange system, the first type service is utilized to receive the interaction request for processing the target transaction in the exchange system, the interaction request is forwarded to the asynchronous framework, and the multithread service of the asynchronous framework is utilized to receive the transaction response when the transaction response returned by the target service system is received, so that the multithread server of the asynchronous framework asynchronously receives the interaction request and the interaction response, the multithread service is prevented from being occupied by the same transaction for a long time after the interaction request is received, and the processing efficiency of the system 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 the system interaction is achieved.
Drawings
FIG. 1 is a block diagram of the hardware architecture of a computer terminal of a processing method of system interactions 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 processing method of system interactions according to an embodiment of the invention;
FIG. 4 is a flow chart of a processing method of system interactions according to an embodiment of the invention;
FIG. 5 is a flow chart of a processing method of system interactions according to an embodiment of the invention;
FIG. 6 is a flow chart of a processing method of system interactions according to an embodiment of the invention;
FIG. 7 is a flow chart of a processing method of system interactions according to an embodiment of the present invention;
fig. 8 is a block diagram of a processing device for system interaction 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 the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
In order to facilitate understanding of the technical solution provided by the present invention, the following explains the technical terms that will be involved in the embodiments of the present invention.
AP, application server.
Atomic method, a function with smaller granularity capable of being configured in transaction flow
Tuxedo, a client/server middleware product, is regulated between the client and server to ensure that transactions are properly handled.
Master control Tuxedo service for processing transaction message and capable of configuring transaction processing flow.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking a computer terminal as an example, fig. 1 is a block diagram of a hardware structure of a computer terminal according to a processing method of system interaction according to an embodiment of the present application. As shown in fig. 1, a computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor (Central Processing Unit, MCU), a programmable logic device (Field Programmable GATE ARRAY, FPGA), etc.) and a memory 104 for storing data, where the computer terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. 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 a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a subject behavior authority control method in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the above-mentioned method. 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 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via 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 means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
Fig. 2 is a network architecture diagram of a system interaction process according to an embodiment of the present invention, and as shown in fig. 2, the network architecture includes a switching system 200 and a service system 210, where the switching system 200 is configured to process an interaction request about a transaction in the system, the interaction request is a request for 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. In the event that an interactive request is detected by the switching system 200, the interactive request is received by the first type of service 202, and the first type of service 202 is the master service in the switching system 200 for receiving the interactive request. The control first class service 202 forwards the interactive requests to the asynchronous framework 206, which is a multi-threaded service, sending the interactive requests to the business system 210 through the asynchronous framework 206. In the case that the switching system 200 detects a transaction response returned by the service system 210, the second type service 204 is utilized to receive the transaction response, and the second type service 204 is a master service for receiving response messages in the switching system.
FIG. 3 is a flow chart of a processing method of system interaction according to an embodiment of the present invention, as shown in FIG. 3, the flow includes the following steps:
Step S302, receiving a target interaction request by using a first type service under the condition that the exchange system detects the target interaction request, wherein the target interaction request is used for requesting a target business system to process target transaction, and the first type service is a main control service used for receiving the interaction request in the exchange system;
Step S304, the first type service is controlled to forward the target interaction request to an asynchronous framework, and the target interaction request is sent to a target business system through the asynchronous framework, wherein the asynchronous framework is a multithreading service;
In step S306, when the switching system detects the target transaction response returned by the target service system, the second type of service is used to receive the target transaction response, where the second type of service is the main control service in the switching system for receiving the response message.
The exchange system is not limited to use in receiving an interactive request in the system, interacting with the business system via the exchange system based on the transaction, and receiving a transaction response returned by the business system via the exchange system to determine whether the transaction was completed successfully.
The exchange system is not limited to be provided with a first type of service for receiving the interaction request and a second type of service for receiving the transaction response, and the interaction request and the transaction response are respectively received through different types of services, so that the service is called to receive under the condition that the interaction requirement exists, and occupation of the service and the interaction request in the exchange system is avoided.
The asynchronous framework is not limited to processing interactive requests independent of each other for multithreading services employing asynchronous processing. And processing each interaction request by each thread, forwarding the interaction request to the service system by the thread under the condition that the first service receives the interaction request, and receiving a transaction response returned by the service system based on the thread.
In the above embodiment of the present invention, based on the situation that the switching system detects the target interaction request, the first type service is used to receive the target interaction request, where the target interaction request is used to request the target service system to process the target transaction, the first type service is a master control service used to receive the interaction request in the switching system, and the first type service is controlled to forward the target interaction request to the asynchronous frame, and send the target interaction request to the target service system through the asynchronous frame, where the asynchronous frame is a multithread service, and in the situation that the switching system detects the target transaction response returned by the target service system, the second type service is used to receive the target transaction response, where the second type service is a master control service used to receive the response message in the switching system, and in the switching system, the first type service is used to receive the interaction request for processing the target transaction by the target service system, and forward the interaction request to the asynchronous frame, and in the case that the multithread service of the asynchronous frame receives the transaction response by the second type service when the transaction response returned by the target service system is received, so as to implement that the multithread server of the asynchronous frame receives the interaction request and the interaction response, and the transaction response are prevented from being occupied by the same transaction system for a long time after the interaction request is received. 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 the system interaction is achieved.
In an alternative example, the step S302 includes determining a first service currently in an idle state from the first service, receiving, by using the first service, a target request message indicating a target interaction request, and storing context data of a target transaction carried in the target request message.
And under the condition that the exchange system receives the interaction request, the first service which is currently in an idle state in the first service is utilized to receive the interaction request, and the first service and the second service are not limited to comprise a plurality of independent master control services and are used for independently processing and receiving the interaction request or the transaction response. In the case where 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 other interactive requests can be continuously received.
Also, in the case 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 an interactive request message, and the first service storing the context data for identifying the transaction is not limited to storing the context data of the transaction to a message header of the interactive request message. The context data is not limited to identifying the interactive request and the transaction response, and is used to indicate the associated context of the transaction.
Alternatively, but not limited to, using the atomic method data_ SAVEKEYDATA to place the context Data in the transaction message header, so that the transaction message carrying the context Data is forwarded to the asynchronous framework, and the context Data is used to indicate the context of the transaction, thereby implementing the decoupling of the transaction from the thread.
The flow of processing transactions 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, a transaction processing flow is determined to begin. And the master control A and the small woman deal logic process and store the context data. And forwarding the interactive message carrying the context data to the asynchronous framework. The asynchronous framework sends a request to a third party (business system) in case of receiving an interactive message. The asynchronous framework receives the third party response and sends the third party response to the master control B. And the main control B recovers the context data, and returns a response to a requester of the system after carrying out transaction logic processing. The transaction processing flow ends.
The data format of the transaction message is not limited to that shown in table 1 below:
TABLE 1
In an alternative example, the step S304 includes controlling the first service to forward the target request message to the asynchronous frame, controlling the target thread in the asynchronous frame to parse the target request message, and sending the target request message to the target service system if the parsing result of the target request message meets the interaction condition.
The asynchronous framework is not limited to initializing the service at startup through a Tuxedo configuration file to support multithreading, where the transaction threads are supported by Tuxedo middleware and the attributes MINDISPATCHTHREADS are configured to monitor the thread's 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 issued service name according to the parameters, issuing the service after the setting is completed, and creating a monitoring thread, wherein the transaction thread is formed by Tuxedo. The monitoring thread is used for monitoring a transaction thread running in the asynchronous framework, and the transaction thread is used for receiving and forwarding the interactive request and receiving and forwarding the transaction response.
In an optional example, the target thread in the control asynchronous frame analyzes the target request message, and the method comprises the steps that the target thread in the control asynchronous frame analyzes a system identifier indicating a target service system and target transaction time from the target request message, and adds monitoring information of the target transaction to a monitoring linked list of the monitoring thread under the condition that the current time does not exceed the target transaction time, 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, analyzing the system identification for indicating the service system from the request message, and judging whether the transaction is overtime or not. Taking the transaction time as the transaction overtime time, under the condition that the current time does not exceed the transaction time, the current transaction is determined not to be overtime, and under the condition that the time exceeds the transaction time, the transaction is determined to be overtime. 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 the related information of each transaction thread for the monitoring thread in the asynchronous framework, and records the current state of each transaction thread, the received monitoring information of the transaction, the transaction information and the like. The transaction thread is in an operating state when processing the interaction request and receiving the transaction response, and is in an idle state when not processing the interaction request and receiving the transaction response.
The monitoring information of the target transaction is not limited to include an identification of a target thread that processes the target transaction and a target transaction time to monitor the transaction threads running in the asynchronous frame through the monitoring linked list.
In an alternative example, the target thread is released in case the current time exceeds the target transaction time, a target response message indicating that the timeout is abnormal is generated, and the target response message is sent to the second class of service to respond to the target interaction request by utilizing the second class of service.
And when the current time exceeds the target transaction time, namely the target transaction is overtime, releasing the target thread for processing the target transaction, and generating a response message indicating that the transaction overtime is abnormal, so as to indicate that the target transaction is completed within the indicated target transaction time.
And when the current time does not exceed the target transaction time, namely the target transaction is not overtime currently, the monitoring information of the target transaction is recorded in the monitoring linked list, and the target thread is utilized to send the interaction request to the third party service system indicated by the interaction request so as to instruct the service system to process the target transaction.
After sending the interactive request to the third party service system, the asynchronous framework is not limited to processing the monitoring linked list by the monitoring thread to determine whether the transaction thread currently processing the transaction is overtime.
In an alternative example, controlling the monitoring thread to perform linked list processing on the monitoring linked list every time the target time passes includes:
S1, adjusting a monitoring linked list into 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 or not;
S3, under the condition that the monitoring linked list is not an empty linked list, judging whether each piece of monitoring information in the monitoring linked list exceeds the current time in sequence;
s4, under the condition that the monitoring information exceeds the current time, the monitoring thread is instructed to close the thread corresponding to the monitoring information;
S5, adjusting the monitoring linked list into 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 to the monitoring linked list through each time of passing the target time, judges whether each piece of monitoring information in the monitoring linked list exceeds the current time or not so as to judge whether the transaction of each currently running thread is overtime, and timely closes the thread corresponding to the overtime transaction to release the thread resource under the condition that the transaction is found overtime, so that the long-time occupation of the thread by the transaction is avoided.
Recorded in the monitoring chain table is the transaction thread in the running state, i.e. the thread currently occupied by the transaction. In the event that the transaction thread is in an idle state, it is not recorded in the monitoring chain table.
The processing of the monitoring linked list by the monitoring thread is not limited to that shown in fig. 6. And (3) starting to acquire the current time, locking the monitoring linked list, enabling the monitoring linked list to be in a locked state, and judging whether the linked list is empty. And unlocking the monitoring linked list under the condition that the judgment determines that the linked list is empty, namely, no running transaction thread exists at present and no transaction request is processed. And under the condition that the judgment and determination link list is not empty and the running transaction process exists currently, judging whether the transaction is overtime or not in sequence. And judging whether the transaction is overtime or not in sequence for each transaction, and closing the overtime transaction thread under the condition that the judgment of judging that the transaction is overtime. And after all transactions in the linked list are judged, locking the monitoring linked list. And (3) the duration of the dormant target time, re-executing the steps after dormancy, and carrying out the next round of processing on the monitoring linked list.
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 information of only one thread in the monitoring linked list is ensured to be changed in the same time period. And under the condition that the transaction thread is closed and released, deleting the monitoring information corresponding to the transaction thread in the monitoring linked list.
In an alternative example, under the condition that the switching system detects the target transaction response and the target thread runs normally, the target thread is utilized to acquire a target response message indicating the target transaction response, the target thread is controlled to add context data of the target transaction in the target response message, the target response message added with the context data of the target transaction is forwarded to the second class service, and the target thread is released.
Under the condition that the transaction response is received, whether the target thread operates normally or not is firstly judged, under the condition that the target thread operates normally, the response message is obtained by the target thread, and under the condition that the target thread operates abnormally, the interaction request is not limited to be responded by the abnormal response message.
In an alternative example, in the event that the switching system detects a target transaction response and the target thread is running abnormally, the target thread is released and a target response message indicating that the target thread is abnormal is generated, and the target response message is sent to the second class of service to respond to the target interaction request by utilizing the second class of service.
And under the condition that the operation of the target thread is abnormal, releasing the target thread and generating a response message indicating the abnormality of the thread to respond to the interaction request.
The flow of processing of the interactive requests and transaction responses by the target threads 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 to acquire the context data. And acquiring the third party service ratio bridge and the timeout time from the request message. Judging whether the transaction is overtime, releasing the thread under the condition that the transaction is overtime, and generating an abnormal message indicating the transaction is overtime. And adding transaction information to the monitoring linked list under the condition that the transaction is judged not to be overtime. 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 that the transaction response is acquired, judging whether the thread runs normally or not. And under the condition that the thread is judged to run normally, the context data is spliced through the transaction response, and a response message is obtained. And sending the response message to the second service to respond to the interaction request. And under the condition that the thread operation is abnormal, releasing the thread and generating a response message indicating the thread abnormality.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read-Only Memory/Random Access Memory (ROM/RAM), magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiment also provides a processing device for system interaction, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 8 is a block diagram of a processing device for system interaction, as shown in FIG. 8, according to an embodiment of the present invention, the device comprising:
A request receiving unit 802, configured to receive, when the switching system detects a target interaction request, the target interaction request by using a first type service, where the target interaction request is used to request the target business system to process a target transaction, and the first type service is a master control service in the switching system for receiving the interaction request;
a forwarding unit 804, configured to control the first type of service to forward the target interaction request to an asynchronous framework, and send the target interaction request to the target service system through the asynchronous framework, where the asynchronous framework is a multithreading service;
and the response receiving unit 806 is configured to receive, when the switching system detects the target transaction response returned by the target service system, the target transaction response by using a second type of service, where the second type of service is a master service in the switching system for receiving the response message.
The request receiving unit 802 further includes:
the determining module is used for determining a first service currently in an idle state from the first type of service;
and the receiving module is used for receiving a target request message indicating the target interaction request by utilizing the first service and storing the 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 framework;
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 the target thread of the asynchronous frame to analyze the system identification and the target transaction time indicating the target service system from the target request message, and adding the monitoring information of the target transaction into a monitoring linked list of the monitoring thread under the condition that the current time does not exceed the target transaction time, wherein the monitoring thread is used for monitoring each thread running in the asynchronous frame.
The device comprises all modules shown in fig. 8, a releasing unit, a target response message and a second type service, wherein the releasing unit is used for releasing the target thread when the current time exceeds the target transaction time, generating the target response message indicating that the timeout is abnormal, and sending the target response message to the second type service so as to respond to the target interaction request by utilizing the second type service.
The device comprises all modules shown in fig. 8, a monitoring unit and a control unit, wherein the monitoring unit is used for controlling a monitoring thread to process a monitoring linked list every time the monitoring thread passes through a target time, and comprises the steps of adjusting the monitoring linked list into a locking state, judging whether the monitoring linked list is an empty linked list or not, judging whether each monitoring information in the monitoring linked list exceeds the current time in sequence if the monitoring linked list is not the empty linked list, indicating the monitoring thread to close the thread corresponding to the monitoring information if the monitoring information exceeds the current time, and adjusting the monitoring linked list into an unlocking state after the monitoring linked list is the empty linked list or each monitoring information is traversed, wherein the monitoring linked list responds to the adjustment operation performed 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 utilizing the target thread under the condition that the switching 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 class service;
And the release module is used for releasing the target thread.
The device comprises all modules shown in fig. 8, an exception unit, and a second type service, wherein the exception unit is used for releasing the target thread and generating a target response message indicating that the target thread is abnormal when the switching system detects that the target transaction response is abnormal and the target thread operates, and sending the target response message to the second type service so as to respond to the target interaction request by utilizing the second type service.
It should be noted that each of the above modules may be implemented by software or hardware, and the latter may be implemented by, but not limited to, the above modules all being located in the same processor, or each of the above modules being located in different processors in any combination.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In an exemplary embodiment, the computer readable storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, etc. various media in which a computer program may be stored.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps 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 of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1.一种系统交互的处理方法,其特征在于,包括:1. A method for processing system interaction, characterized by comprising: 在交换系统检测到目标交互请求的情况下,在第一类服务中确定出当前处于空闲状态的第一服务;利用所述第一服务接收指示所述目标交互请求的目标请求报文,并保存所述目标请求报文中携带的目标交易的上下文数据,其中,所述目标交互请求用于请求目标业务系统处理目标交易,所述第一类服务为所述交换系统中用于接收交互请求的主控服务;In the case where the switching system detects a target interaction request, a first service currently in an idle state is determined in the first type of services; a target request message indicating the target interaction request is received by using the first service, and context data of the target transaction carried in the target request message is saved, wherein the target interaction request is used to request a target business system to process a target transaction, and the first type of service is a master control service in the switching system for receiving interaction requests; 控制所述第一服务将所述目标请求报文转发至异步框架;控制所述异步框架的目标线程从所述目标请求报文中解析出指示所述目标业务系统的系统标识和目标交易时间;在当前时间未超出所述目标交易时间的情况下,将所述目标交易的监控信息添加至监控线程的监控链表中,其中,所述监控线程用于监控所述异步框架中运行的各个线程;Control the first service to forward the target request message to the asynchronous framework; control the target thread of the asynchronous framework to parse the target request message to obtain the system identifier and target transaction time indicating the target business system; if the current time does not exceed the target transaction time, add the monitoring information of the target transaction to the monitoring linked list of the monitoring thread, wherein the monitoring thread is used to monitor each thread running in the asynchronous framework; 控制监控线程每历经目标时间,对所述监控链表进行链表处理,包括:将所述监控链表调整为锁定状态,其中,所述监控链表在所述锁定状态不响应对所述监控链表执行的调整操作;判断所述监控链表是否为空链表;在所述监控链表不为空链表的情况下,依次判断所述监控链表中每个监控信息是否超出当前时间;在所述监控信息超出所述当前时间的情况下,指示所述监控线程关闭所述监控信息对应的线程;在所述监控链表为空链表或在遍历所述每个监控信息之后,将所述监控链表调整为解锁状态,其中,所述监控链表在所述解锁状态响应对所述监控链表执行的调整操作;The control monitoring thread performs linked list processing on the monitoring linked list every time a target time passes, including: adjusting the monitoring linked list to a locked state, wherein the monitoring linked list does not respond to the adjustment operation performed on the monitoring linked list in the locked state; judging whether the monitoring linked list is an empty linked list; if the monitoring linked list is not an empty linked list, judging in turn whether each monitoring information in the monitoring linked list exceeds the current time; if the monitoring information exceeds the current time, instructing the monitoring thread to close the thread corresponding to the monitoring information; if the monitoring linked list is an empty linked list or after traversing each monitoring information, adjusting the monitoring linked list to an unlocked state, wherein the monitoring linked list responds to the adjustment operation performed on the monitoring linked list in the unlocked state; 在所述目标请求报文的解析结果满足交互条件的情况下,发送所述目标请求报文至所述目标业务系统,其中,所述异步框架为多线程服务;When the parsing result of the target request message meets the interaction condition, sending the target request message to the target business system, wherein the asynchronous framework is a multi-threaded service; 在所述交换系统检测到所述目标业务系统返回的目标交易应答的情况下,利用第二类服务接收所述目标交易应答,其中,所述第二类服务为交互系统中用于接收应答报文的主控服务。When the switching system detects the target transaction response returned by the target business system, the target transaction response is received by using a second type of service, wherein the second type of service is a main control service for receiving a response message in an interactive system. 2.根据权利要求1所述的方法,其特征在于:2. The method according to claim 1, characterized in that: 在所述当前时间超出所述目标交易时间的情况下,释放所述目标线程;When the current time exceeds the target transaction time, releasing the target thread; 生成指示超时异常的目标应答报文,并将所述目标应答报文发送给所述第二类服务,以通过利用所述第二类服务应答所述目标交互请求。A target response message indicating a timeout exception is generated, and the target response message is sent to the second type of service to respond to the target interaction request by utilizing the second type of service. 3.根据权利要求1所述的方法,其特征在于:3. The method according to claim 1, characterized in that: 在所述交换系统检测到所述目标交易应答且所述目标线程运行正常的情况下,利用所述目标线程获取指示所述目标交易应答的目标应答报文;When the exchange system detects the target transaction response and the target thread runs normally, using the target thread to obtain a target response message indicating the target transaction response; 控制所述目标线程在所述目标应答报文中添加所述目标交易的上下文数据,并将添加了所述目标交易的上下文数据的所述目标应答报文转发给所述第二类服务;Control the target thread to add the context data of the target transaction to the target response message, and forward the target response message with the context data of the target transaction added to the second type of service; 释放所述目标线程。Release the target thread. 4.根据权利要求1所述的方法,其特征在于:4. The method according to claim 1, characterized in that: 在所述交换系统检测到所述目标交易应答且所述目标线程运行异常的情况下,释放所述目标线程,并生成指示所述目标线程异常的目标应答报文;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; 将所述目标应答报文发送给所述第二类服务,以通过利用所述第二类服务应答所述目标交互请求。The target response message is sent to the second type of service to respond to the target interaction request by utilizing the second type of service. 5.一种系统交互的处理装置,其特征在于,包括:5. A system interaction processing device, characterized by comprising: 请求接收单元,用于在交换系统检测到目标交互请求的情况下,在第一类服务中确定出当前处于空闲状态的第一服务;利用所述第一服务接收指示所述目标交互请求的目标请求报文,并保存所述目标请求报文中携带的目标交易的上下文数据,其中,所述目标交互请求用于请求目标业务系统处理目标交易,所述第一类服务为所述交换系统中用于接收交互请求的主控服务;a request receiving unit, configured to, when the switching system detects a target interaction request, determine a first service that is currently in an idle state in the first type of service; receive a target request message indicating the target interaction request using the first service, and save context data of the target transaction carried in the target request message, wherein the target interaction request is used to request the target business system to process the target transaction, and the first type of service is a master control service in the switching system for receiving interaction requests; 转发单元,用于控制所述第一服务将所述目标请求报文转发至异步框架;控制所述异步框架的目标线程从所述目标请求报文中解析出指示所述目标业务系统的系统标识和目标交易时间;在当前时间未超出所述目标交易时间的情况下,将所述目标交易的监控信息添加至监控线程的监控链表中,其中,所述监控线程用于监控所述异步框架中运行的各个线程;控制监控线程每历经目标时间,对所述监控链表进行链表处理,包括:将所述监控链表调整为锁定状态,其中,所述监控链表在所述锁定状态不响应对所述监控链表执行的调整操作;判断所述监控链表是否为空链表;在所述监控链表不为空链表的情况下,依次判断所述监控链表中每个监控信息是否超出当前时间;在所述监控信息超出所述当前时间的情况下,指示所述监控线程关闭所述监控信息对应的线程;在所述监控链表为空链表或在遍历所述每个监控信息之后,将所述监控链表调整为解锁状态,其中,所述监控链表在所述解锁状态响应对所述监控链表执行的调整操作;a forwarding unit, configured to control the first service to forward the target request message to the asynchronous framework; control the target thread of the asynchronous framework to parse the target request message to obtain the system identifier and target transaction time indicating the target business system; add the monitoring information of the target transaction to the monitoring linked list of the monitoring thread when the current time does not exceed the target transaction time, wherein the monitoring thread is used to monitor each thread running in the asynchronous framework; control the monitoring thread to perform linked list processing on the monitoring linked list every time the target time passes, including: adjusting the monitoring linked list to a locked state, wherein the monitoring linked list does not respond to an adjustment operation performed on the monitoring linked list in the locked state; determining whether the monitoring linked list is an empty linked list; when the monitoring linked list is not an empty linked list, sequentially determining whether each monitoring information in the monitoring linked list exceeds the current time; when the monitoring information exceeds the current time, instructing the monitoring thread to close the thread corresponding to the monitoring information; when the monitoring linked list is an empty linked list or after traversing each monitoring information, adjusting the monitoring linked list to an unlocked state, wherein the monitoring linked list responds to an adjustment operation performed on the monitoring linked list in the unlocked state; 在所述目标请求报文的解析结果满足交互条件的情况下,发送所述目标请求报文至所述目标业务系统,其中,所述异步框架为多线程服务;When the parsing result of the target request message meets the interaction condition, sending the target request message to the target business system, wherein the asynchronous framework is a multi-threaded service; 应答接收单元,用于在所述交换系统检测到所述目标业务系统返回的目标交易应答的情况下,利用第二类服务接收所述目标交易应答,其中,所述第二类服务为交互系统中用于接收应答报文的主控服务。The response receiving unit is used to receive the target transaction response by using the second type service when the switching system detects the target transaction response returned by the target business system, wherein the second type service is a main control service for receiving response messages in the interactive system. 6.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至4任一项中所述的方法。6. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the method described in any one of claims 1 to 4 when running. 7.一种电子装置,包括存储器和处理器,其特征在于,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至4任一项中所述的方法。7. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 4.
CN202210462291.0A 2022-04-28 2022-04-28 A system interaction processing method and device, storage medium, and electronic device Active CN114900451B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

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

Family

ID=82719752

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN114900451B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306695A (en) * 2020-11-19 2021-02-02 中国民航信息网络股份有限公司 Data processing method and device, electronic equipment and computer storage medium
CN114138853A (en) * 2021-12-08 2022-03-04 兴业银行股份有限公司 Core service system access queue system and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9843531B2 (en) * 2012-12-03 2017-12-12 Hewlett Packard Enterprise Development Lp 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
CN110764930B (en) * 2019-10-21 2022-07-26 中国民航信息网络股份有限公司 Request or response processing method and device based on message mode
CN113535355A (en) * 2021-06-30 2021-10-22 北京宇信科技集团股份有限公司 Method, device, medium and equipment for data asynchronous processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306695A (en) * 2020-11-19 2021-02-02 中国民航信息网络股份有限公司 Data processing method and device, electronic equipment and computer storage medium
CN114138853A (en) * 2021-12-08 2022-03-04 兴业银行股份有限公司 Core service system access queue system and method

Also Published As

Publication number Publication date
CN114900451A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
WO2020024405A1 (en) Test method, device, server and storage medium based on distributed coordination
US7886295B2 (en) Connection manager, method, system and program product for centrally managing computer applications
US8001080B2 (en) Managing real-time execution of transactions in a network
CN111813570A (en) An event-driven message interaction method for power Internet of things
WO2019024679A1 (en) Method for upgrading network function and upgrade management entity
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN113660178B (en) CDN content management system
CN107066339A (en) Distributed job manager and distributed job management method
CN109558239A (en) A kind of method for scheduling task, device, system, computer equipment and storage medium
US20240414566A1 (en) Communication method and apparatus for plurality of administrative domains
CN114020368A (en) Information processing method and device based on state machine and storage medium
CN114780177B (en) Transaction execution method and device, storage medium and electronic device
CN116319732A (en) Message queue centralized configuration management system and method based on RabbitMQ
CN114900451B (en) A system interaction processing method and device, storage medium, and electronic device
CN110119269B (en) Method, device, server and storage medium for controlling task object
CN116719623A (en) Job scheduling method, job result processing method and device
CN110381143A (en) Operation, which is submitted, executes method, apparatus, equipment and computer storage medium
CN112866359B (en) Data chaining method and device, electronic equipment and storage medium
CN115809133A (en) Distributed scheduling system, method, electronic device, and computer-readable medium
US11223578B2 (en) System and control method to direct transmission of event data to one of a plurality of reception queues
JP2002108838A (en) Agent execution device and agent execution method
CN112437146A (en) Equipment state synchronization method, device and system
CN115309536B (en) Data consistency method in high-concurrency lottery transaction scene
CN118550890B (en) A method and device for distributing multi-process files
CN113055468B (en) Chip management and control method, device and 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
GR01 Patent grant
GR01 Patent grant