File generation method and device, electronic equipment and storage medium

By using a file conversion device to parse, process, and integrate EtherCAT network configuration files, the compatibility issues caused by the diversity of EtherCAT network configuration software are resolved, enabling efficient generation of network configuration files and improving device integration and interoperability.

CN119676072BActive Publication Date: 2026-01-20GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411685172.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2026-01-20
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The diverse nature of EtherCAT network configuration software leads to significant differences in parameter combinations and structural layouts in the ENI files of the same type of slave devices, resulting in compatibility challenges during network configuration.

Method used

By constructing a file conversion device, including a parsing module, an algorithm module, a storage module, and a creation module, the device imports a first network configuration file generated by network configuration software, performs parsing, algorithm processing, and integration, and generates a second network configuration file adapted to the target device.

Benefits of technology

It greatly saves time and cost in generating network configuration files, and improves the flexibility of network configuration and the integration and interoperability of devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676072B_ABST
    Figure CN119676072B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a file generation method and device, electronic equipment and storage medium, and relate to the technical field of file processing. The method comprises: importing a first network configuration file generated by network configuration software, wherein the first network configuration file comprises a plurality of node information; calling a parsing module to parse the node information, obtaining parsing content corresponding to the node information, and importing the parsing content into an algorithm module; calling the algorithm module to perform algorithm processing on the parsing content, obtaining algorithm processing content corresponding to the node information, and storing the parsing content and the algorithm processing content into the storage module; and calling a creation module to respond to a network configuration instruction for a target device, integrating the parsing content and the algorithm processing content according to the network configuration instruction, and creating a second network configuration file for the target device, thereby improving compatibility in the network configuration process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of file processing, in particular to a file generation method, a file generation device, an electronic device and a computer readable storage medium. BACKGROUND

[0002] EtherCAT (Ethernet for Control Automation Technology) is a high-speed real-time network communication protocol in the field of industrial automation, which has the advantages of high-speed communication, flexibility and scalability, making it very popular in the field of industrial robots and machine tools. Among them, the ENI file (EtherCAT Network Interface) plays a core role in the generation, management and maintenance of EtherCAT files, ensuring that the network configuration, management and operation of industrial robots and machine tools can be carried out efficiently and reliably. However, due to the diversified characteristics of EtherCAT network configuration software, it is easy for the same type of slave device to have significant differences in the ENI files generated by different EtherCAT network configuration software, which exacerbates the compatibility challenges in the network configuration process. SUMMARY

[0003] The embodiments of the present application provide a file generation method, device, electronic device and computer readable storage medium to solve or partially solve the problem of poor compatibility in the network configuration process of the device.

[0004] The embodiments of the present application disclose a file generation method applied to a file conversion device, wherein the file conversion device at least includes an analysis module, an algorithm module connected with the analysis module, a storage module connected with the algorithm module, and a creation module connected with the storage module, and the method comprises the following steps:

[0005] Importing a first network configuration file generated by a network configuration software, wherein the first network configuration file includes a plurality of node information;

[0006] Calling the analysis module to analyze the node information, obtaining analysis content corresponding to the node information, and importing the analysis content into the algorithm module;

[0007] Calling the algorithm module to perform algorithm processing on the analysis content, obtaining algorithm processing content corresponding to the node information, and storing the analysis content and the algorithm processing content into the storage module;

[0008] The creating module is invoked to create a second network configuration file for the target device in response to a network configuration instruction for the target device, integrate the parsed content and the algorithm processing content according to the network configuration instruction, and create the second network configuration file for the target device, wherein the second network configuration file has a different file format from the first network configuration file, and the target device is configured for network according to the second network configuration file.

[0009] In some possible embodiments, the node information includes a plurality of node sets, the parsing of the node information includes:

[0010] Obtaining a node path corresponding to each node set, and obtaining node content corresponding to each node path;

[0011] Obtaining a structure for the node content, and adding the node content to the structure to obtain parsed content corresponding to the node information.

[0012] In some possible embodiments, the node sets include at least a Master node set, a Slave node set, a Cyclic node set, and a ProcessImage node set, and the obtaining of the node path corresponding to each node set includes:

[0013] Obtaining a first node path corresponding to the Master node set, a second node path corresponding to the Slave node set, a third node path corresponding to the Cyclic node set, and a fourth node path corresponding to the ProcessImage node set.

[0014] In some possible embodiments, the obtaining of the node content corresponding to each node path includes:

[0015] Obtaining first node content of the Master node set through the first node path;

[0016] Obtaining second node content of the Slave node set through the second node path;

[0017] Obtaining third node content of the Cyclic node set through the third node path;

[0018] Obtaining fourth node content of the ProcessImage node set through the fourth node path.

[0019] In some possible embodiments, the parsing module is configured with a parsing function, and the adding of the node content to the structure to obtain the parsed content corresponding to the node information includes:

[0020] adding the first node content into a preset structure through the parsing function to obtain a first target structure corresponding to the Master node set;

[0021] adding the second node content into a preset structure through the parsing function to obtain a second target structure corresponding to the Slave node set;

[0022] adding the third node content into a preset structure through the parsing function to obtain a third target structure corresponding to the Cyclic node set;

[0023] adding the fourth node content into a preset structure through the parsing function to obtain a fourth target structure corresponding to the ProcessImage node set.

[0024] In some possible embodiments, the algorithm processing of the parsed content to obtain algorithm processing content corresponding to the node information comprises:

[0025] identifying a specific node in the first network configuration file from the node information, and extracting an associated node corresponding to the specific node, data corresponding to the specific node being different in different network configuration files;

[0026] obtaining a fifth node path corresponding to the specific node, extracting fifth node content corresponding to the specific node from the fifth node path, adding the fifth node content into a preset structure, and obtaining a fifth target structure corresponding to the specific node;

[0027] obtaining a sixth node path corresponding to the associated node, extracting sixth node content corresponding to the associated node from the sixth node path, adding the sixth node content into a preset structure, and obtaining a sixth target structure corresponding to the associated node.

[0028] In some possible embodiments, the parsed content at least includes the first target structure, the second target structure, the third target structure and the fourth target structure, the algorithm processing content at least includes the fifth target structure and the sixth target structure, the creation module is configured with a creation function, and the second network configuration file for the target device is created by integrating the parsed content and the algorithm processing content according to the network configuration instruction for the target device in response to the network configuration instruction for the target device, comprising:

[0029] in response to the network configuration instruction for the target device, obtaining a file format suitable for the target device, and determining a file structure corresponding to the file format, the file structure including an element bit;

[0030] obtaining a sequence corresponding to the creation function, and extracting elements corresponding to the first target structure, the second target structure, the third target structure, the fourth target structure, the fifth target structure and the sixth target structure in the sequence, and adding the elements to the element bit, to create a second network configuration file for the target device.

[0031] In some possible embodiments, the first network configuration file includes setting information, and the method further includes:

[0032] If the setting information is detected in the first network configuration file through a pointer, the first network configuration file is parsed by the parsing module to obtain the setting information.

[0033] The setting information is added to a preset structure to obtain a seventh target structure.

[0034] The setting information at least includes whether to set a DC mode, a communication period or an initialization configuration.

[0035] The embodiment of the application further discloses a file conversion device, which at least includes a parsing module, an algorithm module connected with the parsing module, a storage module connected with the algorithm module and a creation module connected with the storage module, wherein,

[0036] The parsing module is used for importing a first network configuration file generated by network configuration software, the first network configuration file includes a plurality of node information, and the node information is parsed to obtain parsing content corresponding to the node information, and the parsing content is imported into the algorithm module.

[0037] The algorithm module is used for algorithm processing the parsing content to obtain algorithm processing content corresponding to the node information, and the parsing content and the algorithm processing content are stored in the storage module.

[0038] The creation module is used for responding to a network configuration instruction for a target device, integrating the parsing content and the algorithm processing content according to the network configuration instruction, creating a second network configuration file for the target device, the file format of the second network configuration file is different from that of the first network configuration file, and the target device performs network configuration according to the second network configuration file.

[0039] In some possible embodiments, the node information includes a plurality of node sets, and the parsing module is specifically used for:

[0040] acquire node paths corresponding to each of the node sets, and acquire node contents corresponding to each of the node paths;

[0041] acquire a structure for the node contents, and add the node contents into the structure to obtain parsed contents corresponding to the node information.

[0042] In some possible embodiments, the node sets at least include a Master node set, a Slave node set, a Cyclic node set, and a ProcessImage node set, and the parsing module is specifically configured to:

[0043] acquire a first node path corresponding to the Master node set, a second node path corresponding to the Slave node set, a third node path corresponding to the Cyclic node set, and a fourth node path corresponding to the ProcessImage node set.

[0044] In some possible embodiments, the parsing module is specifically configured to:

[0045] acquire first node contents of the Master node set through the first node path;

[0046] acquire second node contents of the Slave node set through the second node path;

[0047] acquire third node contents of the Cyclic node set through the third node path;

[0048] acquire fourth node contents of the ProcessImage node set through the fourth node path.

[0049] In some possible embodiments, the parsing module is configured with a parsing function, and the parsing module is specifically configured to:

[0050] add the first node contents into a preset structure through the parsing function to obtain a first target structure corresponding to the Master node set;

[0051] add the second node contents into a preset structure through the parsing function to obtain a second target structure corresponding to the Slave node set;

[0052] add the third node contents into a preset structure through the parsing function to obtain a third target structure corresponding to the Cyclic node set;

[0053] add the fourth node contents into a preset structure through the parsing function to obtain a fourth target structure corresponding to the ProcessImage node set.

[0054] In some possible embodiments, the algorithm processing module is configured to:

[0055] identify a specific node in the first network configuration file from the node information, and extract an associated node corresponding to the specific node, data corresponding to the specific node being different in different network configuration files;

[0056] obtain a fifth node path corresponding to the specific node, extract a fifth node content corresponding to the specific node from the fifth node path, add the fifth node content to a preset structure, and obtain a fifth target structure corresponding to the specific node;

[0057] obtain a sixth node path corresponding to the associated node, extract a sixth node content corresponding to the associated node from the sixth node path, add the sixth node content to a preset structure, and obtain a sixth target structure corresponding to the associated node.

[0058] In some possible embodiments, the parsed content includes at least a first target structure, a second target structure, a third target structure, and a fourth target structure, the algorithm processing content includes at least a fifth target structure and a sixth target structure, the creation module is configured with a creation function, and the creation module is specifically configured to:

[0059] in response to a network configuration instruction for a target device, obtain a file format applicable to the target device, and determine a file structure corresponding to the file format, the file structure including an element bit;

[0060] obtain an order corresponding to the creation function, extract corresponding elements from the first target structure, the second target structure, the third target structure, the fourth target structure, the fifth target structure, and the sixth target structure according to the order, and add the elements to the element bit, to create a second network configuration file for the target device.

[0061] In some possible embodiments, the first network configuration file includes setting information; and

[0062] The parsing module is further configured to, if it is detected through a pointer that the setting information exists in the first network configuration file, call the parsing module to parse the first network configuration file, and obtain the setting information.

[0063] The creation module is further configured to add the setting information to a preset structure, and obtain a corresponding seventh target structure.

[0064] The setting information at least includes whether to set a DC mode, a communication period, or an initialization configuration.

[0065] The application also discloses an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.

[0066] The memory is used for storing a computer program.

[0067] The processor is used for executing the program stored on the memory, and realizes the method as described in the embodiments of the application.

[0068] The application also discloses a computer readable storage medium, which stores instructions, and when executed by one or more processors, makes the processor execute the method as described in the embodiments of the application.

[0069] The embodiments of the application have the following advantages:

[0070] In the embodiments of the application, the file conversion device can import the first network configuration file generated by the network configuration software, the first network configuration file includes a plurality of node information; the node information is parsed by calling the parsing module to obtain the parsed content corresponding to the node information, and the parsed content is imported into the algorithm module; the algorithm processing content corresponding to the node information is obtained by calling the algorithm module to perform algorithm processing on the parsed content, and the parsed content and the algorithm processing content are stored in the storage module; the second network configuration file for the target device is created by calling the creation module in response to the network configuration instruction for the target device, the parsed content and the algorithm processing content are integrated according to the network configuration instruction, and the file format of the second network configuration file is different from that of the first network configuration file, and the target device is configured according to the second network configuration file, so that the imported network configuration file is parsed, algorithm processed, stored and created through the mutual cooperation between the parsing module, the algorithm module, the storage module and the creation module in the file conversion device, another network configuration file suitable for the target device can be constructed, the time and cost for generating the network configuration file are greatly saved, and based on the fact that the generated network configuration file is suitable for the corresponding target device, the network configuration flexibility is improved, and the integration and interoperability of the device are promoted. BRIEF DESCRIPTION OF DRAWINGS

