[go: up one dir, main page]

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.)
Granted
Application number
CN202210462291.0A
Other languages
Chinese (zh)
Other versions
CN114900451B (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

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

一种系统交互的处理方法及装置、存储介质、电子装置A system interaction processing method and device, storage medium, and electronic device

技术领域technical field

本发明实施例涉及计算机领域,具体而言,涉及一种系统交互的处理方法及装置、存储介质、电子装置。Embodiments of the present invention relate to the field of computers, and in particular, to a method and device for processing system interaction, a storage medium, and an electronic device.

背景技术Background technique

当前,各个业务系统在需要与第三方系统进行交互时,通常需要通过与业务系统中部署的集中交换系统进行联机处理,并使用交易中间件与第三方系统进行通讯。Currently, when each business system needs to interact with a third-party system, it usually needs to perform online processing with a centralized exchange system deployed in the business system, and use transaction middleware to communicate with the third-party system.

以银行系统为例,在需要与第三方业务系统进行联机交互时,通常需要基于部署的集中交换系统,使用Tuxedo交易中间件与第三方业务系统进行通讯。集中交换系统作为请求方,第三方业务系统作为服务方,集中交换系统的主控服务转发交互请求给第三方业务系统,第三方业务系统接收交互请求并处理完成之后,将应答报文返回给集中交换系统的主控服务。Taking a banking system as an example, when online interaction with a third-party business system is required, a centralized exchange system based on deployment is usually required, and the Tuxedo transaction middleware is used to communicate with the third-party business system. The centralized switching system acts as the requester, and the third-party business system acts as the server. The master service of the centralized switching system forwards the interaction request to the third-party business system. After the third-party business system receives the interaction request and processes it, it returns the response message to the centralized exchange. The master service of the switching system.

由于集中交换系统的主控服务在转发交互请求后,会一直处于等待应答报文的状态,在此期间无法处理新的交互请求。如果第三方业务系统处理交互的时间较长,那么集中交换系统的主控服务就需要等待较长时间才能获得第三方业务系统的响应,而这个过程中,集中交换系统的主控始终处于等待状态,无法及时处理其他交互,使得交互处理的效率很低。如果第三方业务系统处理交互出现问题,那么集中交换系统的主控服务很有可能卡顿在该交互上,进一步降低交互的处理效率。Because the main control service of the centralized switching system will always be in a state of waiting for a response message after forwarding the interaction request, and cannot process new interaction requests during this period. If the third-party business system takes a long time to process the interaction, the main control service of the centralized switching system needs to wait for a long time to obtain a response from the third-party business system. During this process, the main control of the centralized switching system is always in a waiting state. , other interactions cannot be processed in time, making the interaction processing inefficient. If there is a problem with the interaction processing by the third-party business system, the main control service of the centralized switching system is likely to be stuck in the interaction, further reducing the processing efficiency of the interaction.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种系统交互的处理方法及装置、存储介质、电子装置,以至少解决相关技术中系统交互处理效率低的问题。Embodiments of the present invention provide a system interaction processing method and device, a storage medium, and an electronic device, so as to at least solve 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: when a target interaction request is detected by a switching system, receiving the above-mentioned target interaction request by using a service of the first type, wherein the above-mentioned target interaction request uses a In requesting the target business system to process the target transaction, the above-mentioned first type of service is the main control service in the above-mentioned exchange system for receiving interaction requests; the above-mentioned first type of service is controlled to forward the above-mentioned target interaction request to the asynchronous framework, and the above-mentioned asynchronous framework is sent to the asynchronous framework. The above-mentioned target business system sends the above-mentioned target interaction request, wherein the above-mentioned asynchronous framework is a multi-threaded service; when the above-mentioned exchange system detects the target transaction response returned by the above-mentioned target business system, the second type of service is used to receive the above-mentioned target transaction response, Wherein, the above-mentioned second type of service is the main control service used for receiving the response message in the above-mentioned switching system.

在一个示例性实施例中,利用第一类服务接收上述目标交互请求,包括:在上述第一类服务中确定出当前处于空闲状态的第一服务;利用上述第一服务接收指示上述目标交互请求的目标请求报文,并保存上述目标请求报文中携带的上述目标交易的上下文数据。In an exemplary embodiment, using the first type of service to receive the above-mentioned target interaction request includes: determining a first service that is currently in an idle state in the above-mentioned first type of service; using the above-mentioned first service to receive an indication of the above-mentioned target interaction request and save the context data of the above-mentioned target transaction carried in the above-mentioned target request packet.

在一个示例性实施例中,控制上述第一类服务将上述目标交互请求转发至异步框架,通过上述异步框架向上述目标业务系统发送目标处理请求,包括:控制上述第一服务将上述目标请求报文转发至上述异步框架;控制上述异步框架中的目标线程解析上述目标请求报文;在上述目标请求报文的解析结果满足交互条件的情况下,发送上述目标请求报文至上述目标业务系统。In an exemplary embodiment, controlling the first type of service to forward the target interaction request to an asynchronous framework, and sending a target processing request to the target business system through the asynchronous framework includes: controlling the first service to report the target request to the asynchronous framework. control the target thread in the asynchronous framework to parse the target request message; and send the target request message to the target service system when the parsing result of the target request message satisfies the interaction conditions.

在一个示例性实施例中,控制上述异步框架中的目标线程解析上述目标请求报文,包括:控制上述异步框架的上述目标线程从上述目标请求报文中解析出指示上述目标业务系统的系统标识和目标交易时间;在当前时间未超出上述目标交易时间的情况下,将上述目标交易的监控信息添加至监控线程的监控链表中,其中,上述监控线程用于监控上述异步框架中运行的各个线程。In an exemplary embodiment, controlling the target thread in the asynchronous framework to parse the target request message includes: controlling the target thread of the asynchronous framework to parse the system identifier indicating the target service system from the target request message and the target transaction time; when the current time does not exceed the above target transaction time, the monitoring information of the above target transaction is added to the monitoring linked list of the monitoring thread, wherein the above monitoring thread is used to monitor each thread running in the above asynchronous framework .

在一个示例性实施例中,在上述当前时间超出上述目标交易时间的情况下,释放上述目标线程;生成指示超时异常的目标应答报文,并将上述目标应答报文发送给上述第二类服务,以通过利用上述第二类服务应答上述目标交互请求。In an exemplary embodiment, when the current time exceeds the target transaction time, the target thread is released; a target response message indicating an abnormal timeout is generated, and the target response message is sent to the second type of service , so as to respond to the above-mentioned target interaction request by using the above-mentioned 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 target time elapses, includes: adjusting the monitoring linked list to a locked state, wherein the monitoring linked list does not respond to the monitoring linked list in the locked state The adjustment operation performed; determine whether the above-mentioned monitoring linked list is an empty linked list; in the case that the above-mentioned monitoring linked list is not an empty linked list, judge in turn whether each monitoring information in the above-mentioned monitoring linked list exceeds the current time; in the case where the above-mentioned monitoring information exceeds the above-mentioned current time In this case, the above-mentioned monitoring thread is instructed to close the thread corresponding to the above-mentioned monitoring information; after the above-mentioned monitoring linked list is an empty linked list or after traversing each of the above-mentioned monitoring information, the above-mentioned monitoring linked list is adjusted to an unlocked state, wherein, the above-mentioned monitoring linked list is in the above-mentioned unlocked state In response to the adjustment operation performed on the above monitoring linked list.

在一个示例性实施例中,在上述交换系统检测到上述目标交易应答且上述目标线程运行正常的情况下,利用上述目标线程获取指示上述目标交易应答的目标应答报文;控制上述目标线程在上述目标应答报文中添加上述目标交易的上下文数据,并将添加了上述目标交易的上下文数据的上述目标应答报文转发给上述第二类服务;释放上述目标线程。In an exemplary embodiment, when the above-mentioned switching system detects the above-mentioned target transaction response and the above-mentioned target thread is running normally, the above-mentioned target thread is used to obtain a target response message indicating the above-mentioned target transaction response; The context data of the target transaction is added to the target response message, and the target response message to which the context data of the target transaction is added is forwarded to the second type of service; the target thread is released.

在一个示例性实施例中,在上述交换系统检测到上述目标交易应答且上述目标线程运行异常的情况下,释放上述目标线程,并生成指示上述目标线程异常的目标应答报文;将上述目标应答报文发送给上述第二类服务,以通过利用上述第二类服务应答上述目标交互请求。In an exemplary embodiment, when the above-mentioned switching system detects the above-mentioned target transaction response and the above-mentioned target thread runs abnormally, the above-mentioned target thread is released, and a target response message indicating that the above-mentioned target thread is abnormal is generated; The message is sent to the above-mentioned second type of service to respond to the above-mentioned target interaction request by using the above-mentioned second type of service.

根据本发明的另一个实施例,提供了一种系统交互的处理装置,包括:请求接收单元,用于在交换系统检测到目标交互请求的情况下,利用第一类服务接收上述目标交互请求,其中,上述目标交互请求用于请求目标业务系统处理目标交易,上述第一类服务为上述交换系统中用于接收交互请求的主控服务;转发单元,用于控制上述第一类服务将上述目标交互请求转发至异步框架,通过上述异步框架向上述目标业务系统发送上述目标交互请求,其中,上述异步框架为多线程服务;应答接收单元,用于在上述交换系统检测到上述目标业务系统返回的目标交易应答的情况下,利用第二类服务接收上述目标交易应答,其中,上述第二类服务为上述交换系统中用于接收应答报文的主控服务。According to another embodiment of the present invention, a system interaction processing device is provided, comprising: a request receiving unit, configured to receive the above target interaction request by using the first type of service when the switching system detects the target interaction request, The above-mentioned target interaction request is used to request the target business system to process the target transaction, and the above-mentioned first type of service is the main control service in the above-mentioned switching system for receiving interaction requests; the forwarding unit is used to control the above-mentioned first type of service to transfer the above-mentioned target The interaction request is forwarded to the asynchronous framework, and the above-mentioned target interaction request is sent to the above-mentioned target business system through the above-mentioned asynchronous framework, wherein the above-mentioned asynchronous framework is a multi-threaded service; the response receiving unit is used for detecting in the above-mentioned exchange system the response returned by the above-mentioned target business system. In the case of the target transaction response, the second type of service is used to receive the above-mentioned target transaction response, wherein the above-mentioned second type of service is the main control service for receiving the response message in the above-mentioned switching system.

根据本发明的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above methods when running steps in the examples.

根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is also provided an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor is configured to run the computer program to execute any of the above Steps in Method Examples.

在本发明中,基于在交换系统检测到目标交互请求的情况下,利用第一类服务接收目标交互请求,其中,目标交互请求用于请求目标业务系统处理目标交易,第一类服务为交换系统中用于接收交互请求的主控服务,控制第一类服务将目标交互请求转发至异步框架,通过异步框架向目标业务系统发送目标交互请求,其中,异步框架为多线程服务,在交换系统检测到目标业务系统返回的目标交易应答的情况下,利用第二类服务接收目标交易应答,其中,第二类服务为交换系统中用于接收应答报文的主控服务,在交换系统中利用第一类服务接收请求目标业务系统处理目标交易的交互请求,并将交互请求转发至异步框架,利用异步框架的多线程服务在接收到目标业务系统返回的交易应答时,利用第二类服务接收交易应答,实现了通过异步框架的多线程服务器异步接收交互请求和交互应答,避免线程服务在接收交互请求后直至交互应答完成前被同一交易长时间的占用,提高系统交互的处理效率。因此,可以解决相关技术中系统交互的处理效率低的问题,达到提高系统交互的处理效率的技术效果。In the present invention, when the target interaction request is detected by the switching system, the first type of service is used to receive the target interaction request, 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 the switching system The main control service used to receive interactive requests in the first class of services controls the first type of service to forward the target interactive request to the asynchronous framework, and sends the target interactive request to the target business system through the asynchronous framework. The asynchronous framework is a multi-threaded service, which is detected in the exchange system. In the case of the target transaction response returned by the target business system, the second type of service is used to receive the target transaction response, wherein the second type of service is the main control service used to receive the response message in the switching system, and the The first-class service receives the interactive request that requests the target business system to process the target transaction, and forwards the interactive request to the asynchronous framework. When receiving the transaction response returned by the target business system, the multi-threaded service using the asynchronous framework uses the second-class service to receive the transaction. Response realizes the asynchronous reception of interactive requests and interactive responses through the multi-threaded server of the asynchronous framework, which prevents the thread service from being occupied by the same transaction for a long time after receiving the interactive request until the interactive response is completed, and improves the processing efficiency of system interaction. Therefore, the problem of low processing efficiency of system interaction in the related art can be solved, and the technical effect of improving the processing efficiency of system interaction can be achieved.

附图说明Description of drawings

图1是本发明实施例的系统交互的处理方法的计算机终端的硬件结构框图;1 is a block diagram of a hardware structure of a computer terminal of a method for processing system interaction according to an embodiment of the present invention;

图2是根据本发明实施例的网络架构图;2 is a network architecture diagram according to an embodiment of the present invention;

图3根据本发明实施例的系统交互的处理方法的流程图;3 is a flowchart of a method for processing system interaction according to an embodiment of the present invention;

图4根据本发明实施例的系统交互的处理方法的流程图;4 is a flowchart of a method for processing system interaction according to an embodiment of the present invention;

图5根据本发明实施例的系统交互的处理方法的流程图;5 is a flowchart of a method for processing system interaction according to an embodiment of the present invention;

图6根据本发明实施例的系统交互的处理方法的流程图;6 is a flowchart of a method for processing system interaction according to an embodiment of the present invention;

图7根据本发明实施例的系统交互的处理方法的流程图;7 is a flowchart of a method for processing system interaction according to an embodiment of the present invention;

图8是根据本发明另一实施例的系统交互的处理装置的结构框图。FIG. 8 is a structural block diagram of a processing apparatus for system interaction according to another embodiment of the present invention.

具体实施方式Detailed ways

下文中将参考附图并结合实施例来详细说明本发明的实施例。Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence.

为便于对本发所提供的技术方案的理解,下面对本发明实施例中会涉及的专业术语进行解释。In order to facilitate the understanding of the technical solutions provided by the present invention, the technical terms involved in the embodiments of the present invention are explained below.

AP:应用服务器。AP: Application server.

原子方法:一种可以配置在交易流程中颗粒度比较小的函数Atomic method: a function that can be configured to be fine-grained in the transaction process

Tuxedo:一款客户端/服务器的中间件产品,在客户机和服务器之间进行调节,以保证正确的处理事务。Tuxedo: A client/server middleware product that mediates between client and server to ensure that transactions are processed correctly.

主控:用于处理交易报文并且可以配置交易处理流程的Tuxedo服务。Master: The Tuxedo service used to process transaction packets and configure the transaction processing flow.

本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的系统交互的处理方法的计算机终端的硬件结构框图。如图1所示,计算机终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器(Central Processing Unit,MCU)或可编程逻辑器件(Field Programmable Gate Array,FPGA)等的处理装置)和用于存储数据的存储器104,其中,上述计算机终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述计算机终端的结构造成限定。例如,计算机终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in the embodiments of this application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, FIG. 1 is a hardware structural block diagram of a computer terminal of a method for processing system interaction according to an embodiment of the present invention. As shown in FIG. 1 , the computer terminal may include one or more (only one is shown in FIG. 1 ) processors 102 (the processors 102 may include but are not limited to a microprocessor (Central Processing Unit, MCU) or a programmable logic device) (Field Programmable Gate Array, FPGA) and other processing devices) and a memory 104 for storing data, wherein the computer terminal may further include a transmission device 106 and an input and output device 108 for communication functions. Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is only a schematic diagram, which does not limit the structure of the above-mentioned 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 that shown in FIG. 1 .

