Global serial number processing method, device, equipment, storage medium and program product

The global serial number processing method solves the problem of difficulty in analyzing distributed link calls in microservice systems, realizes the association between global serial numbers and logs, improves the efficiency of locating abnormal problems, covers the entire life cycle, and reduces development costs.

CN114217957BActive Publication Date: 2025-09-12SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111411210.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-09-12
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

In microservice systems, distributed link call analysis is difficult. Traditional methods cannot effectively correlate microservice applications and distributed data middleware logs, making it difficult to locate abnormal problems. This is especially true in cloud-native distributed architectures, where problems are magnified.

Method used

A global serial number processing method is provided. By receiving transaction processing requests, parsing and configuring global serial numbers, storing transaction processing logs, and associating global serial numbers with logs, it supports real-time output of transaction SQL.

Benefits of technology

It achieves efficient association between microservice applications and distributed data middleware, quickly locates abnormal problems, covers the entire life cycle, reduces development costs, and eliminates the need for additional component deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114217957B_ABST
    Figure CN114217957B_ABST
Patent Text Reader

Abstract

This application relates to a global serial number processing method, apparatus, device, storage medium, and program product. The method comprises: receiving a transaction processing request from an application system; parsing the transaction processing request; when the parsed result indicates a global serial number configuration, configuring the parsed global serial number into a session; and storing transaction processing logs based on the global serial number in the session. This method enables real-time output of transaction global serial numbers and logs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of distributed data middleware, and in particular to a global serial number processing method, apparatus, device, storage medium and program product. Background Art

[0002] Distributed link tracing in distributed systems can be implemented in two ways: One is to develop a distributed microservice system independently or integrate an open-source distributed link tracing component probe. This probe is integrated as a non-business component, intruding minimally or not at all on other business systems and remaining as transparent to applications as possible. Leveraging the customizable nature of HTTP requests, the probe propagates the TraceId of each request. The probe then forwards each request to the server, which stores this detailed information. Subsequent business developers or operations personnel can use the TraceId to query and aggregate link information through the link tracing system's web page, forming a call link graph. This information can then be further analyzed based on factors such as call response time. The other approach is to use distributed logging components such as ELK or Splunk in a distributed environment to centrally collect logs. The business application system can assign a unique identifier to each request and then print it in the log. This unique identifier must be passed to downstream services, which also include it when printing the log. This allows for easy tracking of all links and displays them in the log. Data analysis of the logs then generates a corresponding link call relationship graph. As microservice systems scale rapidly and enterprise businesses become increasingly complex, distributed link call relationships face significant challenges. Accurately and efficiently analyzing distributed system link calls and resolving and identifying microservice call performance issues have become a key focus for technical personnel in related fields.

[0003] In traditional technologies, microservice application calls and the use of distributed data middleware are generally constrained by development specifications. When there is non-standard SQL, it may cause many unpredictable abnormal problems. To find such problems, the distributed data middleware, as a database agent, does not participate in microservice transformation. In addition, distributed data middleware generally implements TCP communication of the open source MySQL protocol. It is not the same type of application as the microservice application and cannot associate every SQL call. Therefore, it is impossible to associate the logs of the microservice application and the distributed data middleware. After the microservice application is developed, tested, and put into production, it is easy for problematic SQL to cause abnormalities. Finding the cause of the abnormality becomes extremely complicated. It is necessary to save logs in each application in the cluster and match the timestamp with the corresponding SQL to locate the problem.

[0004] In addition, considering the future cloud-native distributed architecture, more and more microservice applications will be moved to the cloud. Distributed data middleware needs to be deployed on a larger scale and participate in calls between microservice applications. This will bring more problems in locating abnormal calls between systems. In the two-site three-center and three-site five-center deployment architectures, the above problems will be amplified. Summary of the Invention

[0005] Based on this, it is necessary to provide a global serial number processing method, device, equipment, storage medium and program product that can output transaction global serial numbers and logs in real time to address the above technical problems.

[0006] In a first aspect, the present application provides a global serial number processing method, the method comprising:

[0007] Receive transaction processing requests sent by the application system;

