Transaction data processing method, computer readable storage medium and electronic device
By converting the format of the initial transaction data, extracting key fields, and grouping and sorting them, a target string is generated, which solves the problem that the SkyWalking system cannot analyze the transaction-level call chain and enables efficient business model positioning and performance analysis.
Patent Information
- Application Number
- CN202211711882.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-12-29
AI Technical Summary
The existing SkyWalking system cannot analyze transaction-level call chains based on business models, resulting in low efficiency in abnormal business model localization and performance analysis.
Receive initial transaction data sent by the client, convert the format to string format, extract key fields, group and sort, and generate target strings to determine the calling relationships between transaction data.
It enables rapid and accurate location of abnormal business models and performance analysis, improving the efficiency of transaction-level call chain analysis.
Smart Images

Figure CN116303703B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed data processing technology, and more specifically, to a method for processing transaction data, a server, a computer-readable storage medium, and an electronic device. Background Technology
[0002] With the emergence of distributed systems and microservice architectures, a single request may pass through multiple systems, and the call relationships between services are quite complex. SkyWalking is a mainstream application performance management (APM) system that can quickly locate and analyze abnormal nodes when anomalies occur. It can be used to collect, analyze, aggregate, and visualize data from services and cloud-native infrastructure (such as databases). However, SkyWalking cannot analyze transaction-level call chains based on business models. Summary of the Invention
[0003] The main objective of this application is to provide a method for processing transaction data, a server, a computer-readable storage medium, and an electronic device to solve the problem that the existing SkyWalking system cannot analyze transaction-level call chains based on business models.
[0004] According to one aspect of the present invention, a method for processing transaction data is provided, comprising: receiving initial transaction data sent by a client, the initial transaction data being data related to the client requesting the execution of a target task; converting the format of the initial transaction data to obtain first transaction data, and extracting key fields from the first transaction data to obtain second transaction data; grouping and sorting the second transaction data, and generating a target string, the target string including a calling relationship between any two second transaction data corresponding to the execution of the target task, wherein the calling relationship includes at least the execution order between any two second transaction data, there are multiple second transaction data, and one second transaction data corresponds to a subtask in the target task.
[0005] Optionally, the initial transaction data is format-converted to obtain first transaction data, and key fields in the first transaction data are extracted to obtain second transaction data. This includes: converting the initial transaction data into string format to obtain the first transaction data; extracting key fields from all fields of the first transaction data, wherein the key fields include at least one of the following: business name, business model identifier, and business type; and combining the extracted key fields to obtain the second transaction data.
[0006] Optionally, grouping and sorting the second transaction data and generating a target string includes: obtaining a global business tracking number from the second transaction data, wherein the global business tracking number is a unique identifier for the client requesting to execute the target task, the global business tracking number is generated by an event, the target task to be executed includes multiple events, and one event corresponds to one piece of the second transaction data; dividing the second transaction data into multiple sub-transaction data; grouping the multiple sub-transaction data according to the global business tracking number to obtain multiple data groups, each data group including at least one piece of the sub-transaction data; sorting the sub-transaction data in each data group, and generating the target string based on the sorted sub-transaction data.
[0007] Optionally, the multiple sub-transaction data are grouped according to the global business tracking number to obtain multiple data groups, including: extracting multiple sub-transaction data corresponding to the same global business tracking number; and dividing the multiple sub-transaction data corresponding to the same global business tracking number into one data group to obtain multiple data groups.
[0008] Optionally, sorting the sub-transaction data in each of the data groups and generating the target string based on the sorted sub-transaction data includes: obtaining the call relationship between any two sub-transaction data and the transaction identifier of each sub-transaction data, where the call relationship between any two sub-transaction data refers to the execution order between any two sub-transaction data, and the transaction identifier refers to the unique identifier of the sub-transaction data; if the execution order between any two sub-transaction data is different, sorting them according to the execution order between the two sub-transaction data and generating the target string, where the target string is: the order in which the sub-transaction data runs first. The sub-transaction data includes the execution number, the transaction identifier of the first-running sub-transaction data, the execution number of the second-running sub-transaction data, and the transaction identifier of the third-running sub-transaction data. If any two sub-transaction data are at the same execution order, they are sorted according to the chronological order of their execution times, and a target string is generated. The target string is: the execution number of the first-running sub-transaction data, the transaction identifier of the first-running sub-transaction data, the execution number of the second-running sub-transaction data, and the transaction identifier of the third-running sub-transaction data.
[0009] Optionally, the method further includes: counting the number of transactions requested by the client; counting the number of successful transactions among the number of transactions requested by the client; and obtaining the quotient of the number of transactions and the number of successful transactions to obtain the success rate of the successful transactions.
[0010] Optionally, the method further includes: obtaining the request time of the client requesting the transaction and the completion time of the transaction; obtaining the time difference between the completion time and the request time, and determining the time difference as the time taken to complete the transaction.
[0011] According to another aspect of the present invention, a server is also provided, comprising: a receiving unit for receiving initial transaction data sent by a client, the initial transaction data being data related to the client's request to execute a target task; a first processing unit for converting the format of the initial transaction data to obtain first transaction data, and extracting key fields from the first transaction data to obtain second transaction data; and a second processing unit for grouping and sorting the second transaction data and generating a target string, the target string including a calling relationship between any two second transaction data corresponding to the execution of the target task, wherein the calling relationship includes at least the order of execution between any two second transaction data, there are multiple second transaction data, and one second transaction data corresponds to a subtask in the target task.
[0012] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program executes any one of the methods described.
[0013] According to another aspect of the present invention, an electronic device is also provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any one of the methods described.
[0014] In this embodiment of the invention, initial transaction data sent by the client is first received. Then, the format of the initial transaction data is converted to obtain first transaction data. Data from key fields in the first transaction data is extracted to obtain second transaction data. Finally, the second transaction data is grouped and sorted to generate a target string. In this scheme, the received initial transaction data can be format converted to obtain first transaction data. Only the second transaction data corresponding to the key fields in the first transaction data can be extracted. By grouping and sorting the second transaction data, the calling relationship between any two second transaction data can be obtained. This calling relationship can determine the execution order of any two second transaction data, thereby determining the transaction-level call chain. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A flowchart illustrating a method for processing transaction data according to an embodiment of this application is shown.
[0017] Figure 2 A timeline diagram illustrating the processing of transaction data is shown.
[0018] Figure 3 A schematic diagram of the structure of a server according to an embodiment of this application is shown. Detailed Implementation
[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be an intermediate element present. Furthermore, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element via a third element.
[0023] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0024] Distributed Link Tracing: Distributed link tracing (technology) is an application observability solution for cloud-native architectures such as distributed and microservice architectures. It can clearly reveal the complex call relationships, performance metrics, error messages, and related logs between applications and services in a large-scale microservice architecture, thereby enabling tasks such as root cause analysis, service governance, application development and debugging, performance management, performance tuning, architecture control, and fault attribution.
[0025] Performance analysis: For transactions, the processing time and network time of a single transaction can be analyzed based on the request time, request reception time, response time and response reception time of each transaction, as well as the time of each node in the transaction chain and even the key processing steps within the system, so as to analyze the changes in transaction response over a period of time.
[0026] Global Business Tracking Number: A global business tracking number is a type of serial number. It is generated by the event trigger point (event-triggered or rule-triggered), is globally unique, and shared throughout the entire transaction process (which includes multiple events), persisting until the event is completely completed (transaction ends). That is, the same global business tracking number is inherited by different systems, platforms, components, or transaction flows when the same event is processed. If an event triggers multiple sub-events, the sub-events also inherit the same global business tracking number. The global business tracking number is generated by the initiating system (component). If the initiating system (component) is not an internal system, then the first system (component) entering the internal system is responsible for generating it.
[0027] Business model: also known as business modeling, business modeling is a software model used to describe the objects and elements involved in enterprise management and business, as well as their attributes, behaviors and relationships. Business modeling emphasizes understanding, designing and structuring enterprise information systems in a systematic way.
[0028] The SkyWalking system cannot analyze transaction-level call chains based on business models, nor can it efficiently and quickly locate abnormal business models and perform performance analysis. For example, it cannot view the call relationships between multiple business models of a transaction code in a deposit system, from the online gateway to specific combined services and specific atomic services.
[0029] As mentioned in the background section, the existing SkyWalking system cannot analyze transaction-level call chains based on business models. To solve the above problem, in a typical embodiment of this application, a transaction data processing method, a server, a computer-readable storage medium, and an electronic device are provided.
[0030] According to an embodiment of this application, a method for processing transaction data is provided.
[0031] Figure 1 This is a flowchart of a transaction data processing method according to an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0032] Step S101: Receive initial transaction data sent by the client. The initial transaction data is data related to the client's request to execute the target task.
[0033] In step S101 above, the initial transaction data sent by the client can be received. The initial transaction data is the link data. Since the client did not group or sort the initial transaction data when uploading it, the received initial transaction data is also not grouped or sorted. The received initial transaction data can be processed later to determine the initial transaction data grouping and order.
[0034] Step S102: Convert the format of the initial transaction data to obtain the first transaction data, and extract the key fields from the first transaction data to obtain the second transaction data;
[0035] Specifically, the initial transaction data can be in Protobuf format. This initial transaction data can be converted to string format, or other formats. Because Protobuf data takes a long time to develop and places high demands on the model's time performance, it can be converted to string format to ensure fast data processing and avoid poor readability.
[0036] In step S102 above, the initial transaction data can be formatted and converted into first transaction data that is easier to process and more readable. Since some data in the first transaction data does not affect the transaction, only the key fields in the first transaction data can be extracted to obtain the second transaction data. The second transaction data is at least a part of the first transaction data. This ensures that the data processing speed is faster when processing the second data later.
[0037] Step S103: Group and sort the second transaction data and generate a target string. The target string includes the calling relationship between any two of the second transaction data corresponding to the execution of the target task. The calling relationship includes at least the order of execution between any two of the second transaction data. There are multiple second transaction data, and one of the second transaction data corresponds to a subtask of the target task.
[0038] In step S103 above, one second transaction data corresponds to one subtask, and the execution of the subtask can be performed through a business model. By grouping and sorting the second transaction data, the target string can be obtained. This allows us to determine the calling relationship between any two second transaction data, and thus determine the calling relationship between multiple business models. In turn, we can obtain the calling chain between business models at the transaction dimension. Subsequently, in a large-scale bank's distributed, microservice architecture, the specific business model that has failed can be quickly located through the target string.
[0039] The above method first receives initial transaction data sent by the client, then converts the format of the initial transaction data to obtain first transaction data, and extracts the key fields from the first transaction data to obtain second transaction data. Finally, the second transaction data is grouped and sorted to generate the target string. This scheme can convert the received initial transaction data to obtain first transaction data, and can extract only the second transaction data corresponding to the key fields in the first transaction data. By grouping and sorting the second transaction data, the calling relationship between any two second transaction data can be obtained. This calling relationship can determine the execution order of any two second transaction data, thereby determining the transaction-level call chain.
[0040] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0041] When converting the format of initial transaction data, it can be converted into a format with less computational complexity. String format data has less computational complexity, so it can be converted into string format data. In one embodiment of this application, the initial transaction data is converted to obtain first transaction data, and key fields in the first transaction data are extracted to obtain second transaction data. The specific steps include the following:
[0042] Step S201: Convert the initial transaction data into string format to obtain the first transaction data.
[0043] Step S202: Extract key field data from all fields of the first transaction data. The key fields include at least one of the following: business name, business model identifier, and business type.
[0044] In one optional embodiment, the key fields may include the business name (a field of the business's name attribute), the key fields may include the business model identifier (the business's IP), the key fields may include the business type (whether the business is a deposit or a remittance, etc.), the key fields may include the business name and the business model identifier, the key fields may include the business name and the business type, the key fields may include the business model identifier and the business type, the key fields may include the business name, the business model identifier and the business type. Of course, the key fields are not limited to the above-mentioned types, and other key fields may also be selected.
[0045] Step S203: Combine the extracted key field data to obtain the second transaction data.
[0046] In steps S201 to S203 above, since the computational amount of string format data is small, the conversion process takes less time. Thus, by combining the key fields in the first transaction data, the resulting second transaction data is also in string format, which facilitates the subsequent generation of the target string.
[0047] Since the initial transaction data sent by the client is neither grouped nor sorted, the order of the second transaction data obtained from the initial transaction data is disordered. It's possible that data from one transaction might be mistakenly inserted into the same batch of data. Therefore, grouping and sorting the second transaction data can ensure that the categories and order of the second transaction data are clearer. In another embodiment of this application, grouping and sorting the aforementioned second transaction data and generating a target string specifically includes the following steps:
[0048] Step S301: Obtain the global business tracking number from the second transaction data. The global business tracking number is a unique identifier for the client to request the execution of the target task. The global business tracking number is generated by an event. The target task to be executed includes multiple events, and one event corresponds to one piece of the second transaction data.
[0049] Step S302: Divide the above-mentioned second transaction data into multiple sub-transaction data;
[0050] Step S303: Group the multiple sub-transaction data according to the global business tracking number to obtain multiple data groups, each of the data groups including at least one of the sub-transaction data.
[0051] To further improve the efficiency and speed of grouping multiple sub-transaction data, in one specific embodiment of this application, multiple sub-transaction data are grouped according to the aforementioned global business tracking number to obtain multiple data groups. This includes: extracting multiple sub-transaction data corresponding to the same global business tracking number; and grouping the multiple sub-transaction data corresponding to the same global business tracking number into one data group, thus obtaining multiple data groups. In this embodiment, sub-transaction data can be grouped according to the global business tracking number, so that multiple sub-transaction data with the same global business tracking number can be grouped into one data group, which can efficiently and quickly distinguish multiple transactions.
[0052] Specifically, data can also be grouped according to time windows. Multiple sub-transaction data belonging to the same time window can be grouped according to the global business tracking number. Sub-transactions within the same data group can also be linked together and numbered sequentially.
[0053] By linking the sub-transaction data of the system together using a global business tracking number with business meaning, the connection between sub-transaction data can be realized.
[0054] Step S304: Sort the sub-transaction data in each of the above data groups, and generate the target string based on the sorted sub-transaction data.
[0055] By aggregating and analyzing sub-transaction data, a transaction link view can be obtained by dividing the data according to the new core transaction business model. The sub-transaction data can be categorized and then further subdivided into each endpoint (the lowest level of sub-transaction data). The generated target string can clearly show the link call relationship between business models, thereby enabling refined location of abnormal business models and improving the efficiency of location analysis.
[0056] To further optimize and expedite the sorting of sub-transaction data within a data group, thereby generating the target string more efficiently and accurately, in one specific embodiment of this application, the sub-transaction data in each of the aforementioned data groups is sorted, and the target string is generated based on the sorted sub-transaction data. This includes: obtaining the call relationship between any two sub-transaction data and the transaction identifier of each sub-transaction data; the call relationship between any two sub-transaction data refers to the execution order between any two sub-transaction data, and the transaction identifier refers to the unique identifier of the sub-transaction data; and when the execution order between any two sub-transaction data is different, sorting is performed according to the execution order between the two sub-transaction data. The process involves sorting the sub-transaction data according to their execution time, generating the target string. The target string consists of: the execution number of the first sub-transaction data to run, the transaction identifier of the first sub-transaction data to run, the execution number of the second sub-transaction data to run, and the transaction identifier of the second sub-transaction data to run. If any two sub-transaction data are at the same execution level, they are sorted according to their execution time, and the target string is generated. The target string consists of: the execution number of the first sub-transaction data to run, the transaction identifier of the first sub-transaction data to run, the execution number of the second sub-transaction data to run, and the transaction identifier of the second sub-transaction data to run. In this embodiment, since the order of sub-transaction data within the same data group is random, sorting can be performed based on the specific calling relationship between the sub-transaction data and the transaction identifier of the sub-transaction data. If the calling relationship indicates that two sub-transaction data are at the same execution level, they can be sorted according to their execution time. This allows for a more efficient and accurate determination of the order between multiple sub-transaction data, further ensuring the accuracy of the obtained target string.
[0057] Specifically, you can first obtain the transaction identifiers of all sub-transaction data. Sub-transaction data includes parent-class sub-transaction data and child-class sub-transaction data. Parent-class sub-transaction data refers to data with leaf nodes below it, which will be called. Child-class sub-transaction data refers to data without leaf nodes below it.
[0058] The top-level parent class sub-transaction data is found, with the number (transaction identifier) 1. Within the same group, the sub-transaction data is sorted sequentially according to the running order. The next running sub-transaction data is numbered 2. If there are multiple sub-transaction data, the sorting continues until a sub-transaction data without leaf nodes is found. If two sub-transaction data are at the same level, they are sorted according to their time order.
[0059] For example, there are five sub-transaction data: A, B, C, D, and E. However, because the order in which the client reports the data is random, the original order of the transmitted data might be A, C, D, B, E. Sort according to their calling relationships, we can see that A calls B, B calls C, C runs before D runs, and D runs before E runs. Therefore, the correct order should be A, B, C, D, E. If the calling relationship is that A calls both B and C simultaneously, C runs before D runs, and D runs before E runs, we can determine the times when A calls B and C. If C is called earlier, then the correct order should be A, C, B, D, E.
[0060] In another optional embodiment, the sub-transaction data can be sorted sequentially in ascending order. The target string can also include the business model name corresponding to the sub-transaction data. Then the target string can be: the execution number of the first running sub-transaction data | the business model name of the first running sub-transaction data | the transaction identifier of the first running sub-transaction data | the execution number of the second running sub-transaction data | the business model name of the second running sub-transaction data | the transaction identifier of the second running sub-transaction data | the parent class number of the second running sub-transaction data...
[0061] Of course, you can also calculate the MD5 value of the target string, and use the MD5 value of the target string as its unique identifier.
[0062] Specifically, a mapping relationship can be established between sub-transaction data in the chain and the business model, which can also determine the call chain between business models.
[0063] In steps S301 to S304 above, sub-transaction data can be grouped according to the global business tracking number. Sub-transaction data in the same group have the same global business tracking number. This allows for the rapid grouping of multiple sub-transaction data to distinguish different transactions. Furthermore, the sub-transaction data within the data group can be sorted. The sorted order of the sub-transaction data is relatively clear, as it is arranged according to the order in which the transactions were generated. The resulting target string can represent the calling relationship between multiple sub-transaction data.
[0064] In some implementations, the SkyWalking system also fails to calculate operational metrics for transaction success rates. Therefore, to help staff accurately assess transaction status and perform performance analysis on the transaction system, in another embodiment of this application, the method further includes the following steps:
[0065] Step S401: Count the number of transactions requested by the above clients;
[0066] Step S402: Count the number of successful transactions among the number of transactions requested by the client.
[0067] Step S403: Obtain the quotient of the above number of transactions and the above number of successful transactions to get the success rate of successful transactions.
[0068] In steps S401 to S403 above, specific transaction success rate indicators can be calculated, thereby enabling a relatively accurate determination of the operational status of the business model corresponding to a transaction under the distributed, microservice architecture of a large bank.
[0069] In some implementations, the SkyWalking system also fails to calculate the transaction time as a performance indicator. To help staff accurately determine the status of transactions and perform performance analysis on the transaction system, in another embodiment of this application, the above method further includes the following steps:
[0070] Step S501: Obtain the request time of the client's request for the transaction and the completion time of the transaction.
[0071] Step S502: Obtain the time difference between the completion time and the request time, and determine the time difference as the time required to complete the transaction.
[0072] In steps S501 to S502 above, the specific time taken to complete the transaction can be calculated, thereby enabling a relatively accurate determination of the operational status of the business model corresponding to the transaction under the distributed, microservice architecture of a large bank.
[0073] In one specific embodiment, the transaction data processing procedure of this solution is as follows: Figure 2 As shown, the link data (initial transaction data) is obtained from the data source (client); then aggregation calculations are performed, and the data format is converted. Figure 2 (Data transformation in the process) to obtain the first transaction data, extract the key fields from the first transaction data and parse them ( Figure 2 The data is parsed, then grouped according to grouping rules (based on the global business tracking number), then numbered and sorted according to orchestration rules (based on the call relationship and transaction identifier between sub-transaction data), then the running indicators are calculated, including the time taken to complete the transaction within the time window, the success rate of the transaction, and the transaction volume (the number of transactions requested by the client); finally, the transaction links with business model meaning are grouped together. Figure 2 The business models with numbers, each business model corresponding to a subtask, and each subtask used to execute a sub-transaction (data) and corresponding operating indicators are stored in the database.
[0074] This application also provides a server. It should be noted that the server in this application can be used to execute the transaction data processing method provided in this application. The server provided in this application is described below.
[0075] Figure 3 This is a schematic diagram of a server according to an embodiment of this application. For example... Figure 3 As shown, the server includes:
[0076] The receiving unit 10 is used to receive initial transaction data sent by the client, wherein the initial transaction data is data related to the client's request to execute the target task;
[0077] The aforementioned receiving unit can receive initial transaction data sent by the client. The initial transaction data is the link data. Since the client did not group or sort the initial transaction data when uploading it, the received initial transaction data is also not grouped or sorted. The received initial transaction data can be processed later to determine the initial transaction data grouping and order.
[0078] The first processing unit 20 is used to perform format conversion on the above-mentioned initial transaction data to obtain first transaction data, and extract the data of key fields in the above-mentioned first transaction data to obtain second transaction data;
[0079] Specifically, the initial transaction data can be in Protobuf format. This initial transaction data can be converted to string format, or other formats. Because Protobuf data takes a long time to develop and places high demands on the model's time performance, it can be converted to string format to ensure fast data processing and avoid poor readability.
[0080] The first processing unit described above can convert the format of the initial transaction data into first transaction data that is easier to process and more readable. Furthermore, some data in the first transaction data does not affect the transaction, so only the key fields in the first transaction data can be extracted to obtain the second transaction data. The second transaction data is at least a part of the first transaction data, so that the data processing speed can be guaranteed to be faster when processing the second data later.
[0081] The second processing unit 30 is used to group and sort the second transaction data and generate a target string. The target string includes the calling relationship between any two of the second transaction data corresponding to the execution of the target task. The calling relationship includes at least the order of execution between any two of the second transaction data. There are multiple second transaction data, and one of the second transaction data corresponds to a subtask of the target task.
[0082] The second processing unit described above has one subtask corresponding to one second transaction data. The execution of the subtask can be performed through a business model. By grouping and sorting the second transaction data, a target string can be obtained. This allows us to determine the calling relationship between any two second transaction data, and thus the calling relationship between multiple business models. In turn, we can obtain the calling chain between business models at the transaction dimension. Subsequently, in a large-scale bank's distributed, microservice architecture, the specific business model that has malfunctioned can be quickly located through the target string.
[0083] In the aforementioned server, the receiving unit receives initial transaction data sent by the client. The first processing unit converts the format of the initial transaction data to obtain first transaction data, and extracts the key fields from the first transaction data to obtain second transaction data. The second processing unit groups and sorts the second transaction data and generates a target string. This scheme can convert the received initial transaction data to obtain first transaction data, and can extract only the second transaction data corresponding to the key fields in the first transaction data. By grouping and sorting the second transaction data, the calling relationship between any two second transaction data can be obtained. This calling relationship can determine the execution order of any two second transaction data, thereby determining the transaction-level call chain.
[0084] When converting the format of initial transaction data, it can be converted into a format with less computational complexity. String format data has less computational complexity, so it can be converted into string format data. In one embodiment of this application, the first processing unit includes a conversion module, an extraction module, and a combination module. The functions of each module are as follows:
[0085] The conversion module is used to convert the initial transaction data into string format data to obtain the first transaction data.
[0086] The extraction module is used to extract key field data from all fields of the first transaction data mentioned above. The key fields include at least one of the following: business name, business model identifier, and business type.
[0087] In one optional embodiment, the key fields may include the business name (a field of the business's name attribute), the key fields may include the business model identifier (the business's IP), the key fields may include the business type (whether the business is a deposit or a remittance, etc.), the key fields may include the business name and the business model identifier, the key fields may include the business name and the business type, the key fields may include the business model identifier and the business type, the key fields may include the business name, the business model identifier and the business type. Of course, the key fields are not limited to the above-mentioned types, and other key fields may also be selected.
[0088] The combination module is used to combine the extracted key fields to obtain the second transaction data.
[0089] The conversion, extraction, and combination modules described above consume less time during the conversion process because the computational load of string format data is relatively small. By combining the key fields in the first transaction data, the resulting second transaction data is also in string format, which facilitates the subsequent generation of the target string.
[0090] Since the initial transaction data sent by the client is neither grouped nor sorted, the order of the second transaction data obtained from the initial transaction data is disordered. It is possible that data from one transaction in the same batch of data may be mistakenly inserted into data from another transaction. Therefore, by grouping and sorting the second transaction data, the categories and order of the second transaction data can be made clearer. In another embodiment of this application, the second processing unit includes an acquisition module, a partitioning module, a grouping module, and a processing module. The functions of each module are as follows:
[0091] The acquisition module is used to acquire the global business tracking number in the second transaction data. The global business tracking number is a unique identifier for the client to request the execution of the target task. The global business tracking number is generated by an event. The target task to be executed includes multiple events, and one event corresponds to one piece of the second transaction data.
[0092] The partitioning module is used to partition the aforementioned second transaction data into multiple sub-transaction data.
[0093] The grouping module is used to group multiple sub-transaction data according to the global business tracking number to obtain multiple data groups, and each of the data groups includes at least one of the sub-transaction data.
[0094] To further improve the efficiency and speed of grouping multiple sub-transaction data, in one specific embodiment of this application, the partitioning module includes an extraction sub-module and a partitioning sub-module. The extraction sub-module is used to extract multiple sub-transaction data corresponding to the same global business tracking number; the partitioning sub-module is used to partition the multiple sub-transaction data corresponding to the same global business tracking number into one data group, resulting in multiple data groups. In this embodiment, sub-transaction data can be grouped according to the global business tracking number, so that multiple sub-transaction data with the same global business tracking number can be grouped into one data group, thus enabling more efficient and faster differentiation of multiple transactions.
[0095] Specifically, data can also be grouped according to time windows. Multiple sub-transaction data belonging to the same time window can be grouped according to the global business tracking number. Sub-transactions within the same data group can also be linked together and numbered sequentially.
[0096] By linking the sub-transaction data of the system together using a global business tracking number with business meaning, the connection between sub-transaction data can be realized.
[0097] The processing module is used to sort the sub-transaction data in each of the above data groups and generate the target string based on the sorted sub-transaction data.
[0098] By aggregating and analyzing sub-transaction data, a transaction link view can be obtained by dividing the data according to the new core transaction business model. The sub-transaction data can be categorized and then further subdivided into each endpoint (the lowest level of sub-transaction data). The generated target string can clearly show the link call relationship between business models, thereby enabling refined location of abnormal business models and improving the efficiency of location analysis.
[0099] To further improve efficiency and speed in sorting sub-transaction data within a data group, and to generate target strings more efficiently and accurately, in one specific embodiment of this application, the processing module includes an acquisition submodule, a first processing submodule, and a second processing submodule. The acquisition submodule is used to acquire the call relationship between any two of the aforementioned sub-transaction data and the transaction identifier of each of the aforementioned sub-transaction data. The call relationship between any two of the aforementioned sub-transaction data refers to the order in which they are executed, and the transaction identifier refers to the unique identifier of the aforementioned sub-transaction data. The first processing submodule is used to sort the sub-transaction data according to the order in which they are executed when they are at different levels, and to generate the target string. The target string is defined as follows: the execution number of the first-running sub-transaction data, the transaction identifier of the first-running sub-transaction data, the execution number of the second-running sub-transaction data, and the transaction identifier of the second-running sub-transaction data. The second processing submodule is used to sort the sub-transaction data according to their execution time order when the execution order is at the same level, and generate the target string. The target string is defined as follows: the execution number of the first-running sub-transaction data, the transaction identifier of the first-running sub-transaction data, the execution number of the second-running sub-transaction data, and the transaction identifier of the second-running sub-transaction data. In this embodiment, since the order of sub-transaction data within the same data group is random, sorting can be performed based on the specific calling relationship between the sub-transaction data and the transaction identifier of the sub-transaction data. If the calling relationship indicates that the order of two sub-transaction data is at the same level, then sorting can be performed according to their execution time order. This can efficiently and accurately obtain the order between multiple sub-transaction data, thereby further ensuring the accuracy of the obtained target string.
[0100] Specifically, you can first obtain the transaction identifiers of all sub-transaction data. Sub-transaction data includes parent-class sub-transaction data and child-class sub-transaction data. Parent-class sub-transaction data refers to data with leaf nodes below it, which will be called. Child-class sub-transaction data refers to data without leaf nodes below it.
[0101] The top-level parent class sub-transaction data is found, with the number (transaction identifier) 1. Within the same group, the sub-transaction data is sorted sequentially according to the running order. The next running sub-transaction data is numbered 2. If there are multiple sub-transaction data, the sorting continues until a sub-transaction data without leaf nodes is found. If two sub-transaction data are at the same level, they are sorted according to their time order.
[0102] For example, there are five sub-transaction data: A, B, C, D, and E. However, because the order in which the client reports the data is random, the original order of the transmitted data might be A, C, D, B, E. Sort according to their calling relationships, we can see that A calls B, B calls C, C runs before D runs, and D runs before E runs. Therefore, the correct order should be A, B, C, D, E. If the calling relationship is that A calls both B and C simultaneously, C runs before D runs, and D runs before E runs, we can determine the times when A calls B and C. If C is called earlier, then the correct order should be A, C, B, D, E.
[0103] In another optional embodiment, the sub-transaction data can be sorted sequentially in ascending order. The target string can also include the business model name corresponding to the sub-transaction data. Then the target string can be: the execution number of the first running sub-transaction data | the business model name of the first running sub-transaction data | the transaction identifier of the first running sub-transaction data | the execution number of the second running sub-transaction data | the business model name of the second running sub-transaction data | the transaction identifier of the second running sub-transaction data | the parent class number of the second running sub-transaction data...
[0104] Of course, you can also calculate the MD5 value of the target string, and use the MD5 value of the target string as its unique identifier.
[0105] Specifically, a mapping relationship can be established between sub-transaction data in the chain and the business model, which can also determine the call chain between business models.
[0106] The aforementioned acquisition, partitioning, grouping, and processing modules can group sub-transaction data based on the global business tracking number. Sub-transaction data in the same group share the same global business tracking number, allowing for rapid grouping of multiple sub-transaction data to distinguish different transactions. Furthermore, the modules can sort the sub-transaction data within a data group. The sorted order of the sub-transaction data is relatively clear, arranged according to the order in which the transactions were generated. The resulting target string can then represent the calling relationship between multiple sub-transaction data.
[0107] In some implementations, the SkyWalking system also fails to calculate operational metrics for transaction success rates. Therefore, to help staff accurately determine the status of transactions and perform performance analysis on the transaction system, in another embodiment of this application, the server further includes a first statistical unit, a second statistical unit, and a first acquisition unit. The functions of each unit are as follows:
[0108] The first statistical unit is used to count the number of transactions requested by the aforementioned clients;
[0109] The second statistical unit is used to count the number of successful transactions among the number of transactions requested by the client mentioned above.
[0110] The first acquisition unit is used to obtain the quotient of the above-mentioned number of transactions and the above-mentioned number of successful transactions, and to obtain the success rate of successful transactions.
[0111] The first statistical unit, the second statistical unit, and the first acquisition unit mentioned above can calculate the specific transaction success rate indicators, thereby enabling a relatively accurate determination of the operational status of the business model corresponding to a transaction under the distributed, microservice architecture of a large bank.
[0112] In some solutions, the SkyWalking system also cannot calculate the transaction time as a performance indicator. To help staff accurately determine the status of transactions and perform performance analysis on the transaction system, in another embodiment of this application, the server further includes a second acquisition unit and a third acquisition unit, the functions of which are as follows:
[0113] The second acquisition unit is used to acquire the request time of the client's request for the transaction and the completion time of the transaction.
[0114] The third acquisition unit is used to acquire the time difference between the completion time and the request time, and determine the time difference as the time taken to complete the transaction.
[0115] The second and third acquisition units mentioned above can calculate the specific time required to complete a transaction, thereby enabling a relatively accurate determination of the operational status of the business model corresponding to a transaction in a large bank's distributed, microservice architecture.
[0116] The server includes a processor and a memory. The receiving unit, the first processing unit, and the second processing unit are all stored in the memory as program units. The processor executes the program units stored in the memory to achieve the corresponding functions.
[0117] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and kernel parameters can be adjusted to analyze transaction-level call chains based on business models.
[0118] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0119] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the above-described method for processing transaction data.
[0120] This invention provides a processor for running a program, wherein the program executes a method for processing the transaction data.
[0121] This application also provides an electronic device including one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any of the above-described methods.
[0122] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0123] Step S101: Receive initial transaction data sent by the client. The initial transaction data is data related to the client's request to execute the target task.
[0124] Step S102: Convert the format of the initial transaction data to obtain the first transaction data, and extract the key fields from the first transaction data to obtain the second transaction data;
[0125] Step S103: Group and sort the second transaction data and generate a target string. The target string includes the calling relationship between any two of the second transaction data corresponding to the execution of the target task. The calling relationship includes at least the order of execution between any two of the second transaction data. There are multiple second transaction data, and one of the second transaction data corresponds to a subtask of the target task.
[0126] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0127] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0128] Step S101: Receive initial transaction data sent by the client. The initial transaction data is data related to the client's request to execute the target task.
[0129] Step S102: Convert the format of the initial transaction data to obtain the first transaction data, and extract the key fields from the first transaction data to obtain the second transaction data;
[0130] Step S103: Group and sort the second transaction data and generate a target string. The target string includes the calling relationship between any two of the second transaction data corresponding to the execution of the target task. The calling relationship includes at least the order of execution between any two of the second transaction data. There are multiple second transaction data, and one of the second transaction data corresponds to a subtask of the target task.
[0131] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0132] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units described above can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0133] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0134] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0135] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0136] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0137] 1) The transaction data processing method of this application first receives initial transaction data sent by the client, then converts the format of the initial transaction data to obtain first transaction data, extracts the key fields from the first transaction data to obtain second transaction data, and finally groups and sorts the second transaction data to generate a target string. In this scheme, the received initial transaction data can be converted to obtain first transaction data, and only the second transaction data corresponding to the key fields in the first transaction data can be extracted. By grouping and sorting the second transaction data, the calling relationship between any two second transaction data can be obtained. The calling relationship can determine the execution order of any two second transaction data, thereby determining the transaction-level call chain.
[0138] 2) In this application, the server receiving unit receives initial transaction data sent by the client. The first processing unit converts the format of the initial transaction data to obtain first transaction data, and extracts the key fields from the first transaction data to obtain second transaction data. The second processing unit groups and sorts the second transaction data and generates a target string. In this scheme, the received initial transaction data can be converted to obtain first transaction data, and only the second transaction data corresponding to the key fields in the first transaction data can be extracted. By grouping and sorting the second transaction data, the calling relationship between any two second transaction data can be obtained. The calling relationship can determine the execution order of any two second transaction data, thereby determining the transaction-level call chain.
[0139] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for processing transaction data, characterized in that, include: Receive initial transaction data sent by the client, the initial transaction data being data related to the client's request to execute a target task; The initial transaction data is format-converted to obtain first transaction data, and the key fields in the first transaction data are extracted to obtain second transaction data; The second transaction data is grouped and sorted to generate a target string. The target string includes the calling relationship between any two pieces of the second transaction data corresponding to the execution of the target task. The calling relationship includes at least the execution order between any two pieces of the second transaction data. There are multiple pieces of the second transaction data, and one piece of the second transaction data corresponds to a subtask of the target task. The process of grouping and sorting the second transaction data and generating a target string includes: obtaining a global business tracking number from the second transaction data, wherein the global business tracking number is a unique identifier for the client requesting to execute the target task, the global business tracking number is generated by an event, the target task to be executed includes multiple events, and one event corresponds to one piece of the second transaction data; dividing the second transaction data into multiple sub-transaction data; grouping the multiple sub-transaction data according to the global business tracking number to obtain multiple data groups, each data group including at least one piece of the sub-transaction data; sorting the sub-transaction data in each data group; and generating the target string based on the sorted sub-transaction data.
2. The method according to claim 1, characterized in that, The initial transaction data is format-converted to obtain first transaction data, and key fields in the first transaction data are extracted to obtain second transaction data, including: The initial transaction data is converted into string format to obtain the first transaction data; Extract key fields from all fields of the first transaction data. The key fields include at least one of the following: business name, business model identifier, and business type. The extracted key fields are combined to obtain the second transaction data.
3. The method according to claim 1, characterized in that, Based on the global business tracking number, the multiple sub-transaction data are grouped to obtain multiple data groups, including: Extract multiple sub-transaction data corresponding to the same global business tracking number; Multiple sub-transaction data corresponding to the same global business tracking number are divided into one data group to obtain multiple data groups.
4. The method according to claim 1, characterized in that, Sort the sub-transaction data in each of the data groups, and generate the target string based on the sorted sub-transaction data, including: Obtain the call relationship between any two sub-transaction data and the transaction identifier of each sub-transaction data. The call relationship between any two sub-transaction data refers to the order in which they are executed. The transaction identifier is the unique identifier of the sub-transaction data. If the execution order between any two sub-transaction data is different, the sub-transaction data is sorted according to the execution order between the two sub-transaction data, and the target string is generated. The target string is: the execution number of the sub-transaction data that runs first, the transaction identifier of the sub-transaction data that runs first, the execution number of the sub-transaction data that runs later, and the transaction identifier of the sub-transaction data that runs later. If any two sub-transaction data are executed at the same level, they are sorted according to the order in which they were executed and a target string is generated. The target string is: the execution number of the sub-transaction data that ran earlier, the transaction identifier of the sub-transaction data that ran earlier, the execution number of the sub-transaction data that ran later, and the transaction identifier of the sub-transaction data that ran later.
5. The method according to claim 1, characterized in that, The method further includes: Count the number of transactions requested by the client; The number of successful transactions is counted out of the number of transactions requested by the client. The success rate of a transaction is obtained by quotienting the number of transactions and the number of successful transactions.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the request time of the client's transaction request and the completion time of the transaction; Obtain the time difference between the completion time and the request time, and determine the time difference as the time taken to complete the transaction.
7. A server, characterized in that, include: A receiving unit is configured to receive initial transaction data sent by a client, wherein the initial transaction data is data related to the client's request to execute a target task; The first processing unit is used to convert the format of the initial transaction data to obtain the first transaction data, and extract the data of the key fields in the first transaction data to obtain the second transaction data. The second processing unit is used to group and sort the second transaction data and generate a target string. The target string includes a call relationship between any two pieces of the second transaction data corresponding to the execution of the target task. The call relationship includes at least the execution order between any two pieces of the second transaction data. There are multiple pieces of the second transaction data, and one piece of the second transaction data corresponds to a subtask of the target task. The second processing unit includes an acquisition module, a partitioning module, a grouping module, and a processing module. The acquisition module acquires the global business tracking number from the second transaction data. The global business tracking number is a unique identifier for the client requesting the execution of the target task. The global business tracking number is generated by an event, and the requested target task includes multiple events, with each event corresponding to one piece of the second transaction data. The partitioning module partitions the second transaction data to obtain multiple sub-transaction data. The grouping module groups the multiple sub-transaction data according to the global business tracking number to obtain multiple data groups, each data group including at least one piece of the sub-transaction data. The processing module sorts the sub-transaction data in each data group and generates the target string based on the sorted sub-transaction data.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program performs the method according to any one of claims 1 to 6.
9. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising methods for performing any one of claims 1 to 6.
Citation Information
Patent Citations
Transaction data processing method and device
CN106503974A
Method and system for standardized reporting of failed trades
US20090164386A1