Method and device for determining dynamic call link of full function, and storage medium
By injecting code using aspect-oriented programming (AOP) technology in the blockchain and obtaining unique identifiers for key functions, the problem of segmentation in the blockchain data processing flow is solved, enabling dynamic recording and analysis of the entire process call chain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2020-03-09
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies struggle to quickly capture the entire blockchain data processing flow, especially in high-performance processing modes where block or transaction processing is divided into different parts, making data processing analysis difficult.
By injecting code into key functions through aspect-oriented programming (AOP), a unique identifier is obtained for each key function and its sub-calls, forming a dynamic call chain of the entire function, and realizing the association and integration of different functions.
Without affecting business performance, it enables the recording and analysis of the entire data processing process, improving the visualization of the data processing process and the efficiency of problem diagnosis.
Smart Images

Figure CN111400317B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data collection technology, and in particular to a method, apparatus and storage medium for determining the dynamic call chain of a full function. Background Technology
[0002] As business grows rapidly, to meet the requirements of high performance and high availability, business programs will introduce various concurrent or asynchronous processing methods to solve problems. However, these high-performance processing methods cause the entire blockchain block or transaction processing flow to be fragmented into different parts, making it difficult to quickly obtain the entire data processing flow in order to analyze potential problems in the data processing process.
[0003] Therefore, it is necessary to provide a method, device, and storage medium for determining the dynamic call chain of a full function, so as to associate different functions through the unique identifiers corresponding to each key function and its sub-calls, and to integrate different functions through the dynamic call chain to obtain the entire data processing flow. Summary of the Invention
[0004] This application provides a method, apparatus, and storage medium for determining the dynamic call chain of a full function. It can associate different functions through the unique identifiers corresponding to each key function and its sub-calls, and integrate different functions through the dynamic call chain to obtain the entire data processing flow.
[0005] On the one hand, this application provides a method for determining the dynamic call chain of a full function, the method comprising:
[0006] The receiving terminal sends a transaction request, which carries at least two transaction information items;
[0007] Determine the target blockchain corresponding to the at least two transaction records;
[0008] Identify at least two keypoint functions in the target blockchain;
[0009] By using aspect-oriented programming, code is injected into each key function to perform dynamic link tracing.
[0010] Determine the identifier for each keypoint function and the identifier corresponding to each sub-call of the keypoint function;
[0011] The target identifier set is determined based on the identifier of each key point function and the identifier corresponding to the sub-call of each key point function;
[0012] Based on the target identifier set, determine the full function dynamic call chain in the target blockchain.
[0013] On the other hand, a device for determining the dynamic call chain of a full function is provided, the device comprising:
[0014] A transaction request receiving module is used to receive transaction requests sent by a terminal, wherein the transaction request carries at least two transaction information items;
[0015] A target blockchain determination module is used to determine the target blockchain corresponding to the at least two transaction information pieces;
[0016] A key point function determination module is used to determine at least two key point functions in the target blockchain;
[0017] The code injection module is used to inject code into each key function for dynamic link tracing via aspect-oriented programming.
[0018] The identifier determination module is used to determine the identifier of each key point function and the identifier corresponding to the sub-call of each key point function;
[0019] The target identifier set determination module is used to determine the target identifier set based on the identifier of each key point function and the identifier corresponding to the sub-call of each key point function;
[0020] The call chain determination module is used to determine the dynamic call chain of all functions in the target blockchain based on the target identifier set.
[0021] On the other hand, a computer storage medium is provided, wherein at least one instruction or at least one program is stored in the computer storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the full function dynamic call chain determination method as described above.
[0022] The method, apparatus, and storage medium for determining the dynamic call chain of a full function provided in this application have the following technical advantages:
[0023] (1) This application uses AOP injection to ensure that business operations are not affected without modifying the source code, and also ensures that the performance impact is within an acceptable range.
[0024] (2) This application uses AOP to obtain and output the unique identifier of the key function, thereby forming a dynamic call chain of the entire function.
[0025] (3) Record and track the independent function dynamic call links for different parts, and use data identifiers to connect the different but related function dynamic call links to form a full function dynamic call link with data processing as the dimension, so as to facilitate the analysis of the data processing flow. Attached Figure Description
[0026] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of a full-function dynamic call chain determination system provided in an embodiment of this application;
[0028] Figure 2 This is a flowchart illustrating a method for determining the dynamic call chain of a full function provided in an embodiment of this application;
[0029] Figure 3 This is a schematic diagram of the structure of a blockchain system provided in an embodiment of this application;
[0030] Figure 4 This is a schematic diagram of the block structure provided in an embodiment of this application;
[0031] Figure 5 This is a flowchart illustrating the method for determining the identifier of each keypoint function and the identifier corresponding to the sub-call of each keypoint function, as provided in an embodiment of this application.
[0032] Figure 6 This is a flowchart of code injection via AOP provided in an embodiment of this application;
[0033] Figure 7 This is a schematic diagram of the dynamic function call chain provided in the embodiments of this application;
[0034] Figure 8 This is the real-time dynamic call chain provided in the embodiments of this application;
[0035] Figure 9 This is a schematic diagram of the structure of a full-function dynamic call chain determination device provided in an embodiment of this application;
[0036] Figure 10 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0038] 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 so that the embodiments of this application described herein can be implemented in orders other than those illustrated or 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 server 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 devices.
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram of a full-function dynamic call chain determination system provided in an embodiment of this application, such as... Figure 1 As shown, this full-function dynamic call chain determination system can include at least server 01 and client 02.
[0040] Specifically, in the embodiments of this specification, server 01 may include a standalone server, a distributed server, or a server cluster consisting of multiple servers. Server 01 may include a network communication unit, a processor, and memory, etc. Specifically, server 01 can be used to determine the full function dynamic call chain.
[0041] Specifically, in this embodiment of the specification, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, and smart wearable devices, and may also include software running on the physical device, such as web pages provided to users by some service providers, or applications provided to users by such service providers. Specifically, the client 02 can be used to send transaction requests to the server 01 and display the full dynamic function call chain.
[0042] The following describes a method for determining the dynamic call chain of all functions according to this application. Figure 2 This is a flowchart illustrating a method for determining the dynamic call chain of a full function according to an embodiment of this application. This specification provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or server product execution, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or accompanying drawings. Specifically, as... Figure 2 As shown, the method may include:
[0043] S201: Receive a transaction request sent by the terminal, the transaction request carrying at least two transaction information items.
[0044] Specifically, in the embodiments of this specification, the server can receive transaction requests sent by the terminal, and the transaction request can be a transaction upload request.
[0045] In the embodiments described in this specification, the terminal can send a transaction request to the server based on a user's triggered operation.
[0046] S203: Determine the target blockchain corresponding to the at least two transaction information.
[0047] In the embodiments of this specification, in blockchain business, a target blockchain can be assigned to transaction information. The target blockchain may include multiple blocks, where each block may correspond to zero or one or more transactions. Each block is a collection of transactions that have been packaged and processed.
[0048] In the embodiments described in this specification, the target blockchain exists in a blockchain system, which includes multiple nodes that form a peer-to-peer network.
[0049] In some embodiments, the blockchain system can be Figure 3 The structure shown depicts a peer-to-peer (P2P) network formed by multiple nodes. The P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP). In a blockchain system, any machine, such as a server or terminal, can join and become a node. A node comprises a hardware layer, a middleware layer, an operating system layer, and an application layer.
[0050] Figure 3 The functions of each node in the blockchain system shown include:
[0051] 1) Routing: A basic function of nodes used to support communication between nodes.
[0052] In addition to routing capabilities, nodes can also have the following functions:
[0053] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.
[0054] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.
[0055] In some embodiments, the block structure can be Figure 4 The structure shown includes a hash value for each block containing the transaction records stored in that block (the hash value of this block) and the hash value of the previous block. These blocks are linked together to form the blockchain. Additionally, blocks may include information such as a timestamp when they were generated. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and to generate the next block.
[0056] S205: Determine at least two key point functions in the target blockchain.
[0057] In the embodiments described in this specification, the key point function may include a request function, a packaging function, a verification function, a submission function, and a storage function.
[0058] S207: Dynamic link tracing of functions is performed by injecting code into each key function using aspect-oriented programming.
[0059] Specifically, in the embodiments of this specification, before the step of performing dynamic link tracing of functions by injecting code into each key function using aspect-oriented programming, the method further includes:
[0060] Determine the state information of the function at each key point;
[0061] In the embodiments of this specification, code enhancement techniques are not limited to code injection during compilation (such as AspectJ), but can also include code injection at runtime (such as the Instrumentation+ASM solution).
[0062] Accordingly, the method of injecting code into each key function for dynamic link tracing via aspect-oriented programming includes:
[0063] When each key function is in compile-time or runtime state, dynamic link tracing of the function is performed by injecting code into each key function through aspect-oriented programming (AOP).
[0064] Aspect-oriented programming (AOP) refers to extracting aspects from the business process and dynamically inserting code into specified methods and locations.
[0065] S209: Determine the identifier for each keypoint function and the identifier corresponding to each keypoint function's sub-call.
[0066] Specifically, in the embodiments of this specification, such as Figure 5 As shown, determining the identifier for each keypoint function and the identifier corresponding to each sub-call of the keypoint function includes:
[0067] S2091: Obtain the identifier of each keypoint function through reflection;
[0068] In the embodiments of this specification, when writing the injection processing function, it is not possible to type the parameters of the key points. It is necessary to use the reflection mechanism to obtain the type and query the feature values of the data.
[0069] S2093: Determine the identifier corresponding to the sub-call of the key point function based on the identifier of each key point function.
[0070] Specifically, in the embodiments of this specification, determining the identifier corresponding to the sub-call of the keypoint function based on the identifier of each keypoint function includes:
[0071] Based on the identifier of each keypoint function, determine the identifier corresponding to the first sub-call of the keypoint function;
[0072] Based on the identifier corresponding to the Nth sub-call of the keypoint function, determine the identifier corresponding to the N+1th sub-call of the keypoint function, where N = 1, 2, ..., M, M ≥ 3 and M is a positive integer.
[0073] In the embodiments of this specification, the identifier of the corresponding sub-function is determined based on the identifier of the key point function. For example, a sequence number within the hierarchy is added to the identifier of the key point function.
[0074] In the embodiments of this specification, the identifier can be the root identifier of each function call chain, marking the root part of the identifier, and subsequent sub-calls will add the sequence number within the hierarchy based on this.
[0075] Specifically, in the embodiments of this specification, the method further includes:
[0076] Determine the eigenvalues of the function at each key point;
[0077] Based on the feature values of each key point function, target key point functions with correlation relationships are determined;
[0078] In the embodiments of this specification, the feature values of key point functions are used to associate different parts of the function call chain; target key point functions that have an association relationship include the same string identifier.
[0079] S2011: Determine the target identifier set based on the identifier of each key point function and the identifier corresponding to the sub-call of each key point function.
[0080] In the embodiments of this specification, after determining the target keypoint functions with associated relationships, the step of determining the target identifier set based on the identifier of each keypoint function and the identifier corresponding to the sub-call of each keypoint function includes:
[0081] S20101: Determine the target identifier set based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function.
[0082] Specifically, in the embodiments of this specification, determining the target identifier set based on the identifier of each target keypoint function and the identifier corresponding to the sub-call of each target keypoint function includes:
[0083] S201011: Determine the identifier set corresponding to each target key point function based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function;
[0084] Specifically, in the embodiments of this specification, determining the identifier set corresponding to each target keypoint function based on the identifier of each target keypoint function and the identifier corresponding to the sub-call of each target keypoint function includes:
[0085] The identifier of each target key point function is used as a feature identifier;
[0086] The function corresponding to the identifier containing each feature identifier is determined as a sub-call of the function for each target key point;
[0087] The set of identifiers corresponding to each feature identifier and the sub-calls of each target keypoint function is determined as the identifier set corresponding to each target keypoint function.
[0088] Specifically, in the embodiments of this specification, determining the identifier set corresponding to each target keypoint function based on the identifier of each target keypoint function and the identifier corresponding to the sub-call of each target keypoint function includes:
[0089] The identifier of each target key point function is used as a feature identifier;
[0090] Determine the identifier that contains the identifier for each feature;
[0091] Each feature identifier and the set of identifiers containing each feature identifier are determined as the identifier set corresponding to each target key point function.
[0092] S201013: Determine the target identifier set based on the identifier set corresponding to each target key point function.
[0093] Specifically, in the embodiments of this specification, determining the target identifier set based on the identifier set corresponding to each target keypoint function includes:
[0094] The set of identifiers in the identifier set corresponding to each target key point function is determined as the target identifier set.
[0095] The target identifier set includes identifiers from the identifier set corresponding to all target key point functions.
[0096] Specifically, in the embodiments of this specification, the key point function includes a packaging function and a verification function, and the method further includes:
[0097] The at least two transaction information items are packaged using a packaging function;
[0098] Distribute the at least two transaction messages into at least two blocks of the target blockchain;
[0099] The verification function verifies information about each block and the transactions within each block.
[0100] Specifically, in the embodiments of this specification, the key point function further includes a request function, a commit function, and a storage function, and the information verification of each block and the transactions in each block through the verification function includes:
[0101] The submission function uses asynchronous communication and voting waiting to submit consensus processes for each block and the transactions in each block.
[0102] The storage function uses an asynchronous concurrent processing method to store blocks and transactions after successful consensus submission.
[0103] In the embodiments described in this specification, the introduction of asynchronous communication and voting waiting methods can improve the consensus efficiency within the cluster and the storage performance of massive amounts of data.
[0104] Accordingly, the transaction request sent by the receiving terminal includes:
[0105] Receive transaction requests sent by the terminal through the request function.
[0106] S2013: Based on the target identifier set, determine the full function dynamic call chain in the target blockchain.
[0107] In the embodiments of this specification, the function corresponding to each target identifier can be determined based on each target identifier in the target identifier set, thereby determining the full function dynamic call chain.
[0108] In the embodiments described in this specification, the method may further include:
[0109] The system sends the full dynamic call chain of the target blockchain to the terminal, thereby facilitating the user's analysis of the data processing process.
[0110] In the embodiments described in this specification, the method may further include:
[0111] Based on the identifier of each target key point function, determine the set of associated key point functions;
[0112] Based on the identifiers of each associated key point function and its corresponding sub-function, determine the dynamic call chain corresponding to each associated key point function;
[0113] Based on the dynamic call chain corresponding to each associated key function, the dynamic call chain of the entire function is determined.
[0114] Specifically, in the embodiments of this specification, after receiving a transaction request, the blockchain server creates a task to process the verification request; however, to improve on-chain efficiency, the blockchain packages multiple transactions, which means that multiple transaction data are processed together; in the consensus verification process, to improve performance, information verification is also performed on different blocks and transactions within blocks using a multi-threaded concurrent approach. This part is first processed centrally and then separately; to improve the efficiency of block submission consensus, asynchronous communication and voting waiting methods are used, which is the centralized processing; after successful consensus submission, asynchronous concurrent processing is used to store the block, transaction, or unspent transaction outputs (utxo) separately, which is the separate processing. Figure 6 As shown, since data processing involves a series of separation and combination processes, code enhancement injection is performed on key characteristics of the server, enabling dynamic link tracing of functions and outputting unique data identifiers. Code enhancement injection with dynamic link tracing is also performed on different parts of the code. Enhancement injection can be performed at compile time or runtime with state switching injection (an on / off switch can be set for the enhancement injection method; it is disabled by default to ensure the normal order of the source code), achieving isolation from the program code and preventing pollution of the program source code.
[0115] Specifically, in the embodiments described in this specification, consensus submission refers to verifying the generated block and its contained transactions separately, synchronizing the verification results, and then, after a certain number of verification results are reached, the cluster agrees with the submitted block, which is considered a successful consensus submission. Each transaction has a unique hash value, which is the key point identifier of the transaction.
[0116] In a specific embodiment, such as Figure 7 As shown, key point injection is performed on the entry functions of different processing parts to obtain key data features, i.e., unique identifiers, such as transaction hashes and block hashes, through reflection, and recorded in the log. Furthermore, call chain injection enables real-time call chain tracing and recording of different parts, and records them hierarchically. Figure 7 The entry function has two fields: LevelNo and DataKey. LevelNo is the root identifier of each function call chain, marking the root of this part of the identifier. Subsequent sub-calls will increment their level numbers based on this. For example, if LevelNo is 10340, then the first sub-call's LevelNo is 10340.1, the second sub-call is 10340.2, and the next sub-call after the first is 10340.1.1, thus recording the entire dynamic call chain. For instance, function A includes a series of sub-calls, such as...
[0117]
[0118] In this context, functions B and D are sub-calls of A.
[0119] DataKey is the key data feature value of the entry function. It serves as a unique identifier for data processing and is used to associate different parts of the function call chain.
[0120] The entry functions include request entry functions, packaging entry functions, verification entry functions, submission entry functions, and storage entry functions. For example, request entry function A includes two call chains. One chain calls functions B and F, where the identifiers of functions B and F are based on the identifier of function A with added levels. Then, function B calls functions C and D, where the identifiers of functions C and D are based on the identifier of function B with added levels. Function A in the other chain uses different identifiers and feature values. In addition, the packaging entry function, verification entry function, submission entry function, and storage entry function are all named according to similar rules, thus forming a function call chain.
[0121] Figure 7 Solid lines indicate calls within a single part, while dashed lines indicate calls between different parts.
[0122] Analyzing based on specific data processing dimensions, Figure 7 The function call chain is extracted into Figure 8 The real-time dynamic call chain is used as the full real-time call chain of the function for this request scenario, which is the entire data processing process. Figure 8 In the diagram, sub-call functions B, C, and D of the request entry function A are synchronous operations. Function F initiates an asynchronous operation, which begins in the packaging entry function H. A DataKey in the packaging entry function is identical to the DataKey of the request entry function A. Similarly, function L initiates an asynchronous operation, starting from the verification entry function K; function T initiates an asynchronous operation, starting from the submission entry function Q; and function Z initiates an asynchronous operation, starting from the storage entry function M. The dynamic call chain between functions in different data processing sections aids in the analysis of the entire data processing process.
[0123] As can be seen from the technical solutions provided in the embodiments of this specification above, the embodiments of this specification inject code into different key function through aspect-oriented programming (AOP), and realize the association of different functions through the unique identifiers corresponding to each key function and its sub-calls, and integrate different functions through dynamic call chains to obtain the entire data processing flow.
[0124] This application also provides a device for determining the dynamic call chain of all functions, such as... Figure 9 As shown, the device includes:
[0125] The transaction request receiving module 910 is used to receive a transaction request sent by the terminal, wherein the transaction request carries at least two transaction information items;
[0126] The target blockchain determination module 920 is used to determine the target blockchain corresponding to the at least two transaction information items;
[0127] Key point function determination module 930 is used to determine at least two key point functions in the target blockchain;
[0128] The code injection module 940 is used to inject code into each key function for dynamic link tracing via aspect-oriented programming.
[0129] The identifier determination module 950 is used to determine the identifier of each key point function and the identifier corresponding to the sub-call of each key point function;
[0130] The target identifier set determination module 960 is used to determine the target identifier set based on the identifier of each key point function and the identifier corresponding to the sub-call of each key point function;
[0131] The call chain determination module 970 is used to determine the full function dynamic call chain in the target blockchain based on the target identifier set.
[0132] In some embodiments, the apparatus may further include:
[0133] The eigenvalue determination module is used to determine the eigenvalues of the function for each key point;
[0134] The target key point function determination module is used to determine the target key point functions that have a correlation based on the feature values of each key point function.
[0135] In some embodiments, the target identifier set determination module may include:
[0136] The target identifier set determination unit is used to determine the target identifier set based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function.
[0137] In some embodiments, the target identifier set determination unit may include:
[0138] The identifier set determination subunit is used to determine the identifier set corresponding to each target key point function based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function.
[0139] The target identifier set determination subunit is used to determine the target identifier set based on the identifier set corresponding to each target key point function.
[0140] In some embodiments, the identifier determination module may include:
[0141] The first identifier determination unit is used to obtain the identifier of each key point function through reflection mechanism;
[0142] The second identifier determination unit is used to determine the identifier corresponding to the sub-call of the key point function based on the identifier of each key point function.
[0143] In some embodiments, the second identifier determining unit may include:
[0144] A first-order identifier determination subunit is used to determine the identifier corresponding to the first-order sub-call of the keypoint function based on the identifier of each keypoint function;
[0145] The N+1th identifier determination subunit is used to determine the identifier corresponding to the N+1th sub-call of the key point function based on the identifier corresponding to the Nth sub-call of the key point function, where N = 1, 2, ..., M, M ≥ 3 and M is a positive integer.
[0146] In some embodiments, the keypoint function includes a packaging function and a verification function, and the apparatus may further include:
[0147] The packaging processing module is used to package the at least two transaction information items using a packaging function;
[0148] An allocation module is used to allocate the at least two transaction information items to at least two blocks of the target blockchain;
[0149] The information verification module is used to verify the information of each block and the transactions in each block through a verification function.
[0150] In some embodiments, the key point function further includes a request function, a submission function, and a storage function, and the information verification module may further include:
[0151] A consensus processing unit is used to perform consensus processing on each block and the transactions in each block through a submission function, using asynchronous communication and voting waiting methods.
[0152] Storage units are used to store blocks and transactions that have been successfully submitted for consensus through a storage function and an asynchronous concurrent processing method.
[0153] In some embodiments, the transaction request receiving module may include:
[0154] The transaction request receiving unit is used to receive transaction requests sent by the terminal through a request function.
[0155] In some embodiments, the apparatus may further include:
[0156] The state information determination module is used to determine the state information of each key point function;
[0157] In some embodiments, the code injection module may include:
[0158] The code injection unit is used to inject code into each key function to perform dynamic link tracing by means of aspect-oriented programming when the state of each key function is compile-time or runtime.
[0159] The apparatus and method embodiments described herein are based on the same inventive concept.
[0160] This application provides a device for determining the dynamic call chain of a full function. The device includes a processor and a memory. The memory stores at least one instruction or at least one program segment. The at least one instruction or at least one program segment is loaded and executed by the processor to implement the dynamic call chain determination method of the full function as provided in the above method embodiments.
[0161] The embodiments of this application also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to the full function dynamic call link determination method in the method embodiments. The at least one instruction or the at least one program is loaded and executed by the processor to implement the full function dynamic call link determination method provided in the above method embodiments.
[0162] Optionally, in the embodiments of this specification, the computer storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the aforementioned storage medium may include, but is not limited to, 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.
[0163] The memory described in the embodiments of this specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0164] The full-function dynamic call chain determination method provided in this application can be executed on a mobile terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 10 This is a hardware structure block diagram of a server for a method of determining the dynamic call chain of a full function provided in an embodiment of this application. For example... Figure 10As shown, the server 1000 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1010 (CPUs 1010 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1030 for storing data, and one or more storage media 1020 (e.g., one or more mass storage devices) for storing application programs 1023 or data 1022. The memory 1030 and storage media 1020 may be temporary or persistent storage. The program stored in the storage media 1020 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1010 may be configured to communicate with the storage media 1020 and execute the series of instruction operations in the storage media 1020 on the server 1000. Server 1000 may also include one or more power supplies 1060, one or more wired or wireless network interfaces 1050, one or more input / output interfaces 1040, and / or one or more operating systems 1021, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0165] The input / output interface 1040 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1000. In one example, the input / output interface 1040 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1040 may be a radio frequency (RF) module for wireless communication with the Internet.
[0166] Those skilled in the art will understand that Figure 10 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1000 may also include... Figure 10 The more or fewer components shown, or having the same Figure 10 The different configurations shown.
[0167] As can be seen from the embodiments of the full-function dynamic call chain determination method, apparatus, server or storage medium provided in this application, this application injects code into different key function through aspect-oriented programming (AOP), and realizes the association of different functions through the unique identifiers corresponding to each key function and its sub-calls, and integrates different functions through dynamic call chain to obtain the entire data processing flow.
[0168] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0169] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0170] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0171] The above description is only a preferred embodiment of this application and is not intended to limit this application. 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 determining the dynamic call chain of a full function, characterized in that, The method includes: The receiving terminal sends a transaction request, which carries at least two transaction information items; Determine the target blockchain corresponding to the at least two transaction records; Identify at least two keypoint functions in the target blockchain; By using aspect-oriented programming, code is injected into each key function to perform dynamic link tracing. Determine the identifier for each keypoint function and the identifier corresponding to each sub-call of the keypoint function; Determine the feature values of each keypoint function; based on the feature values of each keypoint function, determine the target keypoint functions that have a correlation. The target identifier set is determined based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function; Based on the target identifier set, determine the full function dynamic call chain in the target blockchain.
2. The method according to claim 1, characterized in that, The step of determining the target identifier set based on the identifier of each target keypoint function and the identifier corresponding to the sub-call of each target keypoint function includes: Based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function, determine the identifier set corresponding to each target key point function; The target identifier set is determined based on the identifier set corresponding to each target key point function.
3. The method according to claim 1, characterized in that, The process of determining the identifier for each keypoint function and the identifier corresponding to each sub-call of the keypoint function includes: The identifier of each key function is obtained through reflection. Based on the identifier of each keypoint function, determine the identifier corresponding to the sub-call of each keypoint function.
4. The method according to claim 3, characterized in that, The step of determining the identifier corresponding to the sub-call of each keypoint function based on the identifier of each keypoint function includes: Based on the identifier of each key point function, determine the identifier corresponding to the first sub-call of each key point function; Based on the identifier corresponding to the Nth sub-call of each keypoint function, determine the identifier corresponding to the N+1th sub-call of each keypoint function, where N = 1, 2, ..., M, M ≥ 3 and M is a positive integer.
5. The method according to claim 1, characterized in that, The key point function includes a packaging function and a verification function, and the method further includes: The at least two transaction information items are packaged using a packaging function; Distribute the at least two transaction messages into at least two blocks of the target blockchain; The verification function verifies information about each block and the transactions within each block.
6. The method according to claim 5, characterized in that, The key point function also includes a request function, a commit function, and a storage function. The verification function verifies information about each block and the transactions within each block, including: The submission function uses asynchronous communication and voting waiting to submit consensus processes for each block and the transactions in each block. The storage function is used to store blocks and transactions after successful consensus submission in an asynchronous and concurrent manner. Accordingly, the transaction request sent by the receiving terminal includes: Receive transaction requests sent by the terminal through the request function.
7. The method according to claim 1, characterized in that, Before the step of injecting code into each key function for dynamic link tracing using aspect-oriented programming, the method further includes: Determine the state information of the function at each key point; Accordingly, the method of injecting code into each key function for dynamic link tracing via aspect-oriented programming includes: When each key function is in compile-time or runtime state, dynamic link tracing of functions is performed by injecting code into each key function through aspect-oriented programming.
8. A device for determining the dynamic call chain of a full function, characterized in that, The device includes: A transaction request receiving module is used to receive transaction requests sent by a terminal, wherein the transaction request carries at least two transaction information items; A target blockchain determination module is used to determine the target blockchain corresponding to the at least two transaction information pieces; A key point function determination module is used to determine at least two key point functions in the target blockchain; The code injection module is used to inject code into each key function for dynamic link tracing via aspect-oriented programming. The identifier determination module is used to determine the identifier of each key point function and the identifier corresponding to the sub-call of each key point function; The eigenvalue determination module is used to determine the eigenvalues of the function for each key point; The target key point function determination module is used to determine the target key point functions that have a relationship based on the feature values of each key point function; A target identifier set determination module is used to determine a target identifier set based on the identifier of each keypoint function and the identifier corresponding to the sub-call of each keypoint function; the target identifier set determination module includes: a target identifier set determination unit, used to determine the target identifier set based on the identifier of each target keypoint function and the identifier corresponding to the sub-call of each target keypoint function; The call chain determination module is used to determine the dynamic call chain of all functions in the target blockchain based on the target identifier set.
9. The apparatus according to claim 8, characterized in that, The target identifier set determination unit includes: The identifier set determination subunit is used to determine the identifier set corresponding to each target key point function based on the identifier of each target key point function and the identifier corresponding to the sub-call of each target key point function. The target identifier set determination subunit is used to determine the target identifier set based on the identifier set corresponding to each target key point function.
10. The apparatus according to claim 8, characterized in that, The identifier determination module includes: The first identifier determination unit is used to obtain the identifier of each key point function through reflection mechanism; The second identifier determination unit is used to determine the identifier corresponding to the sub-call of the key point function based on the identifier of each key point function.
11. The apparatus according to claim 10, characterized in that, The second identifier determination unit includes: A first-order identifier determination subunit is used to determine the identifier corresponding to the first-order sub-call of the keypoint function based on the identifier of each keypoint function; The N+1th identifier determination subunit is used to determine the identifier corresponding to the N+1th sub-call of the key point function based on the identifier corresponding to the Nth sub-call of the key point function, where N = 1, 2, ..., M, M ≥ 3 and M is a positive integer.
12. The apparatus according to claim 8, characterized in that, The key point function includes a packaging function and a verification function, and the device further includes: The packaging processing module is used to package the at least two transaction information items using a packaging function; An allocation module is used to allocate the at least two transaction information items to at least two blocks of the target blockchain; The information verification module is used to verify the information of each block and the transactions in each block through a verification function.
13. The apparatus according to claim 12, characterized in that, The key point function also includes a request function, a submission function, and a storage function; the information verification module also includes: A consensus processing unit is used to perform consensus processing on each block and the transactions in each block through a submission function, using asynchronous communication and voting waiting methods. Storage units are used to store blocks and transactions that have been successfully submitted for consensus through a storage function and an asynchronous concurrent processing method. The transaction request receiving module includes: The transaction request receiving unit is used to receive transaction requests sent by the terminal through a request function.
14. The apparatus according to claim 8, characterized in that, The device further includes: The state information determination module is used to determine the state information of each key point function; The code injection module includes a code injection unit, which is used to inject code into each key function to perform dynamic link tracing of the function through aspect-oriented programming when the state of each key function is compile-time or runtime.
15. A device for determining the dynamic call chain of a full function, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program segment, the at least one instruction or the at least one program segment being loaded and executed by the processor to implement the method for determining the dynamic call chain of a full function as described in any one of claims 1-7.
16. A computer storage medium, characterized in that, The computer storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the full-function dynamic call chain determination method as described in any one of claims 1-7.