存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的主体行为权限管控方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the subject behavior authority control method in the embodiment of the present invention. Executing various functional applications and data processing implements the above-mentioned methods. 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 instances, memory 104 may further include memory located remotely from processor 102, which may be connected to a computer terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。Transmission means 106 are used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), 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 (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.

图2是根据本发明实施例的系统交互的处理的网络架构图,如图2所示,该网络架构包括交换系统200和业务系统210,交换系统200用于处理系统中关于交易的交互请求,交互请求为请求对应的业务系统210处理交易,在业务系统210处理交易后,交换系统200接收交易应答,以完成交互请求。交换系统200在检测到交互请求的情况下,利用第一类服务202接收交互请求,第一类服务202为交换系统200中用于接收交互请求的主控服务。控制第一类服务202将交互请求转发至异步框架206,通过异步框架206向业务系统210发送交互请求,异步框架为多线程服务。在交换系统200检测到业务系统210返回的交易应答的情况下,利用第二类服务204接收交易应答,第二类服务204为交换系统中用于接收应答报文的主控服务。FIG. 2 is a network architecture diagram of system interaction processing 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 used for processing interaction requests related to transactions in the system. The interaction request is to request the corresponding business system 210 to process the transaction. After the business system 210 processes the transaction, the exchange system 200 receives the transaction response to complete the interaction request. In the case of detecting the interaction request, the switching system 200 uses the first type of service 202 to receive the interaction request, and the first type of service 202 is the main control service in the switching system 200 for receiving the interaction request. The first type of service 202 is controlled to forward the interaction request to the asynchronous framework 206, and the interaction request is sent to the business system 210 through the asynchronous framework 206. The asynchronous framework is a multi-threaded service. When the switching system 200 detects the transaction response returned by the business system 210, the second type of service 204 is used to receive the transaction response, and the second type of service 204 is the main control service in the switching system for receiving the response message.

图3根据本发明实施例的系统交互的处理方法的流程图,如图3所示,该流程包括如下步骤:FIG. 3 is a flowchart of a method for processing system interaction according to an embodiment of the present invention. As shown in FIG. 3 , the flowchart includes the following steps:

步骤S302,在交换系统检测到目标交互请求的情况下,利用第一类服务接收目标交互请求,其中,目标交互请求用于请求目标业务系统处理目标交易,第一类服务为交换系统中用于接收交互请求的主控服务;Step S302, when the exchange system detects the target interaction request, the first type of service is used to receive the target interaction request, 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 used in the exchange system. The master service that receives interactive requests;

步骤S304,控制第一类服务将目标交互请求转发至异步框架,通过异步框架向目标业务系统发送目标交互请求,其中,异步框架为多线程服务;Step S304, controlling the first type of service to forward the target interaction request to the 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;

步骤S306,在交换系统检测到目标业务系统返回的目标交易应答的情况下,利用第二类服务接收目标交易应答,其中,第二类服务为交换系统中用于接收应答报文的主控服务。Step S306, when the switching system detects the target transaction response returned by the target business system, the second type of service is used to receive the target transaction response, wherein the second type of service is the main control service used to receive the response message in the switching system .

交换系统不限于用于接收系统中的交互请求,通过交换系统与业务系统基于交易进行交互,并通过交换系统接收业务系统返回的交易应答,以确定交易是否成功完成。The exchange system is not limited to receiving interaction requests in the system, but interacts with the business system based on the transaction through the exchange system, and receives the transaction response returned by the business system through the exchange system to determine whether the transaction is successfully completed.

交换系统中不限于设置有用于接收交互请求的第一类服务和用于接收交易应答的第二类服务,通过不同类服务分别接收交互请求和交易应答,实现在有交互需求的情况下,调用服务进行接收,避免交换系统中的服务与交互请求占用。The exchange system is not limited to the first type of service for receiving interaction requests and the second type of service for receiving transaction responses, and the interaction requests and transaction responses are respectively received through different types of services, so that in the case of interaction requirements, calling The service is received to avoid the occupation of services and interaction requests in the switching system.

异步框架不限于为采用异步处理的多线程服务,每个线程相互独立的处理交互请求。利用每个线程处理每个交互请求,在第一类服务接收到交互请求的情况下,通过线程将交互请求转发给业务系统,并基于线程接收业务系统返回的交易应答。The asynchronous framework is not limited to multi-threaded services that use asynchronous processing, and each thread handles interactive requests independently of each other. Each thread is used to process each interaction request. When the first type of service receives the interaction request, the thread forwards the interaction request to the business system, and receives the transaction response returned by the business system based on the thread.

在本发明的上述实施例中,基于在交换系统检测到目标交互请求的情况下,利用第一类服务接收目标交互请求,其中,目标交互请求用于请求目标业务系统处理目标交易,第一类服务为交换系统中用于接收交互请求的主控服务,控制第一类服务将目标交互请求转发至异步框架,通过异步框架向目标业务系统发送目标交互请求,其中,异步框架为多线程服务,在交换系统检测到目标业务系统返回的目标交易应答的情况下,利用第二类服务接收目标交易应答,其中,第二类服务为交换系统中用于接收应答报文的主控服务,在交换系统中利用第一类服务接收请求目标业务系统处理目标交易的交互请求,并将交互请求转发至异步框架,利用异步框架的多线程服务在接收到目标业务系统返回的交易应答时,利用第二类服务接收交易应答,实现了通过异步框架的多线程服务器异步接收交互请求和交互应答,避免线程服务在接收交互请求后直至交互应答完成前被同一交易长时间的占用,提高系统交互的处理效率。因此,可以解决相关技术中系统交互的处理效率低的问题,达到提高系统交互的处理效率的技术效果。In the above-mentioned embodiment of the present invention, when the switching system detects the target interaction request, the first type of service is used to receive the target interaction request, 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 used to receive the target interaction request. The service is the main control service used to receive interaction requests in the exchange system, and controls the first type of service to forward the target interaction request to the asynchronous framework, and sends 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 the target transaction response returned by the target business system, the second type of service is used to receive the target transaction response. The system uses the first type of service to receive the interactive request requesting the target business system to process the target transaction, and forwards the interactive request to the asynchronous framework. The class service receives the transaction response, which realizes the asynchronous reception of the interaction request and the interaction response through the multi-threaded server of the asynchronous framework, avoiding the thread service being occupied by the same transaction for a long time after receiving the interaction request and before the interaction response is completed, and improving the processing efficiency of system interaction . Therefore, the problem of low processing efficiency of system interaction in the related art can be solved, and the technical effect of improving the processing efficiency of system interaction can be achieved.

在一种可选地示例中,上述步骤S302包括:在第一类服务中确定出当前处于空闲状态的第一服务;利用第一服务接收指示目标交互请求的目标请求报文,并保存目标请求报文中携带的目标交易的上下文数据。In an optional example, the above step S302 includes: determining a first service currently in an idle state among the first type of services; using the first service to receive a target request message indicating a target interaction request, and saving the target request Context data of the target transaction carried in the message.

在交换系统接收到交互请求的情况下,利用第一类服务中当前处于空闲状态的第一服务接收交互请求,第一类服务和第二类服务中不限于均包括多个独立的主控服务,用于独立处理接收交互请求或交易应答。在第一服务将交互请求转发给异步框架的情况下,将第一服务由被占用状态调整为空闲状态,从而可以继续接收其他交互请求。In the case that the switching system receives the interaction request, the interaction request is received by using the first service in the first type of service that is currently in an idle state. The first type of service and the second type of service are not limited to include multiple independent master services. , for independent processing of receiving interactive requests or transaction responses. When the first service forwards the interaction request to the asynchronous framework, the first service is adjusted from the occupied state to the idle state, so that other interaction requests can continue to be received.

同样,在接收到交易应答的情况下,利用第二类服务中当前处于空闲状态的第二服务接收交易应答,在将交易应答处理完成后,将第二服务由被占用状态调整为空闲状态,从而可以继续接收其他交易应答。Similarly, in the case of receiving a transaction response, the second service in the second type of service that is currently in an idle state is used to receive the transaction response, and after the transaction response is processed, the second service is adjusted from the occupied state to the idle state, Thus, other transaction replies can continue to be received.

交互请求不限于是交互请求报文,第一服保存用于标识交易的上下文数据不限于是将交易的上下文数据保存至交互请求报文的报文头部。上下文数据不限用于识别交互请求和交易应答,用于指示交易的关联环境。The interaction request is not limited to an interaction request message, and the context data stored in the first server for identifying the transaction is not limited to saving the context data of the transaction in the header of the interaction request message. Context data is not limited to identifying interaction requests and transaction responses, and is used to indicate the context of the transaction.

可选地,不限于使用原子方法Data_SaveKeyData将上下文数据置于交易报文头部,从而将携带有上下文数据的交易报文转发至异步框架,用上下文数据指示交易的关联环境,实现交易与线程解耦。Optionally, it is not limited to use the atomic method Data_SaveKeyData to place the context data in the header of the transaction message, so that the transaction message carrying the context data is forwarded to the asynchronous framework, and the context data is used to indicate the associated environment of the transaction, so as to realize the transaction and thread solution. coupled.

交换系统对交易的处理流程不限于如图4所示。主控A(第一服务)执行请求处理流程,主控B(第二服务)执行应答处理流程交易流程。在接收到交互请求的情况下,确定交易处理流程开始。主控A及小女子交易逻辑处理,并保存上下文数据。将携带有上下文数据的交互报文转发到异步框架。异步框架在接收到交互报文的情况下,发送请求到第三方(业务系统)。异步框架接收第三方应答,并将第三方应答发送给主控B。主控B恢复上下文数据,并进行交易逻辑处理后,给系统的请求方返回应答。至此交易处理流程结束。The transaction processing flow of the exchange system is not limited to that shown in FIG. 4 . The master A (the first service) executes the request processing flow, and the master B (the second service) executes the response processing flow and the transaction flow. In the case of receiving the interaction request, it is determined that the transaction processing flow starts. The main control A and the little girl's transaction logic processing, and save the context data. Forwards interaction packets carrying context data to the asynchronous framework. In the case of receiving the interactive message, the asynchronous framework sends a request to a third party (business system). The asynchronous framework receives the third-party response and sends the third-party response to master B. After master B restores the context data and performs transaction logic processing, it returns a response to the requester of the system. At this point, the transaction processing flow ends.

交易报文的数据格式不限于如下表1所示:The data format of the transaction message is not limited to those shown in Table 1 below:

表1Table 1

Figure BDA0003622550560000091
Figure BDA0003622550560000091

在一种可选地示例中,上述步骤S304包括:控制第一服务将目标请求报文转发至异步框架;控制异步框架中的目标线程解析目标请求报文;在目标请求报文的解析结果满足交互条件的情况下,发送目标请求报文至目标业务系统。In an optional example, the above step S304 includes: controlling the first service to forward the target request message to the asynchronous framework; controlling the target thread in the asynchronous framework to parse the target request message; In the case of interaction conditions, send the target request message to the target service system.

异步框架不限于在启动时通过tuxedo配置文件将服务初始化,使其支持多线程,其中交易线程由Tuxedo中间件提供支持,通过配置属性MINDISPATCHTHREADS以监控线程在异步框架的启动流程中启动。异步框架的启动流程不限于如图5所示。初始化tpinit,解析参数以根据参数设置发布的服务名,设置完成后发布服务,并创建监控线程,交易线程由Tuxedo。监控线程用于监控异步框架中运行的交易线程,交易线程用于接收并转发交互请求以及接收并转发交易应答。The asynchronous framework is not limited to initializing the service through the tuxedo configuration file at startup, so that it supports multi-threading, in which the transaction thread is supported by the Tuxedo middleware, and the configuration property MINDISPATCHTHREADS is used to monitor the startup of the thread in the startup process of the asynchronous framework. The startup process of the asynchronous framework is not limited to that shown in FIG. 5 . Initialize tpinit, parse the parameters to set the published service name according to the parameters, publish the service after the setting is completed, and create a monitoring thread, the transaction thread is by Tuxedo. The monitoring thread is used to monitor the transaction thread running in the asynchronous framework, and the transaction thread is used to receive and forward interactive requests and receive and forward transaction responses.

在一种可选地示例中,上述控制异步框架中的目标线程解析目标请求报文,包括:控制异步框架的目标线程从目标请求报文中解析出指示目标业务系统的系统标识和目标交易时间;在当前时间未超出目标交易时间的情况下,将目标交易的监控信息添加至监控线程的监控链表中,其中,监控线程用于监控异步框架中运行的各个线程。In an optional example, the above-mentioned controlling the target thread in the asynchronous framework to parse the target request message includes: controlling the target thread of the asynchronous framework to parse out the system identifier indicating the target business system and the target transaction time from the target request message ; Under the condition that the current time does not exceed the target transaction time, the monitoring information of the target transaction is added to the monitoring linked list of the monitoring thread, where the monitoring thread is used to monitor each thread running in the asynchronous framework.

通过异步框架中确定出的当前处于空闲状态的目标线程接收并解析请求报文,从请求报文中解析出用于指示业务系统的系统标识,以及用于判断交易是否超时的交易时间。以交易时间为交易超时时刻为例,在当前时间未超出交易时间的情况下,确定交易当前并未超时;在时间超出交易时间的情况下,确定交易已超时。在交易未超时的情况系啊,将交易的监控信息添加至监控线程的监控链表。The request message is received and parsed by the currently idle target thread determined in the asynchronous framework, and the system identifier used to indicate the business system and the transaction time used to judge whether the transaction has timed out are parsed from the request message. Taking the transaction time as the transaction timeout moment as an example, if the current time does not exceed the transaction time, it is determined that the transaction is not currently timed out; if the time exceeds the transaction time, it is determined that the transaction has timed out. If the transaction does not time out, add the monitoring information of the transaction to the monitoring list of the monitoring thread.

监控链表不限于为异步框架中的监控线程监控各个交易线程以及记录各个交易线程的相关信息的链表,记录有各个交易线程的当前状态、接收的交易的监控信息,交易信息等。交易线程在处理交互请求以及接收交易应答时处于运行状态,在未处理交互请求以及接收交易应答时处于空闲状态。The monitoring linked list is not limited to monitoring each transaction thread for the monitoring thread in the asynchronous framework and the linked list that records the relevant information of each transaction thread, and records the current status of each transaction thread, the monitoring information of the received transaction, and the transaction information. The transaction thread is running when processing interactive requests and receiving transaction responses, and is in an idle state when not processing interactive requests and receiving transaction responses.

目标交易的监控信息不限于包括处理目标交易的目标线程的标识以及目标交易时间,以通过监控链表对运行在异步框架中的交易线程进行监控。The monitoring information of the target transaction is not limited to include the identifier of the target thread processing the target transaction and the target transaction time, so as to monitor the transaction thread running in the asynchronous framework through the monitoring linked list.

在一种可选地示例中,在当前时间超出目标交易时间的情况下,释放目标线程;生成指示超时异常的目标应答报文,并将目标应答报文发送给第二类服务,以通过利用第二类服务应答目标交互请求。In an optional example, when the current time exceeds the target transaction time, the target thread is released; a target response message indicating a timeout exception is generated, and the target response message is sent to the second type of service, so as to use the The second type of service responds to the target interaction request.

在当前时间超出目标交易时间,也就是目标交易当前超时的情况下,释放处理目标交易的目标线程,并生成指示交易超时异常的应答报文,从而指示在指示的目标交易时间内并完成目标交易。When the current time exceeds the target transaction time, that is, the target transaction currently times out, the target thread processing the target transaction is released, and a response message indicating the transaction timeout exception is generated, thereby indicating that the target transaction is completed within the indicated target transaction time. .

在当前时间未超出目标交易时间,也就是目标交易当前未超时的情况下,在将目标交易的监控信息记录在监控链表的同时,利用目标线程将交互请求发送给交互请求所指示的第三方业务系统,以指示业务系统处理目标交易。When the current time does not exceed the target transaction time, that is, the target transaction does not currently time out, while recording the monitoring information of the target transaction in the monitoring linked list, the target thread is used to send the interaction request to the third-party service indicated by the interaction request. system to instruct the business system to process the target transaction.

在将交互请求发送给第三方业务系统后,异步框架不限于通过监控线程对监控链表进行处理,以明确当前正在处理交易的交易线程是否超时。After sending the interactive request to the third-party business system, the asynchronous framework is not limited to processing the monitoring linked list through the monitoring thread to determine whether the transaction thread currently processing the transaction times out.

在一种可选地示例中,控制监控线程每历经目标时间,对监控链表进行链表处理,包括:In an optional example, the control monitoring thread performs linked list processing on the monitoring linked list every time the target time elapses, including:

S1,将监控链表调整为锁定状态,其中,监控链表在锁定状态不响应对监控链表执行的调整操作;S1, 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;

S2,判断监控链表是否为空链表;S2, determine whether the monitoring linked list is an empty linked list;

S3,,在监控链表不为空链表的情况下,依次判断监控链表中每个监控信息是否超出当前时间;S3, in the case that the monitoring linked list is not an empty linked list, judge in turn whether each monitoring information in the monitoring linked list exceeds the current time;

S4,在监控信息超出当前时间的情况下,指示监控线程关闭监控信息对应的线程;S4, in the case that the monitoring information exceeds the current time, instruct the monitoring thread to close the thread corresponding to the monitoring information;

S5,在监控链表为空链表或在遍历每个监控信息之后,将监控链表调整为解锁状态,其中,监控链表在解锁状态响应对监控链表执行的调整操作。S5 , after the monitoring linked list is an empty linked list or after traversing each monitoring information, adjust 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.

监控线程通过每历经目标时间就对监控链表执行上述步骤的处理,判断监控链表中每个监控信息是否超出当前时间,以判断当前运行的各个线程的交易是否超时,在发现交易超时的情况下,及时关闭超时交易对应的线程以释放线程资源,避免交易长时间占用线程。The monitoring thread performs the above steps on the monitoring linked list every time the target time elapses, and judges whether each monitoring information in the monitoring linked list exceeds the current time, so as to judge whether the transaction of each currently running thread has timed out. Close the thread corresponding to the timeout transaction in time to release thread resources and avoid the transaction occupying the thread for a long time.

监控链表中记录的是正在运行状态的交易线程,也就是当前被交易占用的线程。在交易线程处于空闲状态的情况下,并不记录在监控链表中。The transaction thread in the running state is recorded in the monitoring list, that is, the thread currently occupied by the transaction. When the transaction thread is in an idle state, it is not recorded in the monitoring list.

监控线程对监控链表的处理不限于如图6所示。开始获取当前时间,对监控链表进行加锁,使得监控链表处于锁定状态状态,判断链表是否为空。在判断确定链表为空,也就是当前没有正在运行的交易线程,没有正在处理的交易请求的情况下,解锁监控链表。在判断确定链表不为空,当前有正在运行的交易进程的情况下,依次判断交易是否超时。对每个交易依次判断交易是否超时,在判断出确定交易超时的情况下,关闭超时交易线程。在对链表中全部交易判断完毕后,加锁监控链表。休眠目标时间的时长,在休眠过后重新执行上述步骤,对监控链表进行下一轮次的处理。The processing of the monitoring linked list by the monitoring thread is not limited to that shown in FIG. 6 . Start to obtain the current time, lock the monitoring linked list, make the monitoring linked list in a locked state, and judge whether the linked list is empty. When it is determined that the linked list is empty, that is, there is no running transaction thread and no transaction request being processed, the monitoring linked list is unlocked. When it is determined that the linked list is not empty and there are currently running transaction processes, it is determined in turn whether the transaction times out. For each transaction, it is judged whether the transaction has timed out in turn, and if it is determined that the transaction has timed out, the timeout transaction thread is closed. After judging all transactions in the linked list, lock and monitor the linked list. The duration of the sleep target time, the above steps are re-executed after the sleep, and the next round of processing is performed on the monitoring linked list.

可选地,在将目标交易的监控信息写入监控链表时同样对监控链表执行加锁操作,以保证在同一时间段在监控链表中只针对一个线程的信息进行更改。在交易线程关闭以及释放的情况下,在监控链表中删除该交易线程对应的监控信息。Optionally, a locking operation is also performed on the monitoring linked list when the monitoring information of the target transaction is written into the monitoring linked list, so as to ensure that only the information of one thread is changed in the monitoring linked list in the same time period. When the transaction thread is closed and released, the monitoring information corresponding to the transaction thread is deleted from the monitoring linked list.

在一种可选地示例中,在交换系统检测到目标交易应答且目标线程运行正常的情况下,利用目标线程获取指示目标交易应答的目标应答报文;控制目标线程在目标应答报文中添加目标交易的上下文数据,并将添加了目标交易的上下文数据的目标应答报文转发给第二类服务;释放目标线程。In an optional example, when the switching system detects the target transaction response and the target thread is running normally, the target thread is used to obtain a target response message indicating the target transaction response; the target thread is controlled to add the target response message Context data of the target transaction, and forward the target response message added with the context data of the target transaction to the second type of service; release the target thread.

在接收到交易应答的情况下,首先判断目标线程是否运行正常,在目标线程运行正常的情况下,利用目标线程获取应答报文;在目标线程运行异常的情况下,不限于以异常的应答报文应答交互请求。In the case of receiving a transaction response, first determine whether the target thread is running normally. If the target thread is running normally, use the target thread to obtain the response message; if the target thread is running abnormally, it is not limited to reporting an abnormal response. text to respond to interactive requests.

在一种可选地示例中,在交换系统检测到目标交易应答且目标线程运行异常的情况下,释放目标线程,并生成指示目标线程异常的目标应答报文;将目标应答报文发送给第二类服务,以通过利用第二类服务应答目标交互请求。In an optional example, 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 the abnormality of the target thread is generated; the target response message is sent to the first Class II service to respond to the target interaction request by utilizing the second class service.

在目标线程运行异常的情况下,释放目标线程并生成指示线程异常的应答报文以应答交互请求。In the case that the target thread runs abnormally, the target thread is released and a response message indicating the abnormality of the thread is generated to answer the interaction request.

异步框架中的目标线程对交互请求以及交易应答的处理流程不限于如图7所示。接收请求报文的情况下,解析报文,获取上下文数据。从请求报文中获取第三方服务比桥式和超时时间。判断交易是否超时,在判断出交易超时的情况下,释放线程,并生成指示交易超时的异常报文。在判断交易未超时的情况下,将交易信息添加到监控链表。将交易请求转发给第三方服务以获取第三方服务返回的交易应答。在获取到交易应答的情况下,判断线程运行是否正常。在判断出线程运行正常的情况下,通过交易应答拼接上下文数据,得到应答报文。将应答报文发送给第二服务以应答交互请求。在判断出线程运行异常的情况下,释放线程,并生成指示线程异常的应答报文。The processing flow of the interactive request and the transaction response by the target thread in the asynchronous framework is not limited to that shown in FIG. 7 . When receiving a request message, parse the message to obtain context data. Obtaining third-party services from the request message is faster than bridge and timeout. Determine whether the transaction has timed out. In the case of judging that the transaction has timed out, release the thread and generate an exception message indicating that the transaction has timed out. In the case of judging that the transaction has not timed out, add the transaction information to the monitoring list. Forward the transaction request to the third-party service to obtain the transaction response returned by the third-party service. In the case of obtaining the transaction response, it is judged whether the thread is running normally. When it is judged that the thread is running normally, the context data is spliced through the transaction response to obtain a response message. Send the response message to the second service to respond to the interaction request. When it is determined that the thread is running abnormally, the thread is released, and a response message indicating the abnormality of the thread is generated.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器(Read-Only Memory/Random Access Memory,ROM/RAM)、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products that are essentially or contribute to the prior art, and the computer software products are stored in a storage medium (such as read-only memory/random access). The memory (Read-Only Memory/Random Access Memory, ROM/RAM), magnetic disk, CD-ROM) includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the present invention The methods described in the various examples.

