A data processing method, device, apparatus, and storage medium

By analyzing the call information of computer programs, predicting the number of resource accesses, and optimizing the transaction process, the problem of low resource call efficiency in existing technologies is solved, and the performance of computer programs is improved.

CN114035934BActive Publication Date: 2026-01-30WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111188446.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-12
Publication Date
2026-01-30
Estimated Expiration
2041-10-12

AI Technical Summary

Technical Problem

Existing computer program performance testing technologies cannot detect performance problems within computer program code, resulting in inefficient resource allocation.

Method used

By obtaining the call information of the first transaction, the number of times the target object accesses the target resource can be predicted. The call relationship can be analyzed using data processing devices and asynchronous threads to optimize the transaction process and improve resource access efficiency.

Benefits of technology

By identifying transaction processes that need optimization, the resource access efficiency and overall performance of computer programs can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114035934B_ABST
    Figure CN114035934B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, device, and storage medium. The method includes: obtaining invocation information of a first transaction; the invocation information includes: a first invocation relationship between a first interface and at least one method, and a second invocation relationship between the at least one method and at least one resource; based on the invocation information, predicting the number of times a target object accesses a target resource; the target object includes the first interface, or any of the at least one method; the target resource includes any of the at least one resource. This scheme can predict the number of times a target object accesses a target resource.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and relates to but is not limited to a data processing method, device, equipment and storage medium. BACKGROUND

[0002] With the development of Internet technology, computer programs are applied more and more widely, and how to detect the performance of computer programs is of great significance.

[0003] For the detection technology of computer program performance, mainly focuses on code security detection and analysis, bug detection and analysis, and constraint coding convention detection and analysis. For example, the detection technology of computer program performance of Java language can include: through stress testing, analyzing the CPU occupancy rate, memory occupancy rate, average response time and TPS (Transactions Per second) and other indicators under the running computer program, and obtaining the overall performance of the computer program according to the CPU occupancy rate, memory occupancy rate, average response time and TPS indicators.

[0004] However, the above detection technology of computer program performance cannot detect the performance problems inside the computer program code. For example, in actual application, the running computer program may call the same resource (such as table data) in the database multiple times through different methods in the same transaction, so that the computer program has low resource calling efficiency, thereby causing low performance of the computer program. SUMMARY

[0005] The present application provides a data processing method and device, equipment and storage medium, which can predict the number of times of accessing the target resource by the target object. Since the number of times of accessing the target resource by the target object can locate the transaction process to be optimized, the data processing method can be used to assist in optimizing the performance of the computer program to improve the resource access efficiency of the computer program and the performance of the computer program.

[0006] The technical scheme of the present application is realized as follows:

[0007] The present application provides a data processing method, which comprises:

[0008] obtaining the calling information of the first transaction; the calling information comprises: a first calling relationship between the first interface and at least one method, and a second calling relationship between the at least one method and at least one resource;

[0009] predict, based on the calling information, a number of times that a target object accesses a target resource; the target object comprises the first interface or any of the at least one method; and the target resource comprises any of the at least one resource.

[0010] The application provides a data processing apparatus, which comprises:

[0011] an obtaining unit configured to obtain calling information of a first transaction; the calling information comprises a first calling relationship between a first interface and at least one method, and a second calling relationship between the at least one method and at least one resource;

[0012] a processing unit configured to predict, based on the calling information, a number of times that a target object accesses a target resource; the target object comprises the first interface or any of the at least one method; and the target resource comprises any of the at least one resource.

[0013] The application also provides an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor implements the above data processing method when executing the program.

[0014] The application also provides a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the above data processing method.

[0015] The data processing method, apparatus, device and storage medium provided by the application comprise: obtaining calling information of a first transaction; the calling information comprises a first calling relationship between a first interface and at least one method, and a second calling relationship between the at least one method and at least one resource; and predicting, based on the calling information, a number of times that a target object accesses a target resource; the target object comprises the first interface or any of the at least one method; and the target resource comprises any of the at least one resource. In this way, the number of times that the target object accesses the target resource can be predicted through the calling information of the first transaction. Since the number of times that the target object accesses the target resource can be used to locate a transaction process to be optimized, the data processing method can be used to assist in optimizing the performance of a computer program, so as to improve the resource access efficiency and the performance of the computer program. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 An optional structural schematic diagram of a data processing system provided by an embodiment of the application;

[0017] Figure 2 An optional flow schematic diagram of a data processing method provided by an embodiment of the application;

[0018] Figure 3 An optional structural schematic diagram of the calling information graph of the first transaction provided by the embodiment of the present application

[0019] Figure 4 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0020] Figure 5 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0021] Figure 6 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0022] Figure 7 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0023] Figure 8 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0024] Figure 9 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0025] Figure 10 An optional structural schematic diagram of the data processing system provided by the embodiment of the present application

[0026] Figure 11 An optional flow schematic diagram of the data processing method provided by the embodiment of the present application

[0027] Figure 12 An optional structural schematic diagram of the data processing apparatus provided by the embodiment of the present application

[0028] Figure 13 An optional structural schematic diagram of the electronic device provided by the embodiment of the present application DETAILED DESCRIPTION

[0029] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the specific technical scheme of the present application will be further described in detail below with reference to the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but not to limit the scope of the present application.

[0030] In the following description, “some embodiments” are related to a subset of all possible embodiments, but it can be understood that “some embodiments” can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0031] In the following description, the terms "first", "second", "third" are only used to distinguish different objects, and do not represent a specific order or sequence. It can be understood that the "first", "second", "third" can be exchanged in a specific order or sequence as long as it is allowed, so that the application described herein can be implemented in an order other than that illustrated or described herein.

