Service link tracking method based on XML (Extensible Markup Language)
Through the XML-based business link tracing method, XML link templates are configured, parameters for building business links are analyzed, node factories and node generators are built, and query interfaces are defined. This solves the problem that managers find it difficult to fully view the business cycle in complex business systems, and realizes the display and query of visual link maps, which are simple configuration and strong scalability.
Patent Information
- Application Number
- CN202510193897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-02-21
AI Technical Summary
In complex business systems, it is difficult for managers to view the entire business cycle, and abnormal data is difficult to locate, so they need to query between multiple systems and functions.
Using XML-based business link tracing method, by configuring XML link templates, analyzing and generating parameters for building business links, building node factories and node generators, defining query interfaces, and realizing the display and query of visual link diagrams.
It realizes visual display of the system functions of all business nodes during the entire business cycle, simplifies configuration, strong scalability, can add as many business nodes, and provides a link display diagram that is easy to view and interact.
Smart Images

Figure CN119690784A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and in particular to a business link tracking method based on XML. Background Art
[0002] With the development of information technology, business data is increasing in massive amounts. Although the problem of information islands between business systems has been solved through technology, with the increase in the number of management systems, the system functions are becoming more and more complex, and a business is often cross-functional and cross-system. Therefore, a business needs to be viewed and managed in different systems and functions, which requires business managers to operate between various system functions and cannot have a full view of the entire business cycle. At the same time, the business itself may have various abnormal data due to various reasons, including but not limited to: data duplication, data inconsistency, unexpected values within the data time limit, unknown data, etc. Development or operation personnel often need to query different systems, functions, and data tables to locate the problem.
[0003] In order to overcome the above problems, the present invention proposes an XML-based business link tracking method, which is another link tracking mode different from data link tracking based on data embedding, Log, HTTP or RPC request. Summary of the invention
[0004] The purpose of the present invention is to visualize the system functions of all business nodes passed through the entire business cycle from the business start point to the business end point based on the upstream and downstream of business data and XML configuration.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows: A business link tracking method based on XML, comprising the following steps: Step 1: Configure an XML link template, which includes the system configuration of the business system and the attributes of all business nodes; Step 2: Parse the XML link template and generate parameters for building the service link; Step 3: Based on the parameters for building the business link, build a node factory and generate a node generator for each business node in the business link, and add the node generator to the node factory's node generator dictionary; 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, the corresponding node generator is called to generate node data and returned to the Web front end, and then the node data is rendered as a visual link diagram; if it does not exist, an error message is generated and returned to the Web front end.
[0006] Furthermore, the XML link template includes a root node, which includes two child nodes: a basic configuration node and a link node configuration node; The basic configuration node contains two sub-nodes: the system configuration node and the collector configuration node; the system configuration node contains three sub-nodes: the node type node, the exception level node, and the exception priority node; the collector configuration node contains three sub-nodes: the http-based collector node, the rpc-based collector node, and the sql-based collector node; The link node configuration node contains multiple sub-nodes, 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 are composed of the same as the business node.
[0007] Furthermore, the query node includes two sub-nodes, namely a business query node and an exception query node; the business query node includes a business query for querying data of the business node; the exception query node includes at least one exception query for querying abnormal data of the business node; the business query and the exception query are collectors.
[0008] Further, step 2 includes: step 21, establishing a configuration file, the configuration file is used to store parameters for building a business link, and the configuration object attributes are defined in the configuration file, and the configuration object attributes include basic configuration and node configuration dictionaries; the basic configuration includes a system configuration object and a collector dictionary, and the system configuration object includes a node type dictionary, an exception level dictionary, and an exception priority dictionary; the key of the node configuration dictionary is the node name of the business node, and the value is the business node configuration object; the attributes included in the business node configuration object are as follows: the node name of the business node, the node description, the node type, the request parameter dictionary, the display data set, the query object, the exception query dictionary, the caller set, and the child node set; step 22, parsing the XML link template to obtain the root node, the basic configuration node, the link node configuration node, the system configuration node, the collector configuration node, and each business node; traversing the child nodes of the system configuration node Node, get the node type node, exception level node, exception priority node; step 23, loop node type node, get the attributes of node type node and add them to the node type dictionary; loop exception level node, get the attributes of exception level node and add them to the exception level dictionary; loop exception priority node, get the attributes of exception priority node and add them to the exception priority dictionary; step 24, loop collector configuration node, get three child nodes of 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 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 to which all attribute assignments have been completed to the node configuration dictionary.
[0009] Further, step 3 includes: step 31, defining a business node object, a business node object corresponds to a business node in the link node configuration node, and the attributes contained 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, the node id is unique and automatically generated by a globally unique identifier; step 32, defining a node factory and a node generator.
[0010] Further, step 32 includes: step 321, the attributes included in the node factory are as follows: a node generator dictionary, the key of the node generator dictionary is the node name, and the value is the node generator corresponding to the current node; the method included in the node factory is as follows: the node generator is initialized by the initialization node creator method, and the node creation method is used to generate the node data of the business node; 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: the node creation method is used to generate the node data of the business node; step 323, loop construction of the node collector; step 324, generate the business node based on the node factory Object: 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 tracked; the node name is used to query whether there is a business collector with the corresponding node name in the node generator dictionary of the node factory. If it exists, the business collector is obtained and recorded as node generator C, and the node creation method of node generator C is called to obtain the business node and recorded as business node object A; the child nodes of the child node set in the obtained business collector are looped, and the node generator dictionary is queried according to the node name of the child node to see whether there is a corresponding collector. If it exists, the node creation method of the obtained collector is called to pass in the request parameters of the child node to obtain the business node and record it as business node object B, and the business node object B is added to the node set of business node object A.
[0011] Furthermore, 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, the return parameters are the basic response of the business node to be tracked, and 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 includes the business node object of the business node to be tracked.
[0012] Furthermore, in step 5, it is determined whether the node name of the business node is in the node generator dictionary. If so, the node generator corresponding to the node name is obtained from the node generator dictionary, and the node generator is called to generate node data of the business node.
[0013] Furthermore, in step 5, the Web front end calls the query interface of the business node through HTML, CSS and JavaScript technology to obtain the node data of the business node object, and the Web front end renders the returned business node object into a visual link diagram with a tree structure.
[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. The relevant node generator can be dynamically loaded according to the configured XML link template, and finally the node data of the business node can be obtained through the query interface, so as to describe the complex link information through XML, simplify the configuration, and have strong scalability to add any number of business nodes.
[0015] 2. Provide a visual link display diagram to facilitate users to view the overall diagram of the corresponding business link, provide a query interface, and have the ability to access third-party programs. In addition, corresponding business interaction operations can be performed through the link display diagram. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0017] Terminology explanation: 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.
[0018] Web front-end refers to the construction and design of web pages or web applications that users access through browsers.
[0019] URL (Uniform Resource Locator) is a standard address format used to identify and access resources on the Internet.
[0020] HTML (HyperText Markup Language) is a standard markup language for creating web pages and web applications.
[0021] CSS (Cascading Style Sheets) is a markup language used to set the style and layout of web pages.
[0022] JavaScript is an interpreted programming language.
[0023] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are 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 understood as indicating or implying relative importance.
[0024] like Figure 1 As shown, the present invention provides an XML-based service link tracking method, comprising the following steps: Step 1: Configure an XML link template, which includes the system configuration of the business system and the attributes of all business nodes; Step 2: Parse the XML link template and generate parameters for building the service link; Step 3: Based on the parameters for building the business link, build a node factory and generate a node generator for each business node in the business link, and add the node generator to the node factory's node generator dictionary; 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, the corresponding node generator is called to generate node data and returned to the Web front end, and then the node data is rendered as a visual link diagram; if it does not exist, an error message is generated and returned to the Web front end.
[0025] The present invention obtains the parameters of the entire service link based on the configured XML link template, collects and connects each service node in series through a node generator, and finally generates a visual link display diagram. The present invention has simplified configuration and strong scalability, and can add any number of service nodes.
[0026] 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 child nodes: a basic configuration node (basicSettings) and a link node configuration node (linkNodes).
[0027] The basic configuration node defines the basic configuration and includes two sub-nodes: the system configuration node (system) and the collector configuration node (collectors).
[0028] The system configuration node defines the system configuration, including three child nodes: node type node (nodeTypes), exception level node (warnLevels), and exception priority node (warnPrioritys). The node type node defines the type of the node. The node type node contains the following attributes: node type and 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. The exception level node contains the following attributes: exception level, exception level value, and 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. The attributes of the exception priority node are as follows: exception priority and 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; exception information of different exception priorities is sorted in ascending order in the link display diagram. In particular, the sorting rule of exception information in the link display diagram is to sort the exception level nodes in ascending order (i.e., severe, medium, minor, and other), and then sort the exception priority nodes in ascending order (i.e., urgent, medium, normal, and other), with the purpose of sorting severe and urgent exception information first.
[0029] The collector configuration node defines three different collectors and their basic configurations, including three child nodes: http collector node (httpCollector), rpc collector node (rpcCollector), and sql collector node (sqlCollector). The properties of the http collector node are as follows: the value of the http collector is 10, the request method is POST, and the request data type is Json; the properties of the rpc collector node are as follows: the value of the rpc collector is 20, the request method is POST, and the request rpc version is 2.0; the properties of the sql collector node are as follows: the value of the sql collector is 30, the database link, and the database type is MYSQL.
[0030] The link node configuration node defines multiple business nodes (node), which represent actual business nodes. The link node configuration node contains multiple sub-nodes, and each sub-node is an actual business node. The business node contains the following attributes: node name (name), node title (title), which represents the title content displayed by the node, node type (nodeType), which includes data node and logic node. When the node type is a logic node, the value is 10; when the node type is a data node, the value is 20.
[0031] Each business node includes a request parameter node (request), a display data node (view), a querier node (collector), a caller node (callers), and multiple child nodes (childs). Each child node also includes multiple child nodes (node). The child nodes of each child node are composed of the same as the business node, that is, they include a request parameter node (request), a display data node (view), a querier node (queriers), a collector node (collector), a caller node (callers), and multiple child nodes (childs).
[0032] The request parameter node defines the parameters required to access the current business node. Each parameter is represented by <add key="”参数名”" type="”参数类型” / ">Define it.
[0033] The display data node defines the entry content displayed by the current business node on the link display diagram. Each entry content is represented by <add name="”条目名称”" value="”{#条目值}” / ">Define it.
[0034] The query node defines the query set of the current business node, including two child nodes: the business query node (bizQuerier) and the abnormal query node (warnQueriers). The business query node contains a business query, which is used to query the data of the business node, and the abnormal query node contains at least one abnormal query, which is used to query the abnormal data of the business node. Both the business query and the abnormal query are collectors, and both need to be configured with the collector child node (collector).
[0035] The collector node defines the collector collection of the current business node, and contains the following attributes: collector name (name), collector type (type), which correspond to the configuration attributes of the collector configuration node; request parameter (request), which indicates the parameters required for collector execution; return parameter (response), which indicates the content structure returned after the collector is executed. In actual business, if it is cross-platform or does not have access to other platform databases, the http collector is preferred. If the collected platform contains an rpc interface, the rpc collector is used. If it is executed within the system and needs to return complex data that needs to be processed, the sql collector is used.
[0036] The caller node defines the right-click menu displayed in the link display diagram and the method called after each right-click menu is clicked; the caller node contains multiple child nodes, each of which represents a right-click menu. The properties included are as follows: caller name (name), right-click menu name (title), http method called after the right-click menu is clicked (url), request parameters called after the right-click menu is clicked (request), and <add name="”参数名”" value="”{#参数值}”" type="”参数类型” / ">The caller setting depends on whether the current business node needs to display the right-click menu for business processing. If necessary, the caller node needs to be configured in the XML link template. In the link display diagram, after clicking the "query button" to trigger the call query interface, the node data of all business nodes is returned, which contains the node operation information (Funcs). The node operation information is obtained by parsing the caller node. The Web front end loops through the node operation information list and displays the corresponding right-click menu name and the called http method. When the mouse right-clicks on the current business node, the display is triggered, and then by clicking a right-click menu, the http method is called through ajax to complete the triggering.
[0037] The subnode node defines any number of subnodes. Each subnode contains the same attributes as its outer business node. The name attribute of the subnode is consistent with that of the outer business node. The purpose is to find the corresponding outer business node with the same 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 subnode to complete the business link series connection.
[0038] Step 2 of the present invention generates parameters for building a service link by parsing the XML link template, including: Step 21. Create a configuration file. The configuration file is used to store the parameters for building 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 the memory. Specifically, the configuration object attribute (config) is defined in the configuration file to store all element information based on the XML link template. The configuration object attributes include the basic configuration (basicConfig) and the node configuration dictionary (config.nodeConfigDict).
[0039] The basic configuration includes the system configuration object (system) and the collector dictionary (collectorDict). The system configuration object contains the node type dictionary (nodeTypeDict), the exception level dictionary (warnLevelsDict) and the exception priority dictionary (warnPrioritysDict). The key of the collector dictionary is the value of the collector type, and the value is the collector object. The collector class object includes http collector, rpc collector and sql collector. When the collector class object is http collector, the value representing the http collector is 10, when the collector class object is rpc collector, the value representing the rpc collector is 20, and when the collector class object is sql collector, the value representing the sql collector is 30. The attributes of the http collector are as follows: HttpMethod request method, DataType request content format, Request url request address; the attributes of the rpc collector are as follows: HttpMethod request method, JsonRPC protocol version, Request url request address; the attributes of the sql collector are as follows: DBHost database link, DBType database type.
[0040] The node configuration dictionary is used to store the configuration of each node in the business node. The key is the node name of the business node and the value is the business node configuration object (nodeConfig).
[0041] The attributes of the business node configuration object are as follows: the node name (name), node description (title), node type (nodeType), request parameter dictionary (requestDict), display data collection (viewsList), querier object (querierConfig), exception querier dictionary (warnConfigDict), caller collection (callerList) and child node collection (childList).
[0042] The request parameter dictionary is used to store request parameters. The key value is the key in the node, and the value is the type in the node.
[0043] The display data collection is used to store the display data in the link display diagram. Each display data contains two attributes: name and value.
[0044] The properties of the query object are collector name, collector type, request parameters, and return parameters.
[0045] The exception query dictionary is used to store the configuration of the current business node exception collector. 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.
[0046] The caller collection is used to store the right-click function of the link display diagram. Each caller in the caller collection contains attributes such as name, title, url, requestDict, etc.
[0047] The subnode set is used to store the subnodes that the current business node depends on. Each subnode in the subnode set contains the following attributes: name, title, type, and requestDict.
[0048] Step 22: load the XML link template into the program memory, parse the XML link template, 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.
[0049] Step 23, loop node type nodes, obtain the attributes of node type nodes and add them to the node type dictionary; loop exception level nodes, obtain the attributes of exception level nodes and add them to the exception level dictionary; loop exception priority nodes, obtain the attributes of exception priority nodes and add them to the exception priority dictionary. Specifically, loop all child node lists of node type nodes, obtain the node value and node key corresponding to each child node and add them to the node type dictionary; loop all child node lists of exception level nodes, obtain the exception level value and text color of the exception level corresponding to each child node and add them to the exception level dictionary; loop all child node lists of exception priority nodes, obtain the exception priority and exception priority value corresponding to each child node and add them to the exception priority dictionary.
[0050] Step 24: loop through the collector configuration nodes, obtain the three child nodes of the http collector node, the rpc collector node, and the sql collector node, read the attributes in the three child nodes, and add them to the collector dictionary.
[0051] Step 25: loop the child nodes of each business node, and declare the business node configuration object defined in step 21 within 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 attribute assignments completed to the node configuration dictionary.
[0052] Step 3 of the present invention is to build a node factory and generate a node generator for each service node in the service link based on the parameters for building the service link, and add the node generator to the node generator dictionary of the node factory. Specifically, it includes: Step 31. Define the business node object (LinkTrackNode). One business node object corresponds to a business node in the link node configuration node, that is, one business node object is used to assign the relevant information configured in the previous two steps to this object. The business node object contains the following properties: node id, node title, node type, node name, display data, exception collection, call method collection and child node collection. The node id is unique and automatically generated by the global unique identifier (GUID). The node title is the title displayed in the tree structure in the visual link diagram; the exception collection contains the common code (ErrorCode), exception information (Message), exception level (Level), exception priority (Priority), exception level text color (Color) and other properties; the call method collection contains the method name (FuncName), call address (FuncCallUrl), method parameters (FuncArgs) and other properties; the child node collection represents the child nodes contained under the current node, and the data structure is consistent with the business node object.
[0053] Step 32, define the node factory (NodeFactory) and node generator (NodeCreator), as follows: Step 321, the properties of the node factory are as follows: a 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 of the node factory are as follows: using the initialization node creator method (InitNodeCreator) to initialize the node generator, and using the node creation method (CreateNode) to generate the node data of the business node; Step 322, the attributes included in the node generator are as follows: node name, node type, request parameter, display data, business collector, exception collector set, call method set, sub-element set, and the method included in the node generator is: using the node creation method (CreateNode) to generate node data of the business node; Step 323, looping to build a node collector, further includes: Step 3231, the input parameter of the initialization node creator method is the business node configuration object, and the node configuration dictionary is looped inside the method to obtain the business node configuration objects in turn, and a node generator X object is created each time the loop is repeated, and the node name, node description, and node type inside the business node configuration object are assigned respectively; the request parameter dictionary inside the business node configuration object is dynamically constructed into a request object, the attribute name of the request object is the key of the request parameter dictionary, and the attribute type is the value of the request parameter dictionary, the request object is assigned as the request attribute of the node generator X object, and the display data set inside the business node configuration object is assigned as the display data attribute of the node generator X object; Step 3232, constructing a business collector: according to the query type of the query object in the business node configuration object, obtain the corresponding collector class object in the collector dictionary and record it as collector A, assign the request parameters and return parameters of the query object to the corresponding attributes of collector A respectively, and assign the initialized collector A to the business collector attribute of the node generator X object; in particular, different collectors contain different attributes, httpCollector needs to assign its Request url attribute, while sqlCollector collector does not need to objectify the request and can directly assign values.
[0054] Step 3233, construct an exception collector: loop through the exception query configuration object in the exception query dictionary in the service 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 record it as collector B, assign the request parameters and return parameters of the exception query object to the corresponding attributes of collector B respectively; add the collector B obtained in each loop to the exception collector collection of the node generator X object; Step 3234, construct a call method set: loop through the callers in the caller set inside the business node configuration object, construct a call object (func object) each time through the loop, assign the attributes of the caller to the corresponding attributes of the call object; add the call object obtained in each loop to the call method set of the node generator X object; Step 3235, construct a subnode set: loop the subnodes of the subnode set inside the business node configuration object, construct a subnode object each time through the loop, assign the attributes of the subnode to the corresponding attributes of the subnode object; add the subnode object obtained in each loop to the subnode set of the node generator X object; Step 3236, add the node generator X object to the node generator dictionary (NodeFactory.NodeCreatorDict) to complete the construction of 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 tracked; query whether there is a business collector with the corresponding node name in the node generator dictionary of the node factory through the input node name, if so, obtain the business collector and record it as node generator C, 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 child nodes of the child node set in the obtained business collector, query the node generator dictionary according to the node name of the child node to see if there is a corresponding collector, if so, call the node creation method of the obtained collector to pass in the request parameters of the child node, obtain the business node and record it as business node object B, and add the business node object B to the node set of business node object A.
[0055] Further, in step 324, the node creation method of calling node generator C is based on the node parameters (nodeArgs) entered by node generator C when calling the node creation method, including: step 3241, mapping the parameter name of the node parameter and filling it into the request parameter of node generator C; step 3242, creating a business logic node, assigning the node title and node type of node generator C to the corresponding attributes of the business logic node, and initializing the node id of the business logic node; step 3243, searching for the corresponding value in the request parameter dictionary of node generator C by the request parameter of node generator C, replacing the corresponding value found in the request parameter dictionary with the request parameter of node generator C, and initializing the request parameter of node generator C; step 3244, constructing the request parameter dictionary of node generator C through reflection technology A request object, calls node generator C with the constructed request object as a parameter, and after obtaining the result, dynamically generates a data object through reflection using the request parameter dictionary of node generator C; step 3245, searches for the corresponding attribute value of the data object through the display data of the business logic node and completes the dictionary value replacement and filling; step 3246, loops the exception collector of the exception collector set in node generator C, calls the exception collector to obtain the exception result set, and finds the text color corresponding to the exception level according to the exception level; step 3247, loops the calling object of the calling method set, assigns the node title and url of the calling method to the corresponding attribute of the calling object, fills the corresponding attribute value of the data object into the request parameter dictionary of the calling method and converts it into a Json string and assigns it to the node parameter of the calling object, and returns it to the business logic node.
[0056] Step 4 of the present invention is to define the query interface for each business node. Preferably, the interface name, request parameters and return parameters of the query interface are defined. The request parameters include the node name of the business node. The return parameters are the basic response of the business node to be tracked. 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 includes the business node object of the business node to be tracked. An embodiment of the definition of the query interface is as follows: interface name: queryBizNode, type is POST interface; request parameter: nodeName node name, requestBody object type; return parameter: BaseResponse <linktracknode>, BaseResponse contains properties: Code, Data, Message.
[0057] 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 technology to render and generate a visual link diagram. Specifically, it is determined whether the node name of the business node is 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 with a tree structure.
[0058] When the user enters the business link page, the Web front end obtains and calls the list interface of the business node, which actually returns all the root node information in the node generator dictionary. The Web front end renders the returned information to 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 link information interface for querying the current business node.
[0059] The right-click menu of the visual link diagram is used to display the caller configured in the current business node, and is used for data operations that need to be performed on the current business node. When the caller is configured, the right-click menu will be displayed. When you click an item in the menu, the call method of the corresponding caller is triggered. The right-click menu is specifically manifested as: if you need to terminate the business, restore the business, reset the business, etc., data intervention is required. By configuring the caller to display the right-click menu, it is not just a display of the link diagram, but also has operability.
[0060] The visual link diagram also contains the abnormal information of the business nodes. By configuring an abnormal collector on each business node, the abnormal collector counts and analyzes the abnormal data in real time, and finally associates it with the visual link diagram for display. Specifically, each abnormal collector defines the abnormal level and abnormal priority of the current abnormal information.
[0061] 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 them, and certainly not limiting the patent scope of the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention. In other words, any changes or modifications made to the main design concept and spirit of the present invention that have no substantive significance, and the technical problems they solve are still consistent with the present invention, should be included in the protection scope of the present invention. In addition, the direct or indirect application of the technical solutions of the present invention in other related technical fields is also included in the patent protection scope of the present invention.< / linktracknode> < / add> < / add> < / add>
Claims
1. A business link tracking method based on XML, characterized in that: The following steps are involved: Step 1: Configure an XML link template, which includes the system configuration of the business system and the attributes of all business nodes; Step 2: Parse the XML link template and generate parameters for building the service link; Step 3: Based on the parameters for building the business link, build a node factory and generate a node generator for each business node in the business link, and add the node generator to the node factory's node generator dictionary; 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, the corresponding node generator is called to generate node data and returned to the Web front end, and then the node data is rendered as a visual link diagram; if it does not exist, an error message is generated and returned to the Web front end.
2. The XML-based business link tracking method according to claim 1, characterized in that: The XML link template contains a root node, which contains two child nodes: a basic configuration node and a link node configuration node; The basic configuration node contains two sub-nodes: the system configuration node and the collector configuration node; the system configuration node contains three sub-nodes: the node type node, the exception level node, and the exception priority node; the collector configuration node contains three sub-nodes: the http-based collector node, the rpc-based collector node, and the sql-based collector node; The link node configuration node contains multiple sub-nodes, 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 are composed of the same as the business node.
3. The XML-based business link tracking method according to claim 2, characterized in that: The query node includes two sub-nodes: the business query node and the exception query node; the business query node includes a business query for querying the data of the business node; the exception query node includes at least one exception query for querying the abnormal data of the business node; the business query and the exception query are collectors.
4. The XML-based business link tracking method according to claim 3 is characterized in that: Step 2 includes: Step 21, establish a configuration file, the configuration file is used to store parameters for building a business link, define configuration object attributes in the configuration file, the configuration object attributes include basic configuration and node configuration dictionary; basic configuration includes system configuration object and collector dictionary, system configuration object includes node type dictionary, exception level dictionary and exception priority dictionary; the key of the node configuration dictionary is the node name of the business node, and the value is the business node configuration object; the attributes included in the business node configuration object are as follows: node name, node description, node type, request parameter dictionary, display data set, query object, exception query dictionary, caller set and child node set of the business node; 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, Get the node type node, the exception level node, and the exception priority node; step 23, loop the node type node, obtain the attributes of the node type node and add them to the node type dictionary; loop the exception level node, obtain the attributes of the exception level node and add them to the exception level dictionary; loop the exception priority node, obtain the attributes of the exception priority node and add them to the exception priority dictionary; step 24, loop the collector configuration node, obtain the three child nodes of the http collector node, the rpc collector node, and the sql collector node, read the attributes in the three child nodes and add them to the collector dictionary; step 25, loop 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 that has completed all attribute assignments to the node configuration dictionary.
5. The XML-based business link tracking method according to claim 4, characterized in that: Step 3 includes: Step 31, define the business node object, a business node object corresponds to a business node in the link node configuration node, the business node object contains the following attributes: node id, node title, node type, node name, display data, exception set, call method set and child node set, the node id is unique and automatically generated by the global unique identifier; Step 32, define the node factory and node generator.
6. The XML-based business link tracking method according to claim 5, characterized in that: Step 32 includes: Step 321, the attributes included in the node factory are as follows: a node generator dictionary, 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: using the initialization node creator method to initialize the node generator, and using the node creation method to generate the node data of the business node; 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, the method included in the node generator is: using the node creation method to generate the node data of the business node; Step 323, looping to build the node collector; Step 324, generating 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 tracked; the node name is used to query whether there is a business collector with the corresponding node name in the node generator dictionary of the node factory. If it exists, the business collector is obtained and recorded as node generator C, and the node creation method of node generator C is called to obtain the business node and recorded as business node object A; the child nodes of the child node set in the obtained business collector are looped, and the node generator dictionary is queried whether there is a corresponding collector according to the node name of the child node. If it exists, the node creation method of the obtained collector is called to pass in the request parameters of the child node, and the business node is obtained and recorded as business node object B, and the business node object B is added to the node set of business node object A.
7. The XML-based business link tracking method 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 business node. The return parameters are the basic response of the business node to be tracked. 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 tracked.
8. The XML-based service link tracking method according to claim 7, characterized in that: In step 5, it is determined whether the node name of the service node is in the node generator dictionary. If so, 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.
9. The XML-based business link tracking method according to claim 1, characterized in that: In step 5, the Web front end calls the query interface of the business node through HTML, CSS and JavaScript technology to obtain the node data of the business node object, and the Web front end renders the returned business node object into a visual link diagram with 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
Implementation method of dynamic parameter query based on information system
CN117539906A
Log tracking method and device and electronic equipment
CN117573408A
Test item generation device and test item generation method
JP2013161182A