[0008] Parsing the transaction processing request;

[0009] When the parsed result is a global serial number configuration, the parsed global serial number is configured into the session;

[0010] The logs in the transaction processing are stored according to the global serial number in the session.

[0011] In one embodiment, the method further comprises:

[0012] Receive transaction processing start request sent by application system;

[0013] A communication connection is established according to the transaction start request, and a session corresponding to the communication connection is created.

[0014] In one embodiment, storing the logs in the transaction processing according to the global serial number in the session includes:

[0015] Process the transaction and obtain the transaction result;

[0016] The transaction processing result and the global serial number are associated and stored in a log.

[0017] In one embodiment, the processing the transaction to obtain a transaction result includes:

[0018] When a thread switch occurs during transaction processing, the thread record in the session is modified by the context tool of the log component to transfer the global serial number to the new thread.

[0019] In one embodiment, storing the transaction processing result and the global serial number in a log in association with each other includes:

[0020] Get predefined log formats;

[0021] According to the log format, the transaction processing result and the global serial number are associated and stored in the log.

[0022] In one embodiment, the method further comprises:

[0023] Receive a log query request, wherein the log query request carries a global serial number;

[0024] Query the corresponding log according to the global serial number and output the query result.

[0025] In a second aspect, the present application provides a global serial number processing device, the device comprising:

[0026] A first receiving module is used to receive a transaction processing request sent by an application system;

[0027] A parsing module, configured to parse the transaction processing request;

[0028] The configuration module is used to configure the global serial number obtained by parsing into the session when the parsed result is a global serial number configuration;

[0029] The log processing module is used to store the logs in the transaction processing according to the global serial number in the session.

[0030] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0031] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method in any one of the above-mentioned embodiments when executed by a processor.

[0032] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which implements the steps of the method in any one of the above embodiments when executed by a processor.

[0033] The above-mentioned global serial number processing method, device, equipment, storage medium and program product receive a transaction processing request sent by an application system; parse the transaction processing request to obtain a global serial number, and then configure the global serial number before the transaction processing. After the global serial number is fully configured, the log in the transaction processing is stored, thereby configuring the global serial number in advance and supporting the real-time output of transaction SQL and global serial number log through transaction SQL in the application system. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 2. A diagram showing an application environment of a global serial number processing method according to an embodiment;

[0035] Figure 2 1 is a flow chart of a method for processing a global serial number according to an embodiment;

[0036] Figure 3 Schematic diagram of a flow chart of a global serial number processing method in another embodiment;

[0037] Figure 4 is a timing diagram of a global serial number processing method in one embodiment;

[0038] Figure 5 is a structural block diagram of a global serial number processing device in one embodiment;

[0039] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0041] The global serial number processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the application system 102 communicates with the distributed data middleware cluster 104 through the network. The distributed data middleware cluster 104 also communicates with the log storage server 106 through the network, and the distributed data middleware cluster 104 also communicates with the application system data server cluster 108 through the network. Among them, the distributed data middleware cluster 104 can receive the transaction processing request sent by the application system 102; and parse the transaction processing request; when the result of the parsing is a global serial number configuration, the global serial number obtained by the parsing is configured into the session; according to the global serial number in the session, the log in the transaction processing is stored. And after the local serial number is fully configured, the log in the transaction processing is stored, so that the global serial number is configured in advance, and the transaction SQL and the global serial number log can be output in real time through transaction SQL in the application system.

[0042] Application system 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car-mounted devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Distributed data middleware cluster 104, log storage server 106, and application system data server cluster 108 may be implemented using independent servers or a server cluster consisting of multiple servers.

[0043] In one embodiment, Figure 2 As shown, a global serial number processing method is provided, which is applied to Figure 1 The distributed data middleware cluster in the example is used to illustrate the process, which includes the following steps:

[0044] S202: Receive a transaction processing request sent by the application system.

[0045] Specifically, a transaction request may refer to a transaction-type transaction, including but not limited to data query, deletion, and modification. Transaction requests are not specifically limited herein. Optionally, the application system first logs into the distributed data middleware cluster. After the distributed data middleware cluster authenticates the application system's account and password, transaction processing can be initiated. Specifically, the application system sends a transaction request to the distributed data middleware cluster.

