Graphical representation method of JSON data ETL process and terminal
Patent Information
- Application Number
- CN202211454696.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-11-21
AI Technical Summary
[0004]针对于上述现有技术的不足,本发明的目的在于提供一种JSON数据ETL过程图形化表示方法及终端,以解决现有技术中系统迁移时ETL过程需要重复开发、开发ETL过程成本比较高的问题
[0071]1、本发明中图形化表示的ETL过程更容易理解和传播,增加了信息化系统的可理解性。
Smart Images

Figure CN115906770B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data graphical representation technology, specifically relating to a graphical representation method and terminal for JSON data ETL process. Background Technology
[0002] Currently, the concept of low-code is becoming increasingly familiar and accepted by professionals in the IT field, and low-code platform products are emerging in large numbers. These products, to some extent, meet the needs of non-software engineering professionals for customizing business functions on IT platforms. Meanwhile, big data processing technology is becoming increasingly mature, and big data processing scenarios are becoming more and more common. Even large systems like IT systems, which are heavily focused on business operations, will more or less utilize functions such as statistical analysis, data mining, and prediction. Therefore, many methods and concepts that were previously only applied to big data processing can be transferred to similar scenarios in IT systems to meet user needs.
[0003] Existing ETL processes are primarily implemented through direct coding, requiring software engineering skills, but those working in IT-related business areas generally lack advanced software development capabilities. Current mainstream ETL tools are geared towards big data and used for analyzing structured data; low-code platforms for IT systems lack similar tools for statistical analysis of form data within these systems. Most ETL tools are bundled with platforms, requiring the use of specific platform products to retain the ETL process, which causes significant inconvenience for users. Summary of the Invention
[0004] To address the shortcomings of the existing technologies, the present invention aims to provide a graphical representation method and terminal for the JSON data ETL process, thereby solving the problems of repeated development of the ETL process and high development costs during system migration in the prior art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] The present invention provides a graphical representation method for the JSON data ETL process, comprising the following steps:
[0007] 1) The process of converting XML files to images;
[0008] 11) Read the XML file and draw the primitives;
[0009] 12) Draw connecting lines;
[0010] 2) The process of converting images to XML files;
[0011] 21) Save the drawing area primitives to a primitive object array in an incremental manner;
[0012] 22) Save the connecting lines in the drawing area to an array of connecting line objects;
[0013] 23) Check the rationality of the graphic elements and connecting lines, and save them to an XML file.
[0014] Furthermore, step 11) of reading the XML file and drawing primitives specifically includes:
[0015] 111) Convert the XML file into an object (referring to the data structure in an object-oriented program), called a process file object; traverse the sub-objects in the process property of the process file object, each sub-object representing a primitive, convert the read objects into primitive objects, and store them in the primitive object array according to the original order in the XML file;
[0016] 112) Loading a graphic file saved in PNG format from the local file system into memory is called a graphic resource object. The type attribute of the graphic resource object is the same as the corresponding PNG file name. Different file names correspond to different graphic elements.
[0017] 113) Initialize the interface display area. Select a suitable size portion within the visible area of the interface as the drawing area. The rule for the two-dimensional coordinates of the interface is that the upper left corner of the visible area is the origin of the coordinates, with coordinates (0,0). Assume that the coordinates of the upper left corner of the selected drawing area are (x0,y0), and set this coordinate as the origin of the drawing area. The coordinate axes adopt the interface convention, with the horizontal axis pointing to the right and the vertical axis pointing downwards.
[0018] 114) Traverse the array of primitive objects obtained in step 111), and find the graphic resource object to be drawn from the array of graphic resource objects according to the primitive type attribute of the primitive object; assuming that the next primitive A to be drawn is of type A, traverse the array of graphic resource objects and find the graphic resource object with type value of type A.
[0019] 115) Calculate the actual coordinates of primitive object a. Assuming the coordinate position attribute value of primitive object a is (xa, ya), then its actual coordinates are (xa+x0, ya+y0).
[0020] 116) Based on the actual coordinates (xa+x0, ya+y0) of the primitive object a and the corresponding primitive resource object, draw primitive A in the correct position in the drawing area.
[0021] Furthermore, drawing the connecting lines in step 12) specifically includes:
[0022] 121) Iterate through all objects under the lines property of the process file object in order, with each object representing a line; convert each traversed object into a line object and save it into an array of line objects in the original order;
[0023] 122) Traverse the array of connector objects. If the next connector object to be read is L, first obtain the starting coordinates and radius r of L, and then draw a circle in the drawing area to represent the starting point based on the starting coordinates and radius.
[0024] 123) Draw each path point in the path point properties of the connecting line L one by one, using the radius r for all points, and do not draw the endpoint;
[0025] 124) Connect the starting point and all path points using a straight-line vector diagram, excluding the ending point;
[0026] 125) Use arrow lines in a vector diagram to connect the last point and the endpoint of the path.
[0027] Furthermore, the drawing area refers to a portion of the visible area of the interface designated for drawing primitives and connecting lines; the primitives represent the graphics of a certain processing step in the ETL process; the primitive resources refer to files storing images in PNG format, storing vector graphics data of the primitives; the ETL process file is a local file used to store ETL process graphics configuration data and the ETL process, called the ETL process file, and its file format is XML; the ETL process graphics refer to the graphical representation of the ETL process.
[0028] Furthermore, the process file object refers to the data structure generated by reading the ETL process file, and is stored using the object data structure in object-oriented programming; the node object refers to the value of any attribute of the process file object, that is, the process file object reflects the tree structure of the XML file, and any child object is called a node object; the graphic resource object array refers to storing the loaded graphic resources in the form of an array, and the array element is called a graphic resource object. The graphic resource object has a graphic category attribute type, the value of which is the same as the file name of the PNG file, and is used to uniquely identify a graphic object; the graphic object array is used to store objects representing graphic elements, and each array element is called a graphic object; the connector object array is used to store all connectors representing the drawing area, and the array element is a connector object, with one object representing one connector.
[0029] Furthermore, the primitive object has multiple attributes, which are divided into basic attributes, primitive attributes, and extended attributes;
[0030] Basic attributes include: primitive type (type), unique identifier (ID), successor primitive ID (next), coordinate position (coord), and graphic size (L*H, where L is the length and H is the width, in pixels);
[0031] Primitive attributes: Different primitives represent different processing steps in the ETL process. In addition to different graphics, some attributes are also needed to store the parameters required in the processing steps. For example, the columns attribute can be used to represent an array that stores column names.
[0032] Extended attributes: Attributes used to describe custom parameters, which are defined or added by the developer.
[0033] Furthermore, the connecting lines in the ETL process graph are represented by polylines, and the connecting lines are saved by saving path points. The corresponding connecting line objects have the following attributes:
[0034] Unique Identifier (ID): A unique identifier used to identify an object;
[0035] Start point: The two-dimensional coordinates of the starting point;
[0036] Path point: An array of multiple two-dimensional coordinates arranged in order;
[0037] Stop: The two-dimensional coordinates of the destination;
[0038] Point radius (radius): Used to store the radius of the circle formed by the starting point, path points, and ending point.
[0039] Furthermore, the detailed steps of step 21) incrementally saving the primitives of the drawing area into the primitive object array are as follows;
[0040] 211) After drawing primitives on the interface, generate a new primitive object, write the primitive type to the type property, write the coordinate information to the coord property of the newly generated primitive object, and then place the newly generated primitive object at the end of the primitive object array.
[0041] 212) After deleting a graphic element from the interface, based on the ID of the deleted graphic element (read from the XML file during the drawing stage), traverse the graphic element object array and delete the graphic element with the corresponding ID in the graphic element object array;
[0042] 213) When modifying the attribute of a graphic element, input the graphic element ID and the new graphic element object, traverse the graphic element object array to find the graphic element object corresponding to the graphic element ID in the parameter, and then modify it to the input attribute value.
[0043] Further, step 22) specifically includes:
[0044] 221) Draw the starting point. The input parameters are the starting point element ID, the coordinates of the element, and the orientation of the starting point of the connecting line;
[0045] 222) When adding a path point to a connector, the input parameters are the connector ID generated in step 221) and the coordinates of the new path point; traverse the array of connector objects, find the corresponding connector object according to the connector ID, and add the input path point coordinates to the end of the path point attribute;
[0046] 223) When adding an endpoint, the input parameters are the connector ID generated in step 221), the coordinates of the new path point, the endpoint primitive ID, and the endpoint orientation (the calculation method for endpoint coordinates is similar to that for starting point coordinates); traverse the primitive array, find the corresponding primitive object based on the input primitive ID, and modify the next property of the primitive object to the endpoint primitive ID;
[0047] 224) When deleting a connecting line, the input parameter is the line ID; traverse the array of line objects, find the corresponding line object to delete; delete the drawn start point, path point, end point and connecting line from the interface.
[0048] Further, step 221) is as follows:
[0049] 2211) Based on the input starting point primitive ID, find the corresponding primitive object from the primitive object array; calculate the starting point coordinates based on the primitive coordinates and the starting point orientation. The coordinates of the upper left corner are the primitive coordinates (xa, ya). The primitive is displayed as a square in the drawing area with a side length of L.
[0050] 2212) When calculating the starting point coordinates, the input starting point orientation parameter is the number of the starting point orientation. The starting point orientation parameter represents the four sides of the square, and takes values of 0, 1, 2, and 3 for top, right, bottom, and left respectively. If the orientation parameter is 0, the starting point coordinates are (xa+L / 2, ya); if the orientation parameter is 1, the coordinates are (xa+L, ya+L / 2); if the orientation parameter is 2, the coordinates are (xa+L / 2, ya+L); if the orientation parameter is 3, the coordinates are (xa, ya+L / 2).
[0051] 2213) Draw a solid circle with radius r = L / 20 at the calculated coordinate position as the starting point. If L / 20 < 2, then r is 2.
[0052] 2214) Generate a connector object, set the connector object's unique identifier ID to a random UUID value, set the starting point attribute to the calculated starting point coordinates (xa+L / 2, ya), set the connector object's radius attribute to the radius r, and add the connector object to the end of the connector object array.
[0053] Furthermore, step 23) specifically includes:
[0054] 231) Open an existing or create a new empty ETL process file;
[0055] 232) Objects in the primitive object array have a next property, which takes the value of the successor primitive object. All objects in the primitive object array can form a singly linked list. Traverse the singly linked list and check whether it meets the requirements of the ETL process.
[0056] 233) If the singly linked list of primitive objects meets the requirements, then traverse the primitive object array and convert each object into a node object in the XML file object. The objects in the primitive object array are converted into corresponding XML nodes based on the `type` attribute; for example, if `type = A`, then the converted XML node is... All attributes of the object are converted into attributes of the XML node;
[0057] 234) Write the node object as a child node under the process node object in the process file object. The process node object corresponds to the node in the XML file. <process>< / process> The node, a child object of process, is <process>< / process> child nodes;
[0058] 235) Write all line objects as child nodes under the `lines` node object of the XML file object. The `lines` node object corresponds to the line objects in the XML file. <lines>< / lines> Nodes, child objects of lines are <lines>< / lines> child nodes;
[0059] 236) Write XML object data to an XML file.
[0060] Furthermore, the ETL process check in step 232) specifically includes:
[0061] Before the ETL process file object is saved to the XML file, the validity of the process needs to be strictly checked. Initially, the first element of the primitive object array is used as input, and the entire graphic is recursively traversed. If any unreasonable primitive relationships are found, an exception is thrown. The checking steps are as follows:
[0062] 2321) Input the first element of the primitive object array;
[0063] 2322) Determine whether the input object is an output primitive object in the ETL process; if it is an output primitive object, proceed to step 2323); if it is not an output primitive object, proceed to step 2324.
[0064] 2323) Determine if there is a successor primitive object. If there is a successor, the check fails, exits, and returns an exception; if there is no successor, the check passes.
[0065] 2324) Determine if there is a successor primitive object. If there is no successor, the check fails, exits and returns an exception. If there is a successor (which may be one or more), obtain the next successor as the input for step 2321), execute step 2321), return and continue processing the next successor until all successors have been processed.
[0066] The present invention also provides a display terminal, comprising:
[0067] One or more processors;
[0068] Memory, used to store one or more programs;
[0069] When the one or more programs are executed by the one or more processors, the one or more processors implement the graphical representation method of the JSON data ETL process.
[0070] The beneficial effects of this invention are:
[0071] 1. The graphical representation of the ETL process in this invention is easier to understand and disseminate, increasing the understandability of information systems.
[0072] 2. The ETL process description saved in the XML file in this invention can be shared by various programs, reducing the repetitive work brought about by reconstructing business processes during system migration and reducing system migration costs.
[0073] 3. The method of this invention allows people without software engineering skills to directly participate in the custom development of data processing in information systems, reducing the workload in the software development process. Attached Figure Description
[0074] Figure 1 This is a block diagram illustrating the principle of the method of the present invention.
[0075] Figure 2 This is a schematic diagram of the primitive structure in this invention.
[0076] Figure 3 This is a schematic diagram of the ETL graphic inspection method in this invention. Detailed Implementation
[0077] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to embodiments and accompanying drawings. The content mentioned in the embodiments is not intended to limit the present invention.
[0078] Reference Figure 1As shown, the present invention provides a graphical representation method for the JSON data ETL process, comprising the following steps:
[0079] 1) The process of converting XML files to images;
[0080] 11) Read the XML file and draw the primitives;
[0081] 111) Convert the XML file into an object (referring to the data structure in an object-oriented program), called a process file object; traverse the sub-objects in the process property of the process file object, each sub-object representing a primitive, convert the read objects into primitive objects, and store them in the primitive object array according to the original order in the XML file;
[0082] 112) Loading a graphic file saved in PNG format from the local file system into memory is called a graphic resource object. The type attribute of the graphic resource object is the same as the corresponding PNG file name. Different file names correspond to different graphic elements.
[0083] 113) Initialize the interface display area. Select a suitable size portion within the visible area of the interface as the drawing area. The rule for the two-dimensional coordinates of the interface is that the upper left corner of the visible area is the origin of the coordinates, with coordinates (0,0). Assume that the coordinates of the upper left corner of the selected drawing area are (x0,y0), and set this coordinate as the origin of the drawing area. The coordinate axes adopt the interface convention, with the horizontal axis pointing to the right and the vertical axis pointing downwards.
[0084] 114) Traverse the array of primitive objects obtained in step 111), and find the graphic resource object to be drawn from the array of graphic resource objects according to the primitive type attribute of the primitive object; assuming that the next primitive A to be drawn is of type A, traverse the array of graphic resource objects and find the graphic resource object with type value of type A.
[0085] 115) Calculate the actual coordinates of primitive object a. Assuming the coordinate position attribute value of primitive object a is (xa, ya), then its actual coordinates are (xa+x0, ya+y0).
[0086] 116) Based on the actual coordinates (xa+x0, ya+y0) of the primitive object a and the corresponding primitive resource object, draw primitive A in the correct position in the drawing area.
[0087] 12) Draw connecting lines;
[0088] 121) Iterate through all objects under the lines property of the process file object in order, with each object representing a line; convert each traversed object into a line object and save it into an array of line objects in the original order;
[0089] 122) Traverse the array of connector objects. If the next connector object to be read is L, first obtain the starting coordinates and radius r of L, and then draw a circle in the drawing area to represent the starting point based on the starting coordinates and radius.
[0090] 123) Draw each path point in the path point properties of the connecting line L one by one, using the radius r for all points, and do not draw the endpoint;
[0091] 124) Connect the starting point and all path points using a straight-line vector diagram, excluding the ending point;
[0092] 125) Use arrow lines in a vector diagram to connect the last point and the endpoint of the path.
[0093] The drawing area refers to a portion of the visible area of the interface designated for drawing primitives and connecting lines; the primitives represent the graphics of a certain processing step in the ETL process; the primitive resources refer to files storing images in PNG format, containing vector graphics data of the primitives; the ETL process files are used to store ETL process graphical configuration data and local files of the ETL process, and are in XML format; the ETL process graphics refer to the graphical representation of the ETL process.
[0094] The process file object refers to the data structure generated by reading the ETL process file, and is stored using the object data structure in object-oriented programming; the node object refers to the value of any attribute of the process file object, that is, the process file object reflects the tree structure of the XML file, and any child object is called a node object; the graphic resource object array refers to storing the loaded graphic resources in the form of an array, and the array element is called a graphic resource object. The graphic resource object has a graphic category attribute type, the value of which is the same as the file name of the PNG file, and is used to uniquely identify a graphic object; the graphic object array is used to store objects representing graphic elements, and each array element is called a graphic object; the connector object array is used to store all connectors representing the drawing area, and the array element is a connector object, with one object representing one connector.
[0095] The primitive object has multiple attributes, which are divided into basic attributes, primitive attributes, and extended attributes.
[0096] Basic attributes include: primitive type (type), unique identifier (ID), successor primitive ID (next), coordinate position (coord), and graphic size (L*H, where L is the length and H is the width, in pixels);
[0097] Primitive attributes: Different primitives represent different processing steps in the ETL process. In addition to different graphics, some attributes are also needed to store the parameters required in the processing steps. For example, the column attribute can be used to represent an array that stores column names.
[0098] Extended attributes: Attributes used to describe custom parameters, which are defined or added by the developer.
[0099] Furthermore, the connecting lines in the ETL process graph are represented by polylines, and the connecting lines are saved by saving path points. The corresponding connecting line objects have the following attributes:
[0100] Unique Identifier (ID): A unique identifier used to identify an object;
[0101] Start point: The two-dimensional coordinates of the starting point;
[0102] Path point: An array of multiple two-dimensional coordinates arranged in order;
[0103] Stop: The two-dimensional coordinates of the destination;
[0104] Point radius (radius): Used to store the radius of the circle formed by the starting point, path points, and ending point.
[0105] 2) The process of converting images to XML files;
[0106] 21) Save the drawing area primitives to a primitive object array in an incremental manner;
[0107] 211) After drawing primitives on the interface, generate a new primitive object, write the primitive type to the type property, write the coordinate information to the coord property of the newly generated primitive object, and then place the newly generated primitive object at the end of the primitive object array.
[0108] 212) After deleting a graphic element from the interface, based on the ID of the deleted graphic element (read from the XML file during the drawing stage), traverse the graphic element object array and delete the graphic element with the corresponding ID in the graphic element object array;
[0109] 213) When modifying the attribute of a graphic element, input the graphic element ID and the new graphic element object, traverse the graphic element object array to find the graphic element object corresponding to the graphic element ID in the parameter, and then modify it to the input attribute value.
[0110] 22) Save the connecting lines in the drawing area to an array of connecting line objects;
[0111] 221) Draw the starting point. The input parameters are the starting point element ID, the coordinates of the element, and the orientation of the starting point of the connecting line;
[0112] 222) When adding a path point to a connector, the input parameters are the connector ID generated in step 221) and the coordinates of the new path point; traverse the array of connector objects, find the corresponding connector object according to the connector ID, and add the input path point coordinates to the end of the path point attribute;
[0113] 223) When adding an endpoint, the input parameters are the connector ID generated in step 221), the coordinates of the new path point, the endpoint primitive ID, and the endpoint orientation (the calculation method for endpoint coordinates is similar to that for starting point coordinates); traverse the primitive array, find the corresponding primitive object based on the input primitive ID, and modify the next property of the primitive object to the endpoint primitive ID;
[0114] 224) When deleting a connecting line, the input parameter is the line ID; traverse the array of line objects, find the corresponding line object to delete; delete the drawn start point, path point, end point and connecting line from the interface.
[0115] Further, step 221) is as follows:
[0116] 2211) Based on the input starting point primitive ID, find the corresponding primitive object from the primitive object array; the primitive orientation layout is as follows: Figure 2 As shown, the starting point coordinates are calculated based on the coordinates of the graphic element and the starting point orientation. The coordinates of the upper left corner are the coordinates of the graphic element (xa, ya). The graphic element is displayed as a square in the drawing area with a side length of L.
[0117] 2212) When calculating the starting point coordinates, the input starting point orientation parameter is the number of the starting point orientation. The starting point orientation parameter represents the four sides of the square, and takes values of 0, 1, 2, and 3 for top, right, bottom, and left respectively. If the orientation parameter is 0, the starting point coordinates are (xa+L / 2, ya); if the orientation parameter is 1, the coordinates are (xa+L, ya+L / 2); if the orientation parameter is 2, the coordinates are (xa+L / 2, ya+L); if the orientation parameter is 3, the coordinates are (xa, ya+L / 2).
[0118] 2213) Draw a solid circle with radius r = L / 20 at the calculated coordinate position as the starting point. If L / 20 < 2, then r is 2.
[0119] 2214) Generate a connector object, set the connector object's unique identifier ID to a random UUID value, set the starting point attribute to the calculated starting point coordinates (xa+L / 2, ya), set the connector object's radius attribute to the radius r, and add the connector object to the end of the connector object array.
[0120] 23) Check the rationality of the graphic elements and connecting lines, and save them to an XML file;
[0121] 231) Open an existing or create a new empty ETL process file;
[0122] 232) Objects in the primitive object array have a next property, which takes the value of the successor primitive object. All objects in the primitive object array can form a singly linked list. Traverse the singly linked list and check whether it meets the requirements of the ETL process.
[0123] 233) If the singly linked list of primitive objects meets the requirements, then traverse the primitive object array and convert each object into a node object in the XML file object. The objects in the primitive object array are converted into corresponding XML nodes based on the `type` attribute; for example, if `type = A`, then the converted XML node is... All attributes of the object are converted into attributes of the XML node;
[0124] 234) Write the node object as a child node under the process node object in the process file object. The process node object corresponds to the node in the XML file. <process>< / process> The node, a child object of process, is <process>< / process> child nodes;
[0125] 235) Write all line objects as child nodes under the `lines` node object of the XML file object. The `lines` node object corresponds to the line objects in the XML file. <lines>< / lines> Nodes, child objects of lines are <lines>< / lines> child nodes;
[0126] 236) Write XML object data to an XML file.
[0127] Reference Figure 3 As shown, the ETL process check in step 232) specifically includes:
[0128] Before the ETL process file object is saved to the XML file, the validity of the process needs to be strictly checked. Initially, the first element of the primitive object array is used as input, and the entire graphic is recursively traversed. If any unreasonable primitive relationships are found, an exception is thrown. The checking steps are as follows:
[0129] 2321) Input the first element of the primitive object array;
[0130] 2322) Determine whether the input object is an output primitive object in the ETL process; if it is an output primitive object, proceed to step 2323); if it is not an output primitive object, proceed to step 2324.
[0131] 2323) Determine if there is a successor primitive object. If there is a successor, the check fails, exits, and returns an exception; if there is no successor, the check passes.
[0132] 2324) Determine if there is a successor primitive object. If there is no successor, the check fails, exits and returns an exception. If there is a successor (which may be one or more), obtain the next successor as the input for step 2321), execute step 2321), return and continue processing the next successor until all successors have been processed.
[0133] This invention has many specific applications. The above description is only a preferred embodiment of this invention. It should be noted that for those skilled in the art, several improvements can be made without departing from the principle of this invention, and these improvements should also be considered within the scope of protection of this invention.
Claims
1. A graphical representation method for the JSON data ETL process, characterized in that, The steps are as follows: 1) The process of converting XML files to images; 11) Read the XML file and draw the primitives; 12) Draw connecting lines; 2) The process of converting images to XML files; 21) Save the drawing area primitives to a primitive object array incrementally; 22) Save the connecting lines in the drawing area to an array of connecting line objects; 23) Check the rationality of the graphic elements and connecting lines, and save them to an XML file; Step 11) of reading the XML file and drawing primitives specifically includes: 111) Convert the XML file into an object called a process file object; iterate through the sub-objects in the process property of the process file object, each sub-object representing a primitive, convert the read objects into primitive objects, and store them in the primitive object array in the original order of the XML file; 112) Loading a graphic file saved in PNG format from the local file system into memory is called a graphic resource object. The type attribute of the graphic resource object is the same as the corresponding PNG file name. Different file names correspond to different graphic elements. 113) Initialize the interface display area. Select a portion of the visible area as the drawing area. The rule for the two-dimensional coordinates of the interface is that the upper left corner of the visible area is the origin of the coordinates, with coordinates (0,0). Assume that the coordinates of the upper left corner of the selected drawing area are (x0, y0), and set this coordinate as the origin of the drawing area. The coordinate axes adopt the interface convention, with the horizontal axis to the right and the vertical axis downward. 114) Traverse the array of primitive objects obtained in step 111), and find the graphic resource object to be drawn from the array of graphic resource objects according to the primitive type attribute of the primitive object; assuming that the next primitive A to be drawn is of type A, traverse the array of graphic resource objects and find the graphic resource object with type value of type A. 115) Calculate the actual coordinates of primitive object a. Assuming the coordinate position attribute value of primitive object a is (xa, ya), then its actual coordinates are (xa+x0, ya+y0). 116) Based on the actual coordinates (xa+x0, ya+y0) of the primitive object a and the corresponding primitive resource object, draw primitive A in the correct position in the drawing area; The primitive object has multiple attributes, which are divided into basic attributes, primitive attributes, and extended attributes. Basic attributes include: element type, unique identifier, successor element ID, coordinate position, and graphic size; Primitive attributes: Different primitives represent different processing steps in the ETL process. In addition to the different graphics, some attributes are also needed to store the parameters required in the processing steps. Extended attributes: Attributes used to describe custom parameters, which are defined or added by the developer; Step 22) specifically includes: 221) Draw the starting point. The input parameters are the starting point element ID, the coordinates of the element, and the orientation of the starting point of the connecting line; 222) When adding a path point to a connector, the input parameters are the connector ID generated in step 221) and the coordinates of the new path point; traverse the array of connector objects, find the corresponding connector object according to the connector ID, and add the input path point coordinates to the end of the path point attribute; 223) When adding an endpoint, the input parameters are the connector ID generated in step 221), the coordinates of the new path point, the endpoint primitive ID, and the endpoint orientation; traverse the primitive array, find the corresponding primitive object according to the input primitive ID, and modify the successor primitive ID attribute of the primitive object to the endpoint primitive ID; 224) When deleting a connecting line, the input parameter is the line ID; iterate through the array of line objects, find the corresponding line object to delete; delete the drawn start point, path point, end point and connecting line from the interface; Step 221) is as follows: 2211) Based on the input starting point primitive ID, find the corresponding primitive object from the primitive object array; calculate the starting point coordinates based on the primitive coordinates and the starting point orientation. The coordinates of the upper left corner are the primitive coordinates (xa, ya). The primitive is displayed as a square in the drawing area with a side length of L. 2212) When calculating the starting point coordinates, the input starting point orientation parameter is the number of the starting point orientation. The starting point orientation parameter represents the four sides of the square, and takes values of 0, 1, 2, and 3 for top, right, bottom, and left respectively. If the orientation parameter is 0, the starting point coordinates are (xa+L / 2, ya); if the orientation parameter is 1, the coordinates are (xa+L, ya+L / 2); if the orientation parameter is 2, the coordinates are (xa+L / 2, ya+L); if the orientation parameter is 3, the coordinates are (xa, ya+L / 2). 2213) Draw a solid circle with radius r = L / 20 at the calculated coordinate position as the starting point. If L / 20 < 2, then r is 2. 2214) Generate a connector object, set the connector object's unique identifier ID to a random UUID value, set the starting point attribute to the calculated starting point coordinates (xa + L / 2, ya), set the connector object's radius attribute to the radius r, and add the connector object to the end of the connector object array.
2. The graphical representation method for the JSON data ETL process according to claim 1, characterized in that, Step 12) specifically includes: 121) Iterate through all objects under the lines property of the process file object in order, with each object representing a line; convert each traversed object into a line object and save it into an array of line objects in the original order; 122) Traverse the array of connector objects. If the next connector object to be read is L, first obtain the starting coordinates and radius r of L, and then draw a circle in the drawing area to represent the starting point based on the starting coordinates and radius. 123) Draw each path point in the path point properties of the connecting line L one by one, using the radius r for all points, and do not draw the endpoint; 124) Connect the starting point and all path points using a straight-line vector diagram, excluding the ending point; 125) Use arrow lines in a vector diagram to connect the last point and the endpoint of the path.
3. The graphical representation method for the JSON data ETL process according to claim 1, characterized in that, Step 21) specifically includes: 211) After drawing primitives on the interface, generate a new primitive object, write the primitive type to the type property, write the coordinate information to the coord property of the newly generated primitive object, and then place the newly generated primitive object at the end of the primitive object array. 212) After deleting a graphic element from the interface, based on the ID of the deleted graphic element, traverse the graphic element object array and delete the graphic element with the corresponding ID in the graphic element object array; 213) When modifying the attribute of a graphic element, input the graphic element ID and the new graphic element object, traverse the graphic element object array to find the graphic element object corresponding to the graphic element ID in the parameter, and then modify it to the input attribute value.
4. The graphical representation method for the JSON data ETL process according to claim 1, characterized in that, Step 23) specifically includes: 231) Open an existing or create a new empty ETL process file; 232) Objects in the primitive object array have a successor primitive ID attribute, which takes the value of the successor primitive object. All objects in the primitive object array can form a singly linked list. Traverse the singly linked list and check whether it meets the requirements of the ETL process. 233) If the singly linked list of primitive objects meets the requirements, then traverse the primitive object array and convert each one into a node object in the XML file object. The objects in the primitive object array are converted into corresponding XML nodes according to the type attribute. 234) Write the node object as a child node under the process node object in the process file object. The process node object corresponds to the node in the XML file. <process>< / process> The node, a child object of process, is <process>< / process> child nodes; 235) Write all line objects as child nodes under the `lines` node object of the XML file object. The `lines` node object corresponds to the line objects in the XML file. <lines>< / lines> Nodes, child objects of lines are <lines>< / lines> child nodes; 236) Write XML object data to an XML file.
5. The graphical representation method for the JSON data ETL process according to claim 4, characterized in that, The ETL process check in step 232) specifically includes: Before the ETL process file object is saved to the XML file, the process's validity is checked. Initially, the first element of the primitive object array is used as input, and the entire graph is recursively traversed. If any unreasonable primitive relationships are found, an exception is thrown. The checking steps are as follows: 2321) Input the first element of the array of primitive objects; 2322) Determine if the input object is an output primitive object in the ETL process; if it is an output primitive object, proceed to step 2323); if it is not an output primitive object, proceed to step 2324). 2323) Determine if there is a successor primitive object. If there is a successor, the check fails, the process exits, and an exception is returned. If there are no follow-ups, the check passes. 2324) Determine if there is a successor primitive object. If there is no successor, the check fails, exit and return an exception. If there is a successor, obtain the next successor as the input for step 2321), execute step 2321), return and continue to process the next successor until all successors have been processed.
6. A terminal representation, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Drawing interchange format (DXF) file-based pen type plotter plotting path optimization method
CN102331746A
Three-dimensional reconstruction and visualization method for engineering drawings
CN102855668A
Drawing method for power distribution wiring diagram of energy utilization information collection system
CN107450906A
Method and device for drawing flow chart
CN110363828A
Business process data format conversion method and device
CN113626644A