CN107741885B - Transaction and service association method and system based on CS framework - Google Patents

Transaction and service association method and system based on CS framework Download PDF

Info

Publication number
CN107741885B
CN107741885B CN201710930462.7A CN201710930462A CN107741885B CN 107741885 B CN107741885 B CN 107741885B CN 201710930462 A CN201710930462 A CN 201710930462A CN 107741885 B CN107741885 B CN 107741885B
Authority
CN
China
Prior art keywords
information
service
transaction
response
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.)
Active
Application number
CN201710930462.7A
Other languages
Chinese (zh)
Other versions
CN107741885A (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.)
Yonyou Network Technology Co Ltd
Original Assignee
Yonyou Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yonyou Network Technology Co Ltd filed Critical Yonyou Network Technology Co Ltd
Priority to CN201710930462.7A priority Critical patent/CN107741885B/en
Publication of CN107741885A publication Critical patent/CN107741885A/en
Application granted granted Critical
Publication of CN107741885B publication Critical patent/CN107741885B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides a transaction and service association method based on a CS (circuit switched) architecture, an association system, computer equipment and a computer readable storage medium. The transaction and service association method based on the CS architecture comprises the following steps: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information. On one hand, the slow service function realized on the basis of the service associated transaction can develop a plurality of function points taking the service as the concerned dimension; on the other hand, when a user finds a slow business, the user can locate the problem by checking the number of background affairs or the details of the affairs which occur under the business, and the focus of the system is clear at a glance.

Description