在本实施例中还提供了一种系统交互的处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a system interaction processing apparatus is also provided, and the apparatus is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.

图8是根据本发明实施例的系统交互的处理装置的结构框图,如图8所示,该装置包括:FIG. 8 is a structural block diagram of an apparatus for processing system interaction according to an embodiment of the present invention. As shown in FIG. 8 , the apparatus includes:

请求接收单元802,用于在交换系统检测到目标交互请求的情况下,利用第一类服务接收目标交互请求,其中,目标交互请求用于请求目标业务系统处理目标交易,第一类服务为交换系统中用于接收交互请求的主控服务;The request receiving unit 802 is configured to receive the target interaction request by using the first type of service when the exchange system detects the target interaction request, 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 the exchange The main control service in the system for receiving interactive requests;

转发单元804,用于控制第一类服务将目标交互请求转发至异步框架,通过异步框架向目标业务系统发送目标交互请求,其中,异步框架为多线程服务;A forwarding unit 804, configured to control the first type of service to forward the target interaction request to the asynchronous framework, and send the target interaction request to the target business system through the asynchronous framework, wherein the asynchronous framework is a multi-threaded service;

应答接收单元806,用于在交换系统检测到目标业务系统返回的目标交易应答的情况下,利用第二类服务接收目标交易应答,其中,第二类服务为交换系统中用于接收应答报文的主控服务。The response receiving unit 806 is configured to receive the target transaction response by using the second type of service when the switching system detects the target transaction response returned by the target service system, wherein the second type of service is used in the switching system to receive the response message the master service.