[0071] Figure 1 is a step flowchart of a file generation method provided in the embodiments of the application;

[0072] Figure 2 Fig. 1 is a structural schematic diagram of a file conversion device provided in an embodiment of the present application;

[0073] Figure 3 Fig. 2 is a structural schematic diagram of an EtherCAT ENI file provided in an embodiment of the present application;

[0074] Figure 4 Fig. 3 is a flowchart of an ENI file parsing and creating process provided in an embodiment of the present application;

[0075] Figure 5 Fig. 4 is a structural block diagram of a file generation device provided in an embodiment of the present application;

[0076] Figure 6 Fig. 5 is a block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] In order to make the above objectives, features and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0078] As an example, due to the diversified characteristics of EtherCAT network configuration software, for the same type of slave station device, significant differences exist in the ENI (Environment INI) files generated by different EtherCAT network configuration software, which intensifies the compatibility challenge in the network configuration process.

[0079] To this end, in the present application, a corresponding file conversion device is constructed, and the network configuration file generated by the network configuration software is converted by the file conversion device to obtain a new network configuration file adapted to the target device. Specifically, the file conversion device can include a parsing module, an algorithm module connected to the parsing module, a storage module connected to the algorithm module, and a creation module connected to the storage module. The first network configuration file generated by the network configuration software can be imported, and the first network configuration file includes a plurality of node information. The parsing module is called to parse the node information to obtain parsed content corresponding to the node information, and the parsed content is imported into the algorithm module. The algorithm module is called to perform algorithm processing on the parsed content to obtain algorithm processing content corresponding to the node information, and the parsed content and the algorithm processing content are stored in the storage module. The creation module is called to respond to the network configuration instruction for the target device, integrates the parsed content and the algorithm processing content according to the network configuration instruction, and creates a second network configuration file for the target device. The file format of the second network configuration file is different from that of the first network configuration file. The target device performs network configuration according to the second network configuration file. Thus, by mutual cooperation between the parsing module, the algorithm module, the storage module, and the creation module in the file conversion device, the imported network configuration file is parsed, algorithm processed, stored, and created, another network configuration file adapted to the target device can be constructed, the time and cost for generating the network configuration file are greatly saved, and based on the fact that the generated network configuration file is applicable to the corresponding target device, not only the configuration flexibility of the network can be improved, but also the integration and interoperability of the device can be promoted.

[0080] It should be noted that the embodiments of the present application can be applied to the field of industrial robots and machine tools. In these fields, the diversification characteristics of the EtherCAT network configuration software result in significant differences in parameter combination and structural layout of the ENI files generated by different EtherCAT network configuration software for the same type of slave driver.

[0081] In some exemplary application scenarios, for device integration and debugging, different EtherCAT network configuration software may be used by different device suppliers during the integration process of industrial robots and machine tools. For example, one supplier uses TwinCAT software, and another supplier uses Automation Studio software. Different file formats of ENI files can be generated based on different software. Therefore, due to the differences in parameter combination and structural layout of the ENI files generated by different software, the integration engineer needs to spend additional time and effort to understand and parse these files to ensure that all devices can be correctly configured and communicated.

[0082] For network configuration and maintenance, during the network configuration and maintenance process, network administrators may need to handle ENI files from different vendors. For example, a factory may use equipment from multiple vendors at the same time, and each vendor provides ENI files in different formats. Therefore, network administrators need to have knowledge of multiple EtherCAT network configuration software to correctly parse and configure these files. In addition, during the maintenance process, it may be necessary to regularly update ENI files to ensure network configuration consistency and compatibility.

[0083] For system upgrade and expansion, during the system upgrade and expansion process, new devices may need to be added or existing devices may need to be updated. For example, a machine tool manufacturer may need to upgrade the control system and add new sensors or actuators. Due to the different formats of ENI files generated by different software, the network may need to be reconfigured during system upgrade and expansion to ensure that new devices are compatible with the existing network. This may involve manually adjusting ENI files or using automated tools for format conversion.

[0084] For cross-platform compatibility, in cross-platform applications, switching between different control systems and network configuration software may be required. For example, a company may switch from one control system to another or share devices between different factories. Due to the different formats of ENI files generated by different software, cross-platform compatibility becomes an important issue. Compatibility tools need to be developed and used to ensure that ENI files can be correctly parsed and configured between different platforms.

[0085] Referring to Figure 1 , a step flowchart of a file generation method provided in an embodiment of the present application is shown, which is applied to a file conversion device, the file conversion device at least includes a parsing module, an algorithm module connected with the parsing module, a storage module connected with the algorithm module, and a creation module connected with the storage module, and can specifically include the following steps:

[0086] Step 101, importing a first network configuration file generated by network configuration software, the first network configuration file including a plurality of node information;

[0087] In an embodiment of the present application, the file conversion device can be a tool designed by the user for converting TwinCAT ENI files. It can be an application program, plug-in, script, etc. running on an electronic terminal. Through the file conversion device, the ENI file (i.e. network configuration file, in the following embodiments, ENI file refers to network configuration file) generated by EtherCAT network configuration software can be converted into another ENI file format suitable for the target device.

[0088] For the ENI file, it can be a file used to describe the configuration and communication configuration of an automation system. Through the ENI file, the hardware configuration, software configuration, network configuration and device communication and other related parameters of the corresponding device running time can be described. Optionally, the ENI file can adopt an XML (eXtensible Markup Language) format, and contain configuration information of hardware, software and communication nodes. The ENI file plays a key role in an industrial automation system, and can ensure the accuracy and consistency of system configuration.

[0089] In an example, referring to Figure 2 , a structural schematic diagram of a file conversion device provided in an embodiment of the present application is shown, which can include a parsing module, an algorithm module, a storage module and a creation module. The parsing module can be used to parse the ENI file and store the parsed content in the storage module. The algorithm module can be used to perform algorithm processing on part of the nodes in the ENI file and store the processed content in the storage module. The creation module can be used to create an ENI file in a self-required format according to the content stored in the storage module, that is, to convert the ENI file in a first file format into an ENI file in a second file format. For the file conversion device, by importing a TwinCAT ENI file, the ENI file in a self-required format can be exported through the processing of the four units of the parsing module, the algorithm module, the storage module and the creation module.