Transaction and service association method and system based on CS framework
Technical Field
The invention relates to the technical field of computers, in particular to a transaction and service association method based on a CS (circuit switched) architecture, a transaction and service association system based on the CS architecture, computer equipment and a computer readable storage medium.
Background
In the process of continuously integrating the software system, the system becomes more and more large, and the number of remote calls required by single service operation is increased. However, the requirement of the user on efficiency is not reduced, so that a system developer needs to be able to quickly locate and optimize the slow reason when the system is slow, and further, the user experience is improved.
In existing APM products, the dimension of monitoring mostly stays in the transaction. Slow transaction information inherently solves the performance problem at a certain level, but does not directly reflect the system speed experienced by the user. For example, a single business operation may include tens of thousands of repeated short, time-consuming transactions. At this point the user feedback system is slow, but the developer is faced with a short time consuming transaction and cannot accurately locate the source of the problem.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art or the related art.
To this end, a first aspect of the present invention is to provide a method for associating transactions and services based on a CS architecture.
A second aspect of the present invention is to provide a CS architecture-based transaction and service association system.
A third aspect of the invention is directed to a computer device.
A fourth aspect of the present invention is directed to a computer-readable storage medium.
In view of the above, according to an aspect of the present invention, a method for associating transactions and services based on a CS architecture is provided, including: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information.
According to the transaction and service association method based on the CS framework, when a user opens a node or clicks a button, an instruction of a client is received, the instruction enters a response event bound with the instruction, the client generates a service message at the beginning of the response event, the service message comprises a globally unique service code ID, the calling message of each remote call generated in the process of responding to the event is recorded, and the transaction messages corresponding to all remote calls generated under the service are bound with the service message, so that the binding of the transaction and the service is realized, the slow service function realized on the basis of the service association transaction can be developed into a plurality of function points taking the service as the concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
The transaction and service association method based on the CS architecture according to the present invention may further have the following technical features:
in the above technical solution, preferably, executing the response event, generating the service information, and recording remote invocation information generated in the process of executing the response event, specifically include: dispatching the response event to the thread to generate service information; creating a local variable in the thread; and recording the service information and the remote calling information in a local variable.
In the technical scheme, the execution of the method for responding to the event is in an Event Dispatch Thread (EDT), at the moment, the business information is generated, a local variable is created in the EDT thread, the local variable is used for storing business and transaction information, and the information of each remote call is recorded in the local variable during the response period, so that the remote call information of a certain business line is recorded.
In any of the above technical solutions, preferably, the binding the transaction information corresponding to the remote invocation information with the service information specifically includes: determining a response type according to a thread in which the remote call is located in the response event; and binding the transaction information corresponding to the remote calling information with the service information in a corresponding mode according to the response type.
In the technical scheme, response types are distinguished in the binding process of the transaction information and the service information corresponding to the remote call information, because in synchronous response, the end of a response method is the end of service operation, and in asynchronous response, other buttons can still be clicked while time-consuming tasks are performed in the background, therefore, different modes are required to bind the transaction information and the service information corresponding to the remote call information aiming at the synchronous response and the asynchronous response, so that the transaction and the service can be correctly bound no matter the synchronous response and the asynchronous response. In particular, the response type is determined based on the thread in which the remote invocation is located in the response event.
In any of the above technical solutions, preferably, the binding the transaction information corresponding to the remote invocation information with the service information in a corresponding manner according to the response type specifically includes: when the type of the response is synchronous response, acquiring transaction information corresponding to all the remotely called information in the local variable; and directly binding the transaction information with the service information.
In the technical scheme, when the type of the response is the synchronous response, the process of binding the transaction information corresponding to the remote invocation information and the service information specifically comprises the following steps: the method comprises the steps of firstly obtaining transaction information corresponding to all remote calling information in a local variable, wherein the end of a response method is the end of business operation, when the response method is ended, the local variable records all remote calling information, and then when the event response method is ended, directly binding the business information with the transaction information corresponding to all the remote calling information.
In any of the above technical solutions, preferably, the binding the transaction information corresponding to the remote invocation information with the service information in a corresponding manner according to the response type further includes: when the type of the response is asynchronous response, judging the request type of remote call; when the request type is a synchronous foreground request with business significance but the local variable has no recorded business information and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not the current business information, establishing another local variable to store the new business information and binding the transaction information corresponding to the current remote call information with the new business information; when the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is current service information, directly binding the transaction information corresponding to the current remote calling information with the service information; and controlling not to bind the request service information when the request type is a background request with non-service meaning and a request with an unknown type.
In the technical scheme, when the type of the response is asynchronous, other buttons can still be clicked while time-consuming tasks are performed in the background, so that various situations exist, and different request types are bound in different manners. The process of binding the transaction information corresponding to the remote call information and the service information specifically comprises the following steps: firstly, judging the type of a remote call request, if the request is a synchronous foreground request with service significance but the local variable has no recorded service information and/or the request type is an asynchronous foreground request with service significance but the service information recorded by the local variable is not the current service information, and if the two requests do not record corresponding current service information in the current local variable, creating a new local variable, storing the new service information in the new local variable, and binding the transaction information corresponding to the current remote call information with the new service information, thereby realizing the binding of the transaction information corresponding to the current remote call information with the current service information. If the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is the current service information, the current local variable is the service information corresponding to the current remote call information, and then the transaction information corresponding to the current remote call information is directly bound with the service information. If the remote invocation information does not need to be bound with the service when the request type is a background request with non-service meaning and a request with an unknown type, namely when the current remote invocation has no service meaning and the request with the unknown type, the service information is controlled with the request. Therefore, when the response type is asynchronous, different modes of binding are respectively carried out on different request types and the binding is not controlled when the binding is not needed, so that the correct binding of the service information and the transaction information which is generated when the service is loved is realized.
In any of the above technical solutions, preferably, the service information includes one or a combination of the following: the method comprises the following steps that (1) a service code ID, total service operation time, a service operator, service operation time and a node button name of service operation are obtained; the transaction information includes one or a combination of the following: transaction code ID, transaction elapsed time, remote invocation process, type of remote invocation, name of remote invocation, time of remote invocation.
In the technical scheme, the remote invocation of the service is known through detailed service information and transaction information, network time consumption and background transaction time consumption contained in each remote invocation can be quickly searched through a service coding ID, all the remote invocations bound with the serial number ID can be quickly found through the service coding ID, the speed reflected by a feedback system is intuitive when the service is totally consumed, for the transaction which is found to be long in time consumption, the transaction details of the transaction can be directly penetrated to perform problem location, and the following transaction components of the service can be intuitively seen: the total time consumption is caused by a plurality of transactions, or caused by overlong time consumption of single transaction, or caused by overlong time consumption of network.
According to a second aspect of the present invention, a CS architecture-based transaction and service association system is provided, which includes: the access unit is used for receiving a client instruction and executing the instruction to access a response event bound with the instruction; the recording unit is used for executing the response event, generating the service information and recording the remote calling information generated in the process of executing the response event; and the binding unit is used for binding the transaction information corresponding to the remote calling information with the service information.
According to the transaction and service correlation system based on the CS framework, the access unit receives the instruction of the client when a user opens a node or clicks a button, and executes a response event of the instruction to be bound with the instruction, the client generates service information at the beginning of the response event, the service information comprises a globally unique service code ID, the call information of each remote call generated by the recording unit in the process of responding to the event is recorded, and the binding unit binds the transaction information corresponding to all remote calls generated under the service with the service information, so that the binding of the transaction and the service is realized, and further, the slow service function realized on the basis of the service correlation transaction can develop a plurality of function points taking the service as a concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
The transaction and service association system based on the CS architecture according to the present invention may further have the following technical features:
in the above technical solution, preferably, the recording unit specifically includes: the dispatching unit is used for dispatching the response event to the thread to generate service information; the creating unit is used for creating a local variable in the thread; and the recording subunit is used for recording the service information and the remote calling information in the local variable.
In the technical scheme, a dispatching unit dispatches a response event to an Event Dispatching Thread (EDT), at the moment, service information is generated, a creating unit creates a local variable in the EDT thread, the local variable is used for storing service and transaction information, and information of each remote call is recorded in the local variable during the response period of a recording subunit, so that the remote call information of a certain service line is recorded.
In any of the above technical solutions, preferably, the binding unit specifically includes: the determining unit is used for determining the response type according to the thread where the remote call is positioned in the response event; and the classification binding unit is used for binding the transaction information corresponding to the remote calling information with the service information in a corresponding mode according to the response type.
In the technical scheme, the binding unit distinguishes response types in the binding process of the transaction information and the service information corresponding to the remote call information, because in synchronous response, the end of the response method is the end of service operation, and in asynchronous response, time-consuming tasks are performed in the background while other buttons can still be clicked, therefore, the classification binding unit needs to adopt different modes to bind the transaction information and the service information corresponding to the remote call information aiming at the synchronous response and the asynchronous response, so that the transaction and the service can be correctly bound no matter the synchronous response and the asynchronous response. The specific determination unit determines the response type according to the thread in which the remote call is positioned in the response event.
In any of the above technical solutions, preferably, the classification and binding unit specifically includes: the obtaining unit is used for obtaining the transaction information corresponding to all the remotely called information in the local variable when the type of the response is synchronous response; and the first binding subunit is used for directly binding the transaction information with the service information.
In the technical scheme, when the type of the response is the synchronous response, the process of binding the transaction information corresponding to the remote invocation information and the service information specifically comprises the following steps: the method comprises the steps that firstly, an acquisition unit acquires transaction information corresponding to all remotely called information in a local variable, the end of a response method is the end of business operation, when the response method is ended, the local variable records all remotely called information, and then, a first binding subunit directly binds the business information and the transaction information corresponding to all the remotely called information when the execution of an event response method is ended.
In any of the above technical solutions, preferably, the classification and binding unit further includes: the judging unit is used for judging the request type of remote calling when the response type is asynchronous response; the second binding subunit is used for creating another local variable to store new service information and binding the transaction information corresponding to the current remotely called information with the new service information when the request type is a synchronous foreground request with service significance but the local variable does not have recorded service information and/or the request type is an asynchronous foreground request with service significance but the service information recorded by the local variable is not current service information; the third binding subunit is used for directly binding the transaction information corresponding to the current remote call information with the service information when the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is the current service information; and the control unit is used for controlling the unbound request service information when the request type is a background request with non-service significance and a request with an unknown type.
In the technical scheme, when the type of the response is asynchronous, other buttons can still be clicked while time-consuming tasks are performed in the background, so that various situations exist, and different request types are bound in different manners. The process of binding the transaction information corresponding to the remote call information and the service information specifically comprises the following steps: firstly, a judging unit judges the type of a remote call request, if the request is a synchronous foreground request with service significance but the local variable has no recorded service information and/or the request type is an asynchronous foreground request with service significance but the service information recorded by the local variable is not current service information, and the current local variables of the two requests have no recorded corresponding current service information, a second binding subunit is required to create a new local variable, store the new service information in the new local variable, and bind the transaction information corresponding to the current remote call information with the new service information, so that the binding of the transaction information corresponding to the current remote call information with the current service information is realized. If the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is the current service information, it indicates that the current local variable is the service information corresponding to the current remote call information, then the third binding subunit directly binds the transaction information corresponding to the current remote call information with the service information. If the remote invocation information does not need to be bound to the service when the request type is a non-service-meaningful background request and an unknown type of request, i.e. when the current remote invocation is not service-meaningful and when the request is of unknown type, the control unit controls the service information and the request. Therefore, when the response type is asynchronous, different modes of binding are respectively carried out on different request types and the binding is not controlled when the binding is not needed, so that the correct binding of the service information and the transaction information which is generated when the service is loved is realized.
In any of the above technical solutions, preferably, the service information includes one or a combination of the following: the method comprises the following steps that (1) a service code ID, total service operation time, a service operator, service operation time and a node button name of service operation are obtained; the transaction information includes one or a combination of the following: transaction code ID, transaction elapsed time, remote invocation process, type of remote invocation, name of remote invocation, time of remote invocation.
In the technical scheme, the remote invocation of the service is known through detailed service information and transaction information, network time consumption and background transaction time consumption contained in each remote invocation can be quickly searched through a service coding ID, all the remote invocations bound with the serial number ID can be quickly found through the service coding ID, the speed reflected by a feedback system is intuitive when the service is totally consumed, for the transaction which is found to be long in time consumption, the transaction details of the transaction can be directly penetrated to perform problem location, and the following transaction components of the service can be intuitively seen: the total time consumption is caused by a plurality of transactions, or caused by overlong time consumption of single transaction, or caused by overlong time consumption of network.
According to a third aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information.
The invention provides a computer device, which realizes that when a processor executes a computer program: when a user opens a node or clicks a button, receiving an instruction of a client, executing the instruction to enter a response event bound with the instruction, generating service information at the beginning of the response event by the client, wherein the service information comprises a globally unique service code ID, recording the call information of each remote call generated in the process of responding to the event, and binding the transaction information corresponding to all remote calls generated under the service with the service information, so that the binding of the service and the transaction is realized, and further, a slow service function realized on the basis of the service-associated transaction can develop a plurality of function points taking the service as a concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
According to a fourth aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements: when a user opens a node or clicks a button, receiving an instruction of a client, executing the instruction to enter a response event bound with the instruction, generating service information at the beginning of the response event by the client, wherein the service information comprises a globally unique service code ID, recording the call information of each remote call generated in the process of responding to the event, and binding the transaction information corresponding to all remote calls generated under the service with the service information, so that the binding of the service and the transaction is realized, and further, a slow service function realized on the basis of the service-associated transaction can develop a plurality of function points taking the service as a concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart diagram illustrating a method for associating transactions with services based on a CS framework according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an operation result after a service operation is performed by a user according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating performance data of a service after the service is associated with a transaction after one service operation by a user according to an embodiment of the present invention;
FIG. 4 shows a schematic diagram of a front-end presentation for one business operation of an embodiment of the invention;
FIG. 5 is a diagram illustrating transaction information included in a business operation according to one embodiment of the invention;
FIG. 6 is a transaction detail diagram illustrating a transaction included in a business operation of one embodiment of the invention;
FIG. 7 is a schematic diagram illustrating a transaction and service association principle based on a CS architecture according to an embodiment of the present invention;
FIG. 8 is a flow diagram illustrating a method for associating transactions with services based on a CS framework according to another embodiment of the present invention;
FIG. 9 is a diagram illustrating association of a transaction with a service in a synchronous response according to an embodiment of the invention;
FIG. 10 is a diagram illustrating association of transactions with services in an asynchronous response according to an embodiment of the invention;
FIG. 11 is a flowchart illustrating a method for determining a type of remote call request in an asynchronous response, in accordance with an embodiment of the present invention;
FIG. 12 is a schematic block diagram illustrating a transaction and service association system based on a CS architecture, according to an embodiment of the present invention;
FIG. 13 shows a schematic block diagram of a computer device of an embodiment of the present invention.
Detailed Description
So that the manner in which the above recited aspects, features and advantages of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to the embodiments thereof which are illustrated in the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
An embodiment of the first aspect of the present invention provides a CS architecture-based transaction and service association method, and fig. 1 shows a flow diagram of the CS architecture-based transaction and service association method according to an embodiment of the present invention:
step 102, receiving a client instruction, and executing the instruction to enter a response event bound with the instruction;
step 104, executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event;
and step 106, binding the transaction information corresponding to the remote calling information with the service information.
According to the transaction and service association method based on the CS framework, when a user opens a node or clicks a button, an instruction of a client is received, the instruction enters a response event bound with the instruction, the client generates a service message at the beginning of the response event, the service message comprises a globally unique service code ID, the calling message of each remote call generated in the process of responding to the event is recorded, the transaction messages corresponding to all remote calls generated under the service are bound with the service messages, after the user performs a service operation as shown in figure 2, the probe code sends the service message which is already associated with the transaction to a cloud terminal through a network communication API for calculation, aggregation and storage, and the sent data are shown in figure 3. At this time, as shown in fig. 4, the front end may display the current service operation, so as to implement binding between the transaction and the service, and further implement a slow service function based on the service-related transaction, so that a plurality of function points using the service as a concerned dimension may be evolved; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; as shown in FIG. 5, the transaction information included in a certain business operation is penetrated, all remote calling information under the business operation, such as calling times, calling time and the like, is known, the time consumed by the business operation is visually seen, the problem is found out more timely, and the system problem is killed in the cradle before the complaint occurs to the user. It is also possible to look at information of a transaction under a business to see details of the transaction, as shown in fig. 6. The principle of the CS architecture-based transaction and service association method of this embodiment is shown in fig. 7, and finally the Client sends the service information bound with the transaction id, and the Server sends the transaction information bound with the service id, thereby implementing bidirectional binding between the transaction and the service.
Fig. 8 is a flowchart illustrating a CS architecture-based transaction and service association method according to another embodiment of the present invention. Wherein, the method comprises the following steps:
step 802, receiving a client instruction, and executing the instruction to enter a response event bound with the instruction;
step 804, dispatching the response event to the thread to generate service information;
step 806, creating a local variable in the thread;
step 808, recording the service information and the remote calling information in a local variable;
step 810, determining a response type according to the thread in which the remote call is positioned in the response event;
step 812, when the type of the response is synchronous response, acquiring transaction information corresponding to all the remotely called information in the local variable;
step 814, directly binding the transaction information with the service information;
step 816, when the type of the response is asynchronous, judging the request type of the remote call;
step 818, when the request type is a synchronous foreground request with business significance but the local variable has no recorded business information yet and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not the current business information, then another local variable is newly created to store the new business information and the business information corresponding to the current remote call information is bound with the new business information;
step 820, when the request type is an asynchronous foreground request with business significance and the business information recorded by the local variable is the current business information, directly binding the transaction information corresponding to the current remote call information with the business information;
step 822, controlling not to bind the request service information when the request type is a background request with non-service meaning and a request with unknown type.
In the embodiment, the execution of the method responding to the event is in an Event Dispatch Thread (EDT), at the moment, the business information is generated, a local variable is created in the EDT thread, the local variable is used for storing business and transaction information, and the information of each remote call is recorded into the local variable during the response period, so that the recording of the information of the remote call of a certain business line is realized.
In this embodiment, the response type is to be distinguished in the binding process of the transaction information corresponding to the remote invocation information and the service information, and the synchronous response mechanism is as follows: in a GUI-equipped client, a button's synchronous response means that all remote calls are made in sequence in the EDT. Remote invocation, as a long time consuming task, can block interface rendering and the response of the interface to other operations by the user. Standing at the user's perspective, the interface may appear as a "sham" lost response; but simultaneously, because the interface is locked, the user can be prevented from performing other unpredictable operations during the current business processing, thereby ensuring the correctness of the current business operation result. The event response mechanism of the asynchronous response is as follows: the EDT draws the dynamic style identification in the interface to identify that the time-consuming task is being carried out, then starts the background thread, and provides interface update for the EDT when the background thread data is processed to a certain progress. While standing at the user's perspective, the interface is still interactive. And other buttons can be clicked while time-consuming tasks are carried out in the background, so that the efficiency is improved. But may result in the task starting first terminating abnormally due to the effects of other operations. Therefore, for the synchronous response and the asynchronous response, different ways are needed to bind the transaction information corresponding to the remote call information with the service information, so that the transaction and the service can be correctly bound no matter the synchronous response and the asynchronous response. In particular, the response type is determined based on the thread in which the remote invocation is located in the response event.
In this embodiment, since the end of the method is the end of the service operation in the synchronous response event, the scheme is clear and concise: collecting all the remote call information occurring in the EDT thread from the beginning of the event response method of the click button to the end of the event response method, and then directly binding the transaction information with the service when the execution of the event response method is finished. As shown in fig. 9, in the technical solution of binding transaction and service under synchronous response, a thread local variable is created in the createtratninfo method for storing service and transaction information; transmitting the current service id into a background in a writeBusiInfo2Header method, binding after a background transaction (getTransaction) takes out a service id (readRequestheaders), and transmitting the self transaction id back to a foreground (writeResponseheaders); one service operation may include a plurality of remote invocations, and when the service operation is ended, the collected data is sent through finishBusiness; the synchronous response updates the interface after all remote calls are finished, so the interface from button to repaintUI does not respond to other operations of the user.
In the technical scheme, when the type of the response is asynchronous, other buttons can still be clicked while time-consuming tasks are performed in the background, so that various situations exist, and different request types are bound in different manners. As shown in fig. 10, in the asynchronous response event, the result is not waited after the background thread is newly started, and the result is returned immediately; judging the type of the remote call request in a BindBusinessBeforeRequest method; when the Client requests background data through remote invocation, the request can be divided into the following cases, and the judgment process is as shown in fig. 11: if the request is a synchronous foreground request with service significance but the service information recorded by the local variable is not recorded and/or the request type is an asynchronous foreground request with service significance but the service information recorded by the local variable is not the current service information, a new local variable needs to be created, the new service information is stored in the new local variable, and the transaction information corresponding to the current remote call information is bound with the new service information, so that the binding of the transaction information corresponding to the current remote call information and the current service information is realized. If the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is the current service information, the current local variable is the service information corresponding to the current remote call information, and then the transaction information corresponding to the current remote call information is directly bound with the service information. If the remote invocation information does not need to be bound with the service when the request type is a background request with non-service meaning and a request with an unknown type, namely when the current remote invocation has no service meaning and the request with the unknown type, the service information is controlled with the request. Therefore, when the response type is asynchronous, different modes of binding are respectively carried out on different request types and the binding is not controlled when the binding is not needed, so that the correct binding of the service information and the transaction information which is generated when the service is loved is realized.
In the embodiment, which remote calls are included in the service is known through detailed service information and transaction information, network time consumption and background transaction time consumption included in each remote call can be quickly found through a service coding ID, all the remote calls bound with the serial number ID can be quickly found through the service coding ID, the speed reflected by a feedback system is intuitive when the service is totally consumed, for the transaction which is found to be long in time, the transaction details of the transaction can be directly penetrated for problem location, and the following transaction components of the service can be intuitively seen: the total time consumption is caused by a plurality of transactions, or caused by overlong time consumption of single transaction, or caused by overlong time consumption of network.
In the embodiment of the second aspect of the present invention, a CS architecture based transaction and service association system 100 is proposed, and fig. 12 shows a schematic block diagram of the CS architecture based transaction and service association system 100 according to an embodiment of the present invention:
an entry unit 10, configured to receive a client instruction, execute the instruction to enter a response event bound with the instruction;
a recording unit 20, configured to execute a response event, generate service information, and record remote invocation information generated in the process of executing the response event;
and a binding unit 30, configured to bind the transaction information corresponding to the remote invocation information with the service information.
Wherein the recording unit 20 includes:
the dispatching unit 202 is used for dispatching the response event to the thread to generate service information;
a creating unit 204, configured to create a local variable in the thread;
and a recording subunit 206, configured to record the service information and the remote invocation information in the local variable.
The binding unit 30 specifically includes:
a determining unit 302, configured to determine a response type according to a thread in which the remote invocation is located in the response event;
an obtaining unit 304, configured to obtain, when the type of the response is a synchronous response, transaction information corresponding to all pieces of remotely called information in the local variable;
a first binding subunit 306, configured to directly bind the transaction information with the service information;
a judging unit 308, configured to judge a request type of the remote call when the type of the response is an asynchronous response;
a second binding subunit 310, configured to, when the request type is a synchronous foreground request with business significance but the local variable has no recorded business information yet and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not current business information, create another local variable to store new business information, and bind the transaction information corresponding to the current remotely-invoked information with the new business information;
a third binding subunit 312, configured to, when the request type is an asynchronous foreground request with business significance and the business information recorded by the local variable is current business information, directly bind the transaction information corresponding to the current remote call information with the business information;
a control unit 314, configured to control not to bind the request service information when the request type is a background request with non-service meaning and a request with an unknown type.
According to the transaction and service association system 100 based on the CS framework, the access unit 10 receives the instruction of the client when a user opens a node or clicks a button, and executes a response event that the instruction enters and is bound with the instruction, the client generates a service message at the beginning of the response event, the service message comprises a globally unique service code ID, the call message of each remote call generated by the recording unit 20 in the process of responding to the event is recorded, and the binding unit 30 binds the transaction message corresponding to all the remote calls generated under the service with the service message, so that the binding of the transaction and the service is realized, and further, the slow service function realized on the basis of the service association transaction can develop a plurality of function points taking the service as the concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
In this embodiment, the dispatching unit 202 dispatches the response event to an Event Dispatching Thread (EDT), at this time, service information is generated, the creating unit 204 creates a local variable in the EDT thread, the local variable is used for storing service and transaction information, and the recording subunit 206 records information of each remote call into the local variable during the response period, so that the recording of information of remote calls of a certain service line is realized.
In this embodiment, the binding unit 30 distinguishes the response type in the binding process between the transaction information corresponding to the remote call information and the service information, because in the synchronous response, the end of the response method is the end of the service operation, and in the asynchronous response, the time-consuming task is performed in the background while other buttons can still be clicked, so that different manners are required for binding the transaction information corresponding to the remote call information and the service information for the synchronous response and the asynchronous response, so that the transaction and the service can be correctly bound regardless of the synchronous response and the asynchronous response. The specific determination unit 302 determines the response type according to the thread where the remote call is located in the response event.
In this embodiment, when the type of the response is a synchronous response, the obtaining unit 304 first obtains the transaction information corresponding to all the remote invocation information in the local variable, the end of the response method is the end of the service operation, and when the response method is ended, the local variable has recorded all the remote invocation information, so that the first binding subunit 306 directly binds the service information and the transaction information corresponding to all the remote invocation information when the execution of the event response method is ended.
In this embodiment, when the type of the response is an asynchronous response, the time-consuming task is performed in the background while other buttons can still be clicked, so that there are many cases where different request types are bound differently. First, the determining unit 308 determines the type of the remote invocation request, and if the request is a synchronous foreground request with business significance but the local variable has no recorded business information and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not current business information, and the two requests do not record corresponding current business information in the current local variable, then the second binding subunit 310 is required to create a new local variable, store the new business information in the new local variable, and bind the business information corresponding to the current remote invocation information with the new business information, thereby implementing the binding of the business information corresponding to the current remote invocation information with the current business information. If the request type is an asynchronous foreground request with business significance and the business information recorded by the local variable is the current business information, which indicates that the current local variable is the business information corresponding to the current remote call information, the third binding subunit 312 directly binds the transaction information corresponding to the current remote call information with the business information. If the remote invocation information does not need to be bound to the service when the request type is a non-service-meaningful background request and an unknown type of request, i.e. when the current remote invocation is not service-meaningful and when the request is of unknown type, the control unit 314 controls the service information to the request. Therefore, when the response type is asynchronous, different modes of binding are respectively carried out on different request types and the binding is not controlled when the binding is not needed, so that the correct binding of the service information and the transaction information which is generated when the service is loved is realized.
In the embodiment, which remote calls are included in the service is known through detailed service information and transaction information, network time consumption and background transaction time consumption included in each remote call can be quickly found through a service coding ID, all the remote calls bound with the serial number ID can be quickly found through the service coding ID, the speed reflected by a feedback system is intuitive when the service is totally consumed, for the transaction which is found to be long in time, the transaction details of the transaction can be directly penetrated for problem location, and the following transaction components of the service can be intuitively seen: the total time consumption is caused by a plurality of transactions, or caused by overlong time consumption of single transaction, or caused by overlong time consumption of network.
In embodiments of the third aspect of the present invention, a computer device is provided, and fig. 13 shows a schematic block diagram of a computer device 300 according to an embodiment of the present invention. Wherein the computer device 300 comprises:
a memory 302, a processor 304, and a computer program stored on the memory 302 and executable on the processor 304, the processor 304 when executing the computer program implementing the steps of: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information.
In the computer device 300 provided by the present invention, the processor 304 implements, when executing the computer program: when a user opens a node or clicks a button, receiving an instruction of a client, executing the instruction to enter a response event bound with the instruction, generating service information at the beginning of the response event by the client, wherein the service information comprises a globally unique service code ID, recording the call information of each remote call generated in the process of responding to the event, and binding the transaction information corresponding to all remote calls generated under the service with the service information, so that the binding of the service and the transaction is realized, and further, a slow service function realized on the basis of the service-associated transaction can develop a plurality of function points taking the service as a concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
An embodiment of the fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of: receiving a client instruction, and executing the instruction to enter a response event bound with the instruction; executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event; and binding the transaction information corresponding to the remote calling information with the service information.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements: when a user opens a node or clicks a button, receiving an instruction of a client, executing the instruction to enter a response event bound with the instruction, generating service information at the beginning of the response event by the client, wherein the service information comprises a globally unique service code ID, recording the call information of each remote call generated in the process of responding to the event, and binding the transaction information corresponding to all remote calls generated under the service with the service information, so that the binding of the service and the transaction is realized, and further, a slow service function realized on the basis of the service-associated transaction can develop a plurality of function points taking the service as a concerned dimension; when a user finds a slow business, the user can locate the problem by checking the number or details of background affairs occurring under the business, and the focus of the system is clear at a glance; in addition, the time consumption of business operation can be visually seen, the problems can be found more timely, and the system problems can be killed in the cradle before the complaints of the user occur.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A transaction and service association method based on a CS framework is characterized by comprising the following steps:
receiving a client instruction, executing the instruction to enter a response event bound with the instruction;
executing the response event, generating service information, and recording remote calling information generated in the process of executing the response event;
binding the transaction information corresponding to the remote calling information with the service information;
the binding the transaction information corresponding to the remote invocation information with the service information specifically includes:
determining a response type according to a thread where a remote call is located in the response event;
binding the transaction information corresponding to the remote calling information with the service information in a corresponding mode according to the response type;
binding the transaction information corresponding to the remote invocation information with the service information in a corresponding manner according to the response type, and specifically comprising:
when the response type is asynchronous response, judging the request type of remote call;
when the request type is a synchronous foreground request with business significance but the local variable has not recorded the business information and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not the current business information, establishing another local variable to store the new business information and binding the transaction information corresponding to the current remotely called information with the new business information; and
when the request type is an asynchronous foreground request with service significance and the service information recorded by the local variable is current service information, directly binding transaction information corresponding to the current remotely called information with the service information; and
and when the request type is a background request with non-service significance and a request with an unknown type, controlling not to bind the request and the service information.
2. The CS architecture-based transaction and service association method according to claim 1, wherein the executing the response event, generating service information, and recording remote invocation information generated in a process of executing the response event specifically includes:
dispatching the response event to a thread to generate the service information;
creating a local variable in the thread;
and recording the service information and the remote calling information in the local variable.
3. The CS architecture-based transaction and service association method according to claim 1, wherein the binding of the transaction information corresponding to the remote invocation information and the service information in a corresponding manner according to the response type specifically includes:
when the response type is synchronous response, acquiring transaction information corresponding to all the remotely called information in the local variable;
and directly binding the transaction information with the service information.
4. The CS-based architecture transaction and service association method according to any of claims 1 to 3,
the service information comprises one or the combination of the following: the method comprises the following steps that (1) a service code ID, total service operation time, a service operator, service operation time and a node button name of service operation are obtained;
the transaction information comprises one or a combination of the following: transaction code ID, transaction elapsed time, remote invocation process, type of remote invocation, name of remote invocation, time of remote invocation.
5. A CS architecture based transaction and service association system, comprising:
an entry unit, configured to receive a client instruction, execute the instruction to enter a response event bound with the instruction;
the recording unit is used for executing the response event, generating service information and recording remote calling information generated in the process of executing the response event;
the binding unit is used for binding the transaction information corresponding to the remote calling information with the service information;
the CS architecture-based transaction and service association system is characterized in that the binding unit specifically includes:
a determining unit, configured to determine a response type according to a thread in which a remote call is located in the response event;
the classification binding unit is used for binding the transaction information corresponding to the remote calling information with the service information in a corresponding mode according to the response type;
the classification binding unit specifically further includes:
the judging unit is used for judging the request type of remote calling when the response type is asynchronous response;
a second binding subunit, configured to, when the request type is a synchronous foreground request with business significance but a local variable does not have recorded business information yet and/or the request type is an asynchronous foreground request with business significance but the business information recorded by the local variable is not current business information, create another local variable to store new business information, and bind transaction information corresponding to current remotely-invoked information with the new business information;
a third binding subunit, configured to, when the request type is an asynchronous foreground request with a business significance and the business information recorded by the local variable is current business information, directly bind transaction information corresponding to current remotely-invoked information with the business information; and
and the control unit is used for controlling not to bind the request and the service information when the request type is a background request with non-service significance and a request with an unknown type.
6. The CS architecture-based transaction and service association system according to claim 5, wherein the recording unit specifically includes:
the dispatching unit is used for dispatching the response event to a thread to generate the service information;
a creating unit configured to create a local variable in the thread;
and the recording subunit is used for recording the service information and the remote calling information in the local variable.
7. The CS architecture-based transaction and service association system according to claim 5, wherein the classification binding unit specifically includes:
an obtaining unit, configured to obtain, when the response type is a synchronous response, transaction information corresponding to all the remotely called information in the local variable;
and the first binding subunit is used for directly binding the transaction information with the service information.
8. The CS-based architecture transaction and service association system according to any of claims 5 to 7,
the service information comprises one or the combination of the following: the method comprises the following steps that (1) a service code ID, total service operation time, a service operator, service operation time and a node button name of service operation are obtained;
the transaction information comprises one or a combination of the following: transaction code ID, transaction elapsed time, remote invocation process, type of remote invocation, name of remote invocation, time of remote invocation.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the CS architecture based transaction and service association method according to any one of claims 1 to 4 when executing the computer program.
10. A computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the CS architecture based transaction and service association method according to any one of claims 1 to 4.
CN201710930462.7A 2017-10-09 2017-10-09 Transaction and service association method and system based on CS framework Active CN107741885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710930462.7A CN107741885B (en) 2017-10-09 2017-10-09 Transaction and service association method and system based on CS framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710930462.7A CN107741885B (en) 2017-10-09 2017-10-09 Transaction and service association method and system based on CS framework