[0046] In some embodiments, before the distributed data middleware cluster receives a transaction processing request, the corresponding distributed data middleware in the distributed data middleware cluster is determined by load balancing, so that the distributed data middleware cluster can run efficiently.

[0047] S204: Parse the transaction processing request.

[0048] Specifically, parsing refers to determining the type of command used in the transaction processing request, for example, which command in the COM_QUERY extension of MySQL is used.

[0049] S206: When the parsing result is a global serial number configuration, the global serial number obtained by parsing is configured into the session.

[0050] Specifically, transaction processing requests include multiple commands, including at least global serial number configuration and SQL requests. The distributed data middleware cluster can determine the parsing result of the transaction processing request based on keywords in the command. For example, when the transaction processing request is parsed to contain set and the keyword key is global_seq_no, the parsed result is determined to be a global serial number configuration. When the distributed data middleware cluster obtains the keyword key global_seq_no in the parsed SQL text, it will enter the global serial number processing link of the distributed data middleware to save the global serial number. This allows the global serial number and the business processing process to be stored in the log during subsequent business processing.

[0051] When the transaction processing request is other processing requests, such as a query request, the distributed data middleware cluster parses the SQL to execute the corresponding query operation after receiving the COM_QUERY data packet. After execution, it returns a COM_QUERY Response to the client. The COM_QUERY Response is not a basic data packet type. Depending on the SQL execution result, the COM_QUERY Response will have different forms. For basic query operations, the server will return multiple data packets, including the number of column mode packets (denoted as N), N column data packets (each column data packet describes the information of a field in the data table in detail, such as the field name, field data type, field length, etc.), and one or more row data packets, each of which contains N values.

[0052] Optionally, the main step in global serial number processing is to assign a TraceLogging attribute when the session is established. After receiving the global serial number sent by the application, the global serial number is bound to the TraceLogging attribute. In this way, the global serial number bound to the session is saved in the connection context during the transaction execution process and can be globally referenced during subsequent log processing.

[0053] S208: The logs in the transaction processing are stored according to the global serial number in the session.

[0054] Specifically, during the transaction processing process, the transaction processing statements are not changed. The distributed data middleware cluster processes the transaction request to obtain the processing result, and associates the processing result with the global serial number and stores it in the log to facilitate subsequent log query processing, etc.

[0055] This provides broad coverage throughout the entire lifecycle of an application system, encompassing development, testing, and production. It also offers high flexibility, requiring only a single SQL statement to be executed within the application system after a transaction is initiated. It also offers strong real-time performance, supporting real-time output of transaction SQL and global serial number logs within the application system. Furthermore, it is ultra-lightweight, requiring only a log component format modification within the distributed data middleware, eliminating the need for deploying additional components.

[0056] The above-mentioned global serial number processing method receives a transaction processing request sent by an application system; parses the transaction processing request to obtain a global serial number, and then configures the global serial number before transaction processing. After the global serial number is fully configured, the log in the transaction processing is stored, thereby configuring the global serial number in advance and supporting the real-time output of transaction SQL and global serial number log through transaction SQL in the application system.

[0057] In one embodiment, the global serial number processing method further includes: receiving a transaction processing start request sent by an application system; establishing a communication connection according to the transaction processing start request, and creating a session corresponding to the communication connection.

[0058] Specifically, a transaction start request can be treated as a login request. This means that the application system first logs into the distributed data middleware cluster. Upon receiving the login request, the distributed data middleware cluster performs authentication and, if authentication is successful, generates a corresponding session within the distributed data middleware cluster. This session is assigned a tracking attribute, such as the TraceLogging attribute. Upon receiving the global serial number issued by the application, the global serial number is bound to the TraceLogging attribute. This global serial number bound to the session is then saved in the connection context during transaction execution and can be globally referenced during subsequent log processing. Furthermore, after authentication is successful, the authentication result is fed back to the application system.