[0090] In a specific implementation, the first network configuration file that needs to be converted can be determined first. The first network configuration file can include a plurality of node information, and different node information can include different parameters. The node information can include a Master node set, a Slave node set, a Cyclic node set and a ProcessImage node set.

[0091] In an example, referring to Figure 3 , a structural schematic diagram of an EtherCAT ENI file provided in an embodiment of the present application is shown. For the Master node set, it can include:

[0092] Info (node set): contains the basic information of the master station (Master), such as the name of the master station, the version number, the configuration parameters, etc. These information are used to identify and manage the master station.

[0093] InitCmds (node set): contains the initialization commands of the master station, which are used to perform specific initialization operations when the network starts, such as configuring network parameters, starting communication, etc.

[0094] For the Slave node set, it can include:

[0095] Info (Node Set): Contains basic information from the slave, such as the name, type, physical address, etc. These information is used to identify and manage the slave.

[0096] ProcessData (Node Set): Contains real-time data processing information from the slave, such as data mapping, data transmission period, etc. These information is used to ensure that the slave can efficiently process and transmit real-time data.

[0097] Mailbox (Node Set): Contains mailbox communication information from the slave, used to handle non-real-time data transmission and control commands. Mailbox communication is usually used to configure the slave, send control commands, etc.

[0098] InitCmds (Node Set): Contains initialization commands from the slave, used to perform specific initialization operations when the slave starts, such as configuring slave parameters, starting communication, etc.

[0099] For Cyclic Node Set, it can include:

[0100] Cmd (Node Set): Contains cyclic command information, used to periodically perform specific operations, such as data acquisition, status update, etc.

[0101] Irpuls (Node Set): Contains pulse signal information, used to handle periodic pulse signals, such as timers, counters, etc.

[0102] For ProcessImage Node Set, it can include:

[0103] Outputs (Node Set): Contains output data information, used to define the output data mapping of the slave, such as control signals, status signals, etc.

[0104] Step 102, calling the parsing module to parse the node information, obtaining the parsing content corresponding to the node information, and importing the parsing content into the algorithm module;

[0105] After importing the first network configuration file into the file conversion device, the file conversion device can call the parsing module to parse the node information, obtain the parsing content corresponding to the node information, and import the parsing content into the algorithm module, and store the parsing content in the storage module.

[0106] Among them, as in the above embodiment, the node information includes a plurality of node sets, the parsing module can first obtain the node path corresponding to each node set, obtain the node content corresponding to each node path, then obtain the structure body for the node content, and add the node content to the structure body, to obtain the parsing content corresponding to the node information.

[0107] In a specific implementation, for the Master node set, the Slave node set, the Cyclic node set and the ProcessImage node set, the parsing module can first acquire a first node path corresponding to the Master node set, a second node path corresponding to the Slave node set, a third node path corresponding to the Cyclic node set and a fourth node path corresponding to the ProcessImage node set. Then, the first node content of the Master node set is acquired through the first node path, the second node content of the Slave node set is acquired through the second node path, the third node content of the Cyclic node set is acquired through the third node path, and the fourth node content of the ProcessImage node set is acquired through the fourth node path. Then, the parsing module is configured with a corresponding parsing function, and the parsing module can add the first node content to a preset structure body through the parsing function to obtain a first target structure body corresponding to the Master node set, add the second node content to the preset structure body to obtain a second target structure body corresponding to the Slave node set, add the third node content to the preset structure body to obtain a third target structure body corresponding to the Cyclic node set, and add the fourth node content to the preset structure body to obtain a fourth target structure body corresponding to the ProcessImage node set.

[0108] It should be noted that the structure body can be a file structure with a pre-designed parameter combination mode and structure layout. In the parsing process, the parsing functions corresponding to each node set are the same, and the parsing paths are different. By inputting the node paths corresponding to the nodes into the parsing function, the parsing function calls the content acquisition function through the path to acquire the node content corresponding to the nodes, and then assigns the node content to the defined structure body to obtain the corresponding target structure body. The target structure body is stored in the storage module for use by the subsequent creation module.

[0109] Step 103, calling the algorithm module to perform algorithm processing on the parsed content to obtain algorithm processing content corresponding to the node information, and storing the parsed content and the algorithm processing content in the storage module.

[0110] In the process of processing the first network configuration file, part of the nodes in the file need to be processed by an algorithm. Therefore, the algorithm module can be called to perform algorithm processing on the parsed content to obtain algorithm processing content corresponding to the node information, and the parsed content and the algorithm processing content can be stored in the storage module.

[0111] In a specific implementation, a specific node in the first network configuration file can be identified from the node information, and an associated node corresponding to the specific node is extracted. The data corresponding to the specific node is different in different network configuration files. Then, a fifth node path corresponding to the specific node is obtained, and a fifth node content corresponding to the specific node is extracted from the fifth node path. The fifth node content is added to the preset structure to obtain a fifth target structure corresponding to the specific node. A sixth node path corresponding to the associated node is obtained, and a sixth node content corresponding to the associated node is extracted from the sixth node path. The sixth node content is added to the preset structure to obtain a sixth target structure corresponding to the associated node.

[0112] It should be noted that in the process of analyzing the TwinCAT ENI file, the algorithm processing step is responsible for processing certain special nodes in the ENI file. The data of these special nodes may be different in different ENI files, but they have a corresponding relationship with other nodes. By applying a specific algorithm, new or improved data can be generated to meet the needs of subsequent creation of ENI files in the required format.

[0113] In an example, assume that the ENI file describes the network configuration of an industrial automation system, and the algorithm module needs to identify a specific node (such as the "EthernetConfig" node) from these files and extract an associated node (such as the "IPAddress" node) that has a corresponding relationship with it. Then, according to the specific node path, the relevant content is extracted and added to the preset structure. For example, an example ENI file fragment can be:

[0114] <enifile>

[0115] <networkconfig>

[0116] <ethernetconfig>

[0117] <interface>eth0< / interface>