Publications (2)

Publication Number Publication Date
CN107741885A CN107741885A (en) 2018-02-27
CN107741885B true CN107741885B (en) 2020-12-01

Family

ID=61236707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710930462.7A Active CN107741885B (en) 2017-10-09 2017-10-09 Transaction and service association method and system based on CS framework

Country Status (1)

Country Link
CN (1) CN107741885B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109246071A (en) * 2018-06-28 2019-01-18 平安科技(深圳)有限公司 Method for processing business, calls management system and transaction processing system at operation system
CN111290866B (en) * 2020-02-11 2023-06-30 支付宝(杭州)信息技术有限公司 Service processing method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100249797B1 (en) * 1997-12-09 2000-03-15 정선종 The communication event tracking of rpc-based distributed programs
CN103248511B (en) * 2012-02-14 2016-08-03 金蝶软件(中国)有限公司 A kind of analysis methods, devices and systems of single-point service feature
CN106656536B (en) * 2015-11-03 2020-02-18 阿里巴巴集团控股有限公司 Method and equipment for processing service calling information
CN106326017A (en) * 2016-08-17 2017-01-11 广东亿迅科技有限公司 Realization system for call chain based on Annotation application
CN106487596B (en) * 2016-10-26 2019-12-13 宜人恒业科技发展(北京)有限公司 Distributed service tracking implementation method
CN107181675B (en) * 2017-06-20 2020-03-03 北京奇艺世纪科技有限公司 Service calling method and device

