Script file generation method, device and system based on data dictionary
By using a script file generation method based on a data dictionary, the errors caused by manual writing in graph database schema construction are solved, achieving efficient and accurate schema construction and automated updates, thus improving the efficiency and reliability of graph database development.
Patent Information
- Application Number
- CN202410989678.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
AI Technical Summary
In graph database development, existing technologies are prone to errors when manually writing scripts to build schemas, and it is difficult to detect errors in a timely manner, resulting in inefficient and inaccurate schema building processes.
A script file generation method based on a data dictionary is adopted. By responding to the script construction signal, a preset data dictionary is invoked, and anomaly elimination, filtering, and clustering are performed to generate a node and edge script dataset. The dataset is then grouped and sorted according to name information and index number to finally generate the script file.
It improves the efficiency and accuracy of script code detection, reduces construction complexity, decreases the probability of errors, and supports automated updates and detection, thereby improving the efficiency and accuracy of schema construction.
Smart Images

Figure CN118939840A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of research and development management, and in particular to a script file generation method, device and system based on a data dictionary. Background Art
[0002] A graph database is a database system specifically designed to store and query graph-structured data. In a graph database, data is organized in the form of nodes and edges, where nodes represent entities and edges represent relationships between entities. Building a graph database's schema refers to the process of defining node types, edge types, and the properties and relationships between them. The rise of graph databases is mainly to cope with complex relationships and connectivity that traditional relational databases cannot handle well. Although traditional relational databases perform well in processing structured data, they have some limitations when processing many-to-many relationships, complex association relationships, and semi-structured data (such as social networks, knowledge graphs, etc.). The emergence of graph databases fills this gap, making it more efficient and simple to store and query data with complex connectivity.
[0003] In the existing graph database development work, the Schema is basically built by writing scripts, that is, writing the construction statements of each node and each edge one by one according to the Schema syntax rules. However, in actual applications, the number of node types in a Schema is about 200, and the number of edge types is about 400. In the process of writing such a complex Schema, it is very easy to make mistakes and difficult to find errors in time. Generally, the abnormal problems can only be found when the subsequent program runs abnormally and the code is checked. Summary of the invention
[0004] The present invention provides a method, device and system for generating a script file based on a data dictionary, so as to achieve the technical effect of reducing the complexity of script code writing and improving the efficiency and accuracy of detecting script data.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a script file generation method based on a data dictionary, comprising the following steps:
[0006] In response to a script building signal, a preset script data dictionary is retrieved; wherein the script data dictionary includes category information, name information and index number;
[0007] According to the category information, the script data dictionary is subjected to exception elimination, screening extraction and clustering processing, and the corresponding node script data set and edge script data set are outputted; further, according to the name information and the index number, the node script data and the edge script data are respectively grouped, clustered and sorted, and the corresponding groups of node data and groups of edge data are outputted;
[0008] The corresponding node script codes and edge script codes are traversed and generated according to the several groups of node data and the several groups of edge data, and the node script codes and the edge script codes are collected and written into a blank file to generate a script file.
[0009] After responding to a script construction signal, the script file generation method provided by the present invention retrieves the corresponding script data dictionary according to the construction signal, and performs exception elimination, screening, filtering and clustering processing on the data in the dictionary according to the category information of each script data in the data dictionary, and outputs node script data sets and edge script data sets of different categories. Compared with performing anomaly detection on the code after the program is run, the script data is excluded according to the category information, which improves the detection efficiency, detection accuracy and simplicity of abnormal data; and the screening and clustering processing divides the script data into node script data and edge script data according to different categories, providing basic data for the subsequent generation of script code.
[0010] The node script data set and edge script data set obtained after classification are grouped, clustered and sorted according to the name information and index number, which not only facilitates users to perform anomaly detection based on the several groups of node data and edge data obtained after grouping and sorting, and improves the efficiency of anomaly detection of script data, but also provides a more accurate and precise data basis for subsequent systems to build script codes based on node data and edge data. Building script code based on grouped and sorted node data and edge data also reduces the probability of missing node script code or edge script code construction, and also facilitates users to update script data later and thus update script code.
[0011] As a preferred example, performing exception elimination, screening, filtering and clustering processing on the script data dictionary according to the category information and outputting corresponding node script data sets and edge script data sets specifically includes:
[0012] Traversing the category information and the name information in the script data dictionary, and excluding the script data in which the category information or the name information in the data dictionary is missing as abnormal data;
[0013] Screening, extracting and clustering the script data dictionary according to the node class data in the category information, and outputting the corresponding node script data set;
[0014] The script data dictionary is screened, extracted and clustered according to the edge data in the category information, and the corresponding edge script data set is output.
[0015] In order to reduce the complexity of node script code and edge script code construction, the script file generation method provided by the present invention will perform abnormal data exclusion processing on the data dictionary before dividing the script data in the script data dictionary into node script data sets and edge script data sets according to categories, that is, traverse the script data in the script data dictionary, and then perform missing value exclusion processing on the script data according to the category information and name information corresponding to each script data, that is, exclude the script data with missing category information or name information as abnormal data from the script code file construction this time. By excluding abnormal script data, the accuracy and practicality of the two generated data sets are improved, and the probability of problems occurring during the operation of the subsequently generated script code files is reduced.
[0016] As a preferred example, the node script data set and the edge script data set are grouped, clustered and sorted in turn according to the name information and the index number, and the corresponding groups of node data and groups of edge data are output, specifically including:
[0017] Grouping and clustering the node script data set and the edge script data set according to the name information, and outputting several groups of initial node data and several groups of initial edge data;
[0018] Identifying the number of data within the groups of the plurality of groups of initial node data and the plurality of groups of initial edge data, and extracting the group data whose number of data within the groups is greater than one from the plurality of groups of initial node data and the plurality of groups of initial edge data as the group data to be sorted;
[0019] The data in the group of data to be sorted are sorted in ascending order according to the index numbers, and the sorted group data and the group data whose number of the data in the group is identified as one are determined as the plurality of groups of node data and the plurality of groups of edge data.
[0020] In order to further reduce the complexity of constructing script code, after the system divides the script data dictionary according to the category information of each script data and obtains two data sets, it will also group and cluster the data in the two data sets according to the name information, initially forming several groups of initial node data and several groups of initial edge data, so that the name information of the initial node data and initial edge data in each group is the same.
[0021] After completing the initial grouping, the system will identify the number of data in each group of initial data, and treat the group data with a number greater than one as the group data to be sorted, waiting for the system to sort in ascending order according to the index number, while the group data equal to one does not need to be sorted, and can be directly output as the corresponding node data and edge data together with the data to be sorted. Sorting the group data to be sorted in ascending order according to the index number of each data improves the regularity and regularity of the generated groups of node data and edge data, and improves the efficiency of script code construction.
[0022] As a preferred example, after the script file is generated by writing the node script code and the edge script code into a blank file, the method further includes:
[0023] In response to a script update signal, receiving script update information input by a user, and dividing the script update information into node update information and edge update information according to the category information in the script update information;
[0024] The node update information and the edge update information are inserted into the script data dictionary according to the name information, and the inserted node update information and the edge update information are sorted according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated script data dictionary.
[0025] If the user triggers a script update signal, the system can update the script data dictionary according to the script update information input by the user, thereby updating the script code file. First, the script update information is divided into node update information and edge update information according to the category information in the script update information, and then the node update information and edge update information are inserted into the corresponding positions of the script data dictionary according to the name information. Then, the inserted update information is sorted in ascending order according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated data dictionary, realizing the automatic update of the script file.
[0026] As a preferred example, in addition to calling a preset script data dictionary in response to the script building signal, the method further includes:
[0027] In response to a script detection signal, calling and performing an initial detection on the script data dictionary according to the category information and the name information, and outputting an initial detection result;
[0028] If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database;
[0029] If the initial detection result shows that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and a matching degree detection is performed on the category information, the name information and the attribute information of the script data that has passed the initial detection, and a matching detection result is output;
[0030] The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
[0031] If the script detection signal is triggered by the user or according to the preset detection cycle, the system will perform abnormal data detection on the script data in the script data dictionary. When performing abnormal data detection, the system will first perform a preliminary detection on each script data based on whether the category information and name information of each script data are missing. If there is a missing, the preliminary detection fails, and the corresponding script data that fails the detection is stored as abnormal data in the abnormal database for user review.
[0032] The script data that has passed the preliminary test will be subjected to a matching test, that is, to determine whether its category information, name information and attribute information match, that is, whether there is a script data confusion problem, that is, the attribute information or name information of a node data is mixed with the attribute information or name information of a certain edge data. According to the matching test results, the script data is divided into matching normal data and matching abnormal data, and the matching normal data can be stored in the data dictionary as the script data that has passed the abnormal detection for subsequent system calls, while the matching abnormal script data needs to be stored in the abnormal database for user review.
[0033] Correspondingly, an embodiment of the present invention further provides a script file generation device based on a data dictionary, the script file generation device comprising a script signal response module, a script data processing module and a code file generation module;
[0034] The script signal response module is used to call a preset script data dictionary in response to a script construction signal; wherein the script data dictionary includes category information, name information and index number;
[0035] The script data processing module is used to perform exception elimination, screening extraction and clustering processing on the script data dictionary according to the category information, output the corresponding node script data set and edge script data set, and then perform grouping, clustering and sorting processing on the node script data and the edge script data in turn according to the name information and the index number, and output corresponding groups of node data and groups of edge data;
[0036] The code file generation module is used to traverse and generate corresponding node script codes and edge script codes according to the several groups of node data and the several groups of edge data, and to collect and write the node script codes and the edge script codes into a blank file to generate a script file.
[0037] As a preferred example, the script file generating device further includes a script data updating module;
[0038] The script data update module is used to respond to the script update signal, receive the script update information input by the user, and divide the script update information into node update information and edge update information according to the category information in the script update information;
[0039] The node update information and the edge update information are inserted into the script data dictionary according to the name information, and the inserted node update information and the edge update information are sorted according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated script data dictionary.
[0040] As a preferred example, the script file generating device further includes a script data detecting module;
[0041] The script data detection module is used to respond to the script detection signal, retrieve and perform initial detection on the script data dictionary according to the category information and the name information, and output the initial detection result;
[0042] If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database;
[0043] If the initial detection result shows that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and a matching degree detection is performed on the category information, the name information and the attribute information of the script data that has passed the initial detection, and a matching detection result is output;
[0044] The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
[0045] Correspondingly, the present invention also provides a script file generation system based on a data dictionary, the script file generation system comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements any of the above-mentioned script file generation methods based on a data dictionary when processing the computer program.
[0046] Correspondingly, the present invention also provides a storage medium, on which a computer program is stored. The computer program is called and executed by a processor to implement any of the above-mentioned script file generation methods based on a data dictionary. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 : A flow chart of an embodiment of a script file generation method based on a data dictionary provided by the present invention;
[0048] Figure 2 : A structural diagram of an embodiment of a script file generating device based on a data dictionary provided by the present invention;
[0049] Figure 3 : A data example diagram of an embodiment of the data dictionary provided by the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Embodiment 1
[0052] Please refer to Figure 1 , is a flow chart of an embodiment of a script file generation method based on a data dictionary provided by the present invention, including steps 101 to 103, each step is specifically as follows:
[0053] Step 101: In response to a script building signal, a preset script data dictionary is retrieved.
[0054] In this embodiment, the system will respond to the triggered script construction signal and call the corresponding preset script data dictionary to provide data support for subsequent script construction. The script data dictionary in this embodiment includes the node information and edge information of the script, and the corresponding main data contained in each node or each edge is as follows: Figure 3 As shown, Figure 3 A data example diagram of an embodiment of the data dictionary provided by the present invention, Figure 3 Only the main data columns of script nodes and script edges are listed, and the attribute information in the middle is omitted.
[0055] like Figure 3 As shown, the main data columns in the node information and edge information specifically include: category, i.e., the category information described in this embodiment, name, i.e., the name information described in this embodiment, index, i.e., the index number described in this embodiment, field and edge data types, or understood as node names.
[0056] Among them, the script data can be divided into three categories according to the category information, namely node data (vertex), directed edge data (d_e), and undirected edge data (ud_e); and the name information means the node name or edge name, for example: two_port_transformer, ac li nedot_ac li nedot, etc.; the index number means the attribute number of the node or edge, which is numbered sequentially starting from 1; the field means the attribute name of the node or edge, for example: id, name, FROM, TO, etc.; and the data type or the node name, that is, for the node, this column is the data type of the node attribute, and for the edge, the attributes FROM and TO are the names of the two end nodes of the edge, and the other attributes are data types, such as: the attribute FROM of the connected_Load_Sub edge corresponds to the l_oad node, and the attribute TO corresponds to the Substat i on node, and specific examples of data types are: STRING, I NT, LIST 、L I ST <double>wait.
[0057] Step 102: Perform exception elimination, screening, filtering and clustering processing on the script data dictionary according to the category information, output corresponding node script data sets and edge script data sets, and then group, cluster and sort the node script data and the edge script data in turn according to the name information and the index number, and output corresponding groups of node data and groups of edge data.
[0058] After responding to a script construction signal, the script file generation method provided by the embodiment of the present invention retrieves the corresponding script data dictionary according to the construction signal, and performs exception elimination, screening, filtering and clustering processing on the data in the dictionary according to the category information of each script data in the data dictionary, and outputs node script data sets and edge script data sets of different categories. Compared with performing anomaly detection on the code after the program is run, the script data is excluded according to the category information, which improves the detection efficiency, detection accuracy and simplicity of abnormal data; and the screening and clustering processing divides the script data into node script data and edge script data according to different categories, providing basic data for the subsequent generation of script code.
[0059] Specifically, the present embodiment performs exception elimination, screening extraction and clustering processing on the script data dictionary according to the category information, and outputs the corresponding node script data set and edge script data set, specifically including:
[0060] Traversing the category information and the name information in the script data dictionary, and excluding the script data in which the category information or the name information in the data dictionary is missing as abnormal data;
[0061] Screening, extracting and clustering the script data dictionary according to the node class data in the category information, and outputting the corresponding node script data set;
[0062] The script data dictionary is screened, extracted and clustered according to the edge data in the category information, and the corresponding edge script data set is output.
[0063] In order to reduce the complexity of node script code and edge script code construction, the script file generation method provided by the present invention will perform abnormal data exclusion processing on the data dictionary before dividing the script data in the script data dictionary into node script data sets and edge script data sets according to categories, that is, traverse the script data in the script data dictionary, and then perform missing value exclusion processing on the script data according to the category information and name information corresponding to each script data, that is, exclude the script data with missing category information or name information as abnormal data from the script code file construction this time. By excluding abnormal script data, the accuracy and practicality of the two generated data sets are improved, and the probability of problems occurring during the operation of the subsequently generated script code files is reduced.
[0064] In this embodiment, the system first excludes outliers from the script data in the data dictionary according to the category information and name information, and excludes the script data that lacks necessary information data as outliers. After the outliers are excluded, the system filters the script data according to the category information to obtain a node script data set and an edge script data set, wherein the edge script data set also includes a directed edge script data set and an undirected edge script data set.
[0065] Further, in this embodiment, the node script data set and the edge script data set are grouped, clustered and sorted in turn according to the name information and the index number, and corresponding groups of node data and groups of edge data are output, specifically including:
[0066] Grouping and clustering the node script data set and the edge script data set according to the name information, and outputting several groups of initial node data and several groups of initial edge data;
[0067] Identifying the number of data within the groups of the plurality of groups of initial node data and the plurality of groups of initial edge data, and extracting the group data whose number of data within the groups is greater than one from the plurality of groups of initial node data and the plurality of groups of initial edge data as the group data to be sorted;
[0068] The data in the group of data to be sorted are sorted in ascending order according to the index numbers, and the sorted group data and the group data whose number of the data in the group is identified as one are determined as the plurality of groups of node data and the plurality of groups of edge data.
[0069] The node script data set and edge script data set obtained after classification are grouped, clustered and sorted according to the name information and index number, which not only facilitates users to perform anomaly detection based on the several groups of node data and edge data obtained after grouping and sorting, and improves the efficiency of anomaly detection of script data, but also provides a more accurate and precise data basis for subsequent systems to build script codes based on node data and edge data. Building script code based on grouped and sorted node data and edge data also reduces the probability of missing node script code or edge script code construction, and also facilitates users to update script data later and thus update script code.
[0070] In this embodiment, in order to further reduce the complexity of constructing the script code, after the system divides the script data dictionary according to the category information of each script data and obtains two data sets, it will also group and cluster the data in the two data sets according to the name information, initially forming several groups of initial node data and several groups of initial edge data, so that the name information of the initial node data and initial edge data in each group is the same.
[0071] After completing the initial grouping, the system will identify the number of data in each group of initial data, and treat the group data with a number greater than one as the group data to be sorted, waiting for the system to sort in ascending order according to the index number, while the group data equal to one does not need to be sorted, and can be directly output as the corresponding node data and edge data together with the data to be sorted. Sorting the group data to be sorted in ascending order according to the index number of each data improves the regularity and regularity of the generated groups of node data and edge data, and improves the efficiency and accuracy of script code construction.
[0072] Step 103: traverse and generate corresponding node script codes and edge script codes according to the several groups of node data and the several groups of edge data, collect and write the node script codes and the edge script codes into a blank file to generate a script file.
[0073] In this embodiment, when the system generates corresponding node script codes and edge script codes based on several groups of node data and several groups of edge data, the node script code is generated first, and before generating the script code, the system will also generate the Schema script beginning code.
[0074] After completing the construction of the script beginning code, the system traverses several groups of node data and builds the corresponding node script code one by one. Specifically, it first builds the node statement beginning information, including the node name and fixed syntax, and then traverses the node data of the node including category information, name information and other attribute information, that is, it traverses each splicing field and Figure 3 The data type information is shown and commas are added. At the same time, the extra commas after the last attribute information are deleted. The ending code is constructed and added to a single node. After traversing all group node data, the constructed node code is spliced into the node script code through spaces.
[0075] Similar to the construction process of the node script code, the system divides several groups of edge data into several groups of directed edge data and several groups of undirected edge data according to category information, and constructs script codes for them respectively.
[0076] The specific process of constructing the script code for several groups of directed edge data is as follows: construct edge generation statement information, including edge name and fixed syntax; and traverse the edge data of the directed edge, that is, traverse each splicing field and Figure 3 The data type information is shown and a comma is added. After that, the steps are the same as those for constructing the node script code, that is, the extra comma after the last attribute information is deleted, the ending code for a single directed edge is constructed and added, and after traversing all groups of directed edge data, the constructed directed edge code is spliced into the directed edge script code through spaces.
[0077] The specific process of constructing the script code for several groups of undirected edge data is as follows: construct the beginning information of the edge generation statement, including the edge name and fixed syntax; traverse the edge data of the undirected edge, that is, traverse each splicing field and Figure 3 The data type information is shown and a comma is added. After that, the steps are the same as those for constructing the directed edge script code, that is, the extra comma after the last attribute information is deleted, and the ending code for a single undirected edge is constructed and added. After traversing all groups of undirected edge data, the constructed undirected edge code is concatenated into the undirected edge script code through spaces, and the schema construction script ending braces are added at the end of the code.
[0078] The above construction process can realize the writing of automated schema construction script code, which greatly reduces the error rate of manually writing schema construction scripts. It is easier to quickly find problems during troubleshooting and improves the efficiency of schema construction.
[0079] In addition, after the script file is generated by writing the node script code and the edge script code into a blank file, this embodiment further includes:
[0080] In response to a script update signal, receiving script update information input by a user, and dividing the script update information into node update information and edge update information according to the category information in the script update information;
[0081] The node update information and the edge update information are inserted into the script data dictionary according to the name information, and the inserted node update information and the edge update information are sorted according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated script data dictionary.
[0082] If the user triggers a script update signal, the system can update the script data dictionary according to the script update information input by the user, thereby updating the script code file. First, the script update information is divided into node update information and edge update information according to the category information in the script update information, and then the node update information and edge update information are inserted into the corresponding positions of the script data dictionary according to the name information. Then, the inserted update information is sorted in ascending order according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated data dictionary, realizing the automatic update of the script file.
[0083] Furthermore, in addition to calling a preset script data dictionary in response to the script building signal, this embodiment further includes:
[0084] In response to a script detection signal, calling and performing an initial detection on the script data dictionary according to the category information and the name information, and outputting an initial detection result;
[0085] If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database;
[0086] If the initial detection result shows that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and a matching degree detection is performed on the category information, the name information and the attribute information of the script data that has passed the initial detection, and a matching detection result is output;
[0087] The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
[0088] If the script detection signal is triggered by the user or according to the preset detection cycle, the system will perform abnormal data detection on the script data in the script data dictionary. When performing abnormal data detection, the system will first perform a preliminary detection on each script data based on whether the category information and name information of each script data are missing. If there is a missing, the preliminary detection fails, and the corresponding script data that fails the detection is stored as abnormal data in the abnormal database for user review.
[0089] The script data that has passed the preliminary test will be subjected to a matching test, that is, to determine whether its category information, name information and attribute information match, that is, whether there is a script data confusion problem, that is, the attribute information or name information of a node data is mixed with the attribute information or name information of a certain edge data. According to the matching test results, the script data is divided into matching normal data and matching abnormal data, and the matching normal data can be stored in the data dictionary as the script data that has passed the abnormal detection for subsequent system calls, while the matching abnormal script data needs to be stored in the abnormal database for user review.
[0090] In order to better illustrate the working principle and step flow of the script file generation method, device and system based on data dictionary of the present invention, it is possible but not limited to refer to the relevant records above.
[0091] Accordingly, see Figure 2 , Figure 2 The structure diagram of an embodiment of the script file generation device based on the data dictionary provided by the present invention is as follows. Figure 2 As shown, the script file generating device includes a script signal response module 201 , a script data processing module 202 , a code file generating module 203 , a script data updating module 204 and a script data detecting module 205 .
[0092] The script signal response module 201 is used to respond to the script construction signal and retrieve a preset script data dictionary; wherein the script data dictionary includes category information, name information and index number.
[0093] The script data processing module 202 is used to perform exception elimination, screening, filtering and clustering processing on the script data dictionary according to the category information, output corresponding node script data sets and edge script data sets, and then group, cluster and sort the node script data and the edge script data in turn according to the name information and the index number, and output corresponding groups of node data and groups of edge data.
[0094] Furthermore, the script data processing module 202 performs exception elimination, screening, filtering and clustering processing on the script data dictionary according to the category information, and outputs corresponding node script data sets and edge script data sets, specifically including:
[0095] Traversing the category information and the name information in the script data dictionary, and excluding the script data in which the category information or the name information in the data dictionary is missing as abnormal data;
[0096] The script data dictionary is screened, extracted and clustered according to the node class data in the category information, and the corresponding node script data set is output; the script data dictionary is screened, extracted and clustered according to the edge class data in the category information, and the corresponding edge script data set is output.
[0097] Furthermore, the script data processing module 202 performs grouping, clustering and sorting processing on the node script data set and the edge script data set in turn according to the name information and the index number, and outputs corresponding groups of node data and groups of edge data, specifically including:
[0098] Grouping and clustering the node script data set and the edge script data set according to the name information, and outputting several groups of initial node data and several groups of initial edge data;
[0099] The number of data within the groups of the several groups of initial node data and the several groups of initial edge data is identified, and the group data whose number of data within the groups is identified to be greater than one among the several groups of initial node data and the several groups of initial edge data are extracted as the group data to be sorted; the group data within the group data to be sorted are sorted in ascending order according to the index numbers, and the sorted group data and the group data whose number of data within the groups is identified to be one are determined as the several groups of node data and the several groups of edge data.
[0100] The code file generation module 203 is used to traverse and generate corresponding node script codes and edge script codes according to the several groups of node data and the several groups of edge data, and to collect and write the node script codes and the edge script codes into a blank file to generate a script file.
[0101] The script data update module 204 is used to respond to a script update signal, receive script update information input by a user, divide the script update information into node update information and edge update information according to the category information in the script update information, insert the node update information and the edge update information into the script data dictionary according to the name information, sort the inserted node update information and the edge update information according to the index number, and output a corresponding updated script data dictionary so that the script file is updated according to the updated script data dictionary.
[0102] The script data detection module 205 is used to respond to the script detection signal, retrieve and perform initial detection on the script data dictionary according to the category information and the name information, and output the initial detection result;
[0103] If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database; if the initial detection result is that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and the category information, the name information and the attribute information of the script data that have passed the initial detection are tested for matching, and the matching detection result is output;
[0104] The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
[0105] Correspondingly, an embodiment of the present invention also provides a script file generation system based on a data dictionary, the script file generation system comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements any of the above-mentioned script file generation methods based on a data dictionary when processing the computer program.
[0106] Correspondingly, an embodiment of the present invention further provides a storage medium, on which a computer program is stored. The computer program is called and executed by a processor to implement any of the above-mentioned script file generation methods based on a data dictionary.
[0107] In summary, the embodiments of the present invention provide a method, device and system for generating a script file based on a data dictionary, which calls a corresponding script data dictionary according to a corresponding script construction signal, performs exception elimination, screening clustering, grouping clustering and sorting processing on the script data in the script data dictionary according to the category information, name information and index number in the data dictionary, outputs several groups of node data and several groups of edge data, and constructs corresponding node script codes and edge script codes according to the generated several groups of data, and then inputs the constructed code into a blank file to generate the required script file. When the script data is excluded from exceptions in the data dictionary, the efficiency, accuracy and simplicity of detecting abnormal data are improved; screening, grouping and sorting the script data improves the regularity of the output data, and the code construction based on the output data reduces the probability of script code construction omissions, which is convenient for users to update the script data later.
[0108] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.< / double>
Claims
1. A script file generation method based on a data dictionary, characterized in that: The following steps are involved: In response to a script building signal, a preset script data dictionary is retrieved; wherein the script data dictionary includes category information, name information and index number; According to the category information, the script data dictionary is subjected to exception elimination, screening extraction and clustering processing, and the corresponding node script data set and edge script data set are outputted; further, according to the name information and the index number, the node script data and the edge script data are respectively grouped, clustered and sorted, and the corresponding groups of node data and groups of edge data are outputted; The corresponding node script codes and edge script codes are traversed and generated according to the several groups of node data and the several groups of edge data, and the node script codes and the edge script codes are collected and written into a blank file to generate a script file.
2. A script file generation method based on a data dictionary as claimed in claim 1, characterized in that: The step of performing abnormal exclusion, screening extraction and clustering processing on the script data dictionary according to the category information and outputting corresponding node script data sets and edge script data sets specifically includes: Traversing the category information and the name information in the script data dictionary, and excluding the script data in which the category information or the name information in the data dictionary is missing as abnormal data; Screening, extracting and clustering the script data dictionary according to the node class data in the category information, and outputting the corresponding node script data set; The script data dictionary is screened, extracted and clustered according to the edge data in the category information, and the corresponding edge script data set is output.
3. A script file generation method based on a data dictionary as claimed in claim 1, characterized in that: The node script data set and the edge script data set are grouped, clustered and sorted according to the name information and the index number, and a corresponding plurality of groups of node data and a plurality of groups of edge data are output, specifically including: Grouping and clustering the node script data set and the edge script data set according to the name information, and outputting several groups of initial node data and several groups of initial edge data; Identifying the number of data within the groups of the plurality of groups of initial node data and the plurality of groups of initial edge data, and extracting the group data whose number of data within the groups is greater than one from the plurality of groups of initial node data and the plurality of groups of initial edge data as the group data to be sorted; The data in the group of data to be sorted are sorted in ascending order according to the index numbers, and the sorted group data and the group data whose number of the data in the group is identified as one are determined as the plurality of groups of node data and the plurality of groups of edge data.
4. A script file generation method based on a data dictionary as claimed in claim 1, characterized in that: After the script file is generated by writing the node script code and the edge script code into a blank file, the following steps are further included: In response to a script update signal, receiving script update information input by a user, and dividing the script update information into node update information and edge update information according to the category information in the script update information; The node update information and the edge update information are inserted into the script data dictionary according to the name information, and the inserted node update information and the edge update information are sorted according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated script data dictionary.
5. The method for generating a script file based on a data dictionary as claimed in claim 1, characterized in that: In addition to calling a preset script data dictionary in response to the script building signal, the method also includes: In response to a script detection signal, calling and performing an initial detection on the script data dictionary according to the category information and the name information, and outputting an initial detection result; If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database; If the initial detection result shows that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and a matching degree detection is performed on the category information, the name information and the attribute information of the script data that has passed the initial detection, and a matching detection result is output; The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
6. A script file generation device based on a data dictionary, characterized in that: The script file generating device comprises a script signal response module, a script data processing module and a code file generating module; The script signal response module is used to call a preset script data dictionary in response to a script construction signal; wherein the script data dictionary includes category information, name information and index number; The script data processing module is used to perform exception elimination, screening extraction and clustering processing on the script data dictionary according to the category information, output the corresponding node script data set and edge script data set, and then perform grouping, clustering and sorting processing on the node script data and the edge script data in turn according to the name information and the index number, and output corresponding groups of node data and groups of edge data; The code file generation module is used to traverse and generate corresponding node script codes and edge script codes according to the several groups of node data and the several groups of edge data, and to collect and write the node script codes and the edge script codes into a blank file to generate a script file.
7. The script file generating device based on data dictionary as claimed in claim 6, characterized in that: The script file generating device also includes a script data updating module; The script data update module is used to respond to the script update signal, receive the script update information input by the user, and divide the script update information into node update information and edge update information according to the category information in the script update information; The node update information and the edge update information are inserted into the script data dictionary according to the name information, and the inserted node update information and the edge update information are sorted according to the index number, and the corresponding updated script data dictionary is output, so that the script file is updated according to the updated script data dictionary.
8. The script file generating device based on data dictionary as claimed in claim 6, characterized in that: The script file generating device also includes a script data detection module; The script data detection module is used to respond to the script detection signal, retrieve and perform initial detection on the script data dictionary according to the category information and the name information, and output the initial detection result; If the initial detection result is that the category information of the script data exists or the name information is missing, it is determined that the corresponding script data has not passed the initial detection, and the corresponding script data is extracted as abnormal data and stored in the abnormal script database; If the initial detection result shows that the category information and the name information of the script data are complete, it is determined that the corresponding script data has passed the initial detection, and a matching degree detection is performed on the category information, the name information and the attribute information of the script data that has passed the initial detection, and a matching detection result is output; The detected script data is divided into matching normal data and matching abnormal data according to the matching detection result, the matching normal data is stored in the script data dictionary as normal script data, and the matching abnormal data is stored in the abnormal script database.
9. A script file generation system based on a data dictionary, characterized in that: The script file generation system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor processes the computer program, it implements a script file generation method based on a data dictionary as described in any one of claims 1 to 5.
10. A storage medium, characterized in that: The storage medium stores a computer program, which is called and executed by a processor to implement a script file generation method based on a data dictionary as described in any one of claims 1 to 5.
Citation Information
Patent Citations
File generation method, device and equipment and computer readable storage medium
CN110287193A
Graph database knowledge system construction method and device and electronic equipment
CN115858494A
Data processing method and device based on KETTLE script generation tool and medium
CN117193730A
Enterprise management software development method, system and equipment and storage medium
CN117234466A
Script generator for automating system administration operations
US20040254914A1