[0118] <speed>100 Mbps< / speed>

[0119] < / ethernetconfig>

[0120] <ipaddress>

[0121] <address>192.168.1.100< / address>

[0122] <subnetmask> 255.255.255.0< / subnetmask>

[0123] < / ipaddress>

[0124] <gateway>

[0125] <address>192.168.1.1< / address>

[0126] < / gateway>

[0127] < / networkconfig>

[0128] < / enifile>

[0129] For the above file fragment, the algorithm module can perform the following corresponding process:

[0130] 1. Identify the specific node and the associated node

[0131] Identify the "EthernetConfig" node from the node information.

[0132] Assume that the "EthernetConfig" node is the specific node we need to process.

[0133] Identify the associated node "IPAddress" that has a corresponding relationship with the "EthernetConfig" node.

[0134] The associated node "IPAddress" contains network configuration information related to the "EthernetConfig" node.

[0135] 2. Extracting the path and content of a specific node and an associated node

[0136] 1) Obtain the fifth node path of the specific node:

[0137] Suppose the fifth node path of the "EthernetConfig" node is " / ENIFile / NetworkConfig / EthernetConfig / Speed".

[0138] 2) Extract the fifth node content of the specific node:

[0139] Extract the fifth node content "100Mbps" of the "EthernetConfig" node from the fifth node path.

[0140] 3) Add the fifth node content to the preset structure:

[0141] Add "100Mbps" to the preset structure to obtain the fifth target structure corresponding to the specific node.

[0142] 4) Obtain the sixth node path of the associated node:

[0143] Suppose the sixth node path of the "IPAddress" node is " / ENIFile / NetworkConfig / IPAddress / Address".

[0144] 5) Extract the sixth node content of the associated node:

[0145] Extract the sixth node content "192.168.1.100" of the "IPAddress" node from the sixth node path.

[0146] 6) Add the sixth node content to the preset structure:

[0147] Add "192.168.1.100" to the preset structure to obtain the sixth target structure corresponding to the associated node.

[0148] Suppose the preset structure is used to store the extracted content:

[0149]

[0150] Then, for the assignment of the structure:

[0151] ① Fifth node content assignment:

[0152] networkConfig.ethernetSpeed = strdup("100Mbps");

[0153] ② Sixth node content assignment:

[0154] networkConfig.ipAddress = strdup("192.168.1.100");

[0155] Through the above steps, the algorithm module can identify and extract the relevant content of the "EthernetConfig" node and the "IPAddress" node, and assign these contents to the preset structure. Finally, a structure containing network configuration information is obtained:

[0156] NetworkConfigStruct networkConfig = {

[0157] .ethernetSpeed = "100Mbps",

[0158] .ipAddress = "192.168.1.100"};

[0159] Through the above process, specific nodes and associated nodes can be identified, their paths and contents can be extracted, and these contents can be added to the preset structure. We successfully extracted the required network configuration information from the network configuration file. This method ensures the accuracy and consistency of the data, facilitating subsequent network configuration management.

[0160] Step 104, calling the creation module to integrate the parsed content and the algorithm processing content according to the network configuration instruction for the target device, and creating a second network configuration file for the target device according to the network configuration instruction. The file format of the second network configuration file is different from that of the first network configuration file, and the target device performs network configuration according to the second network configuration file.

[0161] In the embodiment of the present application, when the parsed content corresponding to the node information is parsed by the parsing module, and the corresponding algorithm processing content is obtained by the algorithm module for algorithm processing on the specific node, the creation module can be further called to respond to the network configuration instruction for the target device, and the parsed content and the algorithm processing content stored in the storage module are integrated according to the network configuration instruction to create a second network configuration file for the target device, so that the imported network configuration file is parsed, algorithm processed, stored and created through the mutual cooperation between the parsing module, the algorithm module, the storage module and the creation module in the file conversion device. Another network configuration file suitable for the target device can be constructed, which greatly saves the time and cost of generating the network configuration file. At the same time, since the generated network configuration file is suitable for the corresponding target device, based on this, not only the configuration flexibility of the network can be improved, but also the integration and interoperability of the device can be promoted.

[0162] For the above embodiment, the parsed content includes at least the first target structure, the second target structure, the third target structure and the fourth target structure, the algorithm processing content includes at least the fifth target structure and the sixth target structure, and the creation module is configured with a creation function. Then, the creation module can respond to the network configuration instruction for the target device, obtain a file format suitable for the target device, determine a file structure corresponding to the file format, the file structure includes an element bit, obtain the sequence of the creation function, and extract the corresponding elements from the first target structure, the second target structure, the third target structure, the fourth target structure, the fifth target structure and the sixth target structure according to the sequence, and add the elements to the element bit to create a second network configuration file for the target device.

[0163] It should be noted that the creation function is called in the creation process, and the elements contained in different node sets are different, so the creation function can be defined to add the corresponding elements to the corresponding element bit in the file structure. Specifically, the parsed parsed content and algorithm processing content can be filled according to the sequence of the creation function, which is not limited by the present application. It can be understood that the structure is a structure in C language defined according to the node set contained in the ENI file, which contains the corresponding elements in the structure.

[0164] In addition, the influence of different settings of TwinCAT software on ENI file also needs to be considered in the file conversion process. Different settings will affect the number of related nodes and the content contained in the nodes, thereby affecting the parsing, processing and creation of related content.

[0165] In a specific implementation, the first network configuration file includes setting information, if it is detected through a pointer that the setting information exists in the first network configuration file, a parsing module is called to parse the first network configuration file to obtain the setting information, then the setting information is added to a preset structure to obtain a corresponding seventh target structure, so as to add the content contained in the seventh target structure to a file structure, and the integrity of the file content is ensured. The setting information at least includes one of whether to set a DC mode, a communication period and initialization configuration.

[0166] It should be noted that the TwinCAT software has settings such as a DC mode, a communication period and initialization configuration, and the ENI file generated by selecting these configurations is also different, for example: if the DC (Distributed Clock Mode) mode is selected, then a corresponding DC node set containing some DC parameters will be added in the ENI file. Similarly, the TwinCAT software sets the communication period and initialization, and some corresponding nodes will be added or reduced. Changing the DC mode, the communication period and the initialization value will also change the corresponding DC, communication period and initialization node value. In the parsing process, the corresponding node path of the DC mode, the communication period and the initialization configuration will be added, and if the corresponding node exists in the parsing process, then the parsing function can obtain the content of the corresponding node and assign it to the corresponding structure. If there is no corresponding node, the parsing function cannot obtain the node, and an empty node will be displayed and the node creation will be skipped.