[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification is for the purpose of describing the embodiments of the application only and is not intended to be limiting of the application.

[0033] For the convenience of understanding, some technical terms in the embodiments of the application are explained.

[0034] Transaction refers to a data processing process initiated through an interface to perform a specific function. For example, a transaction can be a data processing process for loan approval, or a transaction can also be a data processing process for querying user credit.

[0035] Method refers to a function that performs a predetermined function. For example, a method can be a summation function, or a method can also be a custom function for querying certain data.

[0036] Resource refers to various data. For example, a resource can be data in a database, or a resource can also be data in a remote system.

[0037] Call refers to a direct obtaining manner. For example, the direct processing object of method A is data A, which can be expressed as method A calling data A.

[0038] Access refers to a direct or indirect obtaining manner. For example, the direct processing object of method A is data A, which can also be described as method A accessing data A. For another example, the direct processing object of method B is method C, and the direct processing object of method C is data B, which can also be described as method B accessing data B.

[0039] The embodiments of the application can provide a data processing method and device, equipment and a storage medium. In actual application, the data processing method can be realized by a data processing device, and each functional entity in the data processing device can be realized by hardware resources of an electronic device, such as computing resources (e.g. processors) and communication resources (e.g. used to support various communication modes such as optical cable and cellular).

[0040] The data processing method provided by the embodiments of the application is applied to a data processing system, and the data processing system includes a data processing end device.

[0041] The data processing end device can obtain calling information of the first transaction; the calling information comprises a first calling relationship between the first interface and at least one method, and a second calling relationship between the at least one method and at least one resource; based on the calling information, the number of times of accessing the target resource by a target object is predicted; the target object comprises the first interface or any of the at least one method; and the target resource comprises any of the at least one resource.

[0042] In an example, the data processing system can further comprise a first device and a second device. The first device can perform a first transaction with the second device. The data processing end device can communicate with the first device and the second device respectively to obtain the number of times of accessing the target resource based on the first transaction.

[0043] As an example, the structure of the data processing system 10 can be as shown in Figure 1 , comprising a data processing end device 101, a first device 102 and a second device 103, wherein the data processing end device 101, the first device 102 and the second device 103 can communicate with each other in pairs.

[0044] The first device 102 and the second device 103 can perform a first transaction. The first device 102 can be a client device such as a mobile phone, a tablet computer, a smart bracelet, etc. The second device 103 can be an electronic device such as a server.

[0045] The data processing end device 101 is configured to obtain calling information of the first transaction between the first device 102 and the second device 103, and predict the number of times of accessing a target resource by a target object according to the calling information. The data processing end device 101 can be an electronic device such as a server having a related data processing capability.

[0046] In a possible implementation, the data processing end device 101 can also be deployed in the first device 102, i.e., the data processing end device 101 and the first device 102 are the same device.

[0047] In the following, the embodiments of the data processing method and device, the apparatus and the storage medium provided by the present application are described in conjunction with the schematic diagram of the data processing system shown in Figure 1 .

[0048] In a first aspect, the present application provides a data processing method, which is applied to a data processing device. The data processing device can be deployed in a data processing end device 101 in Figure 1 . In the following, the data processing process provided by the present application is described.

[0049] Figure 2A flowchart of an optional data processing method is shown, which can predict the number of times that a target object accesses a target resource. The data processing method can include but is not limited to Figure 2 S201 and S202 are shown.

[0050] It should be noted that the application embodiments do not limit the application scenarios of the data processing method, which can be configured according to actual needs. For example, the data processing method can be applied to an actual production scenario, and the data processing method is executed under the consideration of actual production traffic. For another example, the data processing method can also be applied to a test scenario, and the data processing method is executed without considering actual production traffic.

[0051] S201, the data processing apparatus obtains the calling information of the first transaction.

[0052] The first transaction can be any transaction. In an example, the first transaction can be a single-sided transaction, i.e., an internal transaction of a device. In another example, the first transaction can also be a double-sided or multi-sided transaction, i.e., a transaction between a device and another device, or a transaction between a device and another plurality of devices.

[0053] The target resource is used to refer to a target data to be accessed. The application embodiments do not limit the source of the target resource, which can be configured according to actual needs. In an example, the target resource can be a target data to be accessed at the local (data processing device) end. In another example, the target resource can also be a target data to be accessed in other remote devices other than the local end. For example, the target resource can be a target data to be accessed in a remote database. For another example, the target resource can also be a target data to be accessed in a remote system.

[0054] The calling information includes a first calling relationship between the first interface and the at least one method, and a second calling relationship between the at least one method and the at least one resource.

[0055] Optionally, the calling information can also include a third calling relationship between the methods in the at least one method.

[0056] The data processing apparatus intercepts the first calling relationship between the first interface and the at least one method (optionally, the third calling relationship between the methods in the at least one method) in the first transaction through the calling link interceptor, intercepts the second calling relationship between the at least one method and the at least one resource in the first transaction through the resource access interceptor, and takes the first calling relationship between the first interface and the at least one method (optionally, the third calling relationship between the methods in the at least one method) and the second calling relationship between the at least one method and the at least one resource as the calling information of the first transaction.

[0057] In a possible implementation, the calling information of the first transaction can be stored in the form of a calling information graph.

[0058] For example, the calling information graph of the first transaction can be as shown in Figure 3 , where the first interface is an interface 1 of an action layer, the target resource is data in a database (sql) 2 of a data access (dao) layer, and the calling methods of a service layer include a method 1, a method 2, a method 3, a method 4, and a method 5. The calling relationship between the service layers is as shown in Figure 3 , and the dao layer includes sq1, sq2, sq3, sq4, and sq5.

[0059] S202: The data processing apparatus predicts the number of times that the target object accesses the target resource based on the calling information.

[0060] The target object includes the first interface or any of the at least one method, and the target resource includes any of the at least one resource. Specifically, the target object and the target resource can be configured according to actual needs, and the embodiments of the present application do not limit the same.

[0061] The data processing apparatus predicts the number of times that the target object accesses the target resource based on a first calling relationship between the first interface and the at least one method, a second calling relationship between the at least one method and the at least one resource (optionally, a third calling relationship between the methods in the at least one method and the methods can also be included).

[0062] It should be noted that the embodiments of the present application do not uniquely limit the type of the execution thread of S201 and S202, and the same can be configured according to actual needs.

[0063] The data processing apparatus starts an asynchronous thread different from the thread of executing the first transaction, and executes S201 and S202 through the asynchronous thread.

[0064] S201 and S202 are executed through the asynchronous thread, which can reduce the impact on the process of the first transaction.

[0065] The data processing scheme provided by the embodiments of the present application comprises: obtaining calling information of a first transaction; the calling information comprises a first calling relationship between a first interface and at least one method, and a second calling relationship between the at least one method and at least one resource; based on the calling information, predicting a number of times of accessing a target resource by a target object; the target object comprises the first interface or any method in the at least one method; and the target resource comprises any resource in the at least one resource. In this way, the number of times of accessing the target resource by the target object can be predicted through the calling information of the first transaction. Since the number of times of accessing the target resource by the target object can locate the transaction process to be optimized, the data processing method can be used to assist in optimizing the performance of the computer program, so as to improve the resource access efficiency and the performance of the computer program.

[0066] Next, the process that the data processing apparatus predicts the number of times of accessing the target resource by the target object based on the calling information in S202 is described in detail.

[0067] The implementation of S202 can include, but is not limited to, the following implementation mode 1 or implementation mode 2.

[0068] Implementation mode 1: predicting the number of times of accessing the target resource by the target object based on a path;

[0069] Implementation mode 2: in the case where the target object comprises the first interface, predicting the number of times of accessing the target resource by the target object based on a third number of times corresponding to a first method.

[0070] The third number of times is the number of times of accessing the target resource by the first method, and the first method is a method for accessing the target resource among the methods called through the first interface.

[0071] In the implementation mode 1, the process of predicting the number of times of accessing the target resource by the target object based on the path can include, but is not limited to Figure 4 S401 to S403 shown in the figure.

[0072] S401, the data processing apparatus determines at least one path for accessing the target resource through the target object based on the calling information.

[0073] The data processing apparatus determines, in the calling information, the methods called in sequence from the target object triggering to the target resource, takes the target object, the methods called in sequence and the target object as a path, and the same method can be used to obtain at least one path for accessing the target resource by the target object.

[0074] Example 3, based on Figure 3The call process shown, in the case of a target object being method 2 and a target resource being data of sql2, at least one path can include path 1 (method 2-method 4-sql2) and path 2 (method 2-method 5-sql2).

[0075] S402, the data processing apparatus determines a first number of times corresponding to each of the at least one path; the first number of times is the number of times of accessing the target resource through the path.

[0076] The first number of times is the number of times of accessing the target resource through the path.

[0077] The data processing apparatus determines the number of times of accessing the target resource through each path in the at least one path as the first number of times corresponding to each path.

[0078] Example 4, based on the above example 3, the first number of times of path 1 can be the number of times of accessing the target data through method 2 and method 4, and the first number of times of path 2 can be the number of times of accessing the target data through method 2 and method 5.

[0079] S403, the data processing apparatus predicts the number of times of accessing the target resource by the target object based at least on the corresponding first number of times of each path.

[0080] The implementation of S403 can include but is not limited to implementation A1 or implementation A2.

[0081] Implementation A1, based on the corresponding first number of times of each path, predicts the number of times of accessing the target resource by the target object;

[0082] Implementation A2, based on the corresponding first number of times of each path and the confidence of the path, predicts the number of times of accessing the target resource by the target object.

[0083] Implementation A1 can include that the data processing apparatus sums the corresponding first number of times of each path, and predicts the number of times of accessing the target resource by the target object as the sum of the corresponding first number of times of each path.

[0084] Implementation A2 can include but is not limited to Figure 5 S501 and S502 shown.

[0085] S501, the data processing apparatus multiplies the corresponding first number of times of each path by the confidence of the path to obtain a second number of times corresponding to the path.

[0086] The confidence of the path is used to characterize the probability of occurrence of the path; the second number of times is the predicted number of times of accessing the target resource through the path.

[0087] Example 5, based on the above example 4, the second number corresponding to path 1 can be the number of times that method 4 accesses the target data multiplied by the confidence of path 1; the second number corresponding to path 2 can be the number of times that method 5 accesses the target data multiplied by the confidence of path 2.

[0088] S502, the data processing apparatus predicts the number of times that the target object accesses the target resource as the sum of the second numbers corresponding to each path.

[0089] Example 6, based on the above example 5, the data processing apparatus predicts the number of times that the target object accesses the target resource as the sum of the third number of path 1 and the third number of path 2.

[0090] Taking the first path as an example, the process of obtaining the confidence corresponding to the first path is described. The first path includes at least two methods, and the at least two methods include the target object. The process can include but is not limited to the following Figure 6 S601 and S602 shown.

[0091] S601, the data processing apparatus obtains a first support degree and a second support degree.

[0092] The first support degree is used to represent the probability of accessing the target resource through the first reference method; the first reference method is the at least two methods; the second support degree is used to represent the probability of accessing the target resource through the second reference method; the second reference method is the method other than the method directly calling the target resource in the at least two methods.

[0093] In one possible implementation, the first support degree and the second support degree can be empirical values.

[0094] In another possible implementation, the first support degree and the second support degree can be obtained based on the calling information in multiple first transactions.

[0095] Example 7, the first path can include method A, method B, method C and method G, then the first support degree is the probability of accessing the target data through method A, method B, method C and method G, and the second support degree is the probability of accessing the target data through method A, method B and method C.

[0096] Suppose that in 10 transactions of accessing the target resource through the first interface, the calling methods can be as shown in Table 1.

[0097] Table 1: Calling method example

[0098] Transaction sequence number Call method 1 Method A, Method B, Method C 2 Method A, Method B, Method C 3 Method A, Method B, Method C 4 Method A, Method B, Method C 5 Method A, Method B, Method D 6 Method A, Method B, Method D 7 Method A, Method B, Method E, Method F 8 Method A, Method B, Method E, Method F 9 Method A, Method B, Method G, Method C 10 Method A, Method B, Method G, Method C

[0099] It can be obtained from Table 1 that the probability of accessing the target data through the method A, the method B and the method C is 0.6, that is, the second support degree is 0.6; the probability of accessing the target data through the method A, the method B, the method C and the method G is 0.2, that is, the first support degree is 0.2.

[0100] S602, the data processing apparatus determines a ratio of the first support degree to the second support degree as the confidence degree of the first path.

[0101] Example 8, based on the above example 7, the data processing apparatus determines a ratio of the first support degree 0.2 to the second support degree 0.6 as the confidence degree of the first path.

[0102] Embodiment 2, in the case that the target object comprises the first interface, the data processing apparatus predicts the number of times of accessing the target resource based on the third number corresponding to the first method.

[0103] Embodiment 2 can include but is not limited to Figure 7 S701 to S703.

[0104] S701, the data processing apparatus obtains the first method based on the calling information.

[0105] In the first transaction, the target resource can be accessed through the first interface; the first method is a method for accessing the target resource in the methods called through the first interface.

[0106] The data processing apparatus obtains, as the first method, the method for accessing the target resource in the methods called through the first interface in the calling information.

[0107] It can be obtained from the content shown in Figure 3 The first interface (interface 1) calls the methods including the method 1, the method 2 and the method 3, and the first method can include the method 1 and the method 2.

[0108] S702, the data processing apparatus determines the third number corresponding to each of the first methods.

[0109] The third number is the number of times of accessing the target resource through the first method.

[0110] The data processing apparatus determines the number of times of accessing the target resource through each of the first methods as the third number corresponding to the first method.

[0111] S703, the data processing apparatus predicts the number of times of accessing the target resource by the target object based on at least the third number corresponding to each of the first methods.

[0112] In a possible implementation, the data processing apparatus predicts the number of times of accessing the target resource by the target object as the sum of the third numbers corresponding to each of the first methods.

[0113] For example, in the test scenario, the actual production traffic can not be considered, i.e., the probability that the first interface calls the first method can not be considered, and the number of times that the target object accesses the target resource can be predicted using the embodiment.

[0114] In another possible implementation, the data processing apparatus predicts the number of times that the target object accesses the target resource based on the first number of times corresponding to each of the first methods and the first probability corresponding to each of the first methods.

[0115] For example, in the actual production scenario, the actual production traffic is considered, i.e., the probability that the first interface calls the first method is considered, and the number of times that the target object accesses the target resource can be predicted using the embodiment.

[0116] Next, the process in which the data processing apparatus determines the third number of times corresponding to each of the first methods is described, which can include but is not limited to Figure 8 S801 to S806 shown.

[0117] S801, the data processing apparatus determines whether the target resource is accessed.

[0118] The data processing apparatus intercepts a method in the first transaction, determines whether the calling object of the method is the same as the configuration information of the target resource, and if so, determines that the target resource is accessed, executes the following S802, and if not, determines that the target resource is not accessed, and re-executes S801.

[0119] The embodiment of the present application does not limit the specific content and form of the configuration information of the target resource, and the configuration information can be configured according to actual needs. For example, the configuration information example can be as shown in Table 2 below.

[0120] Table 2 Configuration information example of target resource

[0121] Field name Meaning PACKAGE_NAME Path of interface DETECT_TYPE Monitoring type DETECT_VALUE Monitoring value

[0122] The path of the interface is used to indicate the first interface, the monitoring type can include a database or a remote system, and the monitoring value can include a data identifier in the database or a data identifier in the remote system.

[0123] S802, if the target resource is accessed, the data processing apparatus determines a second method that calls the target resource, and increments the access number corresponding to the second method by one.

[0124] The access number is used to represent the number of times that the target resource is accessed.

[0125] S803, the data processing apparatus determines whether the second method has a parent method.

[0126] S804, if the second method has no parent method, the data processing apparatus determines that the third number corresponding to the first method is one.

[0127] S805, if the second method has a parent method, the data processing apparatus adds one to the access number of the parent method of the second method; and takes the parent method of the second method as a new second method, judges whether the new second method has a parent method, until the new second method has no parent method.

[0128] The access number of each method is configured as zero in advance.

[0129] S806, in the case that the new second method has no parent method, the data processing apparatus determines that the third number corresponding to the first method is the access number of the new second method, and judges whether the target resource is accessed until the third number corresponding to each first method is obtained.

[0130] Next, the process of S703 data processing apparatus predicting the number of times the target object accesses the target resource based on at least the third number corresponding to each first method will be described. The process can include, but is not limited to, the following embodiment B1 or embodiment B2.

[0131] Embodiment B1, predicting the number of times the target object accesses the target resource based on the third number corresponding to each first method.

[0132] Embodiment B2, predicting the number of times the target object accesses the target resource based on the first probability corresponding to each first method and the third number corresponding to each first method.

[0133] Embodiment B1 can include: the data processing apparatus predicts the number of times the target object accesses the target resource as the sum of the third numbers corresponding to each first method.

[0134] Embodiment B2 can include, but is not limited to Figure 9 S901 to S903 shown.

[0135] S901, the data processing apparatus obtains the first probability corresponding to each first method.

[0136] The first probability is the probability of calling the first method through the first interface.

[0137] The data processing apparatus obtains the number of times the first method is called by the first interface in a plurality of transactions, and the total number of times the method is called by the first interface in a plurality of transactions, and determines the ratio of the number of times the first method is called by the first interface to the total number of times the method is called by the first interface as the first probability corresponding to the first method.

[0138] S902, the data processing apparatus determines, for each of the first methods, a product of a third number corresponding to the first method and a first probability corresponding to the first method as an expected number of the first method, to obtain an expected number of each of the first methods.

[0139] S903, the data processing apparatus predicts the number of times that the target object accesses the target resource as a sum of the expected numbers of the first methods.

[0140] The data processing method provided by the embodiments of the present application can further obtain optimization of the flow of the first transaction based on the number of times that the target object accesses the target resource, which is predicted. Specifically, the data processing apparatus can determine an optimization level based on the number of times that the target object accesses the target resource, which is predicted.

[0141] The embodiments of the present application do not limit the specific implementation of determining the optimization level, which can be configured according to actual needs.

[0142] In a possible implementation, the data processing apparatus can determine that the optimization level is a first level if it is determined that the number of times that the target object accesses the target resource, which is predicted, is greater than or equal to a first threshold value, and determine that the optimization level is a second level if it is determined that the number of times that the target object accesses the target resource, which is predicted, is less than the first threshold value and greater than a second threshold value.

[0143] The optimization space of the first level is greater than the optimization space of the second level.

[0144] The optimization level is used to assist in optimizing the flow of accessing the target resource through the first interface.

[0145] In the following, the data processing method provided by the embodiments of the present application is described through a specific application scenario.

[0146] For the convenience of understanding, some technical terms are explained.

[0147] Expected access times (Ect) refer to the expected number of times of accessing a resource for obtaining a kind of data in a transaction.

[0148] Internal method access times (Ict) refer to the expected number of times of accessing a resource for obtaining a kind of data in a transaction.

[0149] Support (support) refers to the probability of occurrence in a certain case. For example, the support of A and B can be the probability of the occurrence of A and B at the same time, which can be expressed as: support(A=>B)=P(A∪B). Wherein, support(A=>B) represents the support of A and B, and P(A∪B) represents the probability of the occurrence of A and B at the same time.

[0150] Confidence, refers to confidence(A=>B)=support(A∪B) / support(A), represents the ratio of the probability of A and B occurring simultaneously to the probability of A occurring.

[0151] For the detection technology of computer program performance, in the related art, mainly focuses on code security detection and analysis, bug detection and analysis, and constraint coding specification detection and analysis. Among them, the detection means for the performance of Java application mainly has two kinds:

[0152] The first is to analyze the runtime CPU and memory occupancy, average response time, TPS and other performance indicators through stress testing. However, stress testing can only give the observation result of the program running performance, and the optimization of the internal performance of the code still needs to be analyzed separately.

[0153] The second is to detect and locate low-performance query statements or function methods by using analysis execution plan, flame chart analysis function call and other schemes. However, the existing low-performance code positioning scheme can only analyze the performance problem of each method itself independently, and cannot make low-performance code analysis based on the actual production traffic combined with the correlation between method calls according to the running state of the program.

[0154] The embodiment of the application provides a detection method, which can predict the access quantity of resources in a transaction. The expected access resource number of accessing a certain data is labeled, which provides a detection means for analyzing the efficiency of code access resources and positioning redundant access resources.

[0155] In a Java application, calling a remote resource to access (get) data takes longer than simple memory calculation. Therefore, the data of the same data source should be obtained at one time as much as possible. In the project iteration, data acquisition and calculation logic are often coupled together and are not so easy to completely separate, so the following problems may occur:

[0156] 1. To obtain the same data, the same method is called repeatedly to query the database. The correct method is to query the database to obtain data outside the method.

[0157] 2. To obtain data of the same table in a transaction, different methods are called to query the database multiple times. The correct method is to query the table once outside the method, and then filter the data in the memory as the input parameter and distribute it to each method.

[0158] 3. Multiple same transactions are initiated to another remote system. The correct method is to provide batch transaction function to support multiple transactions to be completed by one call.

[0159] For example Figure 3For example, interface 1 calls method 1 and method 2, both of which access sql1, and there is obviously room for optimization. However, in a complex system, due to the complexity of the code structure and the call level, it is not obvious which methods have redundant access to resources. For example, in Figure 3 , method 1 and method 4 both access sql2, and we assume that according to the production traffic, there is a certain probability that interface 1 calls method 2, and there is a certain probability that method 2 calls method 4, so the expectation of repeated execution of sql2 is not easy to evaluate. The call process of the actual production code is very complex, and it is difficult to separate the access resources from the calculation logic. Therefore, the present application proposes a data processing method, which can predict the access quantity of resources in transactions, and the method intercepts and bypasses records the number of times each method accesses the database, remote system and other resources in transactions through the open source framework aspect-oriented programming (spring Aspect Orient Programming, spring AOP) technology, and then analyzes and calculates the expected access times to assist in analyzing which resource access processes can be optimized.

[0160] The data processing method provided by the embodiment of the present application exists in the form of a software development kit (Software Development Kit, SDK) (jar package), and detects through a low-invasion manner, Figure 10 , a structure diagram of a data processing system is shown.

[0161] As shown in Figure 10 , the data processing system includes a transaction subsystem 101 and a data processing device 102. The transaction subsystem 101 can include a client 1011, a remote system 1012, and an application database 1013.

[0162] The client 1011 initiates a first transaction, accesses the remote system 1012 and the application database 1013 through the first interface of the action layer 10111, the target method 1 and the target method 2 of the service layer 10112.

[0163] The data processing device 102 includes a call link interceptor 1021, a resource access interceptor 1022, a data processing module 1023, a data analysis module 1024, and a tool library 1025.

[0164] The interceptor module (the call link interceptor 1021 and the resource access interceptor 1022): by means of the call link interceptor and the resource access interceptor, the original data (including various methods) in the transaction is intercepted, and after the data is integrated by the two interceptors, the integrated data (various methods or method trees) is obtained and transmitted to the data processing module 1023.

[0165] Data processing module 1023: In order not to affect the normal execution of the transaction, the data processing module starts an asynchronous thread to bypass the integrated data for processing, obtains the processed data, and saves the processed data to the tool library 1025.

[0166] Data analysis module 1024: Calculate the expected access resource times Ect for obtaining a certain resource during a transaction for each method. In an ideal case, there is no redundant access resource times for obtaining a data in a transaction, and the value of Ect should be 1. The higher the Ect, the greater the optimization space.

[0167] Call link interceptor 1021: Use spring aop to intercept all methods called by the action layer. The interceptor records a method identifier (TraceId) for each method, which is stored in the method tree (TraceTree) in a tree structure. When the parent method of a method is an action layer method, use this method as the root node of the TraceTree. When the parent method of a method is a service layer method, find the parent method node of the method in the TraceTree, and add the method as a leaf node of the parent method node to the TraceTree.

[0168] Resource access interceptor 1022: For the scenario where the target resource is remote system data, use spring aop to intercept the method that calls the target resource; for the scenario where the target resource is database data, provide a standard interface, which can be implemented differently depending on the framework used by the database. If the hibernate or mybatis framework is used, the Interceptor technology provided by the framework can be used, or spring aop can be used to intercept the methods in the jdbcstatement.

[0169] As shown in Figure 11 , the data processing process mainly includes:

[0170] 1. Filter the data within the monitoring range according to the monitoring configuration, which mainly includes but is not limited to the following S1101 and S1102.

[0171] S1101, obtain the data to be processed.

[0172] Obtain the intercepted method or method tree in the first transaction process through the data processing module, and use the intercepted method or method tree as the data to be processed.

[0173] S1102, determine whether the call object of the intercepted method is the target resource.

[0174] First, the configuration information of the target resource (monitoring configuration) is acquired, and then it is determined whether the calling object of the interception method is the same as the content in the configuration information. If they are the same, it is confirmed that the calling object of the interception method is the target resource, and the following S1103 is executed. If they are different, it is confirmed that the calling object of the interception method is not the target resource, and the next interception method is determined again.

[0175] The configuration information of the target resource can include a monitoring type (DETECT_TYPE) and a monitoring value. The DETECT_TYPE can include a remote system or a database (DB_QUERY).

[0176] In the case of the monitoring type being REMOTE, the corresponding monitoring value (DETECT_VALUE) is the name of the remote system to be monitored. The data processing module parses the input parameter of the intercepted remote calling method to determine whether it is an access to the target system.

[0177] In the case of the monitoring type being DB_QUERY, the corresponding DETECT_VALUE is the table name in the database to be monitored. The data processing module parses the intercepted sql, compares the table name queried by the sql with the configuration, and considers that the table names are the same as repeated access.

[0178] 2. The access times of each method (node) are counted. The process can include, but is not limited to, the following S1103 to S1105.

[0179] S1103, determine that the interception method is the current node (detection node).

[0180] S1104, determine whether the current node exists in the tool library. If it exists, the access times of the current node are incremented by one. If it does not exist, the information of the current node is stored in the tool library, and the access times of the current node are set to one.

[0181] The information of the current node can include a node identifier and the access times of the node.

[0182] S1105, determine whether the current node has a parent node. If it does not have a parent node, it is ended. If it has a parent node, the parent node is taken as a new current node.

[0183] The access times of the current node in the monitoring range are recorded as one, and the access times of the parent node of the current node are incremented by one. The access times are recorded in the access record table. The access record table is shown in Table 3. Each access to a method generates a globally unique path identifier (TRACE_ID). The transaction serial number (BIZ_SEQ_NO) is a globally unique serial number of a transaction initiated by the action.

[0184] Table 3 access record example

[0185] Field name Meaning TRACE_ID Link ID (path identification) BIZ_SEQ_NO Transaction serial number RESOURCE Access resource METHOD_NAME Method name (method identification) PARAENT_TRACE_ID Link parent node ID CALL_TIMES Access times CREATE_DATETIME Creation time

[0186] Data analysis module: According to the access record table analysis, the expected access times Ect of each method is calculated. The expected access times Ect of each method is equal to the access times of the method accessing the target resource (hereinafter referred to as access times) plus the expected sum of the access times of the associated methods, as shown in formula (1):

[0187] Ect = Ict +∑P i ×Ict i Formula (1);

[0188] Wherein, Ect represents the expected access times of a method, Ict i represents the access times of the associated method, P i represents the confidence of the associated method.

[0189] For example, a transaction calls method A, and according to the data of the customer of the transaction or the gray rule in method A, there is a 30% probability that method B is called in the same transaction; there is a 40% probability that method C is called in method B; there is a 50% probability that method D is called in method C, and there is a 50% probability that method E is called. The calculation formula of Ect of method A can be formula (2) as follows:

[0190] Ect(A) = Ict(A) + P(B|A)Ict(B) + P(C|A,B)Ict(C) + P(D|A,B,C)Ict(D) + P(E|A,B,C)Ict(E);

[0191] Formula (2);

[0192] Wherein, Ict represents the access times of method A, Ict(B) represents the access times of method B, Ict(C) represents the access times of method C, Ict(D) represents the access times of method D, and Ict(E) represents the access times of method E; P(B|A) represents the probability that method B also occurs under the condition that method A occurs, P(C|A,B) represents the probability that method C also occurs under the condition that methods A and B occur, P(D|A,B,C) represents the probability that method D also occurs under the condition that methods A, B and C occur, and P(E|A,B,C) represents the probability that method E also occurs under the condition that methods A, B and C occur.

[0193]

[0194] ​It is to be noted that the Ict of a method accessing a resource in a transaction is the sum of the CALL_TIMES of the RESOURCE and METHOD_NAME matching under a BIZ_SEQ_NO in the access record table. In order to reflect the actual situation in production, the average value of multiple transactions should be taken as the expected Ict of the method.

[0195] In order to obtain the probability of calling other methods under the condition of calling method A, the present application estimates the support and confidence of each method by using the Apriori algorithm.

[0196] The support (support) represents the probability of A and B occurring simultaneously, and can be expressed as formula (3):

[0197] support(A=>B)=P(AUB) formula (3);

[0198] The confidence (confidence) represents the ratio of the probability of A and B occurring simultaneously to the probability of A occurring, and can be expressed as formula (4):

[0199] confidence(A=>B)=support(AUB) / support(A) formula (4); assuming that the 10 transactions of an interface calling methods are as shown in Table 1:

[0200] The support of each method combination obtained through Table 1 is as follows in Table 4A, Table 4B, Table 4C and Table 4D.

[0201] Table 4A: Support of each method combination

[0202]

[0203]

[0204] Table 4B: Support of each method combination

[0205] Method combination Support degree Method A, Method B 1 Method A, Method C 1 Method A, Method D 0.6 Method A, Method E 0.2 Method A, Method F 0.2 …… …… Method E, Method F 0.2

[0206] Table 4C: Support of each method combination

[0207] Method combination Support degree Method A, Method B, Method C 0.6 Method A, Method B, Method D 0.2 Method A, Method B, Method E 0.6 Method A, Method B, Method F 0.2 Method A, Method B, Method G 0.2 …… …… Method B, Method E, Method F 0.2

[0208] Table 4D: Support of each method combination

[0209] Method combination Support degree Method A Method B Method E Method F 0.2 Method A Method B Method G Method C 0.2

[0210] According to Table 4A, Table 4B, Table 4C and Table 4D, the conditional probability and confidence of all method combinations can be calculated, for example, the support of the interface calling A, B, C and H is 0.2, the support of calling A, B and C is 0.6, and the confidence of calling H in the case of having called A, B and C (ABC=>H) = support(ABCH) / support(ABC) = 0.2 / 0.6 = 33.33%, that is, P(H|A, B, C) = 33.33%.

[0211] Ect can be calculated by Ict of each method and the probability P of calling the associated method, and the higher Ect is, the greater the optimization is.

[0212] The data processing method provided in the embodiments of the present application can only consider Ict, which reduces complexity and improves processing performance.

[0213] In addition, the present solution can also be applied to single test tools, and for various single test scenarios, the Ect of the tested method in each scenario can also be detected, so that the detection tool does not need to be deployed to the production environment, thereby reducing the complexity of the tool.

[0214] To implement the above data processing method, a data processing apparatus according to an embodiment of the present application is provided, which is described below in combination with the structural schematic diagram of the data processing apparatus. Figure 12

[0215] As shown in Figure 12 The data processing apparatus 120 includes an obtaining unit 1201 and a processing unit 1202. Wherein:

[0216] The obtaining unit 1201 is configured to obtain calling information of a first transaction; the calling information includes a first calling relationship between a first interface and at least one method, and a second calling relationship between the at least one method and at least one resource;

[0217] The processing unit 1202 is configured to predict a number of times of accessing a target resource by a target object based on the calling information; the target object includes the first interface or any of the at least one method; and the target resource includes any of the at least one resource.

[0218] In some embodiments, the processing unit 1202 is further configured to:

[0219] determine at least one path for accessing the target resource by the target object based on the calling information;

[0220] determine a first number of times corresponding to each of the at least one path; the first number of times is a number of times of accessing the target resource by the path.​

[0221] predicting, based on at least the corresponding first number of each of the paths, the number of times the target object accesses the target resource.

[0222] In some embodiments, the processing unit 1202 is further directed to:

[0223] multiplying, for each of the paths, the corresponding first number of the path by a confidence degree of the path to obtain a corresponding second number of the path; the confidence degree of the path is used to represent a probability of occurrence of the path; and the second number is a predicted number of times the target object accesses the target resource through the path;

[0224] predicting the number of times the target object accesses the target resource as a sum of the corresponding second number of each of the paths.

[0225] In some embodiments, the processing unit 1202 is further directed to:

[0226] obtaining, for a first path, a first support degree and a second support degree in a case that the target object includes at least two methods; the first support degree is used to represent a probability of accessing the target resource through a first reference method; the first reference method is one of the at least two methods; and the second support degree is used to represent a probability of accessing the target resource through a second reference method; the second reference method is one of the at least two methods except a method directly invoking the target resource;

[0227] determining a confidence degree of the first path as a ratio of the first support degree to the second support degree.

[0228] In some embodiments, the processing unit 1202 is further directed to:

[0229] obtaining, in a case that the target object includes the first interface, a first method based on the calling information; the first method is one of the methods invoked through the first interface and used to access the target resource;

[0230] determining a third number corresponding to each of the first methods; the third number is a number of times the target object accesses the target resource through the first method;

[0231] predicting, based on at least the third number corresponding to each of the first methods, the number of times the target object accesses the target resource.

[0232] In some embodiments, the processing unit 1202 is further directed to:

[0233] judging whether the target resource is accessed;

[0234] If the target resource is accessed, a second method calling the target resource is determined, and an access number corresponding to the second method is increased by one; the access number is used to represent the number of times of accessing the target resource.

[0235] It is judged whether the second method has a parent method, if the second method has no parent method, a third number corresponding to the first method is determined as one.

[0236] If the second method has a parent method, an access number of the parent method of the second method is increased by one; and the parent method of the second method is taken as a new second method, it is judged whether the new second method has a parent method until the new second method has no parent method.

[0237] In the case that the new second method has no parent method, the third number corresponding to the first method is determined as the access number of the new second method, and it is re-judged whether the target resource is accessed until the third number corresponding to each first method is obtained.

[0238] In some embodiments, the processing unit 1202 is further configured to:

[0239] obtain a first probability corresponding to each first method; the first probability is a probability of calling the first method through the first interface;

[0240] for each first method, a product of the third number corresponding to the first method and the first probability corresponding to the first method is determined as an expected number of the first method, to obtain an expected number of each first method;

[0241] the number of times of accessing the target resource by the target object is predicted as a sum of the expected numbers of each first method.

[0242] It should be noted that the data processing apparatus provided by the embodiments of the present application includes various units included, which can be realized by a processor in an electronic device; of course, it can also be realized by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0243] The above apparatus embodiment is similar to the description of the above method embodiment, and has similar beneficial effects to the method embodiment. For technical details not disclosed in the apparatus embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.

