File processing method, device, equipment and storage medium
By reading and analyzing the hierarchical information of the YAML configuration file, generating and executing the target statement, and importing the configuration parameters into the database, the problem of converting YAML configuration files into SQL statements, which is time-consuming, laborious, and prone to errors, is solved, and efficient and accurate database saving is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CCB FINTECH CO LTD
- Filing Date
- 2023-06-27
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, converting YAML configuration files into SQL statements is time-consuming, laborious, and prone to errors, making it difficult to efficiently and accurately save complex YAML configuration information into a relational database.
By reading the hierarchical information of the target configuration file, analyzing the configuration parameters of each level, generating target statements, and importing the configuration parameters into the database, the system recursively processes multi-level personalized configurations, generates record information and association information for each level, and constructs a multi-dimensional three-dimensional diagram.
It improves the efficiency and accuracy of converting YAML configuration files into SQL statements, can efficiently import configuration parameters into the database, and has good versatility and flexibility.
Smart Images

Figure CN116795866B_ABST
Abstract
Description
Document processing methods, apparatus, equipment and storage media Technical Field
[0001] This application relates to the fields of computer technology and financial technology, and in particular to a document processing method, apparatus, device and storage medium. Background Technology
[0002] YAML (YAML Ain't Markup Language) is a data serialization language used to store information in a human-readable format. SQL (Structured Query Language) is a database query and programming language used to access, query, update, and manage relational database systems. Converting YAML configuration files into corresponding SQL statements allows complex YAML configuration information to be tabled and stored in a relational database.
[0003] However, in related technologies, due to the hierarchical depth of YAML configuration files and the complexity of parameter relationships, converting YAML configuration files into corresponding SQL statements is time-consuming, labor-intensive, and prone to conversion errors. Summary of the Invention
[0004] In view of the above problems, this application provides a document processing method, apparatus, device and storage medium.
[0005] One aspect of this application provides a document processing method, comprising:
[0006] Read the target configuration file to obtain the hierarchical information of the target configuration file, wherein the target configuration file includes N levels, where N is an integer greater than or equal to 1;
[0007] Based on the hierarchical information of the target configuration file, the configuration parameters of each level in the target configuration file are analyzed to obtain the result information of the target configuration file. The result information includes the record information and association information of the configuration parameters of each level in the target configuration file.
[0008] Based on the record information and association information of the configuration parameters at each level, a target statement corresponding to the target configuration file is generated, wherein the target statement includes a statement corresponding to each result sub-information.
[0009] By executing the above target statement, the configuration parameters in the above target configuration file are imported into the database. The second table corresponding to each of the above result sub-information is obtained based on executing the statement corresponding to each of the above result sub-information.
[0010] According to an embodiment of this application, the analysis of configuration parameters at each level of the target configuration file based on the hierarchical information of the target configuration file to obtain the result information of the target configuration file includes:
[0011] For the nth level of the target configuration file, based on the information corresponding to the nth level in the above level information, the parameter type of each configuration parameter in the nth level of the target configuration file is obtained, where n is an integer greater than or equal to 1 and less than or equal to N;
[0012] Based on the hierarchical information of the target configuration file, generate at least one result sub-information corresponding to the nth level.
[0013] If any of the configuration parameters at the nth level above are of type object or array, return to the operation of generating result sub-information and increment n;
[0014] When the parameter types of the configuration parameters at the nth level are all quantifiers, the result information of the target configuration file is obtained based on at least one result sub-information of each level in the target configuration file.
[0015] According to an embodiment of this application, generating at least one result sub-information corresponding to the nth level based on the hierarchical information of the target configuration file includes:
[0016] Based on the hierarchical information of the target configuration file, at least one association information between the nth level and the (n-1)th level in the target configuration file is obtained;
[0017] Based on the information corresponding to the nth level in the above hierarchical information, the record information of each configuration parameter in the nth level is obtained;
[0018] Based on the above-mentioned at least one piece of related information and the record information of each configuration parameter in the above-mentioned nth level, generate the above-mentioned at least one piece of result sub-information corresponding to the above-mentioned nth level, wherein the number of the above-mentioned related information and the number of the above-mentioned result sub-information are the same.
[0019] According to embodiments of this application, the above-described document processing method further includes:
[0020] Retrieve the target table from the database described above;
[0021] Based on the target table above, determine the multiple dimensions of information corresponding to the target configuration file above;
[0022] Based on the above information from multiple dimensions, a multi-dimensional 3D diagram corresponding to the target configuration file is constructed.
[0023] According to an embodiment of this application, the generation of at least one result sub-information corresponding to the nth level based on the at least one piece of associated information and the record information of each configuration parameter in the nth level includes:
[0024] For each piece of related information, determine the record information of the configuration parameters corresponding to the aforementioned related information in the nth level; and
[0025] Based on the aforementioned association information and the record information of the configuration parameters corresponding to the aforementioned association information, the aforementioned result sub-information corresponding to the aforementioned nth level is generated.
[0026] According to an embodiment of this application, the target statement includes a first target statement and a second target statement. Generating the target statement corresponding to the target configuration file based on the record information and association information of the configuration parameters at each level includes:
[0027] For each result sub-information, the first target statement corresponding to the result sub-information is generated based on the record information in the result sub-information.
[0028] Based on the record information and associated information in the above result sub-information, the above second target statement corresponding to the above result sub-information is generated.
[0029] According to an embodiment of this application, the recorded information includes the name and value of the configuration parameters, and the process of importing the configuration parameters from the target configuration file into the database by executing the target statement includes:
[0030] For each of the above result sub-information, by executing the first target statement corresponding to the above result sub-information, a first table corresponding to the above result sub-information is generated, wherein the first table includes the name of the configuration parameter in the above result sub-information;
[0031] Based on the first table above, by executing the second target statement corresponding to the result sub-information above, the value corresponding to the name of the configuration parameter in the result sub-information above is inserted into the first table above, and the second table above is generated;
[0032] Import the second table corresponding to each of the above result sub-information into the above database.
[0033] According to an embodiment of this application, the table name of the second table is determined based on the associated information in the result sub-information.
[0034] Another aspect of this application provides a file processing apparatus, comprising: a reading module, an analysis module, a generation module, and an execution module. The reading module reads a target configuration file to obtain its hierarchical information, wherein the target configuration file includes N levels, where N is an integer greater than or equal to 1. The analysis module analyzes the configuration parameters of each level in the target configuration file based on its hierarchical information to obtain result information, which includes record information and association information of the configuration parameters at each level. The generation module generates a target statement corresponding to the target configuration file based on the record information and association information of the configuration parameters at each level. The execution module imports the configuration parameters from the target configuration file into a database by executing the target statement.
[0035] Another aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the file processing method described above.
[0036] Another aspect of this application provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described file processing method.
[0037] According to the file processing method, apparatus, device, and storage medium provided in this application, the hierarchical information of the target configuration file can be obtained by reading the target configuration file. Based on this hierarchical information, the configuration parameters at each level of the target configuration file are analyzed to obtain the result information. This result information may include record information and association information of the configuration parameters at each level of the target configuration file. Based on this record information and association information, a target statement corresponding to the target configuration file can be generated. Finally, by executing the target statement, the configuration parameters in the target configuration file can be imported into a database. By analyzing the configuration parameters at each level of the target configuration file, it is possible to handle complex and personalized configuration methods at multiple levels, exhibiting good versatility and flexibility. This allows for the execution of the target statement generated based on the result information, directly importing the configuration parameters from the target configuration file into the database, thereby improving the efficiency and accuracy of converting the target configuration file into target statements. Attached Figure Description
[0038] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0039] Figure 1 illustrates an application scenario of the file processing method according to an embodiment of this application.
[0040] Figure 2 shows a flowchart of a document processing method according to an embodiment of this application;
[0041] Figure 3 shows a flowchart of obtaining the result information of the target configuration file according to an embodiment of this application;
[0042] Figure 4 shows a flowchart of the execution of the target statement according to an embodiment of this application;
[0043] Figure 5 shows a structural block diagram of a document processing apparatus according to an embodiment of this application; and
[0044] Figure 6 shows a block diagram of an electronic device suitable for implementing a file processing method according to an embodiment of this application. Detailed Implementation
[0045] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0046] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0047] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0048] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0049] In the technical solution of this application, the collection, storage, use, processing, transmission, provision, application and application of data (including but not limited to user personal information) all comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0050] In implementing this application, it was discovered that YAML initially stood for "Yet Another Markup Language," but was later changed to "YAML Ain't Markup Language" to distinguish it from a true markup language. YAML is a very simple text-based, human-readable language used for exchanging data between humans and computers. YAML is primarily used to store configuration information, and it supports data structures (i.e., parameter types) such as objects, arrays, and literals. YAML's syntax is relatively flexible, while SQL statements have a relatively fixed syntax. Typically, YAML is used to store configuration information. If this configuration information is to be saved to a relational database, it requires manual sorting and analysis, analyzing each level of YAML configuration parameters layer by layer, summarizing the logical relationships between them, and manually writing SQL statements. Therefore, in related technologies, due to the hierarchical depth of YAML configuration files and the complexity of parameter relationships, converting YAML configuration files into corresponding SQL statements is time-consuming, labor-intensive, and prone to conversion errors.
[0051] To this end, embodiments of this application provide a file processing method, comprising: reading a target configuration file to obtain hierarchical information of the target configuration file, wherein the target configuration file includes N levels, where N is an integer greater than or equal to 1; analyzing the configuration parameters of each level in the target configuration file according to the hierarchical information of the target configuration file to obtain result information of the target configuration file, wherein the result information includes record information and association information of the configuration parameters of each level in the target configuration file; generating a target statement corresponding to the target configuration file according to the record information and association information of the configuration parameters of each level; and importing the configuration parameters in the target configuration file into a database by executing the target statement.
[0052] Figure 1 illustrates an application scenario of the file processing method according to an embodiment of this application.
[0053] As shown in Figure 1, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0054] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0055] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0056] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0057] For example, the target configuration file can be read through server 105 to obtain the hierarchical information of the target configuration file. Based on the hierarchical information of the target configuration file, the configuration parameters of each level in the target configuration file can be analyzed to obtain the result information of the target configuration file. Then, based on the record information and association information of the configuration parameters of each level, the target statement corresponding to the target configuration file can be generated. Finally, by executing the target statement, the configuration parameters in the target configuration file can be imported into the database.
[0058] It should be noted that the file processing method provided in this application embodiment can generally be executed by server 105. Correspondingly, the file processing device provided in this application embodiment can generally be located in server 105. The file processing method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the file processing device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0059] It should be understood that the number of terminal devices, networks, and servers shown in Figure 1 is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0060] The following will describe in detail the file processing method of the application embodiment based on the scenario described in Figure 1, with reference to Figures 2 to 4.
[0061] Figure 2 shows a flowchart of a document processing method according to an embodiment of this application.
[0062] As shown in Figure 2, the method 200 includes operations S210 to S240.
[0063] During operation S210, the target configuration file is read to obtain the hierarchical information of the target configuration file.
[0064] According to embodiments of this application, the target configuration file may include N levels, where N is an integer greater than or equal to 1. The target configuration file can represent a configuration file with a hierarchical relationship, and may include a YAML configuration file. The hierarchical information may include the existence of N levels in the target configuration file and the configuration parameters in each level.
[0065] For example, a YAML configuration file can be used as the target configuration file.
[0066] According to an embodiment of this application, by reading the target configuration file, it can be determined that there are 5 levels in the target configuration file. For each line in the target configuration file, the configuration parameters of each line of the same level are aligned to the left. Starting from the left side of the target configuration file, the levels of configuration parameters aligned to the left are the first level, the second level, the third level, the fourth level, and the fifth level.
[0067] According to embodiments of this application, by reading the target configuration file, it can be determined that the first level of the target configuration file may include three configuration parameters named version, services, and data. The value of the configuration parameter named version can be 3, the value of the configuration parameter named services can be the configuration parameter named app01 (application 01), and the value of the configuration parameter named data can be the configuration parameter named dataset01. The second level may include two configuration parameters named app01 and dataset01. The value of the configuration parameter named app01 may include configuration parameters named dimensions and appInfo (application description information), and the value of the configuration parameter named dataset01 may include configuration parameters named dimensions and dataInfo (data description information).
[0068] According to embodiments of this application, the third level may include four configuration parameters named dimensions, appInfo, dimensions, and dataInfo. The configuration parameter named dimensions may include configuration parameters named area and slaScore (application operation SLA score, SLA, Service-Level Agreement). The configuration parameter named dimensions may include configuration parameters named area and sizeScore (data volume score). The configuration parameter named appInfo may include configuration parameters named image, version, serviceName, and black_list (data processing blacklist). The configuration parameter named dataInfo may include configuration parameters named type and format.
[0069] According to embodiments of this application, the fourth level may include ten configuration parameters named area, slaScore, image, version, serviceName, black_list, area, sizeScore, type, and format. The value of the configuration parameter named area can be "region / az / server1;region / az / server7" (where the application runs on which nodes; region can represent a data center, az can represent an availability zone, and server can represent a node). The value of the configuration parameter named slaScore can be 99. The value of the configuration parameter named image can be "app01:v1.0.1" (image). The value of the configuration parameter named version can be "1.0.1". The value of the configuration parameter named serviceName can be com.edma.dataprocessor.v6 (edma, Enhanced Direct). MemoryAccess (used for fast data exchange, dataprocessor), the configuration parameter named black_list can have two configuration parameters named source (data source) and two configuration parameters named info (description information), another configuration parameter named area can have the value "region / az / server6; region / az / server7", the configuration parameter named sizeScore can have the value 99, the configuration parameter named type can have the value "log" (log), and the configuration parameter named format can have the value "gzip" (compressed file).
[0070] According to an embodiment of this application, the fifth level may include four configuration parameters named "source" and "info". The values corresponding to the configuration parameter named "source" may include 192.168.100.1 and 192.168.100.2, and the values corresponding to the configuration parameter named "info" may include "info1" and "info2". In operation S220, based on the hierarchical information of the target configuration file, the configuration parameters of each level in the target configuration file are analyzed to obtain the result information of the target configuration file.
[0071] According to embodiments of this application, the result information may include record information and association information of configuration parameters at each level in the target configuration file. The record information may include the name and value of the configuration parameter, and the association information may represent the association between the current level and the previous level, i.e., the parent node corresponding to the current level, the parent node ID value, and the name of the configuration parameter of the parent level corresponding to this level. For example, for a configuration parameter named app01 in the second level, the parent node corresponding to this level can be represented as the configuration parameter named services in the first level, and the parent node ID value can be represented as 2001; for a configuration parameter named dataset01 in the second level, the parent node corresponding to this level can be represented as the configuration parameter named data in the first level, and the parent node ID value can be represented as 7001.
[0072] According to an embodiment of this application, based on the hierarchical information of the target configuration file, the parameter types of the configuration parameters at each level in the target configuration file can be analyzed recursively to obtain the result information of the target configuration file.
[0073] In operation S230, target statements corresponding to the target configuration file are generated based on the recorded information and associated information of the configuration parameters at each level.
[0074] According to embodiments of this application, the target statement may include an SQL statement. A target statement corresponding to the target configuration file can be generated based on the record information and association information of the configuration parameters at each level, wherein the target statement may include the record information and association information of the configuration parameters at each level.
[0075] In operation S240, the configuration parameters in the target configuration file are imported into the database by executing the target statement.
[0076] According to an embodiment of this application, by executing the target statement, the configuration parameters in the target configuration file can be imported into the database, that is, the configuration parameters in the target configuration file can be tabled and saved in a relational database.
[0077] According to embodiments of this application, reading the target configuration file yields its hierarchical information. Based on this hierarchical information, the configuration parameters at each level of the target configuration file are analyzed to obtain result information. This result information includes record information and association information for the configuration parameters at each level. Based on this record information and association information, a target statement corresponding to the target configuration file is generated. Finally, by executing the target statement, the configuration parameters in the target configuration file can be imported into the database. Analyzing the configuration parameters at each level of the target configuration file allows for handling complex, multi-level, personalized configurations with good versatility and flexibility. This allows for obtaining the result information of the target configuration file, facilitating the execution of the target statement generated from the result information, and directly importing the configuration parameters from the target configuration file into the database. This improves the efficiency and accuracy of converting the target configuration file into target statements.
[0078] Figure 3 shows a flowchart of the result information of obtaining the target configuration file according to an embodiment of this application.
[0079] As shown in Figure 3, the method 300 includes operations S310 to S340.
[0080] In operation S310, for the nth level of the target configuration file, the parameter type of each configuration parameter in the nth level of the target configuration file is obtained based on the information corresponding to the nth level in the level information.
[0081] According to an embodiment of this application, n is an integer greater than or equal to 1 and less than or equal to N, wherein n increments from 1 up to N.
[0082] According to an embodiment of this application, taking a YAML configuration file as the target configuration file as an example, the YAML configuration file is mainly used to store configuration information, namely the name and value of configuration parameters. The data structures supported by the YAML configuration file, namely parameter types, can include objects, arrays, and scalars. Among them, configuration parameters of parameter type object can represent a collection of key-value pairs, and objects can also be called mappings / hashes / dictionaries; configuration parameters of parameter type array can represent a set of values arranged in order, that is, at least two configuration parameters of the same level and status can be represented as an array, and arrays can also be called sequences / lists; configuration parameters of parameter type scalars can represent a single, indivisible value.
[0083] According to an embodiment of this application, taking the aforementioned target configuration file with 5 levels as an example. When n is 1, for the first level of the target configuration file, based on the information corresponding to the first level in the level information, the first level can include three configuration parameters named version, services, and data. The value corresponding to the configuration parameter named version can be 3, the value corresponding to the configuration parameter named services can be the configuration parameter named app01, and the value corresponding to the configuration parameter named data can be the configuration parameter named dataset01. Therefore, it can be concluded that the parameter type of the configuration parameter named version in the first level of the target configuration file is a literal, the parameter type of the configuration parameter named services is an object, and the parameter type of the configuration parameter named data is an object.
[0084] In operation S320, based on the hierarchical information of the target configuration file, at least one result sub-information corresponding to the nth level is generated.
[0085] According to an embodiment of this application, for the nth level of the target configuration file, at least one result sub-information corresponding to the nth level can be generated based on the hierarchical information of the target configuration file. The result sub-information may include the name and value of each configuration parameter in the nth level and the association information between the nth level and the (n-1)th level.
[0086] In operation S330, if there are configuration parameters of type object or array in the configuration parameters at the nth level, return to the operation of generating result sub-information and increment n.
[0087] According to the embodiments of this application, for the first level of the target configuration file, it can be found that the parameter type of the configuration parameter named "version" in the first level of the target configuration file is a quantifier, and the parameter types of the configuration parameters named "services" and "data" are both objects. That is, if there are configuration parameters of object or array type in the first level configuration parameters, then the operation of generating result sub-information can be returned, that is, the operation S310 and operation S320 can be returned, and n is incremented.
[0088] According to an embodiment of this application, when n is 2, for the second level of the target configuration file, based on the information corresponding to the second level in the level information, that is, the second level may include two configuration parameters named app01 and dataset01, wherein the value corresponding to the configuration parameter named app01 may include configuration parameters named dimensions and appInfo, and the value corresponding to the configuration parameter named dataset01 may include configuration parameters named dimensions and dataInfo. Thus, it can be obtained that the parameter types of the configuration parameters named app01 and dataset01 in the second level of the target configuration file are both objects, that is, there are configuration parameters of object or array type in the configuration parameters of the second level. Then, the operation of generating result sub-information can be returned, that is, the operation of executing operation S310 and operation S320 can be returned, and n is incremented.
[0089] According to an embodiment of this application, when n is 3, for the third level of the target configuration file, based on the information corresponding to the third level in the hierarchical information, that is, the third level may include four configuration parameters named dimensions, appInfo, dimensions, and dataInfo. Among them, the value corresponding to the configuration parameter named dimensions may include configuration parameters named area and slaScore, the value corresponding to another configuration parameter named dimensions may include configuration parameters named area and sizeScore, the value corresponding to the configuration parameter named appInfo may include configuration parameters named image, version, serviceName, and black_list, and the value corresponding to the configuration parameter named dataInfo may include configuration parameters named type and format. Thus, it can be seen that the parameter type of the configuration parameters named dimensions, appInfo, dimensions, and dataInfo in the third level of the target configuration file is all objects. That is, there are configuration parameters of type object or array in the configuration parameters of the third level. Then, the operation of generating result sub-information can be returned, that is, the operation of operation S310 and operation S320 can be returned, and n is incremented.
[0090] According to an embodiment of this application, when n is 4, for the fourth level of the target configuration file, based on the information corresponding to the fourth level in the level information, that is, the fourth level can include ten configuration parameters named area, slaScore, image, version, serviceName, black_list, area, sizeScore, type, and format. The configuration parameter named area can have the value of region / az / server1; region / az / server7; the configuration parameter named slaScore can have the value of 99; the configuration parameter named image can have the value of app01:v1.0.1; the configuration parameter named version can have the value of 1.0.1; the configuration parameter named serviceName can have the value of com.edma.dataprocessor.v6; and the configuration parameter named black_list can have the value of com.edma.dataprocessor.v6. Given two configuration parameters named "source" and two named "info", and another configuration parameter named "area" with values corresponding to "region / az / server6" and "region / az / server7", a configuration parameter named "sizeScore" with a value of "99", a configuration parameter named "type" with a value of "log", and a configuration parameter named "format" with a value of "gzip", we can see that the parameter types of the fourth-level configuration parameters named "area", "slaScore", "image", "version", "serviceName", "area", "sizeScore", "type", and "format" in the target configuration file are all quantifiers, and the parameter type of the configuration parameter named "black_list" is an object. That is, if there are configuration parameters of type object or array in the fourth-level configuration parameters, then the operation of generating result sub-information can be returned, that is, the operation S310 and operation S320 can be executed, and n is incremented.
[0091] According to an embodiment of this application, when n is 5, for the 5th level of the target configuration file, based on the information corresponding to the 5th level in the level information, the 5th level can include four configuration parameters named source and info. The value corresponding to the configuration parameter named source can include 192.168.100.1 and 192.168.100.2, and the value corresponding to the configuration parameter named info can include info1 and info2. Thus, it can be seen that the parameter types of the configuration parameters named source and info at the 5th level are both quantifiers.
[0092] When operating S340, if the parameter types of the configuration parameters at the nth level are all quantifiers, the result information of the target configuration file is obtained based on at least one result sub-information of each level in the target configuration file.
[0093] According to an embodiment of this application, for the fifth level of the target configuration file, it can be found that the parameter types of the configuration parameters named source and info at the fifth level of the target configuration file are all quantifiers. That is, the parameter types of the configuration parameters at the fifth level are all quantifiers. Then, based on at least one result sub-information of each level obtained from the above operations S310 to S330, the result information of the target configuration file can be obtained.
[0094] According to the embodiments of this application, based on the hierarchical information of the target configuration file, a recursive approach can be used to analyze the configuration parameters of each level in the target configuration file until the parameter type of the deepest level configuration parameter is a quantifier. This allows for accurate analysis of the parameter type of each configuration parameter in the target configuration file, thereby addressing complex and personalized configuration methods with multiple levels in the target configuration file. It has good versatility and flexibility. Based on the analysis results of the parameter types of the obtained configuration parameters, at least one result sub-information corresponding to the nth level is generated, thereby obtaining the result information of the target configuration file.
[0095] According to an embodiment of this application, generating at least one result sub-information corresponding to the nth level based on the hierarchical information of the target configuration file includes: obtaining at least one association information between the nth level and the (n-1)th level in the target configuration file based on the hierarchical information of the target configuration file; obtaining record information for each configuration parameter in the nth level based on the information corresponding to the nth level in the hierarchical information; and generating at least one result sub-information corresponding to the nth level based on the at least one association information and the record information for each configuration parameter in the nth level.
[0096] According to an embodiment of this application, taking the aforementioned target configuration file with five levels as an example. For the first level of the target configuration file, based on the level information of the target configuration file, the three configuration parameters named version, services, and data can be determined as the first level of the target configuration file. Then, for the first level, the association information between this level and the previous level can be represented as the first level, that is, the upper-level node of the first level can be represented as the first level. The first level does not have an upper-level node id value, nor does it have the name of the configuration parameter corresponding to the upper-level node. Based on the information corresponding to the first level in the level information, the names and values of the two configuration parameters in the first level can be obtained. Therefore, based on one association information of the first level and the names and values of the two configuration parameters, a result sub-information corresponding to the first level can be generated.
[0097] According to an embodiment of this application, for the second level in the target configuration file, based on the hierarchical information of the target configuration file, it can be determined that the two configuration parameters named app01 and dataset01 are the second level of the target configuration file, and the value corresponding to the configuration parameter named services in the first level can be the configuration parameter named app01, and the value corresponding to the configuration parameter named data can be the configuration parameter named dataset01. Therefore, for the second level, the association information between this level and the previous level can include the configuration parameter named app01 and the configuration parameter named services in the first level. The association information of the parameters, and the association information between the configuration parameter named dataset01 and the configuration parameter named data in the first level, that is, the upper-level node of the second level can be represented as the first level, and the upper-level node id value can be represented as 1001. At the same time, the association information can also include the names of the configuration parameters of the upper level corresponding to this level as services and data, respectively. Based on the information corresponding to the second level in the hierarchy information, the names and values of the configuration parameters in the second level can be obtained. Thus, based on the two association information of the second level and the names and values of the configuration parameters, two result sub-information corresponding to the second level can be generated.
[0098] According to an embodiment of this application, for the third level in the target configuration file, the configuration parameters named dimensions, appInfo, dimensions, and dataInfo can be determined as the third level of the target configuration file based on the hierarchical information of the target configuration file. The value corresponding to the configuration parameter named app01 in the second level can include the configuration parameters named dimensions and appInfo, and the value corresponding to the configuration parameter named dataset01 can include the configuration parameters named dimensions and dataInfo. Therefore, for the third level, the association information between this level and the previous level can include the configuration parameters named dimensions and appInfo and the configuration parameter named app01 in the second level. The association information of the configuration parameters and the association information of the configuration parameters named dimensions and dataInfo with the configuration parameter named dataset01 in the second level, that is, the upper-level node of the third level can be represented as services, and the upper-level node ID value can be represented as 2001. Another upper-level node of the third level can be represented as data, and the upper-level node ID value can be represented as 7001. At the same time, the association information can also include the configuration parameters named app01 and dataset01 of the upper level corresponding to this level. Based on the information corresponding to the third level in the hierarchical information, the names and values of the configuration parameters in the third level can be obtained. Thus, based on the two association information of the third level and the names and values of the configuration parameters, two result sub-information corresponding to the third level can be generated.
[0099] According to an embodiment of this application, for the fourth level in the target configuration file, based on the hierarchical information of the target configuration file, ten configuration parameters named area, slaScore, image, version, serviceName, black_list, area, sizeScore, type, and format can be obtained as the fourth level of the target configuration file. The values corresponding to the configuration parameter named dimensions in the third level can include the configuration parameters named area and slaScore. The values corresponding to another configuration parameter named dimensions can include the configuration parameters named area and sizeScore. The values corresponding to the configuration parameter named appInfo can include the configuration parameters named image, version, serviceName, and black_list. The values corresponding to the configuration parameter named dataInfo can include the configuration parameters named type and format. Therefore, for the fourth level, the association information between this level and the previous level can include the configuration parameters named area and slaScore and the configuration parameter named dimensions in the third level. The association information of the configuration parameters in the fourth level includes: the association information of configuration parameters named image, version, serviceName, and black_list with the configuration parameter named appInfo in the third level; the association information of configuration parameters named area and sizeScore with the configuration parameter named dimensions in the third level; and the association information of configuration parameters named type and format with the configuration parameter named dataInfo in the third level. That is, the parent node of the fourth level can be represented as app01, and the parent node ID value can be represented as 3001. Another parent node of the fourth level can be represented as dataset01, and the parent node ID value can be represented as 8001. Additionally, the association information can also include the names of the configuration parameters in the corresponding parent level: dimensions, appInfo, dimensions, and dataInfo. Based on the information corresponding to the fourth level in the hierarchical information, the names and values of the configuration parameters in the fourth level can be obtained. Therefore, based on the four association information and the names and values of the configuration parameters in the fourth level, four result sub-information corresponding to the fourth level can be generated.
[0100] According to an embodiment of this application, for the fifth level in the target configuration file, the values corresponding to the four configuration parameters named "source" and "info" in the fifth level of the target configuration file and the configuration parameter named "black_list" in the fourth level can be obtained based on the hierarchical information of the target configuration file. These values can include the four configuration parameters named "source" and "info". For the fourth level, the association information between this level and the previous level can include the association information between the configuration parameters named "source" and "info" and the configuration parameter named "black_list" in the fourth level. That is, the upper-level node of the fifth level can be represented as "appInfo", and the upper-level node id value can be represented as 5001. At the same time, the association information can also include the configuration parameter named "black_list" in the upper level corresponding to this level. Based on the information corresponding to the fifth level in the hierarchical information, the names and values of the configuration parameters in the fifth level can be obtained. Thus, based on one association information of the fifth level and the names and values of the configuration parameters, a result sub-information corresponding to the fifth level can be generated.
[0101] According to an embodiment of this application, for the nth level, the number of related information items between the nth level and the (n-1)th level is the same as the number of result sub-information items generated corresponding to the nth level.
[0102] According to an embodiment of this application, at least one result sub-information corresponding to the nth level can be generated based on at least one association information between the nth level and the (n-1)th level and the record information of each configuration parameter in the nth level, so that the corresponding target statement can be generated subsequently based on the obtained result sub-information.
[0103] According to an embodiment of this application, the above-mentioned file processing method further includes: obtaining a target table from a database; determining multiple dimension information corresponding to a target configuration file based on the target table; and constructing a multi-dimensional 3D image corresponding to the target configuration file based on the multiple dimension information.
[0104] According to embodiments of this application, for example, there are many servers in a data center. Some servers store data, while others run applications. When a server is running an application, data needs to be loaded before the application can run. However, in reality, some servers lack sufficient bandwidth, resulting in extremely slow data download speeds. Other servers have high-speed networks, where loading 1TB of data might only take a few seconds, while loading data from some servers could take a very long time, such as an hour. This data loading time impacts the efficiency of the server running applications. Therefore, a multi-dimensional diagram can be created to represent the distance between data nodes and service (application) nodes, thereby identifying the server B that runs the application corresponding to a data-storing server A. This allows server B to quickly load data from server A, improving the efficiency of server B in running applications.
[0105] According to embodiments of this application, when processing a configuration file, dimension information corresponding to the configuration parameters in the second level can be added to the third level of the configuration file to obtain the target configuration file. For example, taking the target configuration file with the above five levels as an example, the second level may include two configuration parameters named app01 and dataset01. Then, dimension information corresponding to app01 and dataset01 can be added to the third level. The dimension information of app01 may include area and slaScore, and the dimension information of dataset01 may include area and sizeScore.
[0106] According to an embodiment of this application, before generating a multi-dimensional 3D image corresponding to the target configuration file, the configuration parameters in the target configuration file are imported into a database, thus obtaining multiple second tables corresponding to the target configuration file. Since the dimension information is added in the third level, the target table can be obtained from the database. The target table may include a table containing dimension information corresponding to each configuration parameter in the second level, as well as a table reflecting the type of configuration parameter. The configuration parameter type may include two categories: services and data.
[0107] According to embodiments of this application, dimensional information corresponding to the target configuration file can be obtained based on the target table. The maximum number of configuration parameters included in each dimension of the target configuration file is consistent with the dimensions of the generated multi-dimensional 3D graph corresponding to the target configuration file. For example, for app01, the dimensional information of the configuration parameter may include the values corresponding to the configuration parameter named area (region / az / server1; region / az / server7) and the value corresponding to the configuration parameter named slaScore (99); for dataset, the dimensional information of the configuration parameter may include the values corresponding to the configuration parameter named area (region / az / server6; region / az / server7) and the value corresponding to the configuration parameter named sizeScore (99). The generated multi-dimensional 3D graph corresponding to the target configuration file is two-dimensional, where the value corresponding to the configuration parameter named area can be the horizontal axis and the value corresponding to the configuration parameter named slaScore can be the vertical axis.
[0108] According to embodiments of this application, for each configuration parameter in the second level, its position in a multi-dimensional 3D graph can be determined based on the dimensional information corresponding to that configuration parameter. The configuration parameter is represented as a node in the 3D graph. Different types of configuration parameters can be represented by nodes of different colors. For example, app01 is a service node and can be represented by a red node, while dataset is a data node and can be represented by a blue node. The node can also represent the name of the corresponding configuration parameter.
[0109] According to an embodiment of this application, in the obtained 3D image, for each red node, the distance between it and all blue nodes can be calculated, the blue node closest to the red node can be determined, and the data in the server represented by the blue node can be loaded and processed using the server represented by the red node. The distance between two nodes can be calculated based on the node's dimension information.
[0110] According to an embodiment of this application, a dictionary can be constructed from all the region, az, and server strings corresponding to the configuration parameters in the second level of the target configuration file. The dictionary can also include the corresponding values of region, az, and server. The values can be obtained by one-hot encoding. All region strings are encoded using one-hot encoding to obtain their corresponding values, all az strings are encoded using one-hot encoding to obtain their corresponding values, and all server strings are encoded using one-hot encoding to obtain their corresponding values.
[0111] According to an embodiment of this application, for example, in the second level of the target configuration file, there can be 4 regions corresponding to the configuration parameters, 3 az, and 4 servers. Then, by performing one-hot encoding on all region strings, we can obtain the code 0001 corresponding to region1, the code 0010 corresponding to region2, the code 0100 corresponding to region3, and the code 1000 corresponding to region4; by performing one-hot encoding on all az strings, we can obtain the code 001 corresponding to az1, the code 010 corresponding to az2, and the code 100 corresponding to az3; by performing one-hot encoding on all server strings, we can obtain the code 0001 corresponding to server1, the code 0010 corresponding to server2, the code 0100 corresponding to server3, and the code 1000 corresponding to server4.
[0112] According to the embodiments of this application, since the maximum value obtained by one-hot encoding of region, az, and server is 1 (for example, the encoding corresponding to region1 is 0001, which can be further split into four values: 0, 0, 0, and 1, with the largest value being 1), the score value can be a relatively large value such as 98 or 99. This will cause the score value to be given more weight when calculating the distance, making the value corresponding to region, az, and server have a smaller impact on the distance calculation. Therefore, it is necessary to normalize the score value corresponding to each configuration parameter in the second level so that the score value is between 0 and 1. Here, the score can include slaScore and sizeScore.
[0113] According to an embodiment of this application, the area field of the service node (such as app01) and the data node (such as dataset01) to be compared, such as "region1 / az2 / server1", is split into three fields: region, az and server.
[0114] According to embodiments of this application, the strings "region", "az", and "server" can be converted into corresponding numerical values using dictionary matching based on the dictionary constructed above. For example, "region1" can be converted to "0001", "az2" to "010", and "server01" to "0001" using dictionary matching.
[0115] According to an embodiment of this application, the current data attributes of the configuration parameters in the second level can be: region, az, server, and socre. This results in a data vector composed of the corresponding values of region, az, server, and socre. For example, based on the above-mentioned region1, az2, server1, and the normalized value of score (0.4), a data vector (0,0,0,1,0,1,0,0,0,0,1,0.4) can be obtained.
[0116] According to an embodiment of this application, the cosine distance between the data vector of the data node and the data vector of the service node can be calculated based on the data vector of the obtained data node (such as dataset01) and the data vector of the service node (app01), wherein the cosine distance can characterize the distance between the data node and the service node.
[0117] According to the embodiments of this application, the cosine similarity calculation method can be expressed as the following formula (1).
[0118]
[0119] Where A can represent the data vector of a data node, B can represent the data vector of a service node, and n can represent the number of values constituting the data vector. i B can represent the i-th value in the data vector of a data node. i This can represent the i-th value in the data vector of the service node. Taking the data vector (0,0,0,1,0,1,0,0,0,0,1,0.4) constructed above as an example, the number of values in this data vector is 12, so n can be 12.
[0120] According to embodiments of this application, the cosine distance can characterize the difference between 1 and cosine similarity, i.e., cosine distance = 1 - cosine similarity. The distance represented by the obtained cosine distance can be between 0 and 2, with the closer to 0 indicating a closer distance and the closer to 2 indicating a farther distance.
[0121] According to embodiments of this application, the distance between points can reflect the relationship between them; the closer the distance, the higher the affinity between the two points. Closer distances can indicate the attributes between data points and application points (service points), such as network relationships, memory relationships, and availability zone relationships. Closer distances result in higher data transmission efficiency and computing power between servers. Therefore, the spatial locations of multiple servers can be represented first, and then the distances between them can be calculated.
[0122] According to embodiments of this application, the obtained multi-dimensional stereoscopic image can be used to reflect the affinity between data points and application points. Distance can indicate the attributes between data points and application points, such as network relationships, memory relationships, and availability zone relationships. The closer the distance, the higher the data transmission efficiency and computing power between servers, thereby determining which application server is the fastest to load data from a certain server.
[0123] According to an embodiment of this application, after calculating the distance between the data point and the application point, other data corresponding to the configuration parameters can be obtained from the database to determine information such as the server name and data source represented by the node, thereby loading and processing the data in the corresponding server using the corresponding server. According to an embodiment of this application, based on at least one piece of association information and the record information of each configuration parameter in the nth level, at least one result sub-information corresponding to the nth level is generated, including: for each piece of association information, determining the record information of the configuration parameter corresponding to the association information in the nth level; and generating the result sub-information corresponding to the nth level based on the association information and the record information of the configuration parameter corresponding to the association information.
[0124] According to an embodiment of this application, for each piece of associated information, the record information of the configuration parameter corresponding to the associated information in the nth level can be determined, wherein the record information may include the name and value of the configuration parameter.
[0125] For example, consider the target configuration file mentioned above, which has five levels.
[0126] According to an embodiment of this application, for the first level, an associated information can be obtained, that is, the upper-level node of the first level can be represented as the first level. Then, three configuration parameters with names of version, services, and data corresponding to the associated information in the first level, as well as the id value of the first level, can be determined. Among them, the value corresponding to the configuration parameter with name version can be 3, the value corresponding to the configuration parameter with name services can be the configuration parameter with name app01, the value corresponding to the configuration parameter with name dataset01 can be the configuration parameter with name dataset01, and the id value of the first level can be represented as 1001. Thus, the names and values of the configuration parameters of the first level, as well as the id value of the first level, are recorded to obtain the record information of the configuration parameters corresponding to the associated information in the first level. Based on the associated information and the record information of the configuration parameters corresponding to the associated information, a result sub-information corresponding to the first level can be generated. In this case, there is no corresponding upper-level node id value in the first level.
[0127] According to an embodiment of this application, for the second level, two related information can be obtained: the association information between the configuration parameter named app01 and the configuration parameter named services in the first level. That is, the upper-level node of the second level can be represented as the first level, the upper-level node id value can be represented as 1001, and the name of the configuration parameter of the upper level corresponding to this level is services. The configuration parameter named app01 and the id value of the configuration parameter named services in the second level corresponding to the related information can be determined. The value corresponding to the configuration parameter named app01 can include the configuration parameters named dimensions and appInfo, and the id value of the configuration parameter named services can be represented as 2001. Thus, the names and values of the configuration parameters in the second level and the id value of the configuration parameter named services are recorded to obtain the record information of the configuration parameters corresponding to the related information in the second level. Based on the related information and the record information of the configuration parameters corresponding to the related information, a result sub-information corresponding to the second level can be generated.
[0128] According to an embodiment of this application, regarding the association information between the configuration parameter named dataset01 in the second level and the configuration parameter named data in the first level, i.e., the upper-level node of the second level can be represented as the first level, the upper-level node id value can be represented as 1001, and the configuration parameter of the upper level corresponding to this level is named data, the configuration parameter named dataset01 and the id value of the configuration parameter named data in the second level corresponding to the association information can be determined. The value corresponding to the configuration parameter named dataset01 may include configuration parameters named dimensions and dataInfo, and the id value of the configuration parameter named data can be represented as 7001. Thus, the names and values of the configuration parameters in the second level and the id value of the configuration parameter named data are recorded to obtain the record information of the configuration parameters corresponding to the association information in the second level. Based on the association information and the record information of the configuration parameters corresponding to the association information, another result sub-information corresponding to the second level can be generated.
[0129] According to an embodiment of this application, for the third level, two pieces of association information can be obtained: the association information between the configuration parameters named dimensions and appInfo and the configuration parameter named app01 in the second level. That is, the upper-level node of the third level can be represented as services, the upper-level node ID value can be represented as 2001, and the name of the configuration parameter of the upper level corresponding to this level is app01. The ID values of the configuration parameters named dimensions and appInfo and the configuration parameter named app01 in the third level corresponding to this association information can be determined. The configuration parameter named dimensions corresponds to... The values can include configuration parameters named area and slaScore. The configuration parameter named appInfo can include configuration parameters named image, version, serviceName, and black_list. The id value of the configuration parameter named app01 can be represented as 3001. Thus, the names and values of each configuration parameter in the third level, as well as the id value of the configuration parameter named app01, are recorded to obtain the record information of the configuration parameters corresponding to the associated information in the third level. Based on the associated information and the record information of the configuration parameters corresponding to the associated information, a result sub-information corresponding to the third level can be generated.
[0130] According to an embodiment of this application, regarding the association information between the configuration parameters named dimensions and dataInfo in the third level and the configuration parameter named dataset01 in the second level, that is, the upper-level node of the third level can be represented as dataset01, the upper-level node id value can be represented as 7001, and the configuration parameter of the upper level corresponding to this level is named dataset01, the configuration parameters named dimensions and dataInfo and the id value of the configuration parameter named dataset01 in the third level corresponding to this association information can be determined. Among them, the configuration parameter named dimensions... The values corresponding to the parameters can include configuration parameters named area and sizeScore. The values corresponding to the configuration parameter named dataInfo can include configuration parameters named type and format. The id value of the configuration parameter named dataset01 can be represented as 8001. Thus, the names and values of each configuration parameter in the third level, as well as the id value of the configuration parameter named dataset01, are recorded to obtain another record of the configuration parameter corresponding to the associated information in the third level. Based on the associated information and the record of the configuration parameter corresponding to the associated information, another result sub-information corresponding to the third level can be generated.
[0131] According to an embodiment of this application, for the fourth level, four pieces of associated information can be obtained. These are the associations between the configuration parameters named "area" and "slaScore" and the configuration parameter named "dimensions" in the third level. Specifically, the upper-level node of the fourth level can be represented as "app01," and the upper-level node's ID value can be represented as 3001. The name "dimensions" of the configuration parameter in the upper-level node corresponding to this level can determine the configuration parameters named "area" and "slaScore" and the ID value of the configuration parameter named "dimensions" in the fourth level that correspond to this associated information. Among these, the configuration parameter named "area"... The values corresponding to the configuration parameters can be "region / az / server1; region / az / server7", the value corresponding to the configuration parameter named slaScore can be 99, and the id value of the configuration parameter named dimensions can be represented as 4001. Thus, the names and values of the configuration parameters in the fourth level, as well as the id value of the configuration parameter named dimensions, are recorded to obtain the record information of the configuration parameters corresponding to the associated information in the fourth level. Based on the associated information and the record information of the configuration parameters corresponding to the associated information, a result sub-information corresponding to the fourth level can be generated.
[0132] According to an embodiment of this application, regarding the association information between the configuration parameters named image, version, serviceName, and black_list in the fourth level and the configuration parameter named appInfo in the third level, that is, another upper-level node in the fourth level can be represented as app01, the upper-level node id value can be represented as 3001, and the name appInfo of the configuration parameter in the upper level corresponding to this level, the configuration parameters named image, version, serviceName, and black_list and the id value of the configuration parameter named appInfo in the fourth level corresponding to this association information can be determined. Wherein, the name is... The configuration parameter for image can have the value "app01:v1.0.1", the configuration parameter for version can have the value "1.0.1", the configuration parameter for serviceName can have the value com.edma.dataprocessor.v6, the configuration parameter for black_list can have two configuration parameters named source and two configuration parameters named info, and the id value of the configuration parameter named appInfo can be 5001. Based on this association information and the record information of the configuration parameter corresponding to this association information, another result sub-information corresponding to the 4th level can be generated.
[0133] According to an embodiment of this application, regarding the association information between the configuration parameters named area and sizeScore in the fourth level and the configuration parameter named dimensions in the third level, that is, another upper-level node in the fourth level can be represented as dataset01, the upper-level node id value can be represented as 8001, and the configuration parameter name dimensions corresponding to the upper level can determine the configuration parameters named area and sizeScore and the id value of the configuration parameter named dimensions in the fourth level that correspond to the association information. Among them, the value corresponding to the configuration parameter named area can be "region / az / server6;region / az / server7", the value corresponding to the configuration parameter named sizeScore can be 99, and the id value of the configuration parameter named dimensions can be represented as 9001. Then, based on the association information and the record information of the configuration parameter corresponding to the association information, another result sub-information corresponding to the fourth level can be generated.
[0134] According to an embodiment of this application, regarding the association information between the configuration parameters named "type" and "format" in the fourth level and the configuration parameter named "dataInfo" in the third level, that is, another upper-level node in the fourth level can be represented as dataset01, the upper-level node id value can be represented as 8001, and the configuration parameter name "dataInfo" corresponding to the upper level of this level, the configuration parameters named "type" and "format" and the id value of the configuration parameter named "dataInfo" in the fourth level corresponding to the association information can be determined. Among them, the value corresponding to the configuration parameter named "type" can be "log", the value corresponding to the configuration parameter named "format" can be "gzip", and the id value of the configuration parameter named "dataInfo" can be represented as 10001. Then, based on the association information and the record information of the configuration parameter corresponding to the association information, another result sub-information corresponding to the fourth level can be generated.
[0135] According to an embodiment of this application, for the fifth level, one association information can be obtained. This association information relates the four configuration parameters named "source" and "info" to the configuration parameter named "black_list" in the fourth level. Specifically, the upper-level node of the fifth level can be represented as "appInfo," and the upper-level node's ID value can be represented as 5001. The name "black_list" of the configuration parameter corresponding to this upper-level node can determine the configuration parameters named "source" and "info" and the ID value of the configuration parameter named "black_list" in the fifth level that correspond to this association information. Among these, the configuration parameter named "source"... The values corresponding to the configuration parameters can include 192.168.100.1 and 192.168.100.2. The values corresponding to the configuration parameter named "info" can include "info1" and "info2". The id value of the configuration parameter named "black_list" can be represented as 6001 and 6002. By recording the names and values of the configuration parameters in the fifth level and the id value of the configuration parameter named "black_list", the record information of the configuration parameters corresponding to the associated information in the fifth level can be obtained. Based on the associated information and the record information of the configuration parameters corresponding to the associated information, a result sub-information corresponding to the fifth level can be generated.
[0136] According to the embodiments of this application, for each piece of associated information, the record information of the configuration parameters corresponding to the associated information in the nth level can be determined first, so that a result sub-information corresponding to the nth level can be generated based on the associated information and the record information of the configuration parameters corresponding to the associated information.
[0137] According to an embodiment of this application, the target statement may include a first target statement and a second target statement. Based on the record information and associated information of the configuration parameters at each level, a target statement corresponding to the target configuration file is generated, including: for each result sub-information, generating a first target statement corresponding to the result sub-information based on the record information in the result sub-information; and generating a second target statement corresponding to the result sub-information based on the record information and associated information in the result sub-information.
[0138] According to an embodiment of this application, the first target statement can represent a table creation statement, and the second target statement can represent an insert statement (INSERT statement).
[0139] According to an embodiment of this application, for each result sub-information, a first target statement corresponding to the result sub-information can be generated based on the record information in the result sub-information. The first target statement may include the name of each configuration parameter in the result sub-information. Then, based on the record information and associated information in the result sub-information, a second target statement corresponding to the result sub-information is generated. The second target statement may include the value corresponding to the name of each configuration parameter, the upper-level node ID value, and the ID value of the configuration parameter of the level above that level.
[0140] According to an embodiment of this application, for each result sub-information, a first target statement and a second target statement corresponding to the result sub-information can be generated based on the associated information and record information in the result sub-information, so that a table of the result sub-information can be generated subsequently based on the first target statement and the second target statement.
[0141] Figure 4 shows a flowchart of the execution of the target statement according to an embodiment of this application.
[0142] As shown in Figure 4, the method 400 includes operations S410 to S430.
[0143] In operation S410, for each result sub-information, the first table corresponding to the result sub-information is generated by executing the first target statement corresponding to the result sub-information.
[0144] According to an embodiment of this application, the first table may include the name of the configuration parameter in the result sub-information.
[0145] In operation S420, based on the first table, by executing the second target statement corresponding to the result sub-information, the value corresponding to the name of the configuration parameter in the result sub-information is inserted into the first table, and the second table is generated.
[0146] According to an embodiment of this application, taking the target configuration file with four levels as an example, by executing operations S210 to S230, as well as operations S410 and S420, ten tables, namely Tables 1 to 10, can be obtained. Each of these ten tables can represent a second table. For configuration parameters whose parameter type is an object or an array, the value corresponding to the configuration parameter can be represented by an object.
[0147] Table 1
[0148] idversionservicesdataid_upperNode10013objectobject surface
[0149] Table 2
[0150] idapp01id_upperNode2001objectfirstLayer:1001 Table
[0151] Table 3
[0152] iddimensionsappInfoid_upperNode3001objectobjectservices:2001 Table
[0153] Table 4
[0154] idareaslaScoreid_upperNode4001region / az / server1;region / az / server799app01:3001 Table
[0155] Table 5
[0156]
[0157] Table 6
[0158] idsourceinfoid_upperNode6001192.168.100.1info1appInfo:50016002192.168.100.2info2appInfo:5001 Table
[0159] Table 7
[0160] iddataset01id_upperNode7001objectfirstLayer:1001 Table
[0161] Table 8
[0162] iddimensionsdataInfoid_upperNode8001objectobjectdata:7001 Table
[0163] Table 9
[0164]
[0165] Table 10
[0166] idtypeformatid_upperNode10001loggzipdataset01:8001 surface
[0167] According to embodiments of this application, for each result sub-information, a first table corresponding to the result sub-information can be generated by executing a first target statement corresponding to the result sub-information. The first table may include the name of the configuration parameter in the result sub-information, and may also include id (the id of the configuration parameter of the upper level corresponding to this level) and id_upperNode (the id of the upper-level node). Taking Tables 1 to 10 as examples, the first table can represent a table in Tables 1 to 10 that only includes the first row of data.
[0168] According to an embodiment of this application, based on the first table, the value corresponding to the name of the configuration parameter in the result sub-information can be inserted into the first table by executing the second target statement corresponding to the result sub-information, and the corresponding id value, upper-level node, and upper-level node id value in the result sub-information can also be inserted into the first table, thereby generating the second table.
[0169] According to embodiments of this application, the upper-level node and its ID value can reflect the association between tables.
[0170] In operation S430, the second table corresponding to each result sub-information is imported into the database.
[0171] According to embodiments of this application, in order to achieve universality, the names of configuration parameters in the target configuration file must not violate the restrictions on table names and field names in the SQL statement; otherwise, the generated SQL statement will report an error when imported into the database.
[0172] According to the embodiments of this application, for each result sub-information, a corresponding second table can be obtained by executing the first target statement and the second target statement corresponding to the result sub-information, thereby importing the obtained second table into the database, realizing the creation and saving of the target configuration file in the database.
[0173] According to an embodiment of this application, the table name of the second table is determined based on the associated information in the result sub-information.
[0174] According to an embodiment of this application, Table 1 is generated based on the result sub-information corresponding to the first level. The association information of the first level can be represented as firstLayer, so the table name of Table 1 can be firstLayer. Tables 2 and 7 are generated based on the result sub-information corresponding to the second level. The association information of the second level can include the names of the configuration parameters of the upper level corresponding to this level, such as services and data. So the table name of Table 2 can be services, and the table name of Table 7 can be data. Tables 3 and 8 are generated based on the result sub-information corresponding to the third level. The association information of the third level can include the names of the configuration parameters of the upper level corresponding to this level, such as app01 and dataset01. So the table name of Table 3 can be app01, and the table name of Table 5 can be dataset01. Tables 4, 5, 9, and 10 are generated based on the result sub-information corresponding to level 4. The association information for level 4 can include the configuration parameters of the level above it, named dimensions, appInfo, dimensions, and dataInfo. Therefore, the table name for Table 4 can be black_list, the table name for Table 5 can be appInfo, the table name for Table 9 can be dimensions, and the table name for Table 10 can be dataInfo. Table 6 is generated based on the result sub-information corresponding to level 5. The association information for level 5 can include the configuration parameters of the level above it, named black_list. Therefore, the table name for Table 6 can be black_list.
[0175] According to an embodiment of this application, the table name of the corresponding second table is generated based on the association information in the result sub-information. The association between tables can be reflected by the table name, which can be used to reflect the hierarchical relationship of the target configuration file.
[0176] According to embodiments of this application, taking Tables 1 to 10 above as examples, for a configuration parameter named app01, the target table may include Table 1, Table 2, Table 3, and Table 4, or it may include Table 2 and Table 4. Based on Table 4, the dimension information of app01 can be obtained, and based on Tables 1, 2, and 3, the type of this configuration parameter can be determined to be service. For a configuration parameter named dataset01, the target table may include Table 7, Table 8, and Table 9, or it may include Table 8 and Table 9. Based on Table 9, the dimension information of dataset01 can be obtained, and based on Tables 7 and 8, the type of this configuration parameter can be determined to be data.
[0177] According to an embodiment of this application, after calculating the distance between each node in the multi-dimensional stereoscopic image, Tables 5, 6, and 10 can be obtained from the database to obtain other data corresponding to the configuration parameters, so as to determine the server name, data source, and other information represented by the node, and thus load and process the data in the corresponding server using the corresponding server.
[0178] Based on the above-described document processing method, this application also provides a document processing apparatus. The apparatus will be described in detail below with reference to FIG5.
[0179] Figure 5 shows a structural block diagram of a document processing apparatus according to an embodiment of this application.
[0180] As shown in FIG5, the file processing device 500 of this embodiment includes a reading module 510, an analysis module 520, a generation module 530, and an execution module 540.
[0181] The reading module 510 is used to read the target configuration file to obtain its hierarchical information. The target configuration file includes N levels, where N is an integer greater than or equal to 1. In one embodiment, the reading module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0182] The analysis module 520 is used to analyze the configuration parameters of each level in the target configuration file according to the hierarchical information of the target configuration file, and obtain the result information of the target configuration file. The result information includes the record information and association information of the configuration parameters at each level in the target configuration file. In one embodiment, the analysis module 520 can be used to perform the operation S220 described above, which will not be repeated here.
[0183] The generation module 530 is used to generate target statements corresponding to the target configuration file based on the record information and association information of the configuration parameters at each level. The target statements include statements corresponding to each result sub-information. In one embodiment, the generation module 530 can be used to perform the operation S230 described above, which will not be repeated here.
[0184] The execution module 540 is used to import configuration parameters from the target configuration file into the database by executing the target statement. The second table corresponding to each result sub-information is obtained based on executing the statement corresponding to each result sub-information. In one embodiment, the execution module 540 can be used to execute the operation S240 described above, which will not be repeated here.
[0185] According to an embodiment of this application, the analysis module 520 includes a first obtaining submodule, a first generating submodule, a returning submodule, and a second obtaining submodule.
[0186] The first submodule is used to obtain the parameter type of each configuration parameter in the nth level of the target configuration file based on the information corresponding to the nth level in the level information, where n is an integer greater than or equal to 1 and less than or equal to N.
[0187] The first generation submodule is used to generate at least one result sub-information corresponding to the nth level based on the hierarchical information of the target configuration file.
[0188] Returns a submodule that, when the configuration parameters at the nth level contain configuration parameters of type object or array, returns the operation to generate the result sub-information and increments n.
[0189] The second acquisition submodule is used to obtain the result information of the target configuration file based on at least one result sub-information of each level in the target configuration file, when the parameter types of the configuration parameters at the nth level are all quantifiers.
[0190] According to embodiments of this application, the generation submodule includes a first obtaining unit, a second obtaining unit, and a generation unit.
[0191] The first obtaining unit is used to obtain at least one association information between the nth level and the (n-1)th level in the target configuration file based on the hierarchical information of the target configuration file.
[0192] The second obtaining unit is used to obtain the record information of each configuration parameter in the nth level based on the information corresponding to the nth level in the hierarchical information.
[0193] The generation unit is used to generate at least one result sub-information corresponding to the nth level based on at least one piece of associated information and the record information of each configuration parameter in the nth level, wherein the number of associated information and the number of result sub-information are the same.
[0194] According to embodiments of this application, the document processing apparatus 500 further includes an acquisition module, a determination module, and a construction module.
[0195] The retrieval module is used to retrieve the target table from the database.
[0196] The determination module is used to determine multiple dimensions of information corresponding to the target configuration file based on the target table.
[0197] The building module is used to construct a multi-dimensional 3D image corresponding to the target configuration file based on information from multiple dimensions.
[0198] According to embodiments of this application, the generation unit includes a determining subunit and a generation subunit.
[0199] The sub-unit is determined to identify the record information of the configuration parameters corresponding to the associated information in the nth level for each piece of associated information.
[0200] The generation sub-unit is used to generate result sub-information corresponding to the nth level based on the associated information and the record information of the configuration parameters corresponding to the associated information.
[0201] According to an embodiment of this application, the generation module 530 includes a second generation submodule and a third generation submodule.
[0202] The second generation submodule is used to generate a first target statement corresponding to each result sub-information based on the record information in the result sub-information.
[0203] The third generation submodule is used to generate a second target statement corresponding to the result sub-information based on the record information and record information in the result sub-information.
[0204] According to an embodiment of this application, the execution module 540 includes a fourth generation submodule, a fifth generation submodule, and an import submodule.
[0205] The fourth generation submodule is used to generate a first table corresponding to each result sub-information by executing the first target statement corresponding to the result sub-information. The first table includes the names of the configuration parameters in the result sub-information.
[0206] The fifth generation submodule is used to generate a second table by executing a second target statement corresponding to the result sub-information and inserting the value corresponding to the name of the configuration parameter in the result sub-information into the first table.
[0207] The import submodule is used to import the second table corresponding to each result sub-information into the database.
[0208] According to embodiments of this application, any multiple modules among the reading module 510, analysis module 520, generation module 530, and execution module 540 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the reading module 510, analysis module 520, generation module 530, and execution module 540 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the reading module 510, analysis module 520, generation module 530, and execution module 540 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0209] Figure 6 shows a block diagram of an electronic device suitable for implementing a file processing method according to an embodiment of this application.
[0210] As shown in FIG6, an electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.
[0211] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0212] According to embodiments of this application, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output (I / O) interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0213] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0214] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0215] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the file processing method provided in the embodiments of this application.
[0216] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0217] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0218] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0219] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0220] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0221] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this application can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments and / or claims of this application can be combined or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
[0222] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this application is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this application, and all such substitutions and modifications should fall within the scope of this application.
Claims
1. A file processing method, characterized in that, include: Read the target configuration file to obtain its hierarchical information, wherein the target configuration file includes N levels, where N is an integer greater than or equal to 1; analyze the configuration parameters of each level in the target configuration file based on its hierarchical information to obtain the result information of the target configuration file, wherein the result information includes the record information and association information of the configuration parameters of each level in the target configuration file; wherein, the step of analyzing the configuration parameters of each level in the target configuration file based on its hierarchical information to obtain the result information of the target configuration file includes: for the nth level of the target configuration file, based on the relationship between the hierarchical information and the configuration parameters of each level in the target configuration file... The information corresponding to the nth level is used to obtain the parameter type of each configuration parameter in the nth level of the target configuration file, where n is an integer greater than or equal to 1 and less than or equal to N; based on the hierarchical information of the target configuration file, at least one result sub-information corresponding to the nth level is generated, including: obtaining at least one association information between the nth level and the (n-1)th level in the target configuration file based on the hierarchical information of the target configuration file; obtaining the record information of each configuration parameter in the nth level based on the information corresponding to the nth level in the hierarchical information; and generating the result sub-information corresponding to the nth level based on the at least one association information and the record information of each configuration parameter in the nth level. If one result sub-information is missing, wherein the number of associated information is consistent with the number of result sub-information; if there are configuration parameters of type object or array in the configuration parameters of the nth level, return to execute the operation of generating result sub-information, and increment n; if the parameter types of the configuration parameters of the nth level are all quantifiers, terminate the recursion and obtain the result information of the target configuration file according to the at least one result sub-information of each level in the target configuration file; generate the target statement corresponding to the target configuration file according to the record information and associated information of the configuration parameters of each level, including: for each result sub-information, generate the corresponding statement according to the record information in the result sub-information. The process involves: firstly, defining a first target statement corresponding to the result sub-information; secondly, generating a second target statement corresponding to the result sub-information based on the record information and associated information in the result sub-information, wherein the target statement includes a statement corresponding to each result sub-information, comprising a first target statement and a second target statement, and the record information includes the name and value of the configuration parameter; and thirdly, importing the configuration parameter in the target configuration file into the database by executing the target statement, including: for each result sub-information, generating a first table corresponding to the result sub-information by executing the first target statement corresponding to the result sub-information, wherein the first table includes the name of the configuration parameter in the result sub-information;Based on the first table, by executing the second target statement corresponding to the result sub-information, the value corresponding to the name of the configuration parameter in the result sub-information is inserted into the first table to generate the second table; the second table corresponding to each result sub-information is imported into the database, wherein the second table corresponding to each result sub-information is obtained by executing the statement corresponding to each result sub-information; the table name of the second table is determined according to the association information in the result sub-information, so as to reflect the association between tables according to the table name; wherein the method further includes: obtaining a target table from the database; determining multiple dimension information corresponding to the target configuration file according to the target table; constructing a multi-dimensional stereogram corresponding to the target configuration file based on the multiple dimension information, wherein the target table includes a table including dimension information corresponding to each configuration parameter in the second level and a table reflecting the configuration parameter type, the multi-dimensional stereogram is used to reflect the distance between data nodes and service nodes, the data node is reflected as the name of the configuration parameter, the service node is used to reflect the server, and the multi-dimensional stereogram is used to determine the server used to load the data node.
2. The method according to claim 1, characterized in that, The step of generating at least one result sub-information corresponding to the nth level based on the at least one piece of association information and the record information of each configuration parameter in the nth level includes: for each piece of association information, determining the record information of the configuration parameter corresponding to the association information in the nth level; and generating the result sub-information corresponding to the nth level based on the association information and the record information of the configuration parameter corresponding to the association information.
3. The method according to claim 1, characterized in that, The name of the second table is determined based on the associated information in the result sub-information.
4. A document processing apparatus, comprising: A reading module is used to read the target configuration file and obtain its hierarchical information, wherein the target configuration file includes N levels, where N is an integer greater than or equal to 1. An analysis module is used to analyze the configuration parameters of each level in the target configuration file based on its hierarchical information to obtain result information of the target configuration file, wherein the result information includes record information and association information of the configuration parameters at each level in the target configuration file; wherein, the step of analyzing the configuration parameters of each level in the target configuration file based on its hierarchical information to obtain the result information of the target configuration file includes: for the target... At the nth level of the configuration file, based on the information corresponding to the nth level in the hierarchical information, the parameter type of each configuration parameter at the nth level of the target configuration file is obtained, where n is an integer greater than or equal to 1 and less than or equal to N; based on the hierarchical information of the target configuration file, at least one result sub-information corresponding to the nth level is generated, wherein generating at least one result sub-information corresponding to the nth level based on the hierarchical information of the target configuration file includes: based on the hierarchical information of the target configuration file, obtaining at least one association information between the nth level and the (n-1)th level in the target configuration file; based on the information corresponding to the nth level in the hierarchical information... The process involves obtaining the record information for each configuration parameter in the nth level; generating at least one result sub-information corresponding to the nth level based on the at least one associated information and the record information for each configuration parameter in the nth level, wherein the number of associated information and the number of result sub-information are the same; if there are configuration parameters of object or array type in the configuration parameters of the nth level, the operation of generating result sub-information is returned, and n is incremented; if the parameter type of the configuration parameters in the nth level is all scalar, the recursion is terminated and the result information of the target configuration file is obtained based on the at least one result sub-information of each level in the target configuration file; The generation module is configured to generate target statements corresponding to the target configuration file based on the record information and association information of the configuration parameters at each level. The target statements include statements corresponding to each result sub-information, and include a first target statement and a second target statement. The record information includes the name and value of the configuration parameters. The generation module includes: a second generation sub-module, configured to generate a first target statement corresponding to each result sub-information based on the record information in the result sub-information; and a third generation sub-module, configured to generate a second target statement corresponding to the result sub-information based on the record information and association information in the result sub-information.An execution module is used to import configuration parameters from the target configuration file into a database by executing the target statement. The second table corresponding to each result sub-information is obtained by executing the statement corresponding to each result sub-information. The table name of the second table is determined based on the association information in the result sub-information, so as to reflect the association between tables based on the table name. The execution module includes: a fourth generation submodule, used to generate a first table corresponding to each result sub-information by executing the first target statement corresponding to the result sub-information, wherein the first table includes the names of the configuration parameters in the result sub-information; and a fifth generation submodule, used to, based on the first table, import the configuration parameters from the result sub-information into a database by executing the second target statement corresponding to the result sub-information. The values corresponding to the names of the configuration parameters are inserted into the first table to generate the second table; an import submodule is used to import the second table corresponding to each result sub-information into the database; the device further includes: an acquisition module for acquiring a target table from the database; a determination module for determining multiple dimension information corresponding to the target configuration file based on the target table; and a construction module for constructing a multi-dimensional stereoscopic graph corresponding to the target configuration file based on the multiple dimension information, wherein the target table includes a table containing dimension information corresponding to each configuration parameter in the second level and a table reflecting the type of the configuration parameter, the multi-dimensional stereoscopic graph is used to reflect the distance between data nodes and service nodes, the data node is represented by the name of the configuration parameter, the service node is used to represent the server, and the multi-dimensional stereoscopic graph is used to determine the server used to load the data node.
5. An electronic device, comprising: One or more processors; A storage device for storing one or more programs, wherein 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 perform the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 3.
7. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Data migration method and device
CN104462119A
Configuration file generation method and device and computer readable storage medium
CN115204128A