[0167] It should be noted that the embodiments of the present application include but are not limited to the above examples, and it can be understood that those skilled in the art can also set according to actual needs under the guidance of the idea of the embodiments of the present application, and the present application does not limit this.

[0168] In the embodiment of the present application, the file conversion device can include a parsing module, an algorithm module connected with the parsing module, a storage module connected with the algorithm module, and a creating module connected with the storage module. The first network configuration file generated by the network configuration software can be imported, and the first network configuration file includes a plurality of node information. The parsing module is called to parse the node information to obtain the parsed content corresponding to the node information, and the parsed content is imported into the algorithm module. The algorithm module is called to perform algorithm processing on the parsed content to obtain the algorithm processing content corresponding to the node information, and the parsed content and the algorithm processing content are stored in the storage module. The creating module is called to respond to the network configuration instruction for the target device, integrate the parsed content and the algorithm processing content according to the network configuration instruction, create a second network configuration file for the target device, and the file format of the second network configuration file is different from that of the first network configuration file. The target device performs network configuration according to the second network configuration file, so that the imported network configuration file is parsed, algorithm processed, stored, and created through the mutual cooperation between the parsing module, the algorithm module, the storage module, and the creating module in the file conversion device. Another network configuration file suitable for the target device can be constructed, which greatly saves the time and cost of generating the network configuration file. At the same time, since the generated network configuration file is suitable for the corresponding target device, the network configuration flexibility can be improved, and the integration and interoperability of the device can be promoted.

[0169] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present application, the following will be exemplarily illustrated by corresponding examples:

[0170] As an example, the present application automatically parses the TwinCAT ENI file to generate a self-required format ENI file. For each EtherCAT ENI file, it can include four node sets, namely Master, Slave, Cyclic, and ProcessImage. The parsing module and the creating module can be divided into four parts. Through the automatic parsing and creating process, the present application can be divided into four modules, namely the parsing module, the algorithm module, the storage module, and the creating module. After the TwinCAT ENI file is imported and processed by the four modules, the ENI file in the self-required format can be created.

[0171] In the process of converting the file, for example, Figure 4The ENI file parsing creation flowchart is shown, and the TwinCAT ENI file automatic parsing creation can be divided into four processes: ① importing and parsing the TwinCAT ENI file, first importing the TwinCAT ENI file to be parsed into the system, and parsing each node in the TwinCAT ENI file by calling a parsing function through a parsing module; ② for some nodes in the TwinCAT ENI file, algorithm processing is required, and the parsed content of the corresponding node is placed into an algorithm module, and the algorithm module processes the content by some algorithms; ③ the node content parsed and algorithm-processed before is stored in a storage module; ④ in the creation process, a creation function is called through a creation module to create an ENI file in a self-required format, for example, the node set structure in the ENI file contains three parts A, B and C, and the creation module can create structures including B, A and C, C, B and A, and A, C and B according to the self-required ENI file format, and fill the corresponding content into the corresponding structure.

[0172] In addition, the influence of different TwinCAT software settings on the ENI file also needs to be considered, for example, whether to set the DC mode, the communication cycle, the initialization configuration and the like. Different settings will affect the number of related nodes and the content contained in the nodes. Whether there is a corresponding setting is determined through a pointer, so that the related content is parsed, processed and created.

[0173] Through the present application, the user can download the TwinCAT software by himself, scan the corresponding ENI file through the TwinCAT software, and then automatically parse and create a self-required ENI file format, which is suitable for parsing and creating under different TwinCAT software settings and is suitable for the corresponding driver. The present application provides a highly reliable, flexible, efficient and safe EtherCAT network configuration management scheme, which also greatly saves the time and cost of generating the ENI file.

[0174] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the action sequence described, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0175] Referring to Figure 5 , a structural block diagram of a file generation device provided in the embodiments of the present application is shown, and the file conversion device at least includes a parsing module, an algorithm module connected with the parsing module, a storage module connected with the algorithm module, and a creation module connected with the storage module, wherein,

[0176] The analysis module is configured to import a first network configuration file generated by network configuration software, the first network configuration file including node information; analyze the node information to obtain analysis content corresponding to the node information, and import the analysis content into the algorithm module;

[0177] The algorithm module is configured to perform algorithm processing on the analysis content to obtain algorithm processing content corresponding to the node information, and store the analysis content and the algorithm processing content in the storage module;

[0178] The creation module is configured to integrate the analysis content and the algorithm processing content according to a network configuration instruction for a target device in response to the network configuration instruction, create a second network configuration file for the target device, the file format of the second network configuration file being different from that of the first network configuration file, and the target device performing network configuration according to the second network configuration file.

[0179] In some possible embodiments, the node information includes a plurality of node sets, and the analysis module is specifically configured to:

[0180] Obtain a node path corresponding to each node set, and obtain node content corresponding to each node path;

[0181] Obtain a structure for the node content, add the node content to the structure, and obtain analysis content corresponding to the node information.

[0182] In some possible embodiments, the node sets include at least a Master node set, a Slave node set, a Cyclic node set, and a ProcessImage node set, and the analysis module is specifically configured to:

[0183] Obtain a first node path corresponding to the Master node set, a second node path corresponding to the Slave node set, a third node path corresponding to the Cyclic node set, and a fourth node path corresponding to the ProcessImage node set.

[0184] In some possible embodiments, the analysis module is specifically configured to:

[0185] Obtain first node content of the Master node set through the first node path;

[0186] Obtain second node content of the Slave node set through the second node path;

[0187] acquire third node content of the Cyclic node set through a third node path;

[0188] acquire fourth node content of the ProcessImage node set through a fourth node path.

[0189] In some possible embodiments, the parsing module is configured with a parsing function, and the parsing module is specifically configured to:

[0190] add the first node content into a preset structure through the parsing function to obtain a first target structure corresponding to the Master node set;

[0191] add the second node content into a preset structure through the parsing function to obtain a second target structure corresponding to the Slave node set;