[0244] It should be noted that, in the embodiments of this application, if the above-described data processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, 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 methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0245] To implement the above data processing method, this application provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the data processing method provided in the above embodiments.

[0246] The following is combined Figure 13 The electronic device 130 shown is illustrated with a structural diagram of the electronic device.

[0247] In one example, the aforementioned data processing device may be deployed on electronic device 130. For example... Figure 13 As shown, the electronic device 130 includes: a processor 1301, at least one communication bus 1302, a user interface 1303, at least one external communication interface 1304, and a memory 1305. The communication bus 1302 is configured to enable communication between these components. The user interface 1303 may include a display screen, and the external communication interface 1304 may include standard wired and wireless interfaces.

[0248] The memory 1305 is configured to store instructions and applications executable by the processor 1301, and can also cache data to be processed or already processed by the processor 1301 and various modules in the electronic device (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).

[0249] Fourthly, embodiments of this application provide a storage medium, namely a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps in the data processing method provided in the above embodiments.

[0250] It should be noted that the description of the storage medium and device embodiments above is similar to the description of the method embodiments above, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.

[0251] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that the size of the sequence number of the above processes in various embodiments of the present application does not mean the order of execution, and the execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The sequence number of the above embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.

[0252] It should be noted that in this document, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0253] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.