[0059] In other embodiments, the session has a time limit. The distributed data middleware cluster sets a time limit for the session, for example, half an hour. After half an hour, the session is deleted, that is, the global serial number is deleted. Alternatively, the session is deleted within a preset time period after no business operations are received. This allows the global serial number transmitted by the distributed data middleware to be automatically cleared, preventing log confusion between transactions.

[0060] In one embodiment, the logs in the transaction processing are stored according to the global serial number in the session, including: obtaining a transaction processing result from the transaction processing; and associating the transaction processing result with the global serial number and storing them in the log.

[0061] Specifically, the distributed data middleware cluster processes the transaction request to obtain a processing result, and associates the processing result with a global serial number and stores it in a log to facilitate subsequent log query processing, etc.

[0062] Through this implementation method, the global serial number of the microservice application can be associated and transmitted with the distributed data middleware, and then viewed and analyzed in a unified manner through the log tool. This can quickly discover and solve problems such as anomalies between application systems, thereby improving the efficiency of problem solving between systems.

[0063] In one embodiment, obtaining a transaction result from a transaction processing includes: when a thread switch occurs during the transaction processing, modifying the thread record in the session through a context tool of the log component to transfer the global serial number to the new thread.

[0064] Distributed data middleware log processing is to achieve information data sharing between threads after each thread switches in the distributed data middleware, by mapping the debugging context through the log component's context tool MDC. During the interaction process of a preset number of thread pools in the distributed data middleware, the global serial number bound to the session is shared to complete the global serial number transmission between threads.

[0065] In one embodiment, associating the transaction processing result with the global serial number and storing it in a log includes: obtaining a predefined log format; and associating the transaction processing result with the global serial number and storing it in the log according to the log format.

[0066] Specifically, to customize the log format, when implementing log output by defining the pattern of the log component, the global serial number output set by the application system can be used in the distributed data middleware to customize the log format as follows:

[0067]

[0068] The corresponding log file will contain the following log content:

[0069]

[0070] Through this implementation method, the global serial number of the microservice application can be associated and transmitted with the distributed data middleware, and then viewed and analyzed in a unified manner through the log tool. This can quickly discover and solve problems such as anomalies between application systems, thereby improving the efficiency of problem solving between systems.

[0071] In one embodiment, the global serial number processing method further includes: receiving a log query request, the log query request carrying the global serial number; querying the corresponding log according to the global serial number, and outputting the query result.

[0072] Specifically, combined Figure 1 Log viewing users can use the global serial number to query the corresponding log on the log storage server to facilitate log analysis.

[0073] In order to enable those skilled in the art to fully understand this application, please refer to Figure 3 and Figure 4 As shown, Figure 3 is a flowchart of a global serial number processing method in another embodiment, Figure 4 4 is a timing diagram of a global serial number processing method in one embodiment.

[0074] The application executes SQL to invoke the distributed data middleware, which establishes a TCP connection with the application and creates an internal session. The distributed data middleware then receives a global serial number from the application and stores it in the corresponding attribute within the session. The distributed data middleware then receives additional business SQL from the application, processes it, and outputs the execution log. The Logack logging component then outputs the log file, allowing the log retrieval system to retrieve the relevant log file by inputting the global serial number.

[0075] In the above embodiment, the global serial number transmission mechanism for distributed data middleware makes up for the problem that the current microservice applications and distributed data middleware are widely called but cannot be linked to the global serial number. It has a wide coverage, and each service can obtain benefits throughout the entire life cycle of the distributed application system. It responds to business in real time, is deployed in development and testing, and production environments, and can strongly associate the abnormalities that occur with problems through the global serial number during real-time interaction with the database, so as to discover problems as quickly as possible. It reduces the cost of application system integration throughout the entire life cycle of the application, but does not require the additional integration of other components. It reduces the cost of developers' use, and the entire use process is transparent to developers. It only requires adding a set command once in the unified transaction processing process, and developers do not need to do any additional development work.

[0076] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0077] Based on the same inventive concept, embodiments of the present application further provide a global serial number processing device for implementing the aforementioned global serial number processing method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the global serial number processing device provided below can be found in the above-mentioned limitations of the global serial number processing method and will not be further elaborated here.