[0192] add the third node content into a preset structure through the parsing function to obtain a third target structure corresponding to the Cyclic node set;

[0193] add the fourth node content into a preset structure through the parsing function to obtain a fourth target structure corresponding to the ProcessImage node set.

[0194] In some possible embodiments, the algorithm processing module is configured to:

[0195] identify a specific node in the first network configuration file from the node information, and extract an associated node corresponding to the specific node, wherein data corresponding to the specific node is different in different network configuration files;

[0196] acquire a fifth node path corresponding to the specific node, extract fifth node content corresponding to the specific node from the fifth node path, add the fifth node content into a preset structure, and obtain a fifth target structure corresponding to the specific node;

[0197] acquire a sixth node path corresponding to the associated node, extract sixth node content corresponding to the associated node from the sixth node path, add the sixth node content into a preset structure, and obtain a sixth target structure corresponding to the associated node.

[0198] In some possible embodiments, the parsing content at least includes the first target structure, the second target structure, the third target structure and the fourth target structure, the algorithm processing content at least includes the fifth target structure and the sixth target structure, the creation module is configured with a creation function, and the creation module is specifically configured to:

[0199] In response to the network configuration instruction for the target device, a file format applicable to the target device is acquired, and a file structure corresponding to the file format is determined, the file structure including an element bit;

[0200] An order corresponding to the creation function is acquired, and corresponding elements are extracted from the first target structure, the second target structure, the third target structure, the fourth target structure, the fifth target structure and the sixth target structure according to the order, and the elements are added to the element bit, thereby creating a second network configuration file for the target device.

[0201] In some possible embodiments, the first network configuration file includes setting information; wherein,

[0202] The analysis module is further configured to, if it is detected through the pointer that the setting information exists in the first network configuration file, call the analysis module to analyze the first network configuration file, and obtain the setting information.

[0203] The creation module is further configured to add the setting information to a preset structure, and obtain a seventh target structure corresponding to the setting information.

[0204] The setting information at least includes whether to set a DC mode, a communication period or an initialization configuration.

[0205] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts refer to the part of the method embodiment.

[0206] In addition, the embodiment of the present application further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor to implement each process of the above-mentioned file generation method embodiment and achieve the same technical effects. To avoid repetition, no further description is given here.

[0207] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, the computer program being executed by the processor to implement each process of the above-mentioned file generation method embodiment and achieve the same technical effects. To avoid repetition, no further description is given here. The computer readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, etc.

[0208] Figure 6A hardware structure schematic diagram of an electronic device for implementing various embodiments of the present application.

[0209] The electronic device 600 includes, but is not limited to, a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611, etc. Those skilled in the art can understand that the electronic device structure involved in the embodiments of the present application does not constitute a limitation on the electronic device, and the electronic device can include more or less components than the diagram, or combine certain components, or different component arrangements. In the embodiments of the present application, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, and a pedometer, etc.

[0210] It should be understood that in the embodiments of the present application, the radio frequency unit 601 can be used for receiving and sending signals in the process of information or call, specifically, receiving downlink data from a base station for the processor 610 to process, and sending uplink data to the base station. Generally, the radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 601 can also communicate with the network and other devices through a wireless communication system.

[0211] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users to send and receive emails, browse web pages, and access streaming media, etc.

[0212] The audio output unit 603 can convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output as a sound. Moreover, the audio output unit 603 can also provide audio output related to a specific function performed by the electronic device 600 (for example, a call signal receiving sound, a message receiving sound, etc.). The audio output unit 603 includes a speaker, a buzzer, and a receiver, etc.

[0213] The input unit 604 is configured to receive audio or video signals. The input unit 604 can include a graphic processing unit (GPU) 6041 and a microphone 6042. The graphic processing unit 6041 processes image data of a still picture or a video obtained by an image capture apparatus (e.g., a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 606. The image frame processed by the graphic processing unit 6041 can be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound and can process such sound as audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 601 in a telephone call mode.

[0214] The electronic device 600 further includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, where the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and when at rest, can detect the magnitude and direction of gravity, and can be used to identify the electronic device posture (such as screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, knock), and the like. The sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, which will not be described here.

[0215] The display unit 606 is configured to display information input by a user or information provided to the user. The display unit 606 can include a display panel 6061, which can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0216] The user input unit 607 can be used to receive inputted digital or character information, and to generate key signal input related to user settings of the electronic device and control of functions. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also called a touch screen, can collect a user's touch operation (such as a user's operation on or near the touch panel 6071 using a finger, a stylus, or any suitable object or accessory) on or near it. The touch panel 6071 can include two parts, a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects a signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 610, receives commands from the processor 610 and executes them. In addition, the touch panel 6071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 6071, the user input unit 607 can also include other input devices 6072. Specifically, the other input devices 6072 can include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, on / off buttons, etc.), trackballs, mice, joysticks, and the like, which will not be described here.

[0217] Further, the touch panel 6071 can be overlaid on the display panel 6061, and when the touch panel 6071 detects a touch operation on or near it, it transmits to the processor 610 to determine the type of touch event, and then the processor 610 provides corresponding visual output on the display panel 6061 according to the type of touch event. It can be understood that in one embodiment, the touch panel 6071 and the display panel 6061 are implemented as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0218] The interface unit 608 is an interface for connecting external devices to the electronic device 600. For example, the external devices can include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, an earphone port, and the like. The interface unit 608 can be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 600, or can be used to transmit data between the electronic device 600 and external devices.

[0219] The memory 609 is used to store software programs and various data. The memory 609 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), and the like. In addition, the memory 609 can include a high-speed random access memory, and can also include a nonvolatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0220] The processor 610 is a control center of the electronic device, connects all parts of the electronic device through various interfaces and lines, executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 609 and calling data stored in the memory 609, and thus performs overall monitoring on the electronic device. The processor 610 can include one or more processing units; preferably, the processor 610 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 610.

[0221] The electronic device 600 can further include a power supply 611 (such as a battery) for supplying power to various components; preferably, the power supply 611 can be logically connected to the processor 610 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.

[0222] In addition, the electronic device 600 includes some functional modules which are not shown and will not be described herein.

[0223] It should be noted that, in this document, the term “comprising” or “including” or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article, or device. Without more limitations, the element defined by the statement “including a…” does not exclude the presence of additional identical elements in the process, method, article, or device including the element.