[0254] The units described above as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units; they can be located in one place or distributed on multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0255] In addition, each of the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can be separately implemented as a single unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in the form of hardware or in the form of hardware plus software function unit.

[0256] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program executes the steps including the above-mentioned method embodiments when executed; and the foregoing storage medium includes: mobile storage equipment, read only memory (Read Only Memory, ROM), magnetic disc or optical disc and various storage program codes.

[0257] Alternatively, the integrated unit of the present application, if implemented in the form of a software function module and sold or used as an independent product, can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes: mobile storage equipment, ROM, magnetic disc or optical disc and various storage program codes.

[0258] The above is only an embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data processing method, characterized by, The method comprises: obtaining calling information of a first transaction; the calling information comprises: a first calling relationship of a first interface and at least one method, and a second calling relationship of the at least one method and at least one resource; determining at least one path for accessing a target resource through a target object based on the calling information; determining a first number of times corresponding to each of the at least one path; the first number of times is a number of times of accessing the target resource through the path; predicting a number of times of accessing the target resource by the target object based on at least the first number of times corresponding to each of the at least one path; the target object comprises the first interface or any of the at least one method; and the target resource comprises any of the at least one resource; wherein the predicting the number of times of accessing the target resource by the target object based on at least the first number of times corresponding to each of the at least one path comprises: for each of the at least one path, multiplying the first number of times corresponding to the path by a confidence degree of the path to obtain a second number of times corresponding to the path; the confidence degree of the path is used to represent a probability of occurrence of the path; and the second number of times is a predicted number of times of accessing the target resource through the path; the number of times of accessing the target resource by the target object is a sum of the second number of times corresponding to each of the at least one path.