Also Published As

Publication number Publication date
CN107741885A (en) 2018-02-27

Similar Documents

Publication Publication Date Title
US10348809B2 (en) Naming of distributed business transactions
US10298469B2 (en) Automatic asynchronous handoff identification
CN111045911B (en) Performance test method, performance test device, storage medium and electronic equipment
CN107741885B (en) Transaction and service association method and system based on CS framework
CN113961332A (en) Method and device for realizing workflow engine, electronic equipment and storage medium
CN108733545B (en) Pressure testing method and device
CN111176577A (en) Distributed block storage service command processing method, device, equipment and medium
CN111190805A (en) Training log visualization system, method and equipment of deep learning training platform
CN114219466A (en) Transfer information processing method and device, electronic equipment and storage medium
CN113157411A (en) Reliable configurable task system and device based on Celery
CN115328664B (en) Message consumption method, device, equipment and medium
US20200210307A1 (en) Method for automatically analyzing bottleneck in real time and an apparatus for performing the method
CN109905459A (en) A kind of data transmission method and device
CN115511592A (en) Tax value information calculation method, apparatus, device and storage medium
CN108984238A (en) Gesture processing method, device and the electronic equipment of application program
US8739166B2 (en) Progress-driven progress information in a service-oriented architecture
US10165074B2 (en) Asynchronous custom exit points
CN113535358A (en) Task processing method and device
CN112183982A (en) Workflow creating method and device, computer equipment and storage medium
CN110262871A (en) Container instance start and stop method, apparatus, computer equipment and the storage medium of container application
US9935856B2 (en) System and method for determining end user timing
CN113836405B (en) Information query method, device and computer readable storage medium
CN114581053A (en) Marketing task execution method, device, equipment and storage medium
CN115470017A (en) Message pushing method and device, electronic equipment and storage medium
CN116795256A (en) Task processing method and device, electronic equipment and storage medium

Legal Events

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