An XML-based business link tracing method
Through the XML-based business link tracing method, XML link templates are configured and visual link maps are generated, which solves the complexity of cross-system business management and realizes global view and interactive operation capabilities.
Patent Information
- Application Number
- CN202510193897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-02-21
AI Technical Summary
In multi-system business management, it is difficult to fully view the entire business cycle and locate abnormal data. The existing technology cannot effectively track business links across the system, resulting in complex and inefficient management.
Using XML-based business link tracing method, by configuring XML link templates, analyzing and generating business link parameters, building node factories and generators, defining query interfaces, and visually displaying business nodes and exception data.
It realizes visual display of the entire business cycle, simplifies link configuration, strong scalability, supports multi-node management, and provides interactive operation capabilities.
Smart Images

Figure CN119690784B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and particularly to an XML-based business link tracking method. Background Art
[0002] With the development of information technology, business data shows a trend of massive increase. Although the problem of information silos between business systems has been solved through technology, with the increase in the number of management systems and the increasing complexity of system functions, and a business often spans multiple functions and systems, it is necessary to view and manage a business in different systems and functions. As a result, business managers need to operate among system functions and cannot overview the entire business cycle. At the same time, various abnormal data may occur in the business itself for different reasons, including but not limited to: duplicate data, inconsistent data, non-expected values within the data time limit, unknown data, etc. Developers or operators often need to query different systems, functions, and data tables to locate problems.
[0003] To overcome the above problems, the present invention proposes an XML-based business link tracking method, which is a different link tracking mode from data link tracking based on data burying points, Log, HTTP, or RPC requests. Summary of the Invention
[0004] The purpose of the present invention is to visually display all business node systems and functions passed through during the entire business cycle from the business start point to the business end point based on the upstream and downstream of business data and through XML configuration.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] An XML-based business link tracking method includes the following steps:
[0007] Step 1, configure an XML link template, where the XML link template includes the system configuration of the business system and the attributes of all business nodes;
[0008] Step 2, parse the XML link template to generate parameters for constructing a business link;
[0009] Step 3, based on the parameters for constructing a business link, construct a node factory and generate a node generator for each business node in the business link, and add the node generator to the node generator dictionary of the node factory;
[0010] Step 4, define a query interface for each business node;
[0011] Step 5: The Web front-end calls the query interface to query whether the node generator of the current business node exists in the node generator dictionary. If it exists, it calls the corresponding node generator to generate node data and returns it to the Web front-end, and then renders the node data as a visual link diagram. If it does not exist, it generates an error message and returns it to the Web front-end.
[0012] Further, the XML link template contains a root node, and the root node contains two child nodes: a basic configuration node and a link node configuration node.
[0013] The basic configuration node contains two child nodes: a system configuration node and a collector configuration node. The system configuration node contains three child nodes: a node type node, an exception level node, and an exception priority node. The collector configuration node contains three child nodes: an http-based collector node, an rpc-based collector node, and an sql-based collector node.
[0014] The link node configuration node contains multiple child nodes. One child node is an actual business node. Each business node contains a request parameter node, a display data node, a queryer node, a collector node, a caller node, and multiple child nodes. Each of these child nodes also contains multiple child nodes, and the child nodes of each child node have the same composition as the business node.
[0015] Further, the queryer node contains two child nodes: a business queryer node and an exception queryer node. The business queryer node contains a business queryer for querying the data of the business node. The exception queryer node contains at least one exception queryer for querying the exception data of the business node. The business queryer and the exception queryer are collectors.
[0016] Further, step 2 includes: Step 21, create a configuration file for storing parameters for building a service link. Define configuration object attributes in the configuration file, where the configuration object attributes include basic configuration and node configuration dictionary; the basic configuration includes a system configuration object and a collector dictionary. The system configuration object contains a node type dictionary, an exception level dictionary, and an exception priority dictionary; the keys of the node configuration dictionary are the node names of service nodes, and the values are service node configuration objects; the attributes included in the service node configuration object are as follows: the node name of the service node, node description, node type, request parameter dictionary, display data set, query object, exception query dictionary, invoker set, and child node set; Step 22, parse the XML link template to obtain the root node, basic configuration node, link node configuration node, system configuration node, collector configuration node, and each service node; traverse the child nodes of the system configuration node to obtain the node type node, exception level node, and exception priority node; Step 23, loop through the node type nodes, obtain the attributes of the node type nodes and add them to the node type dictionary; loop through the exception level nodes, obtain the attributes of the exception level nodes and add them to the exception level dictionary; loop through the exception priority nodes, obtain the attributes of the exception priority nodes and add them to the exception priority dictionary; Step 24, loop through the collector configuration nodes, obtain three child nodes: http collector node, rpc collector node, and sql collector node, read the attributes in the three child nodes and add them to the collector dictionary; Step 25, loop through the child nodes of each service node, and declare the service node configuration object defined in Step 21 inside the loop. Assign each attribute in the child nodes to the corresponding attribute of the service node configuration object, and add the service node configuration object with all attributes assigned to the node configuration dictionary.
[0017] Further, step 3 includes: Step 31, define a service node object. One service node object corresponds to one service node in the link node configuration node. The attributes included in the service node object are as follows: node id, node title, node type, node name, display data, exception set, call method set, and child node set. The node id is uniquely automatically generated by a globally unique identifier; Step 32, define a node factory and a node generator.
[0018] Further, step 32 includes: Step 321, the attributes included in the node factory are as follows: a node generator dictionary, where the keys of the node generator dictionary are node names and the values are the node generators corresponding to the current nodes; the methods included in the node factory are as follows: initialize the node generator using the initialize node creator method, and generate the node data of the business node using the node creation method; Step 322, the attributes included in the node generator are as follows: node name, node type, request parameters, display data, business collector, exception collector set, call method set, sub-element set, and the method included in the node generator is: generate the node data of the business node using the node creation method; Step 323, loop to construct the node collector; Step 324, generate a business node object based on the node factory: the input parameters of the node creation method in the node factory are the node name and node parameters, and the output parameter is the business node to be traced; query whether there is a business collector corresponding to the node name in the node generator dictionary of the node factory through the input node name. If it exists, obtain the business collector and record it as node generator C, and call the node creation method of node generator C to obtain the business node and record it as business node object A; loop through the sub-nodes in the sub-node set of the obtained business collector, query whether there is a corresponding collector in the node generator dictionary according to the node name of the sub-node. If it exists, call the node creation method of the obtained collector and pass in the request parameters of the sub-node to obtain the business node and record it as business node object B, and add business node object B to the node set of business node object A.
[0019] Further, step 4 includes: defining the interface name, request parameters, and return parameters of the query interface. The request parameters include the node name of the business node, and the return parameter is the basic response of the business node to be traced. The basic response includes the following attributes: status code, data, and return message. When the status code is 0, it indicates a successful return, otherwise it indicates an error return. When the return is successful, the data contains the business node object of the business node to be traced.
[0020] Further, in step 5, determine whether the node name of the business node is in the node generator dictionary. If it exists, obtain the node generator corresponding to the node name from the node generator dictionary and call the node generator to generate the node data of the business node.
[0021] Further, in step 5, through HTML, CSS, and JavaScript technologies, the Web front-end calls the query interface of the business node to obtain the node data of the business node object, and the Web front-end renders the returned business node object into a tree-structured visual link diagram.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] 1. It can dynamically load relevant node generators according to the configured XML link template, and finally obtain the node data of business nodes through the query interface, completing the description of complex link information in XML, with simple configuration and strong scalability, allowing the addition of any number of business nodes.
[0024] 2. Provide a visual link display diagram for users to view the overall view of the corresponding business link, provide a query interface, have the ability to access third-party programs, and in addition, corresponding business interaction operations can be performed through the link display diagram. Brief Description of the Drawings
[0025] Figure 1 It is the flowchart of the method of the present invention. Detailed Embodiments
[0026] Term Explanation:
[0027] XML (Extensible Markup Language) is a markup language used to define the structure and format of data. It is a self-describing language that allows users to define their own tags and elements.
[0028] Web front-end refers to building and designing web pages or web applications that users access through browsers.
[0029] URL (Uniform Resource Locator) is the standard address format used on the Internet to identify and access resources.
[0030] HTML (HyperText Markup Language) is a standard markup language used to create web pages and web applications.
[0031] CSS (Cascading Style Sheets) is a markup language used to style and layout web pages.
[0032] JavaScript is an interpreted programming language.
[0033] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention. In the description of the present invention, it should be noted that the terms "A", "B", "C", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0034] As Figure 1 shown, a business link tracing method based on XML provided by the present invention includes the following steps:
[0035] Step 1, configure an XML link template, where the XML link template includes system configurations of a business system and attributes of all business nodes;
[0036] Step 2, parse the XML link template to generate parameters for constructing a business link;
[0037] Step 3, based on the parameters for constructing a business link, construct a node factory and generate a node generator for each business node in the business link, and add the node generator to the node generator dictionary of the node factory;
[0038] Step 4, define a query interface for each business node;
[0039] Step 5, the Web front-end calls the query interface to query whether the node generator of the current business node exists in the node generator dictionary: if it exists, call the corresponding node generator to generate node data and return it to the Web front-end, and then render the node data into a visual link diagram; if it does not exist, generate an error message and return it to the Web front-end.
[0040] The present invention obtains the parameters of the entire business link based on the configured XML link template, collects and concatenates each business node through a node generator, and finally generates a link display diagram presented visually. The present invention has the advantages of simplified configuration and strong scalability, and can add any number of business nodes.
[0041] The XML link template of the present invention is used to define the overall business link, including a root node (root), and the root node includes two sub-nodes, namely a basic configuration node (basicSettings) and a link node configuration node (linkNodes).
[0042] The basic configuration node defines the basic configuration, including two sub-nodes, namely a system configuration node (system) and a collector configuration node (collectors).
[0043] The system configuration node defines the system configuration, including three child nodes: the node type node (nodeTypes), the exception level node (warnLevels), and the exception priority node (warnPrioritys). The node type node defines the type of the node, and the attributes included in the node type node are as follows: the node type and the value representing the current node type; when the node type is a logical node, the value is 10; when the node type is a data node, the value is 20. The exception level node defines the exception level, and the attributes included in the exception level node are as follows: the exception level, the exception level value, and the text color of the exception level; when the exception level is severe, the exception level value is 10, and the text color is red; when the exception level is medium, the exception level value is 20, and the text color is orange; when the exception level is minor, the exception level value is 30, and the text color is light blue; when the exception level is other, the exception level value is 40, and the text color is black; the exception information of different exception levels is sorted in ascending order in the link display diagram and displayed in different text colors. The exception priority node defines the exception handling priority, and the attributes included in the exception priority node are as follows: the exception priority and the exception priority value; when the exception priority is urgent, the exception priority value is 10; when the exception priority is medium, the exception priority value is 20; when the exception priority is normal, the exception priority value is 30; when the exception priority is other, the exception priority value is 40; the exception information of different exception priorities is sorted in ascending order in the link display diagram. Specifically, the sorting rule of the exception information in the link display diagram is to sort in ascending order of the exception level node first (i.e., severe, medium, minor, other), and then sort in ascending order of the exception priority node (i.e., urgent, medium, normal, other), with the purpose of sorting the severe and urgent exception information in the front.
[0044] The collector configuration node defines three different collectors and their basic configurations, including three child nodes: the http collector node (httpCollector), the rpc collector node (rpcCollector), and the sql collector node (sqlCollector). The attributes included in the http collector node are as follows: the value based on the http collector is 10, the request method is POST, and the request data type is Json; the attributes included in the rpc collector node are as follows: the value based on the rpc collector is 20, the request method is POST, and the request rpc version is 2.0; the attributes included in the sql collector node are as follows: the value based on the sql collector is 30, the database connection, and the database type is MYSQL.
[0045] The link node configuration node defines multiple service nodes (nodes), representing actual service nodes. The link node configuration node contains multiple child nodes, and one child node is an actual service node. The service node has the following attributes: node name (name), node title (title), which represents the title content displayed by the node, and node type (nodeType), which includes data nodes and logic nodes. When the node type is a logic node, the value is 10; when the node type is a data node, the value is 20.
[0046] Each service node contains a request parameter node (request), a display data node (view), a query node (collector), a caller node (callers), and multiple child nodes (childs). Each child node also contains multiple child nodes (nodes). The child nodes of each child node have the same composition as the service node, that is, they include a request parameter node (request), a display data node (view), a query node (queriers), a collector node (collector), a caller node (callers), and multiple child nodes (childs).
[0047] The request parameter node defines the parameters required to access the current service node. Each parameter is in the form of <add key="”参数名”" type="”参数类型” / ">Define it.
[0048] The display data node defines the entry content of the current service node displayed on the link display diagram, and each entry content is in <add name="”条目名称”" value="”{#条目值}” / ">Define it.
[0049] The querier node defines the set of queriers for the current service node, including two child nodes: the business querier node (bizQuerier) and the exception querier node (warnQueriers). The business querier node contains a business querier for querying the data of the service node, and the exception querier node contains at least one exception querier for querying the exception data of the service node. Both the business querier and the exception querier are collectors, and the collector sub-node (collector) needs to be configured inside.
[0050] The collector node defines the set of collectors for the current service node, including the following attributes: collector name (name), collector type (type), which respectively correspond to the configuration attributes of the collector configuration node; request parameters (request), indicating the parameters required for the collector to execute; return parameters (response), indicating the content structure returned after the collector executes. In actual business, when cross-platform or without access rights to other platform databases, the http collector is preferably used. If the platform to be collected contains rpc interfaces, the rpc collector is used. If it is executed within the system and complex and processed data needs to be returned, the sql collector is used.
[0051] The invoker node defines the right-click menu shown in the link display diagram and the methods called after each right-click menu is clicked; the invoker node contains multiple child nodes, each child node represents a right-click menu, including the following attributes: invoker name (name), right-click menu name (title), http method (url) called after the right-click menu is clicked, request parameters (request) called after the right-click menu is clicked, <add name="”参数名”" value="”{#参数值}”" type="”参数类型” / ">Define request parameters in this way. The invoker settings depend on whether the current business node needs to display a right-click menu for business processing. If so, the invoker node needs to be configured in the XML link template. In the link display diagram, after triggering the query interface by clicking the "Query Button", the node data of all business nodes is returned, including node operation information (Funcs). The node operation information is obtained by parsing the invoker node. The Web front-end loops through the list of node operation information and displays the corresponding right-click menu names and the called http methods. When the mouse right-clicks on the current business node, the display is triggered. Then, by clicking on a right-click menu item, the http method is called via ajax to complete the trigger.
[0052] The sub-node node defines any number of sub-nodes. Each sub-node has the same attributes as its outer business node. The name attribute of the sub-node is the same as that of the outer business node. The purpose is to find the corresponding outer business node with an equal name value through the name attribute value, and call the collector of the outer business node to complete data collection and fill it into the current sub-node to complete the business link connection.
[0053] In step 2 of the present invention, by parsing the XML link template, parameters for constructing the business link are generated, including:
[0054] Step 21: Establish a configuration file. The configuration file is used to store the parameters for constructing the business link. The configuration file converts the attributes of all business nodes defined in the XML link template into program objects and loads them into memory. Specifically, a configuration object attribute (config) is defined in the configuration file to store all element information based on the XML link template. The configuration object attribute includes basic configuration (basicConfig) and a node configuration dictionary (config.nodeConfigDict).
[0055] The basic configuration includes a system configuration object (system) and a collector dictionary (collectorDict). The system configuration object contains a node type dictionary (nodeTypeDict), a warning level dictionary (warnLevelsDict), and a warning priority dictionary (warnPrioritysDict). The keys of the collector dictionary are the numerical values of the collector types, and the values are collector objects. The collector class objects include an HTTP collector, an RPC collector, and an SQL collector. When the collector class object is an HTTP collector, the numerical value representing the HTTP collector is 10. When the collector class object is an RPC collector, the numerical value representing the RPC collector is 20. When the collector class object is an SQL collector, the numerical value representing the SQL collector is 30. The attributes included in the HTTP collector are as follows: HttpMethod request method, DataType request content format, Request url request address; The attributes included in the RPC collector are as follows: HttpMethod request method, JsonRPC protocol version, Request url request address; The attributes included in the SQL collector are as follows: DBHost database link, DBType database type.
[0056] The node configuration dictionary is used to store the configurations of each node in the service node. The key is the node name of the service node, and the value is the service node configuration object (nodeConfig).
[0057] The attributes included in the service node configuration object are as follows: the node name (name) of the service node, the node description (title), the node type (nodeType), the request parameter dictionary (requestDict), the display data set (viewsList), the query object (querierConfig), the exception query dictionary (warnConfigDict), the invoker set (callerList), and the child node set (childList).
[0058] The request parameter dictionary is used to store request parameters. The key-value is the key (key) in the node, and the value is the type (type) in the node.
[0059] The display data set is used to store the display data in the link display diagram. Each display data contains two attributes, name and value.
[0060] The attributes included in the query object are the collector name, collector type, request parameters, and return parameters.
[0061] The exception query dictionary is used to store the configurations of exception collectors for the current business node. The key is the name attribute of the collector, and the value is the current exception collector configuration object (warnConfig), which contains the following attributes: name, type, requestDict, and responseDict.
[0062] The invoker set is used to store the right-click functions of the link display diagram. Each invoker in the invoker set contains the following attributes: name, title, url, requestDict, etc.
[0063] The child node set is used to store the child nodes that the current business node depends on. Each child node in the child node set contains the following attributes: name, title, type, and requestDict.
[0064] Step 22: Load the XML link template into the program memory, parse the XML link template to obtain the root node, basic configuration node, link node configuration node, system configuration node, collector configuration node, and each business node; traverse the child nodes of the system configuration node to obtain the node type node, exception level node, and exception priority node.
[0065] Step 23: Loop through the node type nodes, obtain the attributes of the node type nodes and add them to the node type dictionary; loop through the exception level nodes, obtain the attributes of the exception level nodes and add them to the exception level dictionary; loop through the exception priority nodes, obtain the attributes of the exception priority nodes and add them to the exception priority dictionary. Specifically, loop through all the child node lists of the node type nodes, obtain the corresponding node values and node keys of each child node and add them to the node type dictionary; loop through all the child node lists of the exception level nodes, obtain the corresponding exception level values and the text colors of the exception levels and add them to the exception level dictionary; loop through all the child node lists of the exception priority nodes, obtain the corresponding exception priorities and exception priority values and add them to the exception priority dictionary.
[0066] Step 24: Loop through the collector configuration node, obtain three child nodes: the http collector node, the rpc collector node, and the sql collector node, and read the attributes in the three child nodes and add them to the collector dictionary.
[0067] Step 25: Loop through the child nodes of each business node, and declare the business node configuration object defined in Step 21 inside the loop. Assign each attribute in the child node to the corresponding attribute of the business node configuration object, and add the business node configuration object with all attributes assigned to the node configuration dictionary.
[0068] Step 3 of the present invention is to construct a node factory based on the parameters for constructing a service link, generate a node generator for each service node in the service link, and add the node generator to the node generator dictionary of the node factory. Specifically, it includes:
[0069] Step 31: Define a service node object (LinkTrackNode). One service node object corresponds to one service node in the link node configuration node, that is, one service node object is used to assign the relevant information configured in the previous two steps to this object. The attributes included in the service node object are as follows: node ID, node title, node type, node name, display data, exception set, call method set, and sub-node set. The node ID is uniquely generated by a globally unique identifier (GUID) automatically. The node title is the title displayed in the tree structure of the visual link diagram; the exception set includes attributes such as exception code (ErrorCode), exception information (Message), exception level (Level), exception priority (Priority), and text color (Color) of the exception level; the call method set includes attributes such as method name (FuncName), call address (FuncCallUrl), and method parameters (FuncArgs); the sub-node set represents the sub-nodes included under the current node, and the data structure is the same as that of the service node object.
[0070] Step 32: Define a node factory (NodeFactory) and a node generator (NodeCreator) as follows:
[0071] Step 321: The attributes included in the node factory are as follows: node generator dictionary (NodeCreatorDict). The key of the node generator dictionary is the node name, and the value is the node generator corresponding to the current node; the methods included in the node factory are as follows: initialize the node generator using the initialize node creator method (InitNodeCreator), and generate the node data of the service node using the node creation method (CreateNode);
[0072] Step 322: The attributes included in the node generator are as follows: node name, node type, request parameters, display data, service collector, exception collector set, call method set, and sub-element set. The method included in the node generator is: generate the node data of the service node using the node creation method (CreateNode);
[0073] Step 323: Loop to construct a node collector, which further includes:
[0074] Step 3231: Initialize the input parameters of the node creator method with the business node configuration object. Inside the method, loop through the node configuration dictionary, sequentially obtain the business node configuration objects, create a node generator X object in each loop, and assign the node name, node description, and node type inside the business node configuration object respectively; dynamically construct the request parameter dictionary inside the business node configuration object into a request object, where the property name of the request object is the key of the request parameter dictionary and the property type is the value of the request parameter dictionary, assign the request object to the request property of the node generator X object, and assign the display data set inside the business node configuration object to the display data property of the node generator X object;
[0075] Step 3232: Construct the business collector: Obtain the corresponding collector class object in the collector dictionary according to the query type of the query object inside the business node configuration object and denote it as collector A. Assign the request parameters and return parameters of the query object to the corresponding properties of collector A respectively, and assign the initialized collector A to the business collector property of the node generator X object; In particular, different collectors have different internal properties. For the httpCollector, its Request url property needs to be assigned, while for the sqlCollector, the request can be directly assigned without objectification.
[0076] Step 3233: Construct the exception collector: Loop through the exception query configuration objects in the exception query dictionary inside the business node configuration object. Obtain the corresponding collector class object in the collector dictionary according to the exception query type of the exception query configuration object and denote it as collector B. Assign the request parameters and return parameters of the exception query object to the corresponding properties of collector B respectively; add the collector B obtained in each loop to the exception collector set of the node generator X object;
[0077] Step 3234: Construct the call method set: Loop through the callers in the caller set inside the business node configuration object. Construct a call object (func object) in each loop, and assign the properties of the caller to the corresponding properties of the call object; add the call object obtained in each loop to the call method set of the node generator X object;
[0078] Step 3235: Construct the sub-node set: Loop through the sub-nodes in the sub-node set inside the business node configuration object. Construct a sub-node object in each loop, and assign the properties of the sub-node to the corresponding properties of the sub-node object; add the sub-node object obtained in each loop to the sub-node set of the node generator X object;
[0079] Step 3236: Add the node generator X object to the node generator dictionary (NodeFactory.NodeCreatorDict) to complete the construction of the node collector;
[0080] Step 324: Generate a business node object based on the node factory. The input parameters of the node creation method in the node factory are the node name and node parameters, and the output parameter is the business node to be traced. Query the node generator dictionary in the node factory by the node name in the input parameters to check if there is a corresponding business collector for the node name. If it exists, obtain the business collector and denote it as node generator C. Call the node creation method of node generator C to get the business node and denote it as business node object A. Loop through the child nodes in the child node set of the obtained business collector, query the node generator dictionary by the node name of the child node to check if there is a corresponding collector. If it exists, call the node creation method of the obtained collector and pass in the request parameters of the child node to get the business node and denote it as business node object B. Add business node object B to the node set of business node object A.
[0081] Further, in Step 324, calling the node creation method of node generator C is based on the node parameters (nodeArgs) of the input parameters of the node creation method called by node generator C, including: Step 3241: Map and fill the parameter names of the node parameters into the request parameters of node generator C; Step 3242: Create a business logic node, assign the node title and node type of node generator C to the corresponding attributes of the business logic node, and initialize the node id of the business logic node at the same time; Step 3243: Look up the corresponding value in the request parameter dictionary of node generator C by the request parameters of node generator C, replace the request parameters of node generator C with the corresponding value found by looking up the request parameter dictionary, and initialize the request parameters of node generator C; Step 3244: Use reflection technology to construct the request parameter dictionary of node generator C into a request object, use the constructed request object as a parameter to call node generator C, and after getting the result, dynamically generate a data object in a reflection manner with the request parameter dictionary of node generator C; Step 3245: Look up the corresponding attribute value of the data object through the display data of the business logic node and complete the replacement and filling of the dictionary value; Step 3246: Loop through the exception collectors in the exception collector set of node generator C, call the exception collectors to get the exception result set, and find the corresponding text color for the exception level according to the exception level; Step 3247: Loop through the call objects in the method set, assign the node title and url of the call method to the corresponding attributes of the call object, fill the corresponding attribute value of the data object into the request parameter dictionary of the call method and convert it into a Json string to assign to the node parameters of the call object, and return it to the business logic node.
[0082] Step 4 of the present invention is to define the query interface for each service node. Preferably, define the interface name, request parameters, and return parameters of the query interface. The request parameters include the node name of the service node, and the return parameter is the basic response of the service node to be traced. The basic response includes the following attributes: status code, data, and return message. When the status code is 0 (Code = 0), it indicates a successful return, otherwise it indicates an error return. When the return is successful, the data contains the service node object of the service node to be traced. An example of a defined query interface is as follows: Interface name: queryBizNode, type: POST interface; Request parameters: nodeName node name, requestBody object type; Return parameter: BaseResponse <linktracknode>, BaseResponse contains the attributes: Code, Data, and Message.
[0083] Step 5 of the present invention is that the Web front-end calls the query interface of the business node through HTML, CSS, and JavaScript technologies to render and generate a visual link diagram. Specifically, by determining whether the node name of the business node exists in the node generator dictionary, if it exists, the node generator corresponding to the node name is obtained from the node generator dictionary, and the node generator is called to generate the node data of the business node. The Web front-end renders the returned business node object into a visual link diagram in a tree structure.
[0084] When the user enters the business link page, the Web front-end obtains and calls the list interface of the business node. This interface actually returns all the root node information in the node generator dictionary, and the Web front-end renders the returned information onto the drop-down list. At this time, the user selects the corresponding drop-down item, that is, the node name, and clicks the "Query" button to trigger the interface for querying the link information of the current business node.
[0085] The right-click menu of the visual link diagram is used to display the invokers configured in the current business node, and is used for data operations that need to be performed on the current business node in business. When an invoker is configured, the right-click menu will be displayed. When a certain item in the menu is clicked, the call method of the corresponding invoker is triggered. The specific manifestation of the right-click menu is that if data intervention is required for terminating the business, restoring the business, resetting the business, etc., by configuring the invoker to display the right-click menu, it not only shows the link diagram, but also has operability.
[0086] The visual link diagram also contains the exception information of the business node. By configuring exception collectors for each business node, the exception collectors statistically analyze the exception data in real time and finally associate it with the visual link diagram for display. Specifically, each exception collector defines the exception level and exception priority of the current exception information internally.
[0087] Finally, it should be noted that the above embodiments are only preferred embodiments of the present invention to illustrate the technical solutions of the present invention, rather than limiting it, and certainly not limiting the patent scope of the present invention; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention; that is to say, any meaningless changes or polishings made in the main design concept and spirit of the present invention, as long as the technical problems solved are still consistent with the present invention, should be included within the protection scope of the present invention; in addition, directly or indirectly applying the technical solutions of the present invention to other related technical fields shall similarly be included within the patent protection scope of the present invention.< / linktracknode> < / add> < / add> < / add>
Claims
1. An XML-based business link tracing method, characterized in that, It includes the following steps: Step 1, configure an XML link template, where the XML link template includes the system configuration of the business system and the attributes of all business nodes; Step 2, parse the XML link template to generate parameters for building a business link; Step 3, based on the parameters for building a business link, build a node factory and generate node generators for each business node in the business link, and add the node generators to the node generator dictionary of the node factory; Step 4, define the query interface for each business node; Step 5, the Web front end calls the query interface to query whether the node generator of the current business node exists in the node generator dictionary: if it exists, call the corresponding node generator to generate node data and return it to the Web front end, and then render the node data as a visual link diagram; if it does not exist, generate an error message and return it to the Web front end; Step 21, establish a configuration file, where the configuration file is used to store the parameters for building a business link, define configuration object attributes in the configuration file, and the configuration object attributes include basic configuration and a node configuration dictionary; the basic configuration includes a system configuration object and a collector dictionary, and the system configuration object contains a node type dictionary, an exception level dictionary, and an exception priority dictionary; the keys of the node configuration dictionary are the node names of the business nodes, and the values are business node configuration objects; the attributes included in the business node configuration object are as follows: the node name of the business node, node description, node type, request parameter dictionary, display data set, query object, exception query dictionary, invoker set, and child node set; Step 22, parse the XML link template to obtain the root node, basic configuration node, link node configuration node, system configuration node, collector configuration node, and each business node; traverse the child nodes of the system configuration node to obtain the node type node, exception level node, and exception priority node; Step 23, loop through the node type nodes, obtain the attributes of the node type nodes and add them to the node type dictionary; loop through the exception level nodes, obtain the attributes of the exception level nodes and add them to the exception level dictionary; loop through the exception priority nodes, obtain the attributes of the exception priority nodes and add them to the exception priority dictionary; Step 24, loop through the collector configuration nodes, obtain three child nodes: http collector node, rpc collector node, and sql collector node, read the attributes in the three child nodes and add them to the collector dictionary; Step 25, loop through the child nodes of each business node, and declare the business node configuration object defined in Step 21 inside the loop, assign each attribute in the child node to the corresponding attribute of the business node configuration object, and add the business node configuration object with all attributes assigned to the node configuration dictionary; Step 31, define a business node object, where one business node object corresponds to one business node in the link node configuration node, and the attributes included in the business node object are as follows: node id, node title, node type, node name, display data, exception set, call method set, and child node set, and the node id is automatically generated uniquely by a globally unique identifier; Step 32, define a node factory and a node generator; Step 321: The attributes included in the node factory are as follows: a node generator dictionary, where the keys of the node generator dictionary are node names and the values are the node generators corresponding to the current nodes; the methods included in the node factory are as follows: initialize the node generator using the initialize node creator method, and generate the node data of the business node using the node creation method; Step 322: The attributes included in the node generator are as follows: node name, node type, request parameters, display data, business collector, exception collector set, call method set, sub-element set, and the method included in the node generator is: generate the node data of the business node using the node creation method; Step 323: Loop to construct the node collector; Step 324: Generate a business node object based on the node factory: the input parameters of the node creation method in the node factory are the node name and node parameters, and the output parameter is the business node to be traced; query whether there is a business collector corresponding to the node name in the node generator dictionary of the node factory through the input node name. If it exists, obtain the business collector and record it as node generator C, and call the node creation method of node generator C to obtain the business node and record it as business node object A; loop to obtain the sub-nodes in the sub-node set of the business collector, query whether there is a corresponding collector in the node generator dictionary according to the node name of the sub-node. If it exists, call the node creation method of the obtained collector and pass in the request parameters of the sub-node to obtain the business node and record it as business node object B, and add business node object B to the node set of business node object A.
2. The method for tracing service links based on XML according to claim 1, wherein The XML link template contains a root node, and the root node contains two sub-nodes: a basic configuration node and a link node configuration node; The basic configuration node contains two sub-nodes: a system configuration node and a collector configuration node; the system configuration node contains three sub-nodes: a node type node, an exception level node, and an exception priority node, and the collector configuration node contains three sub-nodes: an http-based collector node, an rpc-based collector node, and an sql-based collector node; The link node configuration node contains multiple sub-nodes, and one sub-node is an actual business node. Each business node contains a request parameter node, a display data node, a query node, a collector node, a caller node, and multiple sub-nodes. Each sub-node also contains multiple sub-nodes, and the sub-nodes of each sub-node have the same composition as the business node.
3. The method for tracing a service link based on XML according to claim 2, wherein The query node contains two sub-nodes: a business query node and an exception query node; the business query node contains a business queryer for querying the data of the business node; the exception query node contains at least one exception queryer for querying the exception data of the business node; the business queryer and the exception queryer are collectors.
4. A method for tracing service links based on XML according to claim 1, characterized in that, Step 4 includes: defining the interface name, request parameters, and return parameters of the query interface. The request parameters include the node name of the service node, and the return parameter is the basic response of the service node to be traced. The basic response includes the following attributes: status code, data, and return message. When the status code is 0, it indicates a successful return; otherwise, it indicates an error return. When the return is successful, the data contains the service node object of the service node to be traced.
5. The method for tracing a service link based on XML according to claim 4, characterized in that, In step 5, it is judged whether the node name of the service node exists in the node generator dictionary. If it exists, the node generator corresponding to the node name is obtained from the node generator dictionary, and the node generator is called to generate the node data of the service node.
6. A method for tracing a service link based on XML according to claim 1, wherein In step 5, through HTML, CSS, and JavaScript technologies, the Web front-end calls the query interface of the service node to obtain the node data of the service node object, and the Web front-end renders the returned service node object into a visual link graph in a tree structure.
Citation Information
Patent Citations
Visual log link tracking method and system based on business level
CN115840687A
Business processing method of flow visualization markup language based on xml (Extensible Markup Language)
CN115935012A