2. The method of claim 1, wherein, for a first path, the first path comprises at least two methods, and the at least two methods comprise the target object, and the method further comprises: obtaining a first support degree and a second support degree; the first support degree is used to represent a probability of accessing the target resource through a first reference method; the first reference method is the at least two methods; and the second support degree is used to represent a probability of accessing the target resource through a second reference method; the second reference method is a method other than a method directly calling the target resource in the at least two methods; determining a ratio of the first support degree to the second support degree as the confidence degree of the first path.

3. The method of claim 1, wherein, the target object comprises the first interface, and the predicting the number of times of accessing the target resource by the target object based on the calling information comprises: obtaining a first method based on the calling information; the first method is a method accessing the target resource in methods called through the first interface; determining a third number of times corresponding to each of the first methods; the third number of times is a number of times of accessing the target resource through the first method; predicting the number of times of accessing the target resource by the target object based on at least the third number of times corresponding to each of the first methods.

4. The method of claim 3, wherein, the determining the third number of times corresponding to each of the first methods comprises: judging whether the target resource is accessed; if the target resource is accessed, determining a second method calling the target resource, and adding one to a number of times of accessing the second method; the number of times of accessing is used to represent a number of times of accessing the target resource; judging whether the second method has a parent method, and if the second method has no parent method, determining that the third number of times corresponding to the first method is one. If the second method has a parent method, the access number of the parent method of the second method is added by one, and the parent method of the second method is taken as a new second method, and it is determined whether the new second method has a parent method until the new second method has no parent method; In the case that the new second method has no parent method, the third number corresponding to the first method is determined as the access number of the new second method, and it is re-determined whether the target resource is accessed until the third number corresponding to each first method is obtained.