[0078] In one embodiment, Figure 5 As shown, a global serial number processing device is provided, including: a first receiving module 501, a parsing module 502, a configuration module 503 and a log processing module 504, wherein:

[0079] A first receiving module 501 is configured to receive a transaction processing request sent by an application system;

[0080] Parsing module 502, used to parse the transaction processing request;

[0081] Configuration module 503, configured to configure the global serial number obtained by the analysis into the session when the analysis result is a global serial number configuration;

[0082] The log processing module 504 is used to store the logs in the transaction processing according to the global serial number in the session.

[0083] In one embodiment, the global serial number processing device further includes:

[0084] A second receiving module is used to receive a transaction processing start request sent by the application system;

[0085] The session creation module is used to establish a communication connection according to the transaction processing start request and create a session corresponding to the communication connection.

[0086] In one embodiment, the log processing module 504 includes:

[0087] A transaction processing unit, configured to process a transaction and obtain a transaction processing result;

[0088] The storage unit is used to associate the transaction processing results with the global serial number and store them in the log.

[0089] In one embodiment, the transaction processing unit is configured to modify the thread record in the session through the context tool of the log component when a thread switch occurs during transaction processing, so as to transfer the global serial number to the new thread.

[0090] In one embodiment, the storage unit includes:

[0091] The format acquisition subunit is used to obtain a predefined log format;

[0092] The storage subunit is used to associate the transaction processing results and the global serial number and store them in the log according to the log format.

[0093] In one embodiment, the global serial number processing device further includes:

[0094] A third receiving module is used to receive a log query request, where the log query request carries a global serial number;

[0095] The output module is used to query the corresponding log according to the global serial number and output the query results.

[0096] Each module in the above-mentioned global serial number processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0097] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store global serial numbers. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a global serial number processing method is implemented.

[0098] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0099] In one embodiment, a computer device is provided, comprising a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: receiving a transaction processing request sent by an application system; parsing the transaction processing request; when the result of the parsing is a global serial number configuration, configuring the global serial number obtained by the parsing into a session; and storing logs in the transaction processing according to the global serial number in the session.

[0100] In one embodiment, when executing the computer program, the processor further implements the following steps: receiving a transaction processing start request sent by the application system; establishing a communication connection according to the transaction processing start request, and creating a session corresponding to the communication connection.

[0101] In one embodiment, the storage of the log in the transaction processing according to the global serial number in the session implemented by the processor when executing the computer program includes: obtaining the transaction processing result from the transaction processing; and associating the transaction processing result with the global serial number and storing them in the log.

[0102] In one embodiment, the transaction processing implemented by the processor when executing the computer program to obtain the transaction processing result includes: when a thread switches during the transaction processing, modifying the thread record in the session through the context tool of the log component to transfer the global serial number to the new thread.

[0103] In one embodiment, the processor executing the computer program implements associating the transaction processing result with the global serial number and storing it in the log, including: obtaining a predefined log format; and associating the transaction processing result with the global serial number and storing it in the log according to the log format.

[0104] In one embodiment, when executing the computer program, the processor further implements the following steps: receiving a log query request carrying a global serial number; querying a corresponding log according to the global serial number, and outputting a query result.

[0105] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: receiving a transaction processing request sent by an application system; parsing the transaction processing request; when the result of the parsing is a global serial number configuration, configuring the global serial number obtained by the parsing into a session; and storing logs in the transaction processing according to the global serial number in the session.

[0106] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a transaction processing start request sent by the application system; establishing a communication connection according to the transaction processing start request, and creating a session corresponding to the communication connection.

[0107] In one embodiment, the computer program implemented by the processor when executed stores the log in the transaction processing according to the global serial number in the session, including: obtaining the transaction processing result from the transaction processing; and associating the transaction processing result with the global serial number and storing it in the log.

[0108] In one embodiment, the transaction processing implemented by the computer program when executed by the processor to obtain the transaction processing result includes: when a thread switches during the transaction processing, modifying the thread record in the session through the context tool of the log component to transfer the global serial number to the new thread.