[0224] Those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner, or network device) execute the method described in each embodiment of the present application.

[0225] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims under the inspiration of the present application, which all belong to the protection of the present application.

[0226] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0227] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0228] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0229] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0230] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0231] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the prior art that essentially contributes or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and various program code storage media.

[0232] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for generating a file, characterized in that, The method is applied to a file conversion device, the file conversion device including at least a parsing module, an algorithm module connected to the parsing module, a storage module connected to the algorithm module, and a creation module connected to the storage module, the method comprising: Import the first network configuration file generated by the network configuration software, which includes information about several nodes; The parsing module is invoked to parse the node information, obtain the parsed content corresponding to the node information, and import the parsed content into the algorithm module; The algorithm module is invoked to process the parsed content to obtain the algorithm-processed content corresponding to the node information, and the parsed content and the algorithm-processed content are stored in the storage module. The creation module is invoked in response to a network configuration instruction for the target device. Based on the network configuration instruction, the parsed content and the algorithm-processed content are integrated to create a second network configuration file for the target device. The second network configuration file has a different file format than the first network configuration file. The target device performs network configuration according to the second network configuration file. The step of performing algorithmic processing on the parsed content to obtain algorithmically processed content corresponding to the node information includes: Identify specific nodes in the first network configuration file from the node information, and extract associated nodes that correspond to the specific nodes. The data corresponding to the specific nodes are different in different network configuration files. Obtain the path of the fifth node corresponding to the specific node, extract the content of the fifth node corresponding to the specific node from the path of the fifth node, add the content of the fifth node to a preset structure, and obtain the fifth target structure corresponding to the specific node; Obtain the path of the sixth node corresponding to the associated node, extract the content of the sixth node corresponding to the associated node from the path of the sixth node, add the content of the sixth node to a preset structure, and obtain the sixth target structure corresponding to the associated node.

2. The method according to claim 1, characterized in that, The node information includes several node sets. Parsing the node information to obtain the parsed content corresponding to the node information includes: Obtain the node path corresponding to each of the node sets, and obtain the corresponding node content from each of the node paths; Obtain the structure for the node content, and add the node content to the structure to obtain the parsed content corresponding to the node information.

3. The method according to claim 2, characterized in that, The node set includes at least a Master node set, a Slave node set, a Cyclic node set, and a ProcessImage node set. Obtaining the node paths corresponding to each of the node sets includes: Obtain the first node path corresponding to the Master node set, the second node path corresponding to the Slave node set, the third node path corresponding to the Cyclic node set, and the fourth node path corresponding to the ProcessImage node set.

4. The method according to claim 3, characterized in that, The step of obtaining the corresponding node content from each of the node paths includes: The content of the first node in the Master node set is obtained through the first node path; The content of the second node in the Slave node set is obtained through the second node path; The content of the third node in the Cyclic node set is obtained through the third node path; The content of the fourth node of the ProcessImage node set is obtained through the fourth node path.

5. The method according to claim 4, characterized in that, The parsing module is configured with parsing functions. Adding the node content to the structure to obtain the parsed content corresponding to the node information includes: The parsing function adds the content of the first node to a preset structure to obtain the first target structure corresponding to the Master node set; The parsing function adds the content of the second node to a preset structure to obtain a second target structure corresponding to the Slave node set; The parsing function adds the content of the third node to a preset structure to obtain a third target structure corresponding to the Cyclic node set; The parsing function adds the content of the fourth node to a preset structure to obtain the fourth target structure corresponding to the ProcessImage node set.

6. The method according to claim 1, characterized in that, The parsed content includes at least a first target structure, a second target structure, a third target structure, and a fourth target structure; the algorithm-processed content includes at least a fifth target structure and a sixth target structure; the creation module is configured with a creation function; and in response to a network configuration command for the target device, the parsed content and the algorithm-processed content are integrated according to the network configuration command to create a second network configuration file for the target device, including: In response to a network configuration command for a target device, a file format suitable for the target device is obtained, and a file structure corresponding to the file format is determined, wherein the file structure includes element bits; Obtain the order of the creation functions, extract the corresponding elements from the first target structure, the second target structure, the third target structure, the fourth target structure, the fifth target structure, and the sixth target structure according to the order, and add the elements to the element positions to create a second network configuration file for the target device.

7. The method according to claim 1, characterized in that, The first network configuration file includes setting information, and the method further includes: If the setting information is detected in the first network configuration file by the pointer, the parsing module is called to parse the first network configuration file to obtain the setting information; The settings information is added to the preset structure to obtain the corresponding seventh target structure; The settings information includes at least one of the following: whether to set DC mode, communication cycle, and initialization configuration.

8. A file conversion device, characterized in that, The file conversion device includes at least a parsing module, an algorithm module connected to the parsing module, a storage module connected to the algorithm module, and a creation module connected to the storage module, wherein... The parsing module is used to import a first network configuration file generated by the network configuration software, the first network configuration file including several node information; and parse the node information to obtain parsed content corresponding to the node information, and import the parsed content into the algorithm module; The algorithm module is used to perform algorithmic processing on the parsed content to obtain algorithm-processed content corresponding to the node information, and to store the parsed content and the algorithm-processed content in the storage module. The creation module is used to respond to a network configuration command for a target device, integrate the parsed content and the algorithm-processed content according to the network configuration command, and create a second network configuration file for the target device. The second network configuration file has a different file format than the first network configuration file, and the target device performs network configuration according to the second network configuration file. Specifically, the algorithm module is used for: Identify specific nodes in the first network configuration file from the node information, and extract associated nodes that correspond to the specific nodes. The data corresponding to the specific nodes are different in different network configuration files. Obtain the path of the fifth node corresponding to the specific node, extract the content of the fifth node corresponding to the specific node from the path of the fifth node, add the content of the fifth node to a preset structure, and obtain the fifth target structure corresponding to the specific node; Obtain the path of the sixth node corresponding to the associated node, extract the content of the sixth node corresponding to the associated node from the path of the sixth node, add the content of the sixth node to a preset structure, and obtain the sixth target structure corresponding to the associated node.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Configuration file management method, device and equipment and storage medium

    CN111651405A

  • Network configuration file compatibility method, electronic equipment and storage medium

    CN112073218A