5. The method of claim 3, wherein, The method further includes: obtaining a first probability corresponding to each first method; the first probability is a probability of calling the first method through the first interface; for each first method, a product of the third number corresponding to the first method and the first probability corresponding to the first method is determined as an expected number of the first method, and an expected number of each first method is obtained; the number of times that the target object accesses the target resource is a sum of the expected numbers of the first methods.

6. A resource adjustment apparatus characterized by comprising: The device is deployed in a storage device. The device includes: an obtaining unit, configured to obtain calling information of a first transaction; the calling information includes a first calling relationship between a first interface and at least one method, and a second calling relationship between the at least one method and at least one resource; a processing unit, configured to determine at least one path of accessing a target resource through a target object based on the calling information, determine a first number corresponding to each path in the at least one path, and predict a number of times that the target object accesses the target resource based on at least the first number corresponding to each path; the target object includes the first interface or any method in the at least one method; the target resource includes any resource in the at least one resource; wherein the prediction of the number of times that the target object accesses the target resource based on at least the first number corresponding to each path includes: for each path, multiplying the first number corresponding to the path by a confidence degree of the path to obtain a second number corresponding to the path; the confidence degree of the path is used to represent an occurrence probability of the path; the second number is a predicted number of times of accessing the target resource through the path; and the number of times that the target object accesses the target resource is a sum of the second numbers corresponding to the paths. 7.An electronic device comprising a memory and a processor, the memory storing a computer program capable of running on the processor, and the processor implements the data processing method of any one of claims 1 to 5 when executing the program.

8. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the data processing method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for distributed system white box association path tracking

    CN109951355A