[0109] In one embodiment, the computer program implemented by the processor for associating and storing transaction processing results and global serial numbers in a log includes: obtaining a predefined log format; and associating and storing the transaction processing results and global serial numbers in the log according to the log format.

[0110] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a log query request carrying a global serial number; querying a corresponding log according to the global serial number, and outputting a query result.

[0111] In one embodiment, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the following steps: receiving a transaction processing request sent by an application system; parsing the transaction processing request; when the result of the parsing is a global serial number configuration, configuring the global serial number obtained by the parsing into a session; and storing logs in the transaction processing according to the global serial number in the session.

[0112] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a transaction processing start request sent by the application system; establishing a communication connection according to the transaction processing start request, and creating a session corresponding to the communication connection.

[0113] In one embodiment, the computer program implemented by the processor when executed stores the log in the transaction processing according to the global serial number in the session, including: obtaining the transaction processing result from the transaction processing; and associating the transaction processing result with the global serial number and storing it in the log.

[0114] In one embodiment, the transaction processing implemented by the computer program when executed by the processor to obtain the transaction processing result includes: when a thread switches during the transaction processing, modifying the thread record in the session through the context tool of the log component to transfer the global serial number to the new thread.

[0115] In one embodiment, the computer program implemented by the processor for associating and storing transaction processing results and global serial numbers in a log includes: obtaining a predefined log format; and associating and storing the transaction processing results and global serial numbers in the log according to the log format.

[0116] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a log query request carrying a global serial number; querying a corresponding log according to the global serial number, and outputting a query result.

[0117] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0118] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0119] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A global serial number processing method, characterized in that: The method comprises: Receive transaction processing start request sent by application system; Establishing a communication connection according to the transaction start request, creating a session corresponding to the communication connection, and assigning a TraceLogging attribute; Receive transaction processing requests sent by the application system; Parsing the transaction processing request includes: determining a parsing result of the transaction processing request according to a keyword in the command, and when the transaction processing request contains set and the keyword key is global_seq_no, determining that the parsing result is a global serial number configuration; When the parsed result is a global serial number configuration, the parsed global serial number is configured to the TraceLogging attribute in the session; The logs in the transaction processing are stored according to the global serial number in the session.

2. The method according to claim 1, characterized in that The storing of logs in transaction processing according to the global serial number in the session includes: Process the transaction and obtain the transaction result; The transaction processing result and the global serial number are associated and stored in a log.

3. The method according to claim 2, characterized in that The processing of the transaction to obtain a transaction processing result includes: When a thread switch occurs during transaction processing, the thread record in the session is modified by the context tool of the log component to transfer the global serial number to the new thread.

4. The method according to claim 2, characterized in that The associating the transaction processing result with the global serial number and storing it in a log includes: Get predefined log formats; According to the log format, the transaction processing result and the global serial number are associated and stored in the log.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Receive a log query request, wherein the log query request carries a global serial number; Query the corresponding log according to the global serial number and output the query result.

6. A global serial number processing device, characterized in that: The device comprises: A second receiving module is used to receive a transaction processing start request sent by the application system; A session creation module, configured to establish a communication connection according to the transaction start request, create a session corresponding to the communication connection, and assign a TraceLogging attribute; A first receiving module is used to receive a transaction processing request sent by an application system; a parsing module, configured to parse the transaction processing request, including: determining a parsing result of the transaction processing request based on keywords in the command, and determining that the parsing result is a global serial number configuration when the transaction processing request contains set and the keyword key is global_seq_no; A configuration module, configured to configure the global serial number obtained by the parsing to the TraceLogging attribute of the session when the parsing result is a global serial number configuration; The log processing module is used to store the logs in the transaction processing according to the global serial number in the session.

7. The device according to claim 6, characterized in that The log processing module includes: A transaction processing unit, configured to process a transaction and obtain a transaction processing result; A storage unit is used to associate the transaction processing result with the global serial number and store them in a log.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Request link context processing method, device and system

    CN108847952A

  • Log storage and calling method, device and system

    CN112579552A