Business error reporting method and system, electronic equipment and computer program product
By generating exclusive error codes in the preset call relationship diagram of the business system, the problem of indistinguishable error information in the cross-link is solved, and the function of quickly positioning the error report service is realized.
Patent Information
- Application Number
- CN202411737065.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
AI Technical Summary
In the business system, it is difficult to distinguish between the error reporting information at the intersection, resulting in difficulty for users to quickly locate the error reporting service.
By generating an error code for exclusive services in the preset call relationship diagram, combining service interface encoding and function encoding, a target error code is generated, and output to the user, so that the user can query the preset call relationship diagram based on the target error code and locate the error service.
It realizes the distinction between business interface calls that occur in the intersection, simplifies the process of user positioning the error service and improves the efficiency of error positioning.
Smart Images

Figure CN119512799A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of business processing technology, and in particular to a business error reporting method, system, electronic device and computer program product. Background Art
[0002] With the development of Internet technology, various businesses are gradually online and business systems are becoming larger and larger, so that in business systems, multiple business paths or business processes often have cross-links. Among them, a business path or business process may involve multiple links.
[0003] When an error occurs in a cross-link, since the cross-link involves multiple business links, the error information of the cross-link is difficult to distinguish the business where the error occurs, making it difficult for users to quickly locate the error business. Summary of the invention
[0004] In view of the above problems, the present application provides a service error reporting method, system, electronic device and computer program product to achieve the purpose of quickly locating the error reporting service. The specific scheme is as follows:
[0005] A first aspect of the present application provides a service error reporting method, the service error reporting method comprising:
[0006] When an error occurs, locate the target business interface based on the current business call request;
[0007] Determine the target calling function where the target service interface reports an error according to the call stack information;
[0008] Determine the business interface code of the target business interface in a preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, wherein the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents a function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code;
[0009] Determine a target function node corresponding to the calling function in the function calling path, and obtain a function code and an error code of the target function node;
[0010] The service interface code, the function code of the target function node and the error code of the target function node are combined to obtain a target error code and output the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
[0011] In a possible implementation, the process of obtaining the preset call relationship graph includes:
[0012] Scan the business code through the code scanning component to obtain the function call relationship of each business interface;
[0013] The function call relationship of each business interface is traversed in the order of before and after the call to obtain the function call path of each business interface. Each function call path has multiple function nodes, and each function node corresponds to a calling function.
[0014] Information annotation is performed on the business interface and the function nodes in the function call path according to the annotation rules to form the preset call relationship graph.
[0015] In a possible implementation, locating the target service interface according to the current service call request includes:
[0016] The target service interface is located according to the uniform resource locator URL in the service call request.
[0017] In a possible implementation, the function code is a sequential number of the function node in the function call path.
[0018] A second aspect of the present application provides a service error reporting system, the service error reporting system comprising:
[0019] A positioning unit, used to locate the target service interface according to the current service call request when an error occurs;
[0020] A search unit, used to determine the target calling function where the target service interface reports an error according to the call stack information;
[0021] A query unit, used to determine the business interface code of the target business interface in a preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, wherein the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents a function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code;
[0022] An acquisition unit, configured to determine a target function node corresponding to the calling function in the function calling path, and acquire a function code and an error code of the target function node;
[0023] An output unit is used to combine the service interface code, the function code of the target function node and the error code of the target function node, obtain a target error code and output the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
[0024] In a possible implementation, a unit for generating the preset call relationship graph is further included, and the generating unit is specifically configured as follows:
[0025] The business code is scanned by the code scanning component to obtain the function call relationship of each business interface; the function call relationship of each business interface is traversed in the order of before and after the call to obtain the function call path of each business interface, each function call path has multiple function nodes, and each function node corresponds to a calling function; the business interface and the function nodes in the function call path are annotated according to the annotation rules to form the preset call relationship diagram.
[0026] In a possible implementation, the positioning unit is specifically configured as follows:
[0027] The target service interface is located according to the uniform resource locator URL in the service call request.
[0028] In a possible implementation, the function code is a sequential number of the function node in the function call path.
[0029] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0030] The memory is used to store computer programs;
[0031] The processor is used to execute the computer program so that the electronic device can implement the service error reporting method of the first aspect or any implementation method of the first aspect.
[0032] A fourth aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the service error reporting method of the first aspect or any implementation method of the first aspect.
[0033] By means of the above technical scheme, the present application provides a business error reporting method, system, electronic device and computer program product. When an error occurs, the method can locate the target business interface being called according to the current business call request, and determine the target calling function where the target business interface has an error according to the call stack information. Determine the business interface code of the target business interface in the preset call relationship graph, determine the function call path corresponding to the target business interface in the preset call relationship graph, and determine the target function node corresponding to the target call function in the function call path, thereby obtaining the function code and error code, thereby combining the business interface code, the function code of the target function node and the error code of the target function node to obtain the target error code, and output the target error code to the user end, so that the user end can query the preset call relationship graph according to the target error code and locate the error business. Since the preset call relationship graph contains the function call paths of all business interfaces, and each function call path can represent the function call sequence of a business interface, each function call path has multiple function nodes, and each function node is marked with a function code and an error code, therefore, when an error occurs, this method can query the preset call relationship graph through the business interface and the calling function, and generate an error code that is specific to the business interface call where the error occurs. The business interface call that has an error can be distinguished in the cross-link, and it is also convenient for the user end to query the preset call relationship graph according to the error code to quickly locate the error business. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0035] Figure 1 A flowchart of a service error reporting method provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of the structure of a preset call relationship diagram provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of the structure of a service error reporting system provided in an embodiment of the present application;
[0038] Figure 4 A hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0040] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0041] The terms "first", "second" etc. in the specification of the application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable in appropriate circumstances, and this is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0042] With the popularization of Internet applications, various life services are gradually online, resulting in the business systems of online applications becoming increasingly large. In a large business system, there are cross-links in the paths or business processes of multiple different businesses, and in the cross-links, various businesses cross-access each other. When different business paths or different business processes pass through the cross-links, the error information is not distinguishable, and the error business cannot be quickly located.
[0043] In order to solve the above problems, the embodiment of the present application provides a service error reporting method, which generates a dedicated service error code by presetting a call relationship diagram, so as to distinguish the error reporting service when an error occurs in a cross link. The service error reporting method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0044] Reference Figure 1 , Figure 1 A flowchart of a service error reporting method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a service error reporting method provided in an embodiment of the present application may include steps S10 to S14, and these steps are described in detail below.
[0045] S10. When an error occurs, locate the target service interface according to the current service call request;
[0046] S11. Determine the target calling function where an error occurs in the target business interface according to the call stack information.
[0047] A business call request refers to a request made by a business service or application in a business process to another service or component to execute specific business logic or operations. A business process can involve multiple business services, and each business service can have a business interface that makes a request to another service interface or component to execute specific business logic or operations, thereby implementing different business services. The target business interface is the business interface where the error occurs.
[0048] When the business interfaces interact, the business interface of the caller constructs an HTTP request, which includes multiple parts such as the request method, URL path, request header (authentication information, content type, etc.) and request body (data to be sent), and sends the HTTP request to the URL of the business interface of the called party. The business interface of the caller receives the HTTP response returned by the business interface of the called party, and the business interface of the caller executes the corresponding business logic according to the HTTP response. Therefore, at the intersection in this embodiment, there are multiple business interfaces of different businesses that issue business call requests to the same business interface. When an error occurs in the cross-link, the target business interface can be located according to the URL (Uniform Resource Locator) in the business call request.
[0049] The calling function is a function that encapsulates the interface calling logic of the business interface, and is a code block used by the business interface to implement specific business logic. Under different business services in a business process, the calling function of the business interface of each business service can be different. For example, in the business process of online shopping, multiple business services such as product display and payment may be involved. The business interface of the product display service can call the interface provided by the product supplier to obtain product information, and the business interface of the payment service can call the interface provided by the payment provider to implement payment. The calling function of the business interface of the product display service is different from the calling function of the business interface of the payment service. Of course, when different business services in a business process are implemented through a business interface, the business interface can contain multiple calling functions for processing different business logics.
[0050] The target calling function in this embodiment is the calling function of the target business interface calling error. The call stack is a data structure used to manage function calls when a computer program is executed. The call stack information in the call stack can be used to track the order of function calls and returns during the execution process. When each business interface calls a function, a new stack frame is created on the call stack, and the stack frame may include information such as the local variables, parameters, and return address of the function. The call stack information generally may include information such as the name of the currently executing function, the parameter values passed to the function, and the position of the function in the code. When an error occurs when the business interface calls a function, the call stack information may also include the function call sequence that causes the error. Therefore, this embodiment can determine the target calling function that the target business interface is using when an error occurs based on the call stack information.
[0051] S12. Determine the business interface code of the target business interface in the preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, where the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents a function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code;
[0052] S13. Determine the target function node corresponding to the calling function in the function calling path, and obtain the function code and error code of the target function node.
[0053] In this embodiment, the preset call relationship graph is a relationship graph representing the calling sequence of the business interface and the calling function. In the preset call relationship graph, multiple function call paths may be included. The function call path is the sequential path of the function calls of the business interface in the business process to which it belongs, and each function call path may correspond to a business interface. In the function call path, there may be multiple function nodes, and each function node may represent a calling function called by the business interface in the business process. The preset call relationship graph includes all business interfaces involved in all businesses and their corresponding function call paths. Then, in the preset call relationship graph, all business interfaces involved in a business process and multiple function call paths corresponding to all business interfaces may represent all function call relationships in a business process.
[0054] The process of obtaining the preset call relationship graph can be shown in steps 1 to 3:
[0055] Step 1: Scan the business code through the code scanning component to obtain the function call relationship of each business interface;
[0056] Step 2: Traverse the function call relationship of each business interface in the order of calling, and obtain the function call path of each business interface. Each function call path has multiple function nodes, and each function node corresponds to a calling function.
[0057] Step 3: Annotate the business interface and function nodes in the function call path according to the annotation rules to form a preset call relationship diagram.
[0058] Among them, the code scanning component is an automated tool that can use specific algorithms and rule sets to check the code. In this embodiment, the code scanning component dynamically scans or statically scans the code of each business interface with the business interface as the dimension, so as to obtain the function call relationship of each business interface in the entire business process. Dynamic scanning refers to the determination of the function call relationship of the business interface by monitoring and recording the function call situation during the operation of the business interface when the code of the business interface is executed. Static scanning refers to the determination of the function call relationship of the business interface by analyzing the syntax and semantic interface of the code of the business interface when the code of the business interface is not executed. After the function call relationship of each business interface is obtained in this embodiment, the function call relationship of each business interface can be traversed to determine the order of calling functions of the business interface, so as to obtain the function call path of each business interface. Therefore, even if there is a cross link, this embodiment can also manage the business error of different function call paths of the same function in the cross link by presetting the call relationship diagram to distinguish the calls of different business interfaces in the cross link.
[0059] The marking rule is a marking method for the business interface and each function node in the preset call relationship diagram, which is used to distinguish and mark multiple business interfaces and multiple function nodes in the preset call relationship diagram. For example, the business interface is directly marked with a number in natural number sequence, and each function node is marked according to the business interface number + function sequence number. The specific marking method can be designed according to the actual situation. Therefore, in the preset call relationship diagram of this embodiment, each business interface is marked with a business interface number, and the function node is marked with a function code and an error code, wherein the function code can be the sequential number of the function node in the function call path, and the error code is a dedicated code for a function call error, indicating that an error occurred when the business interface called the function. The number of digits of the business interface code, function code and error code can all be set by yourself.
[0060] like Figure 2 The schematic diagram of the structure of the preset call relationship diagram is shown in FIG. Figure 2As shown, the preset call relationship diagram may include interface 01, the function call path corresponding to interface 01, interface 02, and the function call path corresponding to interface 02. In the business process to which interface 01 belongs, the order of function calls is: function 1, function 2, and function 3 (such as Figure 2 The black thin arrow shown in the figure), and the order of function calls of interface 02 in the business process to which it belongs is: function 4, function 2, function 5 and function 6 (as shown in the figure Figure 2 (shown by the thick black arrow), interface 01 and interface 02 have a common calling function in the function call path: function 2. The common point of interface 01 and interface 02 in the function call path indicates that the business process to which interface 01 belongs and the business process to which interface 02 belongs have an intersection. Figure 2 In the , each function node is numbered in natural number order. In each function call path, each function node also has a natural number order to reflect the order in which the functions are called.
[0061] S14, combining the service interface code, the function code of the target function node and the error code of the target function node, obtaining the target error code and outputting the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
[0062] Among them, after this embodiment determines the target business interface and the target calling function where an error occurs in the business interface, the preset calling relationship graph can be queried to obtain the business interface number of the target business interface in the preset calling relationship graph, the function code and error code of the target calling function in the preset calling relationship graph, thereby obtaining the target error code composed of the business interface code of the target business interface, the function code of the target function node and the error code of the target function node. The target error code is the error code corresponding to the error when an error occurs in the business system. The number of digits in the error code can be determined by the business interface code, function code and error code. For example, Figure 2 As shown, if interface 01 calls function 2 and reports an error, the business interface code can be 01, the function code can be 02, the error code is 002, and the error code can be 0102002; if interface 02 calls function 2 and reports an error, the business interface code can be 02, the function code can be 02, the error code is 002, and the error code can be 0202002.
[0063] The target error code can be output to the user end, and the user can determine the error business and the specific location of the error based on the target error code, such as which business interface reported the error, which calling function the business interface called to report the error, etc. Among them, when using the target error code to determine the error location, the target error code can be directly used in reverse to query the preset call relationship graph. Specifically, first, the business interface and its corresponding function call path in the preset call relationship graph can be determined based on the business interface code in the target error code, and then the function node in the function call path can be determined based on the function code, and the error that occurred in the function node can be determined based on the error code. Of course, after the user end obtains the target error code, it can also send the target error code to professional maintenance personnel for processing, which is also convenient for professional maintenance personnel to confirm the error location of the business system.
[0064] The present application provides a service error reporting method. When an error occurs, the method can locate the target service interface being called according to the current service call request, and determine the target calling function in which the target service interface has an error according to the call stack information. Determine the service interface code of the target service interface in the preset call relationship graph, determine the function call path corresponding to the target service interface in the preset call relationship graph, and determine the target function node corresponding to the target calling function in the function call path, thereby obtaining the function code and the error code, thereby combining the service interface code, the function code of the target function node and the error code of the target function node to obtain the target error code, and output the target error code to the user end, so that the user end can query the preset call relationship graph according to the target error code and locate the error service. Since the preset call relationship graph contains the function call paths of all service interfaces, and each function call path can represent the function call sequence of a service interface, each function call path has multiple function nodes, and each function node is marked with a function code and an error code.
[0065] Therefore, when an error occurs, this method can query the preset call relationship graph through the business interface and the calling function, and generate an error code that is specific to the business interface call where the error occurs. The business interface call where the error occurs can be distinguished in the cross-links, and it is also convenient for the user end to query the preset call relationship graph according to the error code to quickly locate the error business.
[0066] A service error reporting method provided in an embodiment of the present application is introduced above, and a system for executing the above service error reporting method will be introduced below.
[0067] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a service error reporting system provided in an embodiment of the present application. Figure 3 As shown, the business error reporting system may include:
[0068] The positioning unit 100 is used to locate the target service interface according to the current service call request when an error occurs;
[0069] A search unit 110 is used to determine the target calling function where the target service interface reports an error according to the call stack information;
[0070] The query unit 120 is used to determine the business interface code of the target business interface in the preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, wherein the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents the function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code;
[0071] The acquisition unit 130 is used to determine the target function node corresponding to the calling function in the function calling path, and acquire the function code and error code of the target function node;
[0072] The output unit 140 is used to combine the service interface code, the function code of the target function node and the error code of the target function node, obtain the target error code and output the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
[0073] In a possible implementation, a generation unit of a preset call relationship graph is further included, and the generation unit is specifically configured as follows:
[0074] The business code is scanned by the code scanning component to obtain the function call relationship of each business interface; the function call relationship of each business interface is traversed in the order of before and after the call to obtain the function call path of each business interface, each function call path has multiple function nodes, and each function node corresponds to a calling function; the business interface and the function nodes in the function call path are annotated according to the annotation rules to form a preset call relationship diagram.
[0075] In a possible implementation, the positioning unit is specifically configured as follows:
[0076] The target service interface is located according to the uniform resource locator URL in the service call request.
[0077] In a possible implementation, the function code is the sequential number of the function node in the function call path.
[0078] The present application also provides an electronic device in an embodiment. Figure 4As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0079] like Figure 4 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 to a random access memory (RAM) 403. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0080] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a memory card, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0081] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any service error reporting method provided in the embodiment of the present application.
[0082] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any service error reporting method provided in an embodiment of the present application.
[0083] It should also be noted that the system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the system embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0084] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0085] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0086] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0087] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0088] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0089] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A service error reporting method, characterized in that: The business error reporting method comprises: When an error occurs, locate the target business interface based on the current business call request; Determine the target calling function where the target service interface reports an error according to the call stack information; Determine the business interface code of the target business interface in a preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, wherein the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents a function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code; Determine a target function node corresponding to the calling function in the function calling path, and obtain a function code and an error code of the target function node; The service interface code, the function code of the target function node and the error code of the target function node are combined to obtain a target error code and output the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
2. The service error reporting method according to claim 1, characterized in that: The process of obtaining the preset call relationship graph includes: Scan the business code through the code scanning component to obtain the function call relationship of each business interface; The function call relationship of each business interface is traversed in the order of before and after the call to obtain the function call path of each business interface. Each function call path has multiple function nodes, and each function node corresponds to a calling function. Information annotation is performed on the business interface and the function nodes in the function call path according to the annotation rules to form the preset call relationship graph.
3. The service error reporting method according to claim 1, characterized in that: The locating the target service interface according to the current service call request includes: The target service interface is located according to the uniform resource locator URL in the service call request.
4. The service error reporting method according to claim 1, characterized in that: The function code is the sequential number of the function node in the function call path.
5. A business error reporting system, characterized in that: The business error reporting system comprises: A positioning unit, used to locate the target service interface according to the current service call request when an error occurs; A search unit, used to determine the target calling function where the target service interface reports an error according to the call stack information; A query unit, used to determine the business interface code of the target business interface in a preset call relationship graph, and determine the function call path corresponding to the target business interface in the preset call relationship graph, wherein the preset call relationship graph is a relationship graph including multiple function call paths, each function call path represents a function call sequence of a business interface, and each function call path has multiple function nodes, each function node is annotated with a function code and an error code; An acquisition unit, configured to determine a target function node corresponding to the calling function in the function calling path, and acquire a function code and an error code of the target function node; An output unit is used to combine the service interface code, the function code of the target function node and the error code of the target function node, obtain a target error code and output the target error code to the user end, so that the user end can query the preset call relationship diagram according to the target error code and locate the error service.
6. The service error reporting system according to claim 5, characterized in that: It also includes a generation unit of the preset call relationship graph, and the generation unit is specifically configured as follows: The business code is scanned by the code scanning component to obtain the function call relationship of each business interface; the function call relationship of each business interface is traversed in the order of before and after the call to obtain the function call path of each business interface, each function call path has multiple function nodes, and each function node corresponds to a calling function; the business interface and the function nodes in the function call path are annotated according to the annotation rules to form the preset call relationship diagram.
7. The service error reporting system according to claim 5, characterized in that: The positioning unit is specifically configured as follows: The target service interface is located according to the uniform resource locator URL in the service call request.
8. The service error reporting system according to claim 5, characterized in that: The function code is the sequential number of the function node in the function call path.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the service error reporting method as described in any one of claims 1 to 4.
10. A computer program product, characterized in that It includes computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the service error reporting method as described in any one of claims 1 to 4.