上述请求接收单元802还包括:The above request receiving unit 802 also includes:

确定模块,用于在第一类服务中确定出当前处于空闲状态的第一服务;a determining module, configured to determine the first service currently in an idle state in the first type of service;

接收模块,用于利用第一服务接收指示目标交互请求的目标请求报文,并保存目标请求报文中携带的目标交易的上下文数据。The receiving module is configured to use the first service to receive a target request message indicating a target interaction request, and save the context data of the target transaction carried in the target request message.

上述转发单元804包括:The above-mentioned forwarding unit 804 includes:

转发模块,用于控制第一服务将目标请求报文转发至异步框架;a forwarding module, configured to control the first service to forward the target request message to the asynchronous framework;

解析模块,用于控制异步框架中的目标线程解析目标请求报文;The parsing module is used to control the target thread in the asynchronous framework to parse the target request message;

发送模块,用于在目标请求报文的解析结果满足交互条件的情况下,发送目标请求报文至目标业务系统。The sending module is configured to send the target request message to the target service system under the condition that the parsing result of the target request message satisfies the interaction condition.

上述解析模块还用于控制异步框架的目标线程从目标请求报文中解析出指示目标业务系统的系统标识和目标交易时间;在当前时间未超出目标交易时间的情况下,将目标交易的监控信息添加至监控线程的监控链表中,其中,监控线程用于监控异步框架中运行的各个线程。The above parsing module is also used to control the target thread of the asynchronous framework to parse out the system identifier indicating the target business system and the target transaction time from the target request message; if the current time does not exceed the target transaction time, the monitoring information of the target transaction is parsed. It is added to the monitoring linked list of the monitoring thread, where the monitoring thread is used to monitor each thread running in the asynchronous framework.

该装置除包括图8所示的所有模块外,还包括释放单元,用于在当前时间超出目标交易时间的情况下,释放目标线程;生成指示超时异常的目标应答报文,并将目标应答报文发送给第二类服务,以通过利用第二类服务应答目标交互请求。In addition to all the modules shown in Figure 8, the device also includes a release unit, which is used to release the target thread when the current time exceeds the target transaction time; generate a target response message indicating an abnormal timeout, and report the target response to the The message is sent to the second type of service to respond to the target interaction request by utilizing the second type of service.

该装置除包括图8所示的所有模块外,还包括监控单元,用于控制监控线程每历经目标时间,对监控链表进行链表处理,包括:将监控链表调整为锁定状态,其中,监控链表在锁定状态不响应对监控链表执行的调整操作;判断监控链表是否为空链表;在监控链表不为空链表的情况下,依次判断监控链表中每个监控信息是否超出当前时间;在监控信息超出当前时间的情况下,指示监控线程关闭监控信息对应的线程;在监控链表为空链表或在遍历每个监控信息之后,将监控链表调整为解锁状态,其中,监控链表在解锁状态响应对监控链表执行的调整操作。In addition to all the modules shown in FIG. 8, the device also includes a monitoring unit, which is used to 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 is in the locked state. The lock state does not respond to the adjustment operation performed on the monitoring linked list; judge whether the monitoring linked list is an empty linked list; if the monitoring linked list is not an empty linked list, judge whether each monitoring information in the monitoring linked list exceeds the current time in turn; when the monitoring information exceeds the current time In the case of time, the monitoring thread is instructed to close the thread corresponding to the monitoring information; after the monitoring linked list is an empty linked list or after traversing each monitoring information, the monitoring linked list is adjusted to the unlocked state, wherein the monitoring linked list responds to the monitoring linked list in the unlocked state. adjustment operation.

上述应答接收单元806还包括:The above-mentioned response receiving unit 806 also includes:

获取模块,用于在交换系统检测到目标交易应答且目标线程运行正常的情况下,利用目标线程获取指示目标交易应答的目标应答报文;The acquisition module is used to obtain the target response message indicating the target transaction response by using the target thread when the exchange system detects the target transaction response and the target thread operates normally;

添加模块,用于控制目标线程在目标应答报文中添加目标交易的上下文数据,并将添加了目标交易的上下文数据的目标应答报文转发给第二类服务;The adding module is used to control the target thread to add the context data of the target transaction in 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 module, used to release the target thread.

该装置除包括图8所示的所有模块外,还包括异常单元,用于在交换系统检测到目标交易应答且目标线程运行异常的情况下,释放目标线程,并生成指示目标线程异常的目标应答报文;将目标应答报文发送给第二类服务,以通过利用第二类服务应答目标交互请求。In addition to all the modules shown in FIG. 8 , the device also includes an exception unit, which is used to release the target thread and generate a target response indicating that the target thread is abnormal when the switching system detects the target transaction response and the target thread runs abnormally. message; send the target response message to the second type of service to respond to the target interaction request by using the second type of service.

需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.

本发明的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to, a USB flash drive, a read-only memory (Read-Only Memory, referred to as ROM for short), and a random access memory (Random Access Memory, referred to as RAM for short) , mobile hard disk, magnetic disk or CD-ROM and other media that can store computer programs.

本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides an electronic device, comprising a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.

本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and exemplary implementation manners, and details are not described herein again in this embodiment.

显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices On the other hand, they can be implemented in program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, can be performed in a different order than shown here. Or the described steps, or they are respectively made into individual integrated circuit modules, or a plurality of modules or steps in them are made into a single integrated circuit module to realize. As such, the present invention is not limited to any particular combination of hardware and software.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included within 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 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 true CN114900451A (en) 2022-08-12
CN114900451B 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 (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

Also Published As

Publication number Publication date
CN114900451B (en) 2024-12-03

Similar Documents

Publication Publication Date Title
MXPA04002727A (en) Availability and scalability in a messaging system in a manner transparent to the application.
CN114172829B (en) Server health monitoring method and system and computing equipment
CN107517227B (en) Session implementation method and device for distributed consistency system
WO2019024679A1 (en) Method for upgrading network function and upgrade management entity
CN106657299B (en) The method and system for reminding the anchor to go online
CN110674028A (en) Fault injection method and device thereof, and business service system
CN112783672A (en) Remote procedure call processing method and system
CN111367479A (en) Cloud printing method, printing method of cloud printing service platform and storage medium
CN114900449A (en) Resource information management method, system and device
US8352623B2 (en) System for energy efficient computer management environment via tightly integrated target status and directed work sessions
CN109818977B (en) An access server communication optimization method, access server and communication system
US11102293B2 (en) System and method for migrating an agent server to an agent client device
CN1939035A (en) Method and apparatus for communicating data between computer devices
WO2024103943A1 (en) Service processing method and apparatus, storage medium, and device
CN104683460A (en) A communication method, device and server for the Internet of Things
CN114900451A (en) System interaction processing method and device, storage medium and electronic device
CN117336346A (en) IPPBX and PMS docking state conversion method, terminal equipment and medium
CN113660178B (en) CDN content management system
CN110750369B (en) A distributed node management method and system
CN114615284A (en) Method and device for notifying and receiving messages in cluster
EP1956798A2 (en) Integrating Eventing in a Web Service Application of a Multi-Functional Peripheral
CN110392017B (en) Method and related device for processing RPC message
CN112866359A (en) Data uplink method, device, electronic equipment and storage medium
US7904917B2 (en) Processing fast and slow SOAP requests differently in a web service application of a multi-functional peripheral
US20040059964A1 (en) Method for notification of an error in data exchanged between